/** * Zigzag encoding/decoding for protobuf-style varints. * * Zigzag encoding converts signed integers to unsigned by interleaving * negative and positive values: 0, -1, 1, -2, 2, ... This allows efficient * varint encoding of small negative numbers. * * @module */ /** * Zigzag encode a number using arithmetic operations. * This supports the full safe integer range (up to Number.MAX_SAFE_INTEGER). * Formula: n < 0 ? -2*n - 1 : 2*n * * Used for encoding IDs in vector tiles to convert negative IDs to positive numbers * for unsigned varint encoding. */ export declare function zigzag(num: number): number; /** * Zigzag encode using bitwise operations (for geometry deltas only). * This is faster but limited to 32-bit signed integers. * Used for small coordinate deltas in geometry encoding. */ export declare function zigzag32(num: number): number; /** * Decode zigzag-encoded number back to original value. * Zigzag encoding is used to convert negative IDs to positive numbers for unsigned varint * encoding in vector tiles. Uses arithmetic-based decoding to support the full safe integer range. * * Formula: (encoded & 1) === 1 ? -(encoded + 1) / 2 : encoded / 2 */ export declare function decodeZigzag(encoded: number): number; //# sourceMappingURL=zigzag.d.ts.map