import { ContentTypesXml } from '../../mod.js'; import { Archive } from '../classes/Archive.js'; import { BinaryFile } from '../classes/BinaryFile.js'; import { XmlFile, XmlFileWithContentTypes } from '../classes/XmlFile.js'; import { FileMime, RelationshipType } from '../enums.js'; export declare type RelationshipMeta = { id: string; type: RelationshipType; target: string; isExternal: boolean; isBinary: boolean; }; export declare type File = XmlFile | BinaryFile; export declare class RelationshipsXml extends XmlFileWithContentTypes { #private; static contentType: FileMime; /** * All relationship data */ readonly meta: Array; constructor(location: string, meta?: RelationshipMeta[], instances?: Map); /** * @deprecated Use {@link RelationshipXml.findInstance} instead. */ find(cb: (meta: RelationshipMeta) => boolean): R | null; /** * Find a relationship instance (eg. a {@link DocumentXml}) by its metadata. The metadata would tell you what type * of relationship it is. * * @note So far this function is only used for testing. It may be removed in the future, so if you * have a valid use case for it please submit an issue on GitHub. */ findInstance(cb: (meta: RelationshipMeta) => boolean): R | null; filterInstances(cb: (meta: RelationshipMeta) => boolean): R[]; /** * Create a new relationship and return the new identifier */ add(type: RelationshipType, target: File | string): string; getTarget(id: string): string; hasType(type: RelationshipType): boolean; ensureRelationship(type: RelationshipType, createInstance: () => C): C; protected toNode(): Document; /** * 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. */ getRelated(): File[]; addToArchive(archive: Archive): Promise; /** * Instantiate this class by looking at the DOCX XML for it. */ static fromArchive(archive: Archive, contentTypes: ContentTypesXml, location: string): Promise; }