-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
51 lines (51 loc) · 1.36 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export class UnicodeTrie {
/**
* Creates a trie from a base64-encoded string.
* @param {string} base64 The base64-encoded trie to initialize.
* @returns {UnicodeTrie} The decoded Unicode trie.
*/
static fromBase64(base64: string): UnicodeTrie;
/**
* @typedef {object} TrieValues
* @prop {Int32Array} data
* @prop {number} highStart
* @prop {number} errorValue
* @prop {string[]} [values]
*/
/**
* Creates a trie, either from compressed data or pre-parsed values.
*
* @param {Uint8Array|TrieValues} data
*/
constructor(data: Uint8Array | {
data: Int32Array;
highStart: number;
errorValue: number;
values?: string[] | undefined;
});
highStart: number;
errorValue: number;
/**
* @type{string[]}
*/
values: string[];
/**
* @type {Int32Array}
*/
data: Int32Array;
/**
* Get the value associated with a codepoint, or the default value, or the
* error value if codePoint is out of range.
*
* @param {number} codePoint
* @returns {number}
*/
get(codePoint: number): number;
/**
* Get the value associated with the codePoint, stringified if possible.
*
* @param {number} codePoint
* @returns {number|string}
*/
getString(codePoint: number): number | string;
}