/** * Posting list codec — VByte encoding + delta-encoded doc IDs. * * Wire format for a posting list: * vbyte(count) | [vbyte(delta_i) vbyte(tf_i)] * count * * Doc IDs are delta-encoded: d[0] stored directly, d[i] stored as (d[i] - d[i-1]). * Deltas and tf values are encoded with variable-length bytes (7 bits per byte, * MSB is continuation bit). */ /** Encode a single non-negative integer as a VByte Buffer. */ export declare function encodeVByte(n: number): Buffer; /** Decode a single VByte integer from buf starting at offset. * Returns the decoded value and number of bytes consumed. * Uses multiplication for high bits to avoid signed-integer overflow from JS * bitwise ops (which are capped at signed 32-bit). Supports values up to 2^49-1 (7 bytes). */ export declare function decodeVByte(buf: Buffer, offset: number): { value: number; bytesRead: number; }; /** * Encode a posting list as a Buffer. * @param docIds Sorted, non-negative doc IDs (must be strictly increasing). * @param tfs Parallel term-frequency array; tfs[i] corresponds to docIds[i]. */ export declare function encodePostings(docIds: number[], tfs: number[]): Buffer; /** * Fully decode a posting list buffer — materializes all entries. * Used in tests and for low-frequency bulk access. */ export declare function decodePostings(buf: Buffer): { docIds: number[]; tfs: number[]; }; export interface Posting { docId: number; tf: number; } /** * Lazy posting iterator — decodes one entry at a time. * Suitable for the query path where early termination is common. */ export declare function postingIterator(buf: Buffer): Iterator; //# sourceMappingURL=codec.d.ts.map