/** * GBK Encoding Table - 懒加载版本 * * 优化策略: * 1. 默认使用精简版编码表 (gbk-lite.ts,约 3500 常用字) * 2. 遇到非常用字时动态加载完整编码表 * 3. 二分查找代替 Map,大幅减少内存占用 * * GBK: 23940 个字符映射 * Big5: 13911 个字符映射 */ export declare const unicodeToGbk: Map; export declare const gbkToUnicode: Map; export declare const unicodeToBig5: Map; export declare const big5ToUnicode: Map; /** * Get GBK bytes for a Unicode character * 先查精简表,查不到再懒加载完整表 */ export declare function getGbkBytes(unicode: number): [number, number] | null; /** * Get Unicode character from GBK bytes * 懒加载完整表 */ export declare function getUnicodeFromGbk(high: number, low: number): number | null; /** * Get Big5 bytes for a Unicode character * 懒加载完整表 */ export declare function getBig5Bytes(unicode: number): [number, number] | null; /** * Check if a character is in the ASCII range * @param code - Unicode code point * @returns true if ASCII */ export declare function isAscii(code: number): boolean; /** * Check if a character is a CJK character * @param code - Unicode code point * @returns true if CJK */ export declare function isCjk(code: number): boolean; /** * Check if a character is a Chinese punctuation mark * @param code - Unicode code point * @returns true if Chinese punctuation */ export declare function isChinesePunctuation(code: number): boolean;