docx
    Preparing search index...

    Type Alias PageNumberEstimator

    PageNumberEstimator: (
        body: IXmlableObject,
        context: IContext,
    ) => EstimatedPageNumbers & {
        listNumbers?: (
            body: IXmlableObject,
            context: IContext,
        ) => ReadonlyMap<string, BookmarkListNumber>;
    }

    Works out which page each bookmark of a document starts on, and how many pages the document and its sections have, from the body of the document as it is written, so the page numbers of its tables of contents, page references and page counts can be written with it.

    estimatePageNumbers, from docx/layout, is one. Give it to a document as its pageNumbers.

    Type Declaration

    • Optional ReadonlylistNumbers?: (
          body: IXmlableObject,
          context: IContext,
      ) => ReadonlyMap<string, BookmarkListNumber>

      Works out the list numbers of the paragraphs bookmarks start, by the bookmarks' names. A table of contents filled in from the headings starts the entry of a numbered heading with its number, as Word does, so docx asks for them once the headings are bookmarked, before it writes the entries and works out their pages. A bookmark of a paragraph whose number it didn't work out is left out, and the entry is written without a number.

    The document's body, formatted to be written as XML

    The context the body was formatted in, with the document it is in