import { IncrementalParser } from './parser/incremental-parser.js'; import { PdfObject } from './objects/pdf-object.js'; import { PdfToken } from './tokens/token.js'; import { Parser } from './parser/parser.js'; import { ByteArray } from '../types.js'; /** * Type alias for a parser that converts bytes to PDF tokens. */ export type PdfTokeniser = Parser; /** * Tokenizes a byte stream into PDF tokens. * Handles all PDF syntax including objects, streams, and xref tables. */ export declare class PdfByteStreamTokeniser extends IncrementalParser { private inStream; private inXrefTable; private xrefEntryCount; private lastSectionStartObjectNumber; private streamChunkSizeBytes; /** * Creates a new byte stream tokenizer. * * @param options - Configuration options * @param options.streamChunkSizeBytes - Size of stream chunks (default: 1024) */ constructor(options?: { streamChunkSizeBytes?: number; }); /** * Feeds a byte array into the tokenizer. * * @param bytes - The bytes to process */ feedBytes(bytes: ByteArray): void; private readValue; private nextCommentToken; private nextWhitespaceToken; private nextStartDictionaryToken; private nextNameToken; private nextDictionaryEndToken; private nextHexadecimalToken; private nextNumberToken; private nextObjectReferenceToken; private nextStartObjectToken; private nextStartArrayToken; private nextEndArrayToken; private nextStringToken; private nextEndObjectToken; private nextTrueToken; private nextFalseToken; private nextNullToken; private nextStartStreamToken; private nextStreamChunkToken; private nextEndStreamToken; private nextStartXRefToken; private nextTrailerToken; private nextXRefTableStartToken; private nextXRefTableSectionStartToken; private nextXRefTableEntryToken; private nextToken; protected parse(): PdfToken; private static isWhitespace; private static isNewLine; private static isDigit; private static isNameEnd; private static isOctet; } /** * Converts a PDF object to its token representation. * * @param object - The PDF object to tokenize * @returns A generator yielding the object's tokens */ export declare function objectToTokens(object: PdfObject): Generator; /** * Creates a function that converts a stream of PDF objects to tokens. * * @returns A generator function that yields tokens from PDF objects */ export declare function pdfObjectStreamTokeniser(): (objects: Iterable) => Generator; /** * Tokenizes PDF objects into a stream of PDF tokens. */ export declare class PdfObjectTokeniser extends Parser { private buffer; /** * Feeds PDF objects into the tokenizer buffer. * * @param input - PDF objects to tokenize */ feed(...input: PdfObject[]): void; /** * Generates tokens from the buffered PDF objects. * * @returns A generator yielding PDF tokens */ nextItems(): Generator; }