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