Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/docxml/src/classes/Component.ts>Component#ensureRelationship

TypeScript (component) library for building and parsing a DOCX file
Go to Latest
method Component.prototype.ensureRelationship
import { Component } from "https://deno.land/x/docxml@5.13.2/src/classes/Component.ts";

An event hook with which this component can ensure that the correct relationship type is recorded to the relationship XML.

For example;

  • Create a relationship to a Hyperlink external target
  • Create a relationship from the Image component to its image file binary.

You'll want to use RelationshipsXml to create a relationship and store its identifier somewhere, before using it in Component.toNode.

this.#relationshipId = relationships.add(RelationshipType.hyperlink, this.props.url);