docx
    Preparing search index...

    Type Alias TemplatePackage

    What a DrawingPatch can do with the template's package.

    type TemplatePackage = {
        format: (content: XmlComponent) => Element;
        getRelatedPart: (
            from: TemplatePart,
            relationshipId: string,
        ) => TemplatePart | undefined;
        replaceRelatedPart: (
            from: TemplatePart,
            relationshipId: string | undefined,
            part: PackagePart,
        ) => string;
    }
    Index
    format: (content: XmlComponent) => Element

    Formats XML as the template's parts are parsed, to put in one of them

    getRelatedPart: (
        from: TemplatePart,
        relationshipId: string,
    ) => TemplatePart | undefined

    The part a relationship of a part refers to, such as the chart a drawing's c:chart refers to by its r:id.

    Type Declaration

      • (from: TemplatePart, relationshipId: string): TemplatePart | undefined
      • Parameters

        Returns TemplatePart | undefined

        The part, or undefined if the part has no such relationship, the relationship is to something outside the package, or the package has no such part

    replaceRelatedPart: (
        from: TemplatePart,
        relationshipId: string | undefined,
        part: PackagePart,
    ) => string

    Points a relationship of a part to a new part, such as a chart's to a new workbook, or adds the relationship if the part has none with the id. The part the relationship referred to is removed from the package, unless something else refers to it.

    Type Declaration

      • (
            from: TemplatePart,
            relationshipId: string | undefined,
            part: PackagePart,
        ): string
      • Parameters

        • from: TemplatePart
        • relationshipId: string | undefined

          The relationship's id, or undefined for a new relationship

        • part: PackagePart

        Returns string

        The relationship's id