Skip to main content
Module

x/docxml/src/bundle/Relationships.ts>Relationships

An experimental Deno tool to transform XML to DOCX with a little XPath- and component based configuration
Go to Latest
class Relationships
extends XmlFile
import { Relationships } from "https://deno.land/x/docxml@1.4.0/src/bundle/Relationships.ts";

Constructors

new
Relationships(
location: string,
instances?,
)

Properties

private
instances: Map<string, XmlFile>

Class instances of all relationships that are not "external"

private
meta: Array<RelationshipMeta>

All relationship data

Methods

protected
toNode(): Document
add(type: RelationshipType, instance: XmlFile)
ensureRelationship<C extends XmlFile>(type: RelationshipType, createInstance: () => C): C
find<R extends XmlFile = XmlFile>(cb: (meta: RelationshipMeta) => boolean): R | null

Find a relationship instance (eg. a OfficeDocument) by its metadata. The metadata would tell you what type of relationship it is.

Static Methods

fromArchive(archive: ZipArchive, location: string): Promise<Relationships>

Instantiate this class by looking at the DOCX XML for it.