import type { PDFObject } from '../core/pdf-object.ts'; import { PDFRef } from '../core/pdf-ref.ts'; import type { PDFResource } from './pdf-resource.ts'; /** * Represents the context of a PDF document, managing the collection * of PDF objects and their references. */ export declare class PDFContext { #private; private _objects; private _registeredResources; /** * Returns an iterator over the PDF objects in the context. */ objects(): IterableIterator<[PDFRef, PDFObject]>; /** Returns the number of objects in the context. */ get size(): number; /** * Returns the PDF object associated with the given PDFRef, or * `undefined` if it does not exist. */ getObject(ref: PDFRef): PDFObject | undefined; /** * Adds a PDF object to the context and returns its assigned PDFRef. */ addObject(obj: PDFObject): PDFRef; /** * Registers a resource, calling `resource.register()` only the * first time a resource with a given key is seen. Returns the * cached reference on subsequent calls with the same key. */ registerResource(resource: PDFResource): PDFRef; }