2019-12-17 06:20:05 +08:00
|
|
|
import { Editor } from './Editor'
|
|
|
|
|
2020-03-06 03:30:58 +08:00
|
|
|
export default abstract class Extension {
|
|
|
|
|
|
|
|
public abstract name: string
|
2019-12-17 06:20:05 +08:00
|
|
|
|
|
|
|
editor: any
|
|
|
|
options: { [key: string]: any } = {}
|
|
|
|
defaultOptions: { [key: string]: any } = {}
|
|
|
|
|
|
|
|
constructor(options = {}) {
|
|
|
|
this.options = {
|
|
|
|
...this.defaultOptions,
|
|
|
|
...options,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
init(): any {
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
|
|
|
|
bindEditor(editor: Editor): void {
|
|
|
|
this.editor = editor
|
|
|
|
}
|
|
|
|
|
2020-03-06 04:05:01 +08:00
|
|
|
public type = 'extension'
|
2019-12-17 06:20:05 +08:00
|
|
|
|
|
|
|
get update(): any {
|
|
|
|
return () => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
get plugins(): any {
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
|
|
|
|
inputRules(): any {
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
|
|
|
|
pasteRules(): any {
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
|
|
|
|
keys(): any {
|
|
|
|
return {}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|