import type { jsPDF as JsPdf } from 'jspdf'; export interface WorkPdfOutlineEntry { /** 1-based outline level for nesting (h1 / outlineLvl 0 → 1 … outlineLvl 8 → 9). */ level?: number; pageNumber: number; title: string; } export interface WorkPdfDocumentStructure { language?: string; outline?: readonly WorkPdfOutlineEntry[]; title?: string; } /** * Applies bounded PDF document metadata and outline bookmarks. This is the * tagged/accessibility bootstrap: language (catalog + StructElem `/Lang`) + * title (Info dict + Document StructElem `/Alt`) + heading outline + MarkInfo * (Marked + Suspects false) + catalog Tabs /S + StructTreeRoot (Document / * H1–H6 / P with /Pg) with ParentTree / MCID links for vector-run Span content, * without claiming full PDF/UA certification. */ export declare function applyWorkPdfDocumentStructure(pdf: JsPdf, structure: WorkPdfDocumentStructure): void; /** * Writes catalog `/Lang` for any normalized BCP-47-like tag via putCatalog. * Prefer this over jsPDF `setLanguage`, which silently skips tags outside its * fixed enum (for example `yue`). Not a PDF/UA certification claim. */ export declare function ensureWorkPdfCatalogLang(pdf: JsPdf, language: string | null): void; /** * Declares `/MarkInfo << /Marked true /Suspects false >>` once via jsPDF's * putCatalog hook so ActualText Span marked content is catalog-visible and * structure suspects are denied. Not a PDF/UA certification claim. */ export declare function ensureWorkPdfMarkInfo(pdf: JsPdf): void; /** * Declares `/ViewerPreferences << /DisplayDocTitle true >>` so tagged-PDF * consumers prefer the document title. Not a PDF/UA certification claim. */ export declare function ensureWorkPdfViewerPreferences(pdf: JsPdf): void; /** * Declares catalog `/Tabs /S` so tagged-PDF consumers follow structure-tree * reading order. Not a PDF/UA certification claim. */ export declare function ensureWorkPdfStructTabs(pdf: JsPdf): void; /** * Emits StructTreeRoot (Document + outline-derived H1–H6/P + Span content * links) with ParentTree / page StructParents via jsPDF hooks. * Outline roles nest by level under parent `/K` (same stack as bookmarks); * page-matched Spans nest under the last outline role on that page (H1–H6 * wrap those Spans in a child `/P`; outline-level `/P` keeps Spans direct); * unmatched Spans nest under a page-level `/P` under Document; document * language is copied onto outline / `/P` / Span StructElems when set; document * title is copied onto Document StructElem `/Alt` when set. Not a full PDF/UA * certification claim. */ export declare function ensureWorkPdfStructTreeRoot(pdf: JsPdf, plan: { language?: string | null; outline?: readonly WorkPdfOutlineEntry[]; title?: string | null; }): void; /** * Maps outline levels to PDF structure roles: 1–6 → H1–H6, else P. * Exported for unit coverage of the role boundary. */ export declare function workPdfStructRoleFromOutlineLevel(level: number): string; /** * Seeds catalog + StructTree language before vector paint so Span BDC can * include `/Lang`. Safe to call repeatedly; outline may be filled later by * {@link applyWorkPdfDocumentStructure}. Not a PDF/UA certification claim. */ export declare function seedWorkPdfDocumentLanguage(pdf: JsPdf, language?: string): void; /** * Opens a `/Span` BDC with `/ActualText` and a page-local `/MCID` for a vector * text run. Pairs with {@link endWorkPdfActualTextSpan}. Fail-soft when jsPDF * internals are absent; falls back to ActualText-only when the MCID budget is * exhausted. When document language was seeded, includes `/Lang` on the BDC. */ export declare function beginWorkPdfActualTextSpan(pdf: JsPdf, text: string): boolean; /** Closes a Span marked-content sequence opened by {@link beginWorkPdfActualTextSpan}. */ export declare function endWorkPdfActualTextSpan(pdf: JsPdf): void; /** * Opens an `/Artifact << /Type /Layout >> BDC` region for decorative vector * paint (highlights, underlines, paragraph borders) so assistive tech can skip * layout decoration. No MCID or StructElem. Pairs with {@link endWorkPdfArtifact}. */ export declare function beginWorkPdfArtifact(pdf: JsPdf): boolean; /** Closes an Artifact marked-content sequence opened by {@link beginWorkPdfArtifact}. */ export declare function endWorkPdfArtifact(pdf: JsPdf): void; /** * Encodes an ActualText operand: PDF literal for Latin-1, UTF-16BE hex (BOM) * otherwise. Exported for unit coverage of the escape boundary. */ export declare function encodePdfActualTextOperand(text: string): string; export declare function collectWorkPdfOutlineEntriesFromRoot(root: HTMLElement, pageNumber: number, pageBounds?: { height: number; left: number; top: number; width: number; }): WorkPdfOutlineEntry[]; export declare function normalizePdfLanguage(language: string | undefined): string | null;