feat: add plugin interface

This commit is contained in:
Hufe921
2023-06-25 21:33:43 +08:00
committed by Hufe
parent ca28454049
commit ad0bb32b70
3 changed files with 28 additions and 1 deletions
+16
View File
@@ -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)
}
}