feat: Add extension storage (#2069)

This commit is contained in:
Philipp Kühn
2021-10-22 08:52:54 +02:00
committed by GitHub
parent 6987505fda
commit 7ffabf251c
26 changed files with 555 additions and 105 deletions

View File

@@ -50,6 +50,8 @@ export class Editor extends EventEmitter<EditorEvents> {
public isFocused = false
public extensionStorage: Record<string, any> = {}
public options: EditorOptions = {
element: document.createElement('div'),
content: '',
@@ -100,6 +102,13 @@ export class Editor extends EventEmitter<EditorEvents> {
}, 0)
}
/**
* Returns the editor storage.
*/
public get storage(): Record<string, any> {
return this.extensionStorage
}
/**
* An object of all registered commands.
*/