docx
    Preparing search index...

    Class PackagePart

    A part that something in a document adds to the package when it is written, such as a chart, with the relationship to it from the part it is used in: the document, a header, a footer, the footnotes, the endnotes or the comments.

    The part is added once, however many times it is written, and parts are numbered in the order they are added, such as word/charts/chart1.xml and word/charts/chart2.xml. The XML that refers to the part uses relationshipId, and calls addTo from its prepForXml.

    const chart = new PackagePart({
    folder: "charts",
    name: "chart",
    extension: "xml",
    contentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
    relationshipType: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
    content: chartSpace,
    });

    class ChartReference extends XmlComponent {
    public prepForXml(context: IContext): IXmlableObject | undefined {
    chart.addTo(context);
    return super.prepForXml(context);
    }
    }
    Index
    relationshipId: string = ...

    The id of the relationship to the part, such as a chart's r:id in the document