@twip/web
    Preparing search index...

    Interface Commands

    Every edit, one method per command. Each resolves after its change commits, with getState() already at that revision, and rejects with EditorError. Commands act on the selection at the time they run. Each is one undo step unless its documentation says otherwise: typing joins consecutive insertText and delete calls in one paragraph into one step; view changes no document and adds no undo step.

    interface Commands {
        acceptAllRevisions(options?: { author?: string }): Promise<void>;
        acceptRevision(id: RevisionId): Promise<void>;
        acceptRevisionsInSelection(): Promise<void>;
        activatePictureControl(options?: { element?: ElementId }): Promise<void>;
        addComment(body: string | RichText): Promise<{ id: CommentId }>;
        addEditableRange(options?: { editor?: string }): Promise<void>;
        addTabStop(
            options: {
                alignment?: TabAlignment;
                leader?: TabLeader;
                position: number;
            },
        ): Promise<void>;
        adjustListIndents(
            options: {
                follow: FollowNumber;
                numberPosition: number;
                tab?: number;
                textIndent: number;
            },
        ): Promise<void>;
        alignObjects(
            options: {
                align:
                    | "top"
                    | "middle"
                    | "bottom"
                    | "center"
                    | "left"
                    | "right"
                    | "distributeHorizontally"
                    | "distributeVertically";
                relativeTo?: "page"
                | "margin"
                | "selectedObjects";
            },
        ): Promise<void>;
        applyCharacterStyle(styleId: StyleId | null): Promise<void>;
        applyListEntry(id: string): Promise<void>;
        arrangeObject(where: Arrange): Promise<void>;
        autoFitColumns(to: "contents" | "window" | "fixed"): Promise<void>;
        changeCase(
            to: "sentence" | "lower" | "upper" | "title" | "toggle",
        ): Promise<void>;
        changePicture(data: Uint8Array): Promise<void>;
        clearFormatting(): Promise<void>;
        clearTabStops(): Promise<void>;
        closeHeaderFooter(): Promise<void>;
        closePopover(): Promise<void>;
        closeSubTemplate(): Promise<void>;
        continueNumbering(): Promise<void>;
        convertNotes(
            conversion: "footnotesToEndnotes" | "endnotesToFootnotes" | "swap",
        ): Promise<void>;
        convertTableToText(
            options: {
                character?: string;
                separator: "tabs" | "other" | "paragraphs" | "commas";
            },
        ): Promise<void>;
        convertTextToTable(
            options: {
                character?: string;
                columns?: number;
                separator: "tabs" | "other" | "paragraphs" | "commas";
            },
        ): Promise<void>;
        copy(): Promise<void>;
        copyFormatting(): Promise<void>;
        createSubTemplate(
            options: {
                category?: string;
                copyOf?: string;
                from?: Uint8Array<ArrayBufferLike>;
                name: string;
            },
        ): Promise<void>;
        cut(): Promise<void>;
        decreaseIndent(): Promise<void>;
        delete(
            options: {
                direction: "forward" | "backward";
                unit?: "word" | "character";
            },
        ): Promise<void>;
        deleteBookmark(name: string): Promise<void>;
        deleteCells(shift: "left" | "up"): Promise<void>;
        deleteColumns(): Promise<void>;
        deleteComment(id: CommentId): Promise<void>;
        deleteObject(): Promise<void>;
        deleteRows(): Promise<void>;
        deleteStyle(styleId: StyleId): Promise<void>;
        deleteTable(): Promise<void>;
        deleteTabStop(position: number): Promise<void>;
        describeFormatting(): Promise<void>;
        distributeColumns(): Promise<void>;
        distributeRows(): Promise<void>;
        editComment(
            options: { body: string | RichText; id: CommentId },
        ): Promise<void>;
        editFooter(): Promise<void>;
        editHeader(): Promise<void>;
        editHyperlink(options: { address?: string; text?: string }): Promise<void>;
        editSubTemplate(
            options: { category?: string; name: string },
        ): Promise<void>;
        escape(): Promise<void>;
        fillControl(
            options: {
                buildingBlock?: string;
                docx?: Uint8Array<ArrayBufferLike>;
                id: ElementId;
                image?: Uint8Array<ArrayBufferLike>;
                text?: string;
            },
        ): Promise<void>;
        fillFormField(
            options: {
                checked?: boolean;
                entry?: number;
                id?: ElementId;
                text?: string;
            },
        ): Promise<void>;
        flipObject(axis: FlipAxis): Promise<void>;
        goBack(): Promise<void>;
        goToBookmark(name: string): Promise<void>;
        goToPage(page: number): Promise<void>;
        groupObjects(): Promise<void>;
        growFont(): Promise<void>;
        increaseIndent(): Promise<void>;
        insertAlignmentTab(
            options: {
                alignment: "center" | "left" | "right";
                leader?: TabLeader;
                relativeTo: "margin" | "indent";
            },
        ): Promise<void>;
        insertBookmark(name: string): Promise<void>;
        insertColumnBreak(): Promise<void>;
        insertColumns(
            options: { count?: number; where: "left" | "right" },
        ): Promise<void>;
        insertControl(
            options: {
                binding?: DataBinding;
                float?: {
                    horizontal?: HorizontalPosition;
                    vertical?: VerticalPosition;
                    wrap: ObjectWrap;
                };
                kind: ControlKind;
                lock?: "none"
                | "control"
                | "content"
                | "both";
                options?: ControlOptions;
                placeholder?: string;
                placeholderImage?: PlaceholderImage;
                tag?: string;
                title?: string;
                wrapSelection?: boolean;
            },
        ): Promise<{ id: ElementId }>;
        insertEndnote(): Promise<void>;
        insertField(
            options: { code: string; display?: string; showCode?: boolean },
        ): Promise<{ id: ElementId }>;
        insertFootnote(): Promise<void>;
        insertFormField(
            kind: "text" | "checkBox" | "dropDown",
        ): Promise<{ id: ElementId }>;
        insertHyperlink(options: { address: string; text?: string }): Promise<void>;
        insertLineBreak(): Promise<void>;
        insertNote(
            options: { customMark?: string; kind: "footnote" | "endnote" },
        ): Promise<void>;
        insertPageBreak(): Promise<void>;
        insertPageNumber(
            options: {
                alignment?: "center" | "left" | "right";
                format: "page" | "pageOfTotal" | "total";
                where?: "header" | "footer" | "caret";
            },
        ): Promise<void>;
        insertParagraph(): Promise<void>;
        insertPicture(
            options: { altText?: string; data: Uint8Array },
        ): Promise<void>;
        insertRows(
            options: { count?: number; where: "above" | "below" },
        ): Promise<void>;
        insertSectionBreak(kind: SectionBreakKind): Promise<void>;
        insertShape(options: ShapeInsert): Promise<void>;
        insertSymbol(options: { char: string; font?: string }): Promise<void>;
        insertTab(): Promise<void>;
        insertTable(options: { columns: number; rows: number }): Promise<void>;
        insertText(text: string): Promise<void>;
        insertTextBox(): Promise<void>;
        markElements(
            options: {
                clear?: boolean;
                marks: {
                    id: ElementId;
                    message: string;
                    severity: "error" | "warning" | "info";
                }[];
            },
        ): Promise<void>;
        mergeCells(): Promise<void>;
        moveColumnBoundary(options: { column: number; to: number }): Promise<void>;
        moveRows(direction: "up" | "down"): Promise<void>;
        moveSelection(
            options: {
                by:
                    | "line"
                    | "screen"
                    | "page"
                    | "document"
                    | "paragraph"
                    | "word"
                    | "character"
                    | "lineEdge"
                    | "rowEdge"
                    | "columnEdge";
                direction: "forward"
                | "backward";
                extend?: boolean;
            },
        ): Promise<void>;
        moveTableColumnBoundary(
            options: { index: number; to: number },
        ): Promise<void>;
        moveTableRowBoundary(options: { index: number; to: number }): Promise<void>;
        moveTabStop(options: { from: number; to: number }): Promise<void>;
        moveToCell(direction: "next" | "previous"): Promise<void>;
        neverAutoCorrect(): Promise<void>;
        paste(options?: { as?: "text" | "formatted" }): Promise<void>;
        pasteFormatting(): Promise<void>;
        pasteText(text: string): Promise<void>;
        redo(): Promise<void>;
        rejectAllRevisions(options?: { author?: string }): Promise<void>;
        rejectRevision(id: RevisionId): Promise<void>;
        rejectRevisionsInSelection(): Promise<void>;
        removeControl(
            options: { id: ElementId; keepContent?: boolean },
        ): Promise<void>;
        removeDataPart(
            options: { itemId?: string; namespace: string },
        ): Promise<void>;
        removeEditableRanges(): Promise<void>;
        removeElement(id: ElementId): Promise<void>;
        removeFrame(): Promise<void>;
        removeHeaderFooter(
            options: {
                kind: "header" | "footer";
                pages: "default" | "first" | "even";
            },
        ): Promise<void>;
        removeHyperlink(): Promise<void>;
        removeSubTemplate(
            options: { category?: string; name: string },
        ): Promise<void>;
        removeWatermark(): Promise<void>;
        renameSubTemplate(
            options: {
                category?: string;
                name: string;
                to: string;
                updateReferences?: boolean;
            },
        ): Promise<void>;
        repeat(): Promise<void>;
        replaceBody(options: { from: Uint8Array }): Promise<void>;
        replaceFont(
            options: {
                bold?: boolean;
                from: string;
                italic?: boolean;
                scope?: ReplaceScope;
                to: string;
            },
        ): Promise<{ changed: number; skipped: number }>;
        replaceInElements(
            options: {
                find: string;
                ids?: ElementId[];
                in: "title" | "code" | "tag";
                kind?: "field" | "control";
                replace: string;
            },
        ): Promise<{ changed: number }>;
        replyToComment(
            options: { body: string | RichText; to: CommentId },
        ): Promise<{ id: CommentId }>;
        resetObjectSize(): Promise<void>;
        resolveComment(options: { done: boolean; id: CommentId }): Promise<void>;
        restartNumbering(): Promise<void>;
        revertAutoCorrect(): Promise<void>;
        select(
            unit:
                | "table"
                | "paragraph"
                | "row"
                | "cell"
                | "word"
                | "sentence"
                | "column",
        ): Promise<void>;
        selectAll(): Promise<void>;
        selectComment(id: CommentId): Promise<void>;
        selectGroupChild(direction: "next" | "previous"): Promise<void>;
        selectNextObject(direction: "next" | "previous"): Promise<void>;
        selectRevision(direction: "next" | "previous"): Promise<void>;
        setActiveComment(id: CommentId | null): Promise<void>;
        setAlignment(
            alignment: "center" | "left" | "right" | "justify",
        ): Promise<void>;
        setAllCaps(on: boolean): Promise<void>;
        setAltText(options: { decorative?: boolean; text: string }): Promise<void>;
        setAnchorLocked(on: boolean): Promise<void>;
        setApplicationFieldTypes(options: { types: string[] }): Promise<void>;
        setAuthorColor(
            options: { author: string; color: `#${string}` },
        ): Promise<void>;
        setAutoCorrect(change: AutoCorrectChange): Promise<void>;
        setAutoHyphenation(on: boolean): Promise<void>;
        setBold(on: boolean): Promise<void>;
        setCellAlignment(vertical: "top" | "bottom" | "center"): Promise<void>;
        setCellBorders(
            options: { border?: BorderLine; edges: CellBorderEdges },
        ): Promise<void>;
        setCellMargins(
            options: {
                bottom?: number;
                left?: number;
                right?: number;
                top?: number;
            },
        ): Promise<void>;
        setCellProperties(
            options: {
                fitText?: boolean;
                hideMark?: boolean;
                textDirection?: TextFlow;
                width?: TableWidth;
                wrapText?: boolean;
            },
        ): Promise<void>;
        setCellShading(color: `#${string}` | null): Promise<void>;
        setCharacterEffects(effects: CharacterEffects): Promise<void>;
        setCharacterPosition(position: number): Promise<void>;
        setCharacterSpacing(spacing: number): Promise<void>;
        setCheckbox(options: { checked: boolean; id: ElementId }): Promise<void>;
        setColumns(
            options: {
                count: number;
                separator?: boolean;
                spacing?: number;
                widths?: ColumnWidth[];
            },
        ): Promise<void>;
        setColumnWidth(width: number): Promise<void>;
        setConsecutiveHyphenLimit(limit: number): Promise<void>;
        setControl(
            options: {
                appearance?: "hidden" | "boundingBox" | "tags";
                binding?: DataBinding | null;
                color?: `#${string}` | "none";
                id: ElementId;
                lock?: "none" | "control" | "content" | "both";
                options?: ControlOptions;
                placeholder?: string;
                placeholderImage?: PlaceholderImage;
                style?: StyleId | "none";
                tag?: string;
                temporary?: boolean;
                title?: string;
            },
        ): Promise<void>;
        setDefaultTableStyle(styleId: StyleId | null): Promise<void>;
        setDefaultTabStop(spacing: number): Promise<void>;
        setDifferentFirstPage(on: boolean): Promise<void>;
        setDifferentOddEvenPages(on: boolean): Promise<void>;
        setDocumentDefaults(defaults: DocumentDefaults): Promise<void>;
        setDocumentProperties(
            options: {
                author?: string;
                category?: string;
                comments?: string;
                company?: string;
                custom?: CustomProperty[];
                hyperlinkBase?: string;
                keywords?: string;
                lastModifiedBy?: string;
                manager?: string;
                status?: string;
                subject?: string;
                title?: string;
            },
        ): Promise<void>;
        setDocumentProtection(
            options: {
                enforce?: boolean;
                formatting?: boolean;
                kind?: "none" | "readOnly" | "comments" | "trackedChanges" | "forms";
                password?: string;
                unprotectedSections?: number[];
            },
        ): Promise<void>;
        setDocumentVariable(
            options: { name: string; value?: string },
        ): Promise<void>;
        setDoubleStrikethrough(on: boolean): Promise<void>;
        setDropCap(dropCap: DropCap): Promise<void>;
        setField(
            options: { code?: string; display?: string | RichText; id: ElementId },
        ): Promise<void>;
        setFieldLabels(
            options: { labels: Record<string, string>; merge?: boolean },
        ): Promise<void>;
        setFieldResults(
            options: {
                results: { display: string | RichText; id: ElementId }[];
                token?: number;
            },
        ): Promise<void>;
        setFieldsLocked(options: { locked: boolean } & FieldTargets): Promise<void>;
        setFileName(name: string): Promise<void>;
        setFont(family: string): Promise<void>;
        setFontColor(color: `#${string}` | "auto"): Promise<void>;
        setFontSize(size: number): Promise<void>;
        setFormField(
            options: {
                calculateOnExit?: boolean;
                checkBox?: { checkedByDefault?: boolean; size?: number | "auto" };
                dropDown?: { default?: number; entries?: string[] };
                enabled?: boolean;
                entryMacro?: string;
                exitMacro?: string;
                helpText?: string;
                id?: ElementId;
                name?: string;
                statusText?: string;
                text?: {
                    default?: string;
                    format?: string;
                    inputType?: TextInputType;
                    maxLength?: number;
                };
            },
        ): Promise<void>;
        setFormFieldShading(on: boolean): Promise<void>;
        setFrame(properties: FrameProperties): Promise<void>;
        setHeaderFooterDistance(
            options: { footer?: number; header?: number },
        ): Promise<void>;
        setHeaderFooterLinked(
            options: {
                kind: "header" | "footer";
                linked: boolean;
                pages: "default" | "first" | "even";
            },
        ): Promise<void>;
        setHeaderRow(on: boolean): Promise<void>;
        setHidden(on: boolean): Promise<void>;
        setHighlight(color: HighlightColor | null): Promise<void>;
        setHyphenateCaps(on: boolean): Promise<void>;
        setHyphenationZone(zone: number): Promise<void>;
        setIndents(
            options: {
                firstLine?: number;
                hanging?: number;
                left?: number;
                mirror?: boolean;
                right?: number;
            },
        ): Promise<void>;
        setItalic(on: boolean): Promise<void>;
        setLanguage(language: Language): Promise<void>;
        setLineNumbering(numbers: LineNumbers | null): Promise<void>;
        setLineSpacing(spacing: LineSpacing): Promise<void>;
        setList(kind: "bullet" | "numbered" | null): Promise<void>;
        setListDefinition(
            options: {
                applyTo?: "thisPointForward" | "wholeList" | "currentParagraph";
                levels: ListLevel[];
                name?: string;
            },
        ): Promise<void>;
        setListLevel(change: "increase" | "decrease"): Promise<void>;
        setMargins(
            options: {
                bottom?: number;
                gutter?: number;
                left?: number;
                right?: number;
                top?: number;
            },
        ): Promise<void>;
        setMarkupView(view: MarkupView): Promise<void>;
        setMode(mode: "editing" | "design"): Promise<void>;
        setMultiplePages(
            options: { gutterAtTop?: boolean; mode?: MultiplePagesMode },
        ): Promise<void>;
        setNoteProperties(
            options: {
                applyTo?: "wholeDocument" | "thisSection";
                columns?: number;
                format?: NumberFormat;
                kind: "footnote" | "endnote";
                position?: NotePosition;
                restart?: "continuous" | "eachSection" | "eachPage";
                start?: number;
            },
        ): Promise<void>;
        setNumberingValue(
            options: {
                advance?: boolean;
                mode: "continue" | "startNew";
                value: number;
            },
        ): Promise<void>;
        setObjectPosition(
            options: {
                allowOverlap?: boolean;
                horizontal?: HorizontalPosition;
                layoutInCell?: boolean;
                vertical?: VerticalPosition;
            },
        ): Promise<void>;
        setObjectRotation(degrees: number): Promise<void>;
        setObjectSize(
            options: {
                height?: number;
                lockAspect?: boolean;
                relativeHeight?: "none" | RelativeSize;
                relativeWidth?: "none" | RelativeSize;
                width?: number;
            },
        ): Promise<void>;
        setObjectWrap(wrap: ObjectWrap): Promise<void>;
        setObjectWrapOptions(
            options: {
                bottom?: number;
                left?: number;
                right?: number;
                side?: WrapSide;
                top?: number;
            },
        ): Promise<void>;
        setOrientation(orientation: "portrait" | "landscape"): Promise<void>;
        setOutline(options: { collapsed?: boolean; level?: number }): Promise<void>;
        setPageBorders(
            options: {
                applyTo?: "wholeDocument" | "thisSection";
                bottom?: BorderLine | null;
                display?: "allPages" | "firstPage" | "notFirstPage";
                left?: BorderLine | null;
                offsetFrom?: "text" | "page";
                right?: BorderLine | null;
                shadow?: boolean;
                surroundFooter?: boolean;
                surroundHeader?: boolean;
                top?: BorderLine | null;
            },
        ): Promise<void>;
        setPageColor(fill: FillValue): Promise<void>;
        setPageNumbering(
            options: {
                chapter?: ChapterNumbers | null;
                format?: NumberFormat;
                start?: number | null;
            },
        ): Promise<void>;
        setPageVerticalAlignment(
            alignment: "top" | "bottom" | "center" | "justified",
        ): Promise<void>;
        setPaperSize(options: { height: number; width: number }): Promise<void>;
        setParagraphBorderLines(
            options: {
                between?: BorderLine | null;
                bottom?: BorderLine | null;
                left?: BorderLine | null;
                right?: BorderLine | null;
                shadow?: boolean;
                top?: BorderLine | null;
            },
        ): Promise<void>;
        setParagraphBorders(preset: "none" | "bottom" | "box"): Promise<void>;
        setParagraphFlow(
            options: {
                dontHyphenate?: boolean;
                keepLinesTogether?: boolean;
                keepWithNext?: boolean;
                pageBreakBefore?: boolean;
                suppressLineNumbers?: boolean;
                textboxTightWrap?: TightWrap;
                widowControl?: boolean;
            },
        ): Promise<void>;
        setParagraphShading(color: `#${string}` | null): Promise<void>;
        setParagraphSpacing(
            options: {
                after?: number | "auto";
                before?: number | "auto";
                contextual?: boolean;
            },
        ): Promise<void>;
        setParagraphStyle(styleId: StyleId): Promise<void>;
        setParagraphTextDirection(direction: TextFlow): Promise<void>;
        setPictureAdjust(change: PictureAdjustChange): Promise<void>;
        setPictureCrop(
            crop: { bottom?: number; left?: number; right?: number; top?: number },
        ): Promise<void>;
        setProtectedPictureControls(
            options: { tagPrefixes: string[] },
        ): Promise<void>;
        setRowCanBreak(on: boolean): Promise<void>;
        setRowHeight(height: RowHeight): Promise<void>;
        setRowProperties(
            options: {
                exceptions?: {
                    alignment?: "center" | "left" | "right";
                    borders?: { border?: BorderLine; edges: CellBorderEdges };
                    cellSpacing?: number;
                    reset?: boolean;
                    shading?: `#${string}`;
                };
                hidden?: boolean;
            },
        ): Promise<void>;
        setRulerTabType(type: TabSelector): Promise<void>;
        setSectionBreakType(kind: SectionBreakKind): Promise<void>;
        setSectionTextDirection(direction: TextFlow): Promise<void>;
        setSelectionMode(mode: "normal" | "extend" | "block"): Promise<void>;
        setShading(
            options: {
                color?: `#${string}` | "auto";
                fill: `#${string}` | "none";
                pattern?: ShadingPattern;
                target: "text" | "table" | "paragraph" | "cell";
            },
        ): Promise<void>;
        setShapeAdjust(options: ShapeAdjust): Promise<void>;
        setShapeEffects(change: EffectsChange): Promise<void>;
        setShapeFill(fill: FillValue): Promise<void>;
        setShapeLine(change: LineChange): Promise<void>;
        setShapePreset(preset: ShapePreset): Promise<void>;
        setShapeText(change: ShapeTextChange): Promise<void>;
        setSmallCaps(on: boolean): Promise<void>;
        setStrikethrough(on: boolean): Promise<void>;
        setStyleMeta(
            options: {
                id: StyleId;
                locked?: boolean;
                priority?: number;
                quick?: boolean;
                visibility?: "show" | "hideUntilUsed" | "hide";
            },
        ): Promise<void>;
        setSubscript(on: boolean): Promise<void>;
        setSubTemplateRules(options: { rules: ReferenceRule[] }): Promise<void>;
        setSubTemplateView(
            options: { expanded: boolean; ids?: ElementId[] },
        ): Promise<void>;
        setSuperscript(on: boolean): Promise<void>;
        setTableAlignment(alignment: "center" | "left" | "right"): Promise<void>;
        setTableAltText(
            options: { description?: string; title?: string },
        ): Promise<void>;
        setTableCellSpacing(spacing: number | null): Promise<void>;
        setTableIndent(indent: number): Promise<void>;
        setTablePosition(position: TablePosition | null): Promise<void>;
        setTableStyle(styleId: StyleId): Promise<void>;
        setTableStyleOptions(
            options: {
                bandedColumns?: boolean;
                bandedRows?: boolean;
                firstColumn?: boolean;
                headerRow?: boolean;
                lastColumn?: boolean;
                totalRow?: boolean;
            },
        ): Promise<void>;
        setTableWidth(width: TableWidth): Promise<void>;
        setTextBorder(
            options: { border: BorderLine | null; shadow?: boolean },
        ): Promise<void>;
        setTextEffects(change: TextEffectsChange): Promise<void>;
        setTrackChanges(on: boolean): Promise<void>;
        setTypography(typography: Typography): Promise<void>;
        setUnderline(style: UnderlineStyle): Promise<void>;
        setUnderlineColor(color: `#${string}` | "auto"): Promise<void>;
        setViewOptions(options: ViewOptions): Promise<void>;
        setWatermark(watermark: Watermark): Promise<void>;
        setZoom(zoom: number | "pageWidth" | "wholePage"): Promise<void>;
        showAutoCorrectOptions(): Promise<void>;
        showFieldCodes(options: { show: boolean } & FieldTargets): Promise<void>;
        showTabStop(): Promise<void>;
        showTabTypes(): Promise<void>;
        shrinkFont(): Promise<void>;
        splitCells(options: { columns: number; rows?: number }): Promise<void>;
        splitTable(): Promise<void>;
        undo(): Promise<void>;
        ungroupObjects(): Promise<void>;
        unlinkFields(options?: FieldTargets): Promise<void>;
        updateFields(options?: FieldTargets): Promise<void>;
        updateStyleToSelection(styleId: StyleId): Promise<void>;
        wrapInRepeatingSection(
            options?: { tag?: string; title?: string },
        ): Promise<{ id: ElementId }>;
        writeDataPart(
            options: { itemId?: string; namespace: string; xml: string },
        ): Promise<{ itemId: string }>;
    }
    Index
    acceptAllRevisions acceptRevision acceptRevisionsInSelection activatePictureControl addComment addEditableRange addTabStop adjustListIndents alignObjects applyCharacterStyle applyListEntry arrangeObject autoFitColumns changeCase changePicture clearFormatting clearTabStops closeHeaderFooter closePopover closeSubTemplate continueNumbering convertNotes convertTableToText convertTextToTable copy copyFormatting createSubTemplate cut decreaseIndent delete deleteBookmark deleteCells deleteColumns deleteComment deleteObject deleteRows deleteStyle deleteTable deleteTabStop describeFormatting distributeColumns distributeRows editComment editFooter editHeader editHyperlink editSubTemplate escape fillControl fillFormField flipObject goBack goToBookmark goToPage groupObjects growFont increaseIndent insertAlignmentTab insertBookmark insertColumnBreak insertColumns insertControl insertEndnote insertField insertFootnote insertFormField insertHyperlink insertLineBreak insertNote insertPageBreak insertPageNumber insertParagraph insertPicture insertRows insertSectionBreak insertShape insertSymbol insertTab insertTable insertText insertTextBox markElements mergeCells moveColumnBoundary moveRows moveSelection moveTableColumnBoundary moveTableRowBoundary moveTabStop moveToCell neverAutoCorrect paste pasteFormatting pasteText redo rejectAllRevisions rejectRevision rejectRevisionsInSelection removeControl removeDataPart removeEditableRanges removeElement removeFrame removeHeaderFooter removeHyperlink removeSubTemplate removeWatermark renameSubTemplate repeat replaceBody replaceFont replaceInElements replyToComment resetObjectSize resolveComment restartNumbering revertAutoCorrect select selectAll selectComment selectGroupChild selectNextObject selectRevision setActiveComment setAlignment setAllCaps setAltText setAnchorLocked setApplicationFieldTypes setAuthorColor setAutoCorrect setAutoHyphenation setBold setCellAlignment setCellBorders setCellMargins setCellProperties setCellShading setCharacterEffects setCharacterPosition setCharacterSpacing setCheckbox setColumns setColumnWidth setConsecutiveHyphenLimit setControl setDefaultTableStyle setDefaultTabStop setDifferentFirstPage setDifferentOddEvenPages setDocumentDefaults setDocumentProperties setDocumentProtection setDocumentVariable setDoubleStrikethrough setDropCap setField setFieldLabels setFieldResults setFieldsLocked setFileName setFont setFontColor setFontSize setFormField setFormFieldShading setFrame setHeaderFooterDistance setHeaderFooterLinked setHeaderRow setHidden setHighlight setHyphenateCaps setHyphenationZone setIndents setItalic setLanguage setLineNumbering setLineSpacing setList setListDefinition setListLevel setMargins setMarkupView setMode setMultiplePages setNoteProperties setNumberingValue setObjectPosition setObjectRotation setObjectSize setObjectWrap setObjectWrapOptions setOrientation setOutline setPageBorders setPageColor setPageNumbering setPageVerticalAlignment setPaperSize setParagraphBorderLines setParagraphBorders setParagraphFlow setParagraphShading setParagraphSpacing setParagraphStyle setParagraphTextDirection setPictureAdjust setPictureCrop setProtectedPictureControls setRowCanBreak setRowHeight setRowProperties setRulerTabType setSectionBreakType setSectionTextDirection setSelectionMode setShading setShapeAdjust setShapeEffects setShapeFill setShapeLine setShapePreset setShapeText setSmallCaps setStrikethrough setStyleMeta setSubscript setSubTemplateRules setSubTemplateView setSuperscript setTableAlignment setTableAltText setTableCellSpacing setTableIndent setTablePosition setTableStyle setTableStyleOptions setTableWidth setTextBorder setTextEffects setTrackChanges setTypography setUnderline setUnderlineColor setViewOptions setWatermark setZoom showAutoCorrectOptions showFieldCodes showTabStop showTabTypes shrinkFont splitCells splitTable undo ungroupObjects unlinkFields updateFields updateStyleToSelection wrapInRepeatingSection writeDataPart
    • Accepts every revision, or one author's.

      Parameters

      • Optionaloptions: { author?: string }

      Returns Promise<void>

    • Selects a picture control (the selected one when none is named) and emits pictureControlActivated, in any mode.

      Parameters

      Returns Promise<void>

    • Makes the selection a range everyone (or editor) may edit while the document is protected.

      Parameters

      • Optionaloptions: { editor?: string }

      Returns Promise<void>

    • Adds a tab stop at 0 to 1584, replacing one at the same position. Left aligned with no leader by default.

      Parameters

      Returns Promise<void>

    • Adjust List Indents: the selection's list level's indents and what follows its number, for its whole list.

      Parameters

      • options: {
            follow: FollowNumber;
            numberPosition: number;
            tab?: number;
            textIndent: number;
        }

      Returns Promise<void>

    • Aligns or distributes the selected floating objects across their page, its margins, or the box around them (the default for two or more; else the margins).

      Parameters

      • options: {
            align:
                | "top"
                | "middle"
                | "bottom"
                | "center"
                | "left"
                | "right"
                | "distributeHorizontally"
                | "distributeVertically";
            relativeTo?: "page"
            | "margin"
            | "selectedObjects";
        }

      Returns Promise<void>

    • Applies a character style to the selected text (a linked paragraph style's character half), or removes it (null).

      Parameters

      Returns Promise<void>

    • Applies a list gallery entry (lists.galleries): a library or recent entry defines the selection's list, or makes a new one; a document list or list style continues that list.

      Parameters

      • id: string

      Returns Promise<void>

    • Fits the columns to their contents or the window, or fixes their widths.

      Parameters

      • to: "contents" | "window" | "fixed"

      Returns Promise<void>

    • Changes the case of the selection (Shift+F3 cycles).

      Parameters

      • to: "sentence" | "lower" | "upper" | "title" | "toggle"

      Returns Promise<void>

    • Replaces the selected picture's image, keeping its width, effects and place; its height follows the new image.

      Parameters

      • data: Uint8Array

      Returns Promise<void>

    • Dismisses the popover asked for (popoverClosed), for an application that closes its own on Esc or a press elsewhere; with none open, nothing. View.

      Returns Promise<void>

    • Back to the template from a sub-template, at the template's selection from before. View.

      Returns Promise<void>

    • Turns every footnote into an endnote, every endnote into a footnote, or both ('swap').

      Parameters

      • conversion: "footnotesToEndnotes" | "endnotesToFootnotes" | "swap"

      Returns Promise<void>

    • Converts the selected rows, or the whole table, to text: a paragraph for each row, its cells joined by the separator (character with 'other').

      Parameters

      • options: { character?: string; separator: "tabs" | "other" | "paragraphs" | "commas" }

      Returns Promise<void>

    • Converts the selected paragraphs to a table: a row for each paragraph, split into cells at the separator (character with 'other'); columns (1-63) by default the most pieces a paragraph has.

      Parameters

      • options: {
            character?: string;
            columns?: number;
            separator: "tabs" | "other" | "paragraphs" | "commas";
        }

      Returns Promise<void>

    • A new sub-template, empty, with a DOCX's body, or a copy of the sub-template copyOf in the same category (category: default the first rule's).

      Parameters

      • options: {
            category?: string;
            copyOf?: string;
            from?: Uint8Array<ArrayBufferLike>;
            name: string;
        }

      Returns Promise<void>

    • Deletes backward or forward, by character (the default) or word. Typing.

      Parameters

      • options: { direction: "forward" | "backward"; unit?: "word" | "character" }

      Returns Promise<void>

    • Deletes a bookmark (compared without case), keeping its text.

      Parameters

      • name: string

      Returns Promise<void>

    • Deletes the selected cells, shifting the rest up or left.

      Parameters

      • shift: "left" | "up"

      Returns Promise<void>

    • Deletes a style the document made: its paragraphs take the default paragraph style, its runs lose it, and the styles based on it take its base. Built-in styles can't be deleted (not-allowed).

      Parameters

      Returns Promise<void>

    • Deletes the tab stop at a position; an inherited one is cleared in the paragraph.

      Parameters

      • position: number

      Returns Promise<void>

    • Says the formatting at the caret to screen readers (an announcement of kind formatting). Shift+F1.

      Returns Promise<void>

    • Edits the caret page's footer, creating it when the page has none.

      Returns Promise<void>

    • Edits the caret page's header, creating it when the page has none.

      Returns Promise<void>

    • Changes the link at the selection.

      Parameters

      • options: { address?: string; text?: string }

      Returns Promise<void>

    • Edits a sub-template's body in this editor, on its own pages. View.

      Parameters

      • options: { category?: string; name: string }

      Returns Promise<void>

    • Fills a content control with exactly one of text, an image (fitted to its box), DOCX content, or a building block gallery's entry (its buildingBlocks).

      Parameters

      • options: {
            buildingBlock?: string;
            docx?: Uint8Array<ArrayBufferLike>;
            id: ElementId;
            image?: Uint8Array<ArrayBufferLike>;
            text?: string;
        }

      Returns Promise<void>

    • Fills in a legacy form field (default: the one at the selection): a text field's text, a check box's state, a drop-down's entry.

      Parameters

      • options: { checked?: boolean; entry?: number; id?: ElementId; text?: string }

      Returns Promise<void>

    • Selects a bookmark's text, or puts the caret at it when it holds none (Go To); '_top' is the document's start.

      Parameters

      • name: string

      Returns Promise<void>

    • Moves the caret to a page, from 1.

      Parameters

      • page: number

      Returns Promise<void>

    • Groups the selected floating objects: two or more, in one story. The group is selected.

      Returns Promise<void>

    • Inserts a tab to a place set from the margin or the indent, not from the tab stops (Insert Alignment Tab).

      Parameters

      • options: {
            alignment: "center" | "left" | "right";
            leader?: TabLeader;
            relativeTo: "margin" | "indent";
        }

      Returns Promise<void>

    • Bookmarks the selection: the name starts with a letter (or _, for a hidden bookmark) and holds letters, digits and _, 40 at most. A bookmark of the same name (compared without case) moves here.

      Parameters

      • name: string

      Returns Promise<void>

    • Inserts a column break (Ctrl+Shift+Enter); in the body, not in a table.

      Returns Promise<void>

    • Inserts columns left or right, 1 by default.

      Parameters

      • options: { count?: number; where: "left" | "right" }

      Returns Promise<void>

    • Inserts a content control, optionally around the selection.

      Parameters

      • options: {
            binding?: DataBinding;
            float?: {
                horizontal?: HorizontalPosition;
                vertical?: VerticalPosition;
                wrap: ObjectWrap;
            };
            kind: ControlKind;
            lock?: "none"
            | "control"
            | "content"
            | "both";
            options?: ControlOptions;
            placeholder?: string;
            placeholderImage?: PlaceholderImage;
            tag?: string;
            title?: string;
            wrapSelection?: boolean;
        }
        • Optionalbinding?: DataBinding
        • Optionalfloat?: {
              horizontal?: HorizontalPosition;
              vertical?: VerticalPosition;
              wrap: ObjectWrap;
          }

          Floats a picture control, positioned and wrapped as setObjectWrap and setObjectPosition place an object; wrap can't be inline.

        • kind: ControlKind
        • Optionallock?: "none" | "control" | "content" | "both"
        • Optionaloptions?: ControlOptions
        • Optionalplaceholder?: string
        • OptionalplaceholderImage?: PlaceholderImage

          A picture control's placeholder picture (PNG, JPEG, GIF, BMP or SVG): what the editor, the saved DOCX and a PDF show until it is filled. An SVG is drawn with the picture's box as its viewport, so one with percentage geometry and no viewBox adapts to every size. Default: the engine's.

        • Optionaltag?: string
        • Optionaltitle?: string
        • OptionalwrapSelection?: boolean

      Returns Promise<{ id: ElementId }>

    • Inserts a field. With a selection and an empty code, wraps it (Ctrl+F9).

      Parameters

      • options: { code: string; display?: string; showCode?: boolean }

      Returns Promise<{ id: ElementId }>

    • Inserts a legacy form field (FORMTEXT, FORMCHECKBOX, FORMDROPDOWN) at the selection.

      Parameters

      • kind: "text" | "checkBox" | "dropDown"

      Returns Promise<{ id: ElementId }>

    • Inserts a link; text replaces the selection (default: the selection, or the address).

      Parameters

      • options: { address: string; text?: string }

      Returns Promise<void>

    • Inserts a footnote or an endnote at the caret, numbered or with its own mark (1 to 10 characters).

      Parameters

      • options: { customMark?: string; kind: "footnote" | "endnote" }

      Returns Promise<void>

    • Inserts a page break (Ctrl+Enter); in the body, not in a table.

      Returns Promise<void>

    • Inserts a page number at the caret, or in the header or footer.

      Parameters

      • options: {
            alignment?: "center" | "left" | "right";
            format: "page" | "pageOfTotal" | "total";
            where?: "header" | "footer" | "caret";
        }

      Returns Promise<void>

    • Inserts a picture (PNG, JPEG, GIF, BMP, TIFF, JPEG XR, SVG, EMF or WMF).

      Parameters

      • options: { altText?: string; data: Uint8Array }

      Returns Promise<void>

    • Inserts rows above or below, 1 by default.

      Parameters

      • options: { count?: number; where: "above" | "below" }

      Returns Promise<void>

    • Inserts one character, optionally in a symbol font.

      Parameters

      • options: { char: string; font?: string }

      Returns Promise<void>

    • Inserts a table of 1 to 32767 rows and 1 to 63 columns.

      Parameters

      • options: { columns: number; rows: number }

      Returns Promise<void>

    • Inserts text at the selection, replacing it. Typing.

      Parameters

      • text: string

      Returns Promise<void>

    • Draws wavy marks with a tooltip on elements. View.

      Parameters

      • options: {
            clear?: boolean;
            marks: {
                id: ElementId;
                message: string;
                severity: "error" | "warning" | "info";
            }[];
        }

      Returns Promise<void>

    • Moves a section text column's boundary.

      Parameters

      • options: { column: number; to: number }

      Returns Promise<void>

    • Moves the selected rows up or down (Alt+Shift+Up, Down).

      Parameters

      • direction: "up" | "down"

      Returns Promise<void>

    • Moves or extends the selection.

      Parameters

      • options: {
            by:
                | "line"
                | "screen"
                | "page"
                | "document"
                | "paragraph"
                | "word"
                | "character"
                | "lineEdge"
                | "rowEdge"
                | "columnEdge";
            direction: "forward"
            | "backward";
            extend?: boolean;
        }

      Returns Promise<void>

    • Moves a column boundary of the caret's row.

      Parameters

      • options: { index: number; to: number }

      Returns Promise<void>

    • Moves a row boundary of the caret's table.

      Parameters

      • options: { index: number; to: number }

      Returns Promise<void>

    • Moves the tab stop at from (within 0.5 pt).

      Parameters

      • options: { from: number; to: number }

      Returns Promise<void>

    • Moves to the next or previous cell; next from the last cell adds a row (one step).

      Parameters

      • direction: "next" | "previous"

      Returns Promise<void>

    • Reverts the correction just made, as revertAutoCorrect does, and never makes it again (adds it to autoCorrect.never).

      Returns Promise<void>

    • Pastes from the system clipboard, formatted (the default) or as text. Fails not-allowed where the browser denies reading it.

      Parameters

      • Optionaloptions: { as?: "text" | "formatted" }

      Returns Promise<void>

    • Applies the held formatting to the selection (Ctrl+Shift+V).

      Returns Promise<void>

    • Rejects every revision, or one author's.

      Parameters

      • Optionaloptions: { author?: string }

      Returns Promise<void>

    • Removes a content control, optionally keeping its content.

      Parameters

      • options: { id: ElementId; keepContent?: boolean }

      Returns Promise<void>

    • Removes a custom XML data part.

      Parameters

      • options: { itemId?: string; namespace: string }

      Returns Promise<void>

    • Removes the frame the selection is in: its paragraphs go back in the text, before the paragraph it was anchored to.

      Returns Promise<void>

    • Empties the caret section's header or footer (its own, so a linked one stops linking).

      Parameters

      • options: { kind: "header" | "footer"; pages: "default" | "first" | "even" }

      Returns Promise<void>

    • Removes a sub-template; its references no longer resolve.

      Parameters

      • options: { category?: string; name: string }

      Returns Promise<void>

    • Renames a sub-template, and with updateReferences every reference to it.

      Parameters

      • options: { category?: string; name: string; to: string; updateReferences?: boolean }

      Returns Promise<void>

    • The template's body becomes the DOCX from's body, on its last section's page; its sub-templates, custom XML data parts, settings, styles, headers and footers stay. Closes a sub-template being edited first.

      Parameters

      • options: { from: Uint8Array }

      Returns Promise<void>

    • Rewrites a font family's name in the document itself, so the saved file names to: one undo step. In document scope with no style filter it rewrites the text (runs, paragraph marks, symbols) and the tables below it (styles, document defaults, numbering levels, the theme's font slots and the font table). In selection scope, or with a filter, it rewrites only the text, and a matching run whose family comes from a style or the theme gets to as its own. With tracked changes on, the text's changes are formatting revisions. Text inside locked content controls is skipped and counted.

      Parameters

      • options: {
            bold?: boolean;
            from: string;
            italic?: boolean;
            scope?: ReplaceScope;
            to: string;
        }

      Returns Promise<{ changed: number; skipped: number }>

    • Replaces text in element codes, tags or titles: case-sensitive, every occurrence.

      Parameters

      • options: {
            find: string;
            ids?: ElementId[];
            in: "title" | "code" | "tag";
            kind?: "field" | "control";
            replace: string;
        }

      Returns Promise<{ changed: number }>

    • Puts back what was typed in place of the correction just made: undoes it when it is the last step, else one undo step.

      Returns Promise<void>

    • Selects the unit around the selection; the table units in a table.

      Parameters

      • unit: "table" | "paragraph" | "row" | "cell" | "word" | "sentence" | "column"

      Returns Promise<void>

    • Selects the next or previous child of the selected group. View.

      Parameters

      • direction: "next" | "previous"

      Returns Promise<void>

    • Selects the next or previous floating object.

      Parameters

      • direction: "next" | "previous"

      Returns Promise<void>

    • Selects the next or previous revision.

      Parameters

      • direction: "next" | "previous"

      Returns Promise<void>

    • Sets the alignment (Ctrl+L, E, R, J).

      Parameters

      • alignment: "center" | "left" | "right" | "justify"

      Returns Promise<void>

    • Sets the alternative text, or marks the object decorative.

      Parameters

      • options: { decorative?: boolean; text: string }

      Returns Promise<void>

    • Locks a floating object's anchor.

      Parameters

      • on: boolean

      Returns Promise<void>

    • The application's own field types (a code's first word, compared without case), replacing those set before: their fields keep their results, show their labels in design mode (Commands.setFieldLabels, else «first argument»), are listed by fieldsUpdateRequested and are never read as bookmark references ("Error! Bookmark not defined."). [] clears them. Set it after each open, as the rules, or once in the session options. View.

      Parameters

      • options: { types: string[] }

      Returns Promise<void>

    • Sets the colour an author's changes are marked with. View.

      Parameters

      • options: { author: string; color: `#${string}` }

      Returns Promise<void>

    • Turns automatic hyphenation on or off, with the hyphenation patterns of the text's language.

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets the cells' vertical alignment.

      Parameters

      • vertical: "top" | "bottom" | "center"

      Returns Promise<void>

    • Sets the cell margins, 0 to 1584; unset fields keep their value.

      Parameters

      • options: { bottom?: number; left?: number; right?: number; top?: number }

      Returns Promise<void>

    • Sets the cells' preferred width (points 0 to 1584, or percent of the table 0 to 100), text direction, wrapping, fitting and end mark height (hideMark); unset fields keep their value.

      Parameters

      • options: {
            fitText?: boolean;
            hideMark?: boolean;
            textDirection?: TextFlow;
            width?: TableWidth;
            wrapText?: boolean;
        }

      Returns Promise<void>

    • Sets or removes (null) the cell shading.

      Parameters

      • color: `#${string}` | null

      Returns Promise<void>

    • Raises (positive) or lowers the text, -1584 to 1584.

      Parameters

      • position: number

      Returns Promise<void>

    • Sets the character spacing, -1584 to 1584.

      Parameters

      • spacing: number

      Returns Promise<void>

    • Sets the text columns: 1 to 45, with spacing and a separator line.

      Parameters

      • options: { count: number; separator?: boolean; spacing?: number; widths?: ColumnWidth[] }
        • count: number
        • Optionalseparator?: boolean
        • Optionalspacing?: number
        • Optionalwidths?: ColumnWidth[]

          Columns of their own widths (count of them), each with the space after it; equal columns when not given.

      Returns Promise<void>

    • Sets the column width, 1 to 1584.

      Parameters

      • width: number

      Returns Promise<void>

    • Sets the most consecutive lines that may end in a hyphen, 0 to 32767; 0 for no limit.

      Parameters

      • limit: number

      Returns Promise<void>

    • Changes a content control; a null binding removes it. placeholderImage replaces a picture control's placeholder picture while it shows it (else it rejects with unavailable).

      Parameters

      • options: {
            appearance?: "hidden" | "boundingBox" | "tags";
            binding?: DataBinding | null;
            color?: `#${string}` | "none";
            id: ElementId;
            lock?: "none" | "control" | "content" | "both";
            options?: ControlOptions;
            placeholder?: string;
            placeholderImage?: PlaceholderImage;
            style?: StyleId | "none";
            tag?: string;
            temporary?: boolean;
            title?: string;
        }
        • Optionalappearance?: "hidden" | "boundingBox" | "tags"

          How it shows its edges.

        • Optionalbinding?: DataBinding | null
        • Optionalcolor?: `#${string}` | "none"

          Its colour, or the default ('none').

        • id: ElementId
        • Optionallock?: "none" | "control" | "content" | "both"
        • Optionaloptions?: ControlOptions
        • Optionalplaceholder?: string
        • OptionalplaceholderImage?: PlaceholderImage
        • Optionalstyle?: StyleId | "none"

          The character style text typed into it takes, or none ('none').

        • Optionaltag?: string
        • Optionaltemporary?: boolean

          It goes when its content is edited, leaving the content.

        • Optionaltitle?: string

      Returns Promise<void>

    • Sets the table style new tables take (Set as Default), or Table Grid (null).

      Parameters

      Returns Promise<void>

    • Sets the document's default tab spacing, 1 to 1584.

      Parameters

      • spacing: number

      Returns Promise<void>

    • Sets a different first page header and footer.

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets different odd and even page headers and footers.

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets the document's properties; unset fields keep their value, an empty text removes one, and custom replaces the custom properties.

      Parameters

      • options: {
            author?: string;
            category?: string;
            comments?: string;
            company?: string;
            custom?: CustomProperty[];
            hyperlinkBase?: string;
            keywords?: string;
            lastModifiedBy?: string;
            manager?: string;
            status?: string;
            subject?: string;
            title?: string;
        }

      Returns Promise<void>

    • Restrict Editing: what the document allows, and starting or stopping its enforcement. Starting takes the password stopping will need (none when absent); stopping a password-protected document needs it. With filling in forms, unprotectedSections are the sections (by index) anyone may edit; it can't change while enforced.

      Parameters

      • options: {
            enforce?: boolean;
            formatting?: boolean;
            kind?: "none" | "readOnly" | "comments" | "trackedChanges" | "forms";
            password?: string;
            unprotectedSections?: number[];
        }

      Returns Promise<void>

    • Sets a document variable (read by DOCVARIABLE), or removes it when value is absent.

      Parameters

      • options: { name: string; value?: string }

      Returns Promise<void>

    • Sets double strikethrough.

      Parameters

      • on: boolean

      Returns Promise<void>

    • The selection's paragraph's drop cap: its first letter dropped into the text or in the margin, or put back ('none').

      Parameters

      Returns Promise<void>

    • What design mode shows for each field code. View.

      Parameters

      • options: { labels: Record<string, string>; merge?: boolean }

      Returns Promise<void>

    • Supplies field results; token joins the step a fieldsUpdateRequested event started.

      Parameters

      • options: { results: { display: string | RichText; id: ElementId }[]; token?: number }

      Returns Promise<void>

    • The document's file name, with its folder when FILENAME \p should show one: what FILENAME shows. Not saved, and not an edit.

      Parameters

      • name: string

      Returns Promise<void>

    • Sets the font family (non-empty).

      Parameters

      • family: string

      Returns Promise<void>

    • Sets the font colour.

      Parameters

      • color: `#${string}` | "auto"

      Returns Promise<void>

    • Sets the font size, 1 to 1638 in 0.5 steps.

      Parameters

      • size: number

      Returns Promise<void>

    • Sets a legacy form field's options (default: the one at the selection); only its own kind's options apply.

      Parameters

      • options: {
            calculateOnExit?: boolean;
            checkBox?: { checkedByDefault?: boolean; size?: number | "auto" };
            dropDown?: { default?: number; entries?: string[] };
            enabled?: boolean;
            entryMacro?: string;
            exitMacro?: string;
            helpText?: string;
            id?: ElementId;
            name?: string;
            statusText?: string;
            text?: {
                default?: string;
                format?: string;
                inputType?: TextInputType;
                maxLength?: number;
            };
        }

      Returns Promise<void>

    • Shades legacy form fields, or not.

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets the header and footer distances; unset fields keep their value.

      Parameters

      • options: { footer?: number; header?: number }

      Returns Promise<void>

    • The caret section's header or footer takes the section before's (Link to Previous), or gets its own copy of it.

      Parameters

      • options: {
            kind: "header" | "footer";
            linked: boolean;
            pages: "default" | "first" | "even";
        }

      Returns Promise<void>

    • Repeats the rows as a header row.

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets hidden text (Ctrl+Shift+H).

      Parameters

      • on: boolean

      Returns Promise<void>

    • Hyphenates words in capitals, or not.

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets the hyphenation zone, 0 to 1584: in documents in compatibility mode 14 and earlier, a word is hyphenated only when moving it whole would leave this gap.

      Parameters

      • zone: number

      Returns Promise<void>

    • Sets the indents, -1584 to 1584; firstLine and hanging are exclusive. Unset fields keep their value.

      Parameters

      • options: {
            firstLine?: number;
            hanging?: number;
            left?: number;
            mirror?: boolean;
            right?: number;
        }
        • OptionalfirstLine?: number
        • Optionalhanging?: number
        • Optionalleft?: number
        • Optionalmirror?: boolean

          Mirror indents: on facing pages left is the inside indent and right the outside.

        • Optionalright?: number

      Returns Promise<void>

    • Makes the paragraphs a bullet or numbered list, or removes the list (null).

      Parameters

      • kind: "bullet" | "numbered" | null

      Returns Promise<void>

    • Defines the selection's list levels (level k of levels is level k; the levels after them are kept) for the whole list, from this paragraph on, or for the selected paragraphs. Outside a list, makes a new one.

      Parameters

      • options: {
            applyTo?: "thisPointForward" | "wholeList" | "currentParagraph";
            levels: ListLevel[];
            name?: string;
        }

      Returns Promise<void>

    • Changes the list level (Tab, Shift+Tab at an item's start); in a list.

      Parameters

      • change: "increase" | "decrease"

      Returns Promise<void>

    • Sets the margins, 0 to 1584; unset fields keep their value.

      Parameters

      • options: {
            bottom?: number;
            gutter?: number;
            left?: number;
            right?: number;
            top?: number;
        }

      Returns Promise<void>

    • Switches between editing and design mode.

      Parameters

      • mode: "editing" | "design"

      Returns Promise<void>

    • Sets how the document's pages pair and where the gutter is; unset fields keep their value.

      Parameters

      Returns Promise<void>

    • Sets footnotes' or endnotes' position, number format, first number and restarting, for the caret section or the whole document (the default); unset fields keep their value. Footnotes go at the pageBottom or beneathText; endnotes at the sectionEnd or documentEnd (the whole document's).

      Parameters

      • options: {
            applyTo?: "wholeDocument" | "thisSection";
            columns?: number;
            format?: NumberFormat;
            kind: "footnote" | "endnote";
            position?: NotePosition;
            restart?: "continuous" | "eachSection" | "eachPage";
            start?: number;
        }
        • OptionalapplyTo?: "wholeDocument" | "thisSection"
        • Optionalcolumns?: number

          Footnotes only: the footnote area's columns, 1 to 4, or the section's own (0).

        • Optionalformat?: NumberFormat
        • kind: "footnote" | "endnote"
        • Optionalposition?: NotePosition
        • Optionalrestart?: "continuous" | "eachSection" | "eachPage"
        • Optionalstart?: number

      Returns Promise<void>

    • Set Numbering Value: starts a new list at value, or continues the previous list (skipping to value with advance).

      Parameters

      • options: { advance?: boolean; mode: "continue" | "startNew"; value: number }

      Returns Promise<void>

    • Places the floating object: each axis given is aligned, offset, or (with neither) kept where it is and measured from its new reference; vertical: { relativeTo: 'page' } fixes it on the page, 'paragraph' moves it with text. Unset fields keep their value.

      Parameters

      Returns Promise<void>

    • Sets the selected objects' rotation, 0 to 360 degrees clockwise.

      Parameters

      • degrees: number

      Returns Promise<void>

    • Sets the object's size, 1 to 1584.

      Parameters

      • options: {
            height?: number;
            lockAspect?: boolean;
            relativeHeight?: "none" | RelativeSize;
            relativeWidth?: "none" | RelativeSize;
            width?: number;
        }
        • Optionalheight?: number
        • OptionallockAspect?: boolean
        • OptionalrelativeHeight?: "none" | RelativeSize

          A floating object's height as a share of a box on the page, or absolute ('none').

        • OptionalrelativeWidth?: "none" | RelativeSize

          A floating object's width as a share of a box on the page, or absolute ('none').

        • Optionalwidth?: number

      Returns Promise<void>

    • Sets the sides text wraps on around the floating object and its distance from the text, 0 to 1584; unset fields keep their value.

      Parameters

      • options: {
            bottom?: number;
            left?: number;
            right?: number;
            side?: WrapSide;
            top?: number;
        }

      Returns Promise<void>

    • Sets the orientation.

      Parameters

      • orientation: "portrait" | "landscape"

      Returns Promise<void>

    • Sets the outline level (1 to 9, or 0 for body text) and whether the paragraphs open collapsed; unset fields keep their value.

      Parameters

      • options: { collapsed?: boolean; level?: number }

      Returns Promise<void>

    • Sets the page borders of the selection's section, or of every section: each edge given is set or removed (null), the rest kept; what they're measured from, and the pages they show on.

      Parameters

      • options: {
            applyTo?: "wholeDocument" | "thisSection";
            bottom?: BorderLine | null;
            display?: "allPages" | "firstPage" | "notFirstPage";
            left?: BorderLine | null;
            offsetFrom?: "text" | "page";
            right?: BorderLine | null;
            shadow?: boolean;
            surroundFooter?: boolean;
            surroundHeader?: boolean;
            top?: BorderLine | null;
        }
        • OptionalapplyTo?: "wholeDocument" | "thisSection"
        • Optionalbottom?: BorderLine | null
        • Optionaldisplay?: "allPages" | "firstPage" | "notFirstPage"
        • Optionalleft?: BorderLine | null
        • OptionaloffsetFrom?: "text" | "page"
        • Optionalright?: BorderLine | null
        • Optionalshadow?: boolean

          A shadow on the bottom and right edges.

        • OptionalsurroundFooter?: boolean

          The borders go around the footer (every section's).

        • OptionalsurroundHeader?: boolean

          The borders go around the header (every section's).

        • Optionaltop?: BorderLine | null

      Returns Promise<void>

    • Sets the page colour of the document: no fill, a solid colour (a theme colour takes one tint or shade), a gradient, a pattern, or a picture (tile makes it a texture). A picture fill with an empty image keeps the page's own.

      Parameters

      Returns Promise<void>

    • Sets the section's page number format, first number (null continues from the section before) and chapter numbers (null for none); unset fields keep their value.

      Parameters

      Returns Promise<void>

    • Sets where text sits between the section's top and bottom margins.

      Parameters

      • alignment: "top" | "bottom" | "center" | "justified"

      Returns Promise<void>

    • Sets the paper size, in portrait, 36 to 1584.

      Parameters

      • options: { height: number; width: number }

      Returns Promise<void>

    • Sets the selected paragraphs' border lines: each edge given is set, or removed (null); the rest are kept.

      Parameters

      • options: {
            between?: BorderLine | null;
            bottom?: BorderLine | null;
            left?: BorderLine | null;
            right?: BorderLine | null;
            shadow?: boolean;
            top?: BorderLine | null;
        }
        • Optionalbetween?: BorderLine | null

          The line between paragraphs with the same borders.

        • Optionalbottom?: BorderLine | null
        • Optionalleft?: BorderLine | null
        • Optionalright?: BorderLine | null
        • Optionalshadow?: boolean

          A shadow on the bottom and right edges set here.

        • Optionaltop?: BorderLine | null

      Returns Promise<void>

    • Sets the paragraph borders (a half-point single line).

      Parameters

      • preset: "none" | "bottom" | "box"

      Returns Promise<void>

    • Sets the pagination flags; unset fields keep their value.

      Parameters

      • options: {
            dontHyphenate?: boolean;
            keepLinesTogether?: boolean;
            keepWithNext?: boolean;
            pageBreakBefore?: boolean;
            suppressLineNumbers?: boolean;
            textboxTightWrap?: TightWrap;
            widowControl?: boolean;
        }
        • OptionaldontHyphenate?: boolean

          Don't hyphenate the paragraph.

        • OptionalkeepLinesTogether?: boolean
        • OptionalkeepWithNext?: boolean
        • OptionalpageBreakBefore?: boolean
        • OptionalsuppressLineNumbers?: boolean

          Leaves the paragraph's lines out of line numbering.

        • OptionaltextboxTightWrap?: TightWrap

          In a text box, which lines text around the box wraps tightly to.

        • OptionalwidowControl?: boolean

      Returns Promise<void>

    • Sets or removes (null) the paragraph shading.

      Parameters

      • color: `#${string}` | null

      Returns Promise<void>

    • Sets the space before and after, 0 to 1584; unset fields keep their value.

      Parameters

      • options: { after?: number | "auto"; before?: number | "auto"; contextual?: boolean }
        • Optionalafter?: number | "auto"
        • Optionalbefore?: number | "auto"
        • Optionalcontextual?: boolean

          No space between paragraphs of the same style.

      Returns Promise<void>

    • Crops the selected picture by fractions of its image from each edge (0 to 1; negative pads it): its box follows the part shown, at the scale it is drawn. Unset fields keep their value.

      Parameters

      • crop: { bottom?: number; left?: number; right?: number; top?: number }

      Returns Promise<void>

    • Sets the tag prefixes (compared without case) whose picture controls keep their pictures: editing can't delete, paste over or replace such a picture; fillControl and setControl still change it, and in design mode deleting it removes its whole control. Replaces the prefixes set before; an empty list protects none. Not saved.

      Parameters

      • options: { tagPrefixes: string[] }

      Returns Promise<void>

    • Lets rows break across pages.

      Parameters

      • on: boolean

      Returns Promise<void>

    • Hides the rows' end marks (a row hides when its text is hidden too), and sets the table properties the rows override: reset drops their own first.

      Parameters

      • options: {
            exceptions?: {
                alignment?: "center" | "left" | "right";
                borders?: { border?: BorderLine; edges: CellBorderEdges };
                cellSpacing?: number;
                reset?: boolean;
                shading?: `#${string}`;
            };
            hidden?: boolean;
        }

      Returns Promise<void>

    • Sets the selection mode (F8 extends, Ctrl+Shift+F8 selects a block).

      Parameters

      • mode: "normal" | "extend" | "block"

      Returns Promise<void>

    • Shades the selected paragraphs, text, cells or tables (a table's shows around cells with spacing): the fill, and a pattern of color over it. fill: 'none' with a clear pattern removes the shading.

      Parameters

      • options: {
            color?: `#${string}` | "auto";
            fill: `#${string}` | "none";
            pattern?: ShadingPattern;
            target: "text" | "table" | "paragraph" | "cell";
        }

      Returns Promise<void>

    • Sets small caps (Ctrl+Shift+K).

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets a style's list flags; what isn't given is kept.

      Parameters

      • options: {
            id: StyleId;
            locked?: boolean;
            priority?: number;
            quick?: boolean;
            visibility?: "show" | "hideUntilUsed" | "hide";
        }

      Returns Promise<void>

    • Shows references' sub-template bodies in their place, or their fields (default: every reference). View.

      Parameters

      • options: { expanded: boolean; ids?: ElementId[] }

      Returns Promise<void>

    • Sets superscript (Ctrl+Shift+=).

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets the table alignment.

      Parameters

      • alignment: "center" | "left" | "right"

      Returns Promise<void>

    • Sets the table's alternative text title and description; unset fields keep their value.

      Parameters

      • options: { description?: string; title?: string }

      Returns Promise<void>

    • Sets the space between the table's cells, 0 to 1584, or none (null).

      Parameters

      • spacing: number | null

      Returns Promise<void>

    • Sets the table indent, -1584 to 1584.

      Parameters

      • indent: number

      Returns Promise<void>

    • Positions the caret's table, so text wraps around it, as dragging its move handle does: a table without a position gets one across from the margin and down from the paragraph, and each axis given is aligned, offset, or (with neither) kept where it is and measured from its new reference. Unset fields keep their value; null puts the table back in the text.

      Parameters

      Returns Promise<void>

    • Sets which parts of the table style apply; unset fields keep their value.

      Parameters

      • options: {
            bandedColumns?: boolean;
            bandedRows?: boolean;
            firstColumn?: boolean;
            headerRow?: boolean;
            lastColumn?: boolean;
            totalRow?: boolean;
        }

      Returns Promise<void>

    • Sets or removes (border: null) the selected text's border: a box of one line, with a shadow or not.

      Parameters

      • options: { border: BorderLine | null; shadow?: boolean }

      Returns Promise<void>

    • Sets the text's fill, outline, shadow, glow and reflection: each one given replaces the text's own, null turns it off (over a style's too; a fill is only removed), and what isn't given is kept.

      Parameters

      Returns Promise<void>

    • Turns change tracking on or off (Ctrl+Shift+E).

      Parameters

      • on: boolean

      Returns Promise<void>

    • Sets the underline's colour, or the text's ('auto'); underlined text only.

      Parameters

      • color: `#${string}` | "auto"

      Returns Promise<void>

    • Sets view options: formatting marks (Ctrl+Shift+8), gridlines, text boundaries, live layout, the chrome's theme and accent, the page's appearance, the measuring detail and the object grid.

      Parameters

      Returns Promise<void>

    • Sets the zoom: 10 to 500 percent, or a fit.

      Parameters

      • zoom: number | "pageWidth" | "wholePage"

      Returns Promise<void>

    • Asks for the options of the correction just made (popoverRequested), Alt+Shift+F10. View.

      Returns Promise<void>

    • Asks for the options of the tab stop nearest the caret (popoverRequested). View.

      Returns Promise<void>

    • Splits the selected cells.

      Parameters

      • options: { columns: number; rows?: number }

      Returns Promise<void>

    • Changes a style to the selection's formatting (its paragraph's and its first run's direct formatting).

      Parameters

      Returns Promise<void>

    • Wraps the selected paragraphs or table rows in a repeating section.

      Parameters

      • Optionaloptions: { tag?: string; title?: string }

      Returns Promise<{ id: ElementId }>

    • Writes a custom XML data part (well-formed).

      Parameters

      • options: { itemId?: string; namespace: string; xml: string }

      Returns Promise<{ itemId: string }>