import type { AppendRecord, ReadRecord } from "./lib/stream/types.js"; /** * Calculate the UTF-8 byte length of a string. * Handles all Unicode characters including surrogate pairs correctly. * * @param str The string to measure * @returns The byte length when encoded as UTF-8 */ export declare function utf8ByteLength(str: string): number; /** * Calculate the metered size in bytes of a record (append or read). * This includes the body and headers, but not metadata like timestamp. * * This function calculates how many bytes the record will occupy * after being received and deserialized as raw bytes on the S2 side. * For strings, it calculates UTF-8 byte length. For Uint8Array, it uses * the array length directly (same value as would be used when encoding * to base64 for transmission). * * @param record The record to measure * @returns The size in bytes */ export declare function meteredBytes(record: AppendRecord | ReadRecord): number; /** * Whether this is a command record. * Command records have exactly one header with an empty name. */ export declare function isCommandRecord(record: { headers?: ReadonlyArray | ReadonlyArray | Array<[string, string]> | Array<[Uint8Array, Uint8Array]> | null; }): boolean; export declare function computeAppendRecordFormat(record: AppendRecord): "string" | "bytes"; //# sourceMappingURL=utils.d.ts.map