mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-22 16:17:50 +08:00
51 lines
770 B
TypeScript
51 lines
770 B
TypeScript
import { Editor, Command } from './Editor'
|
|
|
|
export default abstract class Extension {
|
|
|
|
constructor(options = {}) {
|
|
this.options = {
|
|
...this.defaultOptions,
|
|
...options,
|
|
}
|
|
}
|
|
|
|
editor!: Editor
|
|
options: { [key: string]: any } = {}
|
|
defaultOptions: { [key: string]: any } = {}
|
|
|
|
public abstract name: string
|
|
|
|
public extensionType = 'extension'
|
|
|
|
public created() {}
|
|
|
|
public bindEditor(editor: Editor): void {
|
|
this.editor = editor
|
|
}
|
|
|
|
update(): any {
|
|
return () => {}
|
|
}
|
|
|
|
plugins(): any {
|
|
return []
|
|
}
|
|
|
|
inputRules(): any {
|
|
return []
|
|
}
|
|
|
|
pasteRules(): any {
|
|
return []
|
|
}
|
|
|
|
keys(): string | { [key: string]: Function } {
|
|
return {}
|
|
}
|
|
|
|
commands(): { [key: string]: Command } {
|
|
return {}
|
|
}
|
|
|
|
}
|