ReorderedIndexMap.d.ts (795B)
1 // generated by diplomat-tool 2 import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; 3 4 5 /** 6 * Thin wrapper around a vector that maps visual indices to source indices 7 * 8 * `map[visualIndex] = sourceIndex` 9 * 10 * Produced by `reorder_visual()` on [`Bidi`]. 11 */ 12 13 14 export class ReorderedIndexMap { 15 get ffiValue(): pointer; 16 17 18 /** 19 * Get this as a slice/array of indices 20 */ 21 get asSlice(): Array<number>; 22 23 /** 24 * The length of this map 25 */ 26 get length(): number; 27 28 /** 29 * Whether this map is empty 30 */ 31 get isEmpty(): boolean; 32 33 /** 34 * Get element at `index`. Returns 0 when out of bounds 35 * (note that 0 is also a valid in-bounds value, please use `len()` 36 * to avoid out-of-bounds) 37 */ 38 get(index: number): number; 39 }