Editor
class Editor extends EventEmitter<EditorEvents> { }
constructor(options?: Partial<EditorOptions>);
private capturedTransaction;
private commandManager;
private createCommandManager;
private createExtensionManager;
private createSchema;
private createView;
private css;
private dispatchTransaction;
private injectCSS;
extensionManager: ExtensionManager;
extensionStorage: Record<string, any>;
isCapturingTransaction: boolean;
get isEditable(): boolean;
isFocused: boolean;
options: EditorOptions;
schema: Schema;
get storage(): Record<string, any>;
get isEmpty(): boolean;
get isDestroyed(): boolean;
view: EditorView;
can(): CanCommands;
chain(): ChainedCommands;
createNodeViews(): void;
destroy(): void;
getCharacterCount(): number;
getHTML(): string;
getJSON(): JSONContent;
getText(options?: {
blockSeparator?: string;
textSerializers?: Record<string, TextSerializer>;
}): string;isActive(name: string, attributes?: {}): boolean;
isActive(attributes: {}): boolean;
prependClass(): void;
registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): void;
setEditable(editable: boolean, emitUpdate?: boolean): void;
§Extends
§
EventEmitter<EditorEvents>
[src]§Constructors
§
new Editor(options?: Partial<EditorOptions>)
[src]§Properties
§
dispatchTransaction
[src]The callback over which to send transactions (state updates) produced by the view.
§
commands: SingleCommands readonly
[src]An object of all registered commands.
§
extensionManager: ExtensionManager
[src]§
options: EditorOptions
[src]§
state: EditorState readonly
[src]Returns the editor state.
§
view: EditorView
[src]§Methods
§
can(): CanCommands
[src]Check if a command or a command chain can be executed. Without executing it.
§
captureTransaction(fn: Function): Transaction | null
[src]§
chain(): ChainedCommands
[src]Create a command chain to call multiple commands at once.
§
getCharacterCount(): number deprecated
[src]Get the number of characters for the current document.
@deprecated
§
getJSON(): JSONContent
[src]Get the document as JSON.
§
getText(options?: {
[src]blockSeparator?: string;
textSerializers?: Record<string, TextSerializer>;
}): stringGet the document as text.
§
isActive(name: string, attributes?: {}): boolean
[src]Returns if the currently selected node or mark is active.
@param name
Name of the node or mark
@param attributes
Attributes of the node or mark
isActive(attributes: {}): boolean
[src]§
setEditable(editable: boolean, emitUpdate?: boolean): void
[src]Update editable state of the editor.
§
setOptions(options?: Partial<EditorOptions>): void
[src]Update editor options.
@param options
A list of options