docx
    Preparing search index...

    Class AbstractNumbering

    Represents an abstract numbering definition in a WordprocessingML document.

    Abstract numbering definitions define the formatting and style of numbered or bulleted lists that can be referenced by concrete numbering instances. Each abstract definition can contain up to 9 levels.

    Reference: http://officeopenxml.com/WPnumbering.php

    <xsd:complexType name="CT_AbstractNum">
    <xsd:sequence>
    <xsd:element name="nsid" type="CT_LongHexNumber" minOccurs="0"/>
    <xsd:element name="multiLevelType" type="CT_MultiLevelType" minOccurs="0"/>
    <xsd:element name="tmpl" type="CT_LongHexNumber" minOccurs="0"/>
    <xsd:element name="name" type="CT_String" minOccurs="0"/>
    <xsd:element name="styleLink" type="CT_String" minOccurs="0"/>
    <xsd:element name="numStyleLink" type="CT_String" minOccurs="0"/>
    <xsd:element name="lvl" type="CT_Lvl" minOccurs="0" maxOccurs="9"/>
    </xsd:sequence>
    <xsd:attribute name="abstractNumId" type="ST_DecimalNumber" use="required"/>
    </xsd:complexType>
    // Create an abstract numbering definition with multiple levels
    const abstractNumbering = new AbstractNumbering(1, [
    {
    level: 0,
    format: LevelFormat.DECIMAL,
    text: "%1.",
    alignment: AlignmentType.LEFT,
    },
    {
    level: 1,
    format: LevelFormat.LOWER_LETTER,
    text: "%2)",
    alignment: AlignmentType.LEFT,
    },
    ]);

    Hierarchy (View Summary)

    Index
    id: number

    The unique identifier for this abstract numbering definition.

    • get writtenAs(): readonly BaseXmlComponent[] | undefined
      Internal

      The components written in this one's place, one after another, when it can't be written as a single element, such as a run with another run in its children. Undefined when it is written as itself.

      Returns readonly BaseXmlComponent[] | undefined

    • Prepares this component and its children for XML serialization.

      This method is called by the Formatter to convert the component tree into an object structure compatible with the xml library (https://www.npmjs.com/package/xml). It recursively processes all children and handles special cases like attribute-only elements and empty elements.

      The method can be overridden by subclasses to customize XML representation or execute side effects during serialization (e.g., creating relationships).

      Parameters

      • context: IContext

        The serialization context containing document state

      Returns IXmlableObject | undefined

      The XML-serializable object, or undefined to exclude from output

      // Override to add custom serialization logic
      prepForXml(context: IContext): IXmlableObject | undefined {
      // Custom logic here
      return super.prepForXml(context);
      }