@twip/web
    Preparing search index...

    Interface SubTemplates

    The template's sub-templates, and editing one in this editor. While one is edited, state.editing names it and every command, query and event concerns its body; editingTargetChanged fires on each switch.

    interface SubTemplates {
        close(): Promise<void>;
        create(
            name: string,
            options?: {
                category?: string;
                copyOf?: string;
                from?: Uint8Array<ArrayBufferLike>;
            },
        ): Promise<void>;
        edit(name: string, category?: string): Promise<void>;
        export(
            name: string,
            options?: { category?: string },
        ): Promise<Uint8Array<ArrayBufferLike>>;
        list(): Promise<SubTemplateInfo[]>;
        remove(name: string, options?: { category?: string }): Promise<void>;
        rename(
            name: string,
            to: string,
            options?: { category?: string; updateReferences?: boolean },
        ): Promise<void>;
    }
    Index
    • A new sub-template: empty, with the body of the DOCX from, or a copy of the sub-template copyOf in the same category (its formatting, fields, controls, pictures and references). One undo step.

      Parameters

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

      Returns Promise<void>

    • Edits a sub-template's body on its own pages (category: when several rules name categories).

      Parameters

      • name: string
      • Optionalcategory: string

      Returns Promise<void>

    • A standalone DOCX of a sub-template's body, with the document's styles, numbering, theme and fonts and without its headers, footers or other sub-templates; create(name, { from }) reads it back unchanged.

      Parameters

      • name: string
      • Optionaloptions: { category?: string }

      Returns Promise<Uint8Array<ArrayBufferLike>>

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

      Parameters

      • name: string
      • Optionaloptions: { category?: string }

      Returns Promise<void>

    • Renames a sub-template; updateReferences renames every reference to it too. One undo step.

      Parameters

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

      Returns Promise<void>