wcwidth-o1
Version:
Unicode text width calculation (wcwidth/wcswidth) for Node.js and TypeScript, optimized to O(1), based on Markus Kuhn's reference.
12 lines (11 loc) • 451 B
TypeScript
/**
* Bitset accessor for combining/zero-width characters (Unicode 17.0.0).
*
* - Uses `combiningMap` for sparse bitset lookups.
* - Returns 0 if a block has no zero-width characters, or -1 for carve-outs.
*
* @param idx Codepoint block index (ucs >> 5)
* @returns 32-bit mask of zero-width characters for this block, or -1
*/
export declare const combining: (idx: number) => number;
export declare const combiningMap: Record<number, number>;