CreateEditorOptions
CreateEditorOptions:
{}Options for creating an editor instance.
Examples
Section titled “Examples”// Create editor with empty documentconst editor = await system.createEditor(targetElement);// Create editor with existing documentconst doc = await system.loadDocument(docJSON);const editor = await system.createEditor(targetElement, { document: doc });// Create editor with custom UI settingsconst editor = await system.createEditor(targetElement, { ui: { locale: 'de', unit: 'cm', ruler: { enabled: false }, },});// Create editor with custom actions and toolbarconst editor = await system.createEditor(targetElement, { ui: { actions: [ { id: 'custom.save', label: 'Save', shortcuts: ['Mod+S'], handler: async () => { const doc = await editor.currentDocument().saveDocument(); }, }, ], toolbar: { items: [ { type: 'built-in', id: 'undo', builtInType: 'undo' }, { type: 'built-in', id: 'redo', builtInType: 'redo' }, { type: 'separator', id: 'sep-1' }, { type: 'action', id: 'save-btn', actionId: 'custom.save' }, ], }, },});DocAuthSystem.createEditorfor creating editors.UIOptionsfor available UI configuration options.
Properties
Section titled “Properties”document?
Section titled “document?”
optionaldocument:DocAuthDocument
The document to attach to this editor. If no document is provided, an empty document will be created.
DocAuthEditor.setCurrentDocument for setting the document after the editor is created.
optionalui:UIOptions