add extension class

This commit is contained in:
Philipp Kühn
2019-12-16 23:20:05 +01:00
parent 6f1aedb2b2
commit 3b291c3a3c
7 changed files with 129 additions and 9 deletions

View File

@@ -12,11 +12,13 @@ import insertText from './commands/insertText'
import insertHTML from './commands/insertHTML'
import focus from './commands/focus'
type EditorContent = string | JSON
interface EditorOptions {
element: Node
content: string
content: EditorContent
}
export class Editor {
private lastCommand = Promise.resolve()
@@ -84,7 +86,7 @@ export class Editor {
return this[name](...args)
}
private createDocument(content: any): any {
private createDocument(content: EditorContent): any {
// if (content === null) {
// return this.schema.nodeFromJSON(this.options.emptyDocument)
// }