import type { GlyphId } from "../../types.ts"; import type { Coverage } from "./coverage.ts"; /** * Set Digest - A Bloom filter for fast O(1) glyph membership rejection. * * Uses three 64-bit masks with different bit shifts (0, 4, 9) to minimize * false positives. This is the same technique used by HarfBuzz/rustybuzz. * * The digest allows us to quickly reject glyphs that are definitely NOT * in a lookup's coverage without doing expensive Coverage table lookups. */ export declare class SetDigest { private mask0; private mask1; private mask2; /** * Add a single glyph to the digest * @param glyphId - The glyph ID to add */ add(glyphId: GlyphId): void; /** * Add a range of glyphs to the digest * @param start - Start glyph ID (inclusive) * @param end - End glyph ID (inclusive) */ addRange(start: GlyphId, end: GlyphId): void; /** * Fast check if glyph MAY be in the set * @param glyphId - The glyph ID to check * @returns False if glyph is definitely NOT in the set, true if glyph MAY be in the set (false positives possible) */ mayHave(glyphId: GlyphId): boolean; /** * Add all glyphs from a Coverage table to this digest * @param coverage - The coverage table containing glyphs to add */ addCoverage(coverage: Coverage): void; /** * Check if this digest MAY intersect with another digest * @param other - The other digest to check intersection with * @returns False if there is definitely NO overlap, true if there MAY be overlap (false positives possible) */ mayIntersect(other: SetDigest): boolean; /** * Get raw masks for external comparison * @returns Object containing the three internal mask values */ getMasks(): { mask0: number; mask1: number; mask2: number; }; } /** * Create a SetDigest from multiple Coverage tables (for a lookup with multiple subtables) * @param coverages - Array of coverage tables to combine into a single digest * @returns A new SetDigest containing all glyphs from all coverage tables */ export declare function createLookupDigest(coverages: Coverage[]): SetDigest;