@twip/web
    Preparing search index...

    Class HeadlessEditor

    A session with no DOM: Node, workers, tests and servers.

    Hierarchy (View Summary)

    Index
    accessibility: Accessibility

    The accessibility tree.

    catalog: readonly CommandInfo[]

    Every command's id, label, group, shortcuts and undo grouping.

    commands: Commands

    Every edit, one method per command.

    data: DataParts

    The custom XML data parts.

    dialogs: Dialogs

    The dialogs.

    elements: Elements

    The merge designer's elements.

    find: Find

    Find and replace.

    lists: Lists

    The list galleries, and the characters of fonts for a symbol picker.

    menus: Menus

    The context menu.

    navigation: Navigation

    The document's headings.

    review: Review

    Tracked changes and comments.

    The ruler model.

    shapeGallery: readonly ShapeGalleryGroup[]

    Word's Insert > Shapes gallery: its groups and their presets, in order.

    shortcuts: Shortcuts

    Keyboard shortcuts.

    spelling: Spelling

    Spell checking.

    styles: Styles

    The document's styles.

    subTemplates: SubTemplates

    The template's sub-templates, and editing one in this editor.

    • Runs several commands atomically: one transaction and one undo step, or nothing when one fails.

      Parameters

      • ops: readonly Op[]
      • Optionaloptions: { label?: string }

      Returns Promise<void>

    • Releases the editor. Idempotent; later calls reject destroyed.

      Returns Promise<void>

    • Exports the document as DOCX or PDF, with the revision it captures: the whole document, template and every sub-template, whether or not a sub-template is being edited. A PDF can take an open password and keywords; an empty password rejects with invalid-argument.

      Parameters

      Returns Promise<ExportResult>

    • Replaces the document, only after it was read successfully. Resolves with the read's warnings.

      Parameters

      • bytes: Uint8Array
      • Optionaloptions: { signal?: AbortSignal }

      Returns Promise<{ warnings: Warning[] }>

    • Switches between editing and design mode.

      Parameters

      • mode: "editing" | "design"

      Returns Promise<void>

    • Makes the editor read only, or editable again, without reopening.

      Parameters

      • value: boolean

      Returns Promise<void>

    • Calls listener with the current state now, then after every change. Returns the unsubscribe function.

      Parameters

      Returns () => void