/** Largest value that fits in a 1-byte varint (6 bits). */ export declare const MAX_U6: number; /** Largest value that fits in a 2-byte varint (14 bits). */ export declare const MAX_U14: number; /** Largest value that fits in a 4-byte varint (30 bits). */ export declare const MAX_U30: number; /** Largest value representable without precision loss (`Number.MAX_SAFE_INTEGER`, 53 bits). */ export declare const MAX_U53: number; /** Number of bytes needed to encode a value in the leading-ones varint format. */ export declare function sizeLeadingOnes(v: number | bigint): number; /** Encode a value in leading-ones varint format into the provided buffer, returning the written subarray. */ export declare function encodeLeadingOnesTo(dst: ArrayBuffer, v: number | bigint): Uint8Array; /** Encode a value in leading-ones varint format into a freshly allocated buffer. */ export declare function encodeLeadingOnes(v: number | bigint): Uint8Array; /** Decode a leading-ones varint, returning the value and the remaining buffer. */ export declare function decodeLeadingOnes(buf: Uint8Array): [bigint, Uint8Array]; /** * Returns the number of bytes needed to encode a value as a varint. */ export declare function size(v: number): number; /** * Encodes a number or bigint into a scratch buffer. * Used by stream.ts to avoid allocations. */ export declare function encodeTo(dst: ArrayBuffer, v: number | bigint): Uint8Array; /** * Encodes a number as a QUIC variable-length integer. * Returns a new Uint8Array containing the encoded bytes. */ export declare function encode(v: number): Uint8Array; /** * Decodes a QUIC variable-length integer from a buffer. * Returns a tuple of [value, remaining buffer]. */ export declare function decode(buf: Uint8Array): [number, Uint8Array]; //# sourceMappingURL=varint.d.ts.map