Skip to content
QuireKit
Classic docs
Alpha · evolving API
Classic developmentView Markdown ↗

Classic API

Public composition, context, actions and resource lifetime.

Presets and instances

createClassicEditor(options) returns a product instance. document is content; preset resolves model/View; plugins declare product capabilities; extensions add ordinary features; shell configures UI; media and host supply services.

instance.editor exists only while mounted. Locale, editability and built-in preset theme updates retain Core and history; structural configuration still rebuilds Core/View. A custom Core workspace uses editor.changeMode() for different semantics. See the instance reference for settings and methods.

@quirekit/classic-editorAGPL-3.0-only

Reusable product preset resolved independently for every editor instance.

ClassicEditorPresetts

preset.resolveExtensions(context) returns ordinary extensions. Its plugins still need a product registry. Consuming only extensions does not install preset file services, license feedback or product keyboard plugins.

A custom preset uses updatePresentation(context) to refresh theme/locale-derived paint in a retained session. Update owned presentation, preserve explicit host overrides and refresh cache dependencies. Do not change Schema, install plugins or write content. Call public updateClassicEditorPresetPresentation(context) to reuse built-in Canvas/SVG color updates, then refresh custom extensions. Without this hook, theme changes still rebuild Core.

Plugins

@quirekit/classic-editorAGPL-3.0-only

Product-level plugin for UI, services, shortcuts, and lifecycle.

ClassicEditorPlugints

Plugin IDs are unique per instance. extensions supply content capabilities; contributions and independent toolbar/popup/sidebar declarations supply product surfaces; services register formats. Hooks distinguish reusable mounting from final disposal.

Typed actions

@quirekit/classic-editorAGPL-3.0-only

One typed command definition shared by every projected product surface.

ClassicEditorActionDefinitionts

run(context) receives editor, instance, ui, root, locale, backend and trigger. Availability, executability, active state and disabled reasons are read-only queries without commands or requests. Core owns document mutation; context.ui owns chrome.

@quirekit/classic-editorAGPL-3.0-only

Projects one direct action onto Ribbon chrome without accepting a behavior. @param id - Stable contribution id. @param groupId - Parent ribbon group id. @param action - Shared direct typed action definition. @returns Ribbon action contribution.

createClassicEditorRibbonActionts

Reference an installed group ID. IDs are not another command-routing protocol. See the runnable plugin.

Interactive panels

@quirekit/classic-editorAGPL-3.0-only

Framework-neutral mounted content returned by an interactive contribution.

ClassicEditorMountedRenderablets

Render acquires resources once; update refreshes retained DOM/Vue roots; destroy cleans up. Keep a current context reference for locale/selection rather than permanently capturing the initial mount context.

File services

@quirekit/classic-editorAGPL-3.0-only

Named import/export service contributed to the product registry.

ClassicEditorImportExportServicets

instance.importDocument(serviceId, artifact) selects an installed format and supplies text/bytes with filename/MIME. exportDocument(serviceId) returns data/fileName/mimeType; the host downloads it. File menus need explicit document-service contributions.

Import services receive ClassicEditorImportContext. Parse and validate, then perform one synchronous write through context.commit(() => context.editor.commands.replaceDocument(document, { errorOnInvalidContent: true })). Commit checks latest-operation ownership, original Core, document revision, editability and signal. Async callbacks are invalid; a false command result fails. Older services that write directly must migrate; the product cannot roll back arbitrary effects bypassing commit.

Hosts can pass { signal } as the third argument to cancel preparation. New imports, edits, editability updates and unmounts also invalidate preparation. Official DOCX import uses this boundary and stages images until commit. Its export captures the starting document and reports diagnostics through onReport; artifacts contain only data/fileName/mimeType. See files for complete cancellation semantics.

QuireKitQuireKit · Core, plugins and Classic docs