Editor options and events
Look up creation options, replacement settings and the complete public event map.
Use this page to look up fields, and Editor usage for invocation steps. Signatures come from the public @quirekit/core entry; internal imports are unnecessary.
Creation options
Extensions, Schema and commands are established at creation. setOptions() does not recompile extensions. Mounting through element requires an adapter for the selected mode; omitting the mode selects retained html, rather than native dom.
Register onCreate, onUpdate and similar callbacks through creation options. create fires synchronously during construction, so subscribing after new Editor() returns misses it. Use the callback's editor argument inside onCreate.
@quirekit/coreMITOptions used to create a QuireKit editor instance.
export interface QuireEditorOptions extends QuireEditorEventCallbacks {
readonly content?: QuireEditorContent;
readonly contentType?: QuireMarkdownContentType | undefined;
readonly markdown?: QuireMarkdownManagerOptions | undefined;
readonly docx?: QuireDocxManagerOptions | undefined;
readonly schema?: Schema;
readonly editorProps?: QuireEditorProps | undefined;
readonly parseOptions?: ParseOptions | undefined;
readonly autofocus?: FocusPosition | undefined;
readonly editable?: boolean | undefined;
readonly textDirection?: "ltr" | "rtl" | "auto" | undefined;
readonly injectCSS?: boolean | undefined;
readonly injectNonce?: string | undefined;
readonly coreExtensionOptions?: CoreExtensionOptions | undefined;
readonly enableCoreExtensions?: boolean | Partial<Record<CoreExtensionName, false>> | undefined;
readonly enableContentCheck?: boolean | undefined;
readonly emitContentError?: boolean | undefined;
readonly enableExtensionDispatchTransaction?: boolean | undefined;
readonly enableInputRules?: QuireEnableRules | undefined;
readonly enablePasteRules?: QuireEnableRules | undefined;
readonly extensions?: readonly QuireAnyExtension[];
readonly element?: Element | {
readonly mount: HTMLElement;
} | ((editor: HTMLElement) => void) | null | undefined;
readonly mode?: QuireViewMode;
readonly viewId?: string;
}Content replacement options
setContent() and replaceDocument() share these options. Updates are emitted unless disabled with emitUpdate; enable errorOnInvalidContent explicitly. See content operations for semantics and validation limits.
@quirekit/coreMITQuireKit setContent options with explicit Markdown content selection.
export interface QuireSetContentOptions extends SetContentOptions {
readonly contentType?: QuireMarkdownContentType | undefined;
readonly parseOptions?: ParseOptions;
readonly errorOnInvalidContent?: boolean;
readonly emitUpdate?: boolean;
}Event map
Events describe state or input facts and do not establish a second mutation channel. transaction includes appendedTransactions. Compare accepted and previous documents to detect content changes, rather than inspecting only the root transaction. setEditable() also emits update by default; see event usage.
@quirekit/coreMITEditor events exposed through Tiptap-compatible event methods.
export interface QuireEditorEvents {
readonly mount: EditorEvents["mount"];
readonly unmount: EditorEvents["unmount"];
readonly beforeCreate: QuireEditorEventPayload;
readonly create: QuireEditorEventPayload;
readonly contentError: EditorEvents["contentError"];
readonly beforeTransaction: QuireEditorBeforeTransactionEvent;
readonly transaction: QuireEditorTransactionEvent;
readonly selectionUpdate: QuireEditorSelectionUpdateEvent;
readonly focus: QuireEditorFocusEvent;
readonly blur: QuireEditorBlurEvent;
readonly paste: QuireEditorPasteEvent;
readonly clipboardPasteResult: QuireClipboardPasteResult;
readonly drop: QuireEditorDropEvent;
readonly delete: QuireEditorDeleteEvent;
readonly update: QuireEditorUpdateEvent;
readonly destroy: void;
}