import type { PageRef } from '../identity/PageRef'; /** * What a `/Names /Pages` or `/Names /Templates` registration resolves to. * * - `page`: a page in the page tree โ€” the normal case; addressable through * `doc.page(ref)` and present in `PageListSnapshot.pages`. * - `template`: a `/Type /Template` dictionary outside the page tree * (ISO 32000-2 ยง12.7.7): never listed as a page, never renderable, * `doc.page()` does not accept its object number. Reported so consumers * can diagnose hidden templates instead of silently ignoring them. * - `dangling`: the value is null, missing, or not a page/template * dictionary. Engines remove `/Pages` registrations when their page is * deleted, so this is only observable in files authored elsewhere. */ export type NamedPageTarget = | { kind: 'page'; page: PageRef } | { kind: 'template'; objectNumber: number } | { kind: 'dangling' }; /** * One entry of the catalog's named-page trees, in tree (key-sorted) order. * Page-identity data like `PageLayout.label`, so it rides * `PageListSnapshot` and shares the layout plane's version โ€” a key only * means something against the page set that contains its target. * * `name` is the decoded key text and the identity for `pages.setName` / * `pages.removeName`; the engine re-encodes it. The engine never interprets * the text โ€” Acrobat's stamp-library convention (`identifier=label`) is a * consumer concern. */ export interface NamedPageEntry { name: string; target: NamedPageTarget; }