/** * DOCX Module - Reference Scanners * * Shared helpers for scanning the document model for image / hyperlink / * chart references that need to be registered against a part-level .rels * file. Used by both the bulk packager and the streaming writer to avoid * behaviour drift in how header/footer/notes/comments parts collect their * own relationships. */ import type { ChartContent, HeaderFooterContent, Hyperlink, Paragraph, ParagraphChild } from "../types.js"; /** * Recursively collect image rIds referenced inside a list of paragraph * children. Descends into track-change wrappers (`InsertedRun`, * `MovedToRun`, etc.) so an image embedded inside `...` is * not silently lost. */ export declare function scanChildrenForImages(children: readonly ParagraphChild[], out: Set): void; /** * Recursively collect external-URL hyperlinks from a list of paragraph * children. Descends into track-change wrappers so an inserted hyperlink * isn't dropped. * * Always emits hyperlinks that carry a `url`, regardless of whether the * model already has an `rId`. Reader-supplied `rId`s are stale once the * package is repackaged because the relationship table is rebuilt from * scratch — the packager assigns its own canonical `rId` and exposes * it via the `hyperlinkRIds` WeakMap, which the renderer consults. */ export declare function scanChildrenForHyperlinks(children: readonly ParagraphChild[], out: Hyperlink[]): void; /** Collect all image rIds referenced in header/footer content. */ export declare function collectImageRidsFromContent(content: HeaderFooterContent): Set; /** Collect hyperlinks from header/footer content. */ export declare function collectHyperlinksFromHeaderFooter(content: HeaderFooterContent): Hyperlink[]; /** Collect all chart contents inside header/footer content. */ export declare function collectChartsFromHeaderFooter(content: HeaderFooterContent, out: ChartContent[]): void; /** Collect image rIds and hyperlinks from a notes/comments collection. */ export declare function collectImageRidsFromNotes(notes: readonly { content: readonly Paragraph[]; }[] | undefined): Set; export declare function collectHyperlinksFromNotes(notes: readonly { content: readonly Paragraph[]; }[] | undefined): Hyperlink[];