import { type HeaderValue, type ParsedHeaderValue } from './message/header.utils.js'; /** Maximum number of key-value entries in one options block. */ export declare const MAX_OPTIONS = 1024; /** * Maximum total byte length of an encoded options block. * * Mirrors the Rust `MAX_OPTIONS_BYTES`, which in turn mirrors the user-headers * budget: options ride that codec and inherit its limit. */ export declare const MAX_OPTIONS_BYTES: number; /** A resource option entry: UTF-8 string key with a typed value. */ export type OptionEntry = { key: string; value: HeaderValue; }; /** Deserialized options block keyed by option name. */ export type ParsedOptions = Record; /** Result of deserializing a length-prefixed options block. */ export type OptionsDeserialized = { /** Number of bytes consumed, length prefix included */ bytesRead: number; /** Deserialized options */ options: ParsedOptions; }; /** * Keeps the last entry for each key, preserving first-seen order. * * A block carrying a key twice is refused whole by wire validation, so callers * that append their own entries ahead of the typed ones rely on this to let the * typed value win. */ export declare const dedupeOptions: (options: OptionEntry[]) => OptionEntry[]; /** * Serializes resource options into a TLV block. * Reuses the user-headers TLV encoding: each field is * `[kind:u8][len:u32_le][bytes]`, alternating key, value. * Empty options serialize to zero bytes. * * @param options - Option entries to serialize * @returns Serialized options block * @throws Error if an options constraint is violated */ export declare const serializeOptions: (options: OptionEntry[]) => Buffer; /** * Deserializes a bare options TLV block spanning `[pos, end)`. * * @param p - Buffer containing the options block * @param pos - Starting position of the block * @param end - End position of the block (exclusive) * @returns Deserialized options keyed by option name * @throws Error if a key is not a string or the block is malformed */ export declare const deserializeOptions: (p: Buffer, pos?: number, end?: number) => ParsedOptions; /** * Deserializes a `u32_le`-length-prefixed options block at `pos`. * * @param p - Buffer containing `[options_len:u32_le][options TLV]` * @param pos - Starting position of the length prefix * @returns Bytes consumed (prefix included) and deserialized options */ export declare const deserializePrefixedOptions: (p: Buffer, pos?: number) => OptionsDeserialized; //# sourceMappingURL=options.utils.d.ts.map