mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 21:48:48 +08:00
feat: init new plugin system (#3323)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { EditorContainer } from '@blocksuite/editor';
|
||||
import type { FC } from 'react';
|
||||
|
||||
export type Part = 'headerItem' | 'editor' | 'window';
|
||||
|
||||
export type CallbackMap = {
|
||||
headerItem: (root: HTMLElement) => () => void;
|
||||
window: (root: HTMLElement) => () => void;
|
||||
editor: (root: HTMLElement, editor: EditorContainer) => () => void;
|
||||
};
|
||||
|
||||
export interface PluginContext {
|
||||
register: <T extends Part>(part: T, callback: CallbackMap[T]) => void;
|
||||
utils: {
|
||||
PluginProvider: FC;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user