class Relationships
extends XmlFile
import { Relationships } from "https://deno.land/x/docxml@5.3.1/src/files/Relationships.ts";
Constructors
Methods
protected
toNode(): Documentadd(type: RelationshipType, instance: File): string
Create a new relationship and return the new identifier
addToArchive(archive: Archive): Promise<void>
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.
getRelated(): File[]
Get all XmlFile instances related to this one, including self. This helps the system serialize itself back to DOCX fullly. Probably not useful for consumers of the library.
By default only returns the instance itself but no other related instances.
hasType(type: RelationshipType)
Static Methods
fromArchive(archive: Archive, location: string): Promise<Relationships>
Instantiate this class by looking at the DOCX XML for it.