mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
28 lines
689 B
TypeScript
28 lines
689 B
TypeScript
import type { MainEventRegister } from '../type';
|
|
import { applicationMenuSubjects } from './subject';
|
|
|
|
export * from './create';
|
|
export * from './subject';
|
|
|
|
/**
|
|
* Events triggered by application menu
|
|
*/
|
|
export const applicationMenuEvents = {
|
|
/**
|
|
* File -> New Doc
|
|
*/
|
|
onNewPageAction: (fn: () => void) => {
|
|
const sub = applicationMenuSubjects.newPageAction.subscribe(fn);
|
|
return () => {
|
|
sub.unsubscribe();
|
|
};
|
|
},
|
|
openAboutPageInSettingModal: (fn: () => void) => {
|
|
const sub =
|
|
applicationMenuSubjects.openAboutPageInSettingModal.subscribe(fn);
|
|
return () => {
|
|
sub.unsubscribe();
|
|
};
|
|
},
|
|
} satisfies Record<string, MainEventRegister>;
|