Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/docxml/src/files/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@2.0.1/src/files/Relationships.ts";

Constructors

new
Relationships(
location: string,
instances?,
)

Properties

private
instances: Map<string, File>

Class instances of all relationships that are not "external"

private
meta: Array<RelationshipMeta>

All relationship data

Methods

protected
toNode(): Document
add(type: RelationshipType, instance: File): string

Create a new relationship and return the new identifier

ensureRelationship<C extends File>(type: RelationshipType, createInstance: () => C): C
find<R extends File = File>(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.

toArchive(archive: ZipArchive): void

Static Methods

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

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