parent
ca28454049
commit
ad0bb32b70
@ -0,0 +1,16 @@
|
|||||||
|
import Editor from '../..'
|
||||||
|
import { PluginFunction } from '../../interface/Plugin'
|
||||||
|
|
||||||
|
export class Plugin {
|
||||||
|
|
||||||
|
private editor: Editor
|
||||||
|
|
||||||
|
constructor(editor: Editor) {
|
||||||
|
this.editor = editor
|
||||||
|
}
|
||||||
|
|
||||||
|
public use<Options>(pluginFunction: PluginFunction<Options>, options?: Options) {
|
||||||
|
pluginFunction(this.editor, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
import Editor from '..'
|
||||||
|
|
||||||
|
export type PluginFunction<Options> = (editor: Editor, options?: Options) => any;
|
||||||
|
|
||||||
|
export type UsePlugin = <Options>(pluginFunction: PluginFunction<Options>, options?: Options) => void;
|
||||||
Loading…
Reference in new issue