import type { Payload, Symbol } from './types.js'; /** * Session tracks symbols that have been transmitted to a client, enabling * subsequent responses to reference them by ID without full retransmission. * This makes multi-call workflows progressively cheaper. */ export declare class Session { private symbols; private nextID; /** Returns true if the symbol has been sent in a previous response. */ transmitted(qname: string): boolean; /** Returns the session-global ID for a previously transmitted symbol, or -1 if not found. */ getID(qname: string): number; /** * Record marks symbols as transmitted and assigns session-global IDs. * Call this after a successful encode to register newly-sent symbols. */ record(symbols: Symbol[]): void; /** Returns the number of symbols tracked in this session. */ size(): number; /** Returns the next available session ID without consuming it. */ nextSessionID(): number; /** Clears the session state. */ reset(): void; } /** * Encode a payload using GCF with session deduplication. * Symbols that were already transmitted in prior responses are emitted as * bare references (`@N # previously transmitted`) instead of full declarations. * After encoding, newly-sent symbols are recorded in the session. */ export declare function encodeWithSession(p: Payload, sess: Session | null): string; //# sourceMappingURL=session.d.ts.map