-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
17 lines (16 loc) · 653 Bytes
/
index.d.ts
File metadata and controls
17 lines (16 loc) · 653 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
* Interface for a translation table where the key is a character's Unicode code point (as a number)
* and the value is the translated character's Unicode code point (also as a number).
*/
interface Table {
[code: number]: number;
}
/**
* Translates each character in the string based on a provided translation table.
*
* @param {Table} table - A translation table where the key is a character's Unicode code point (as a number) and the value is the translated character's Unicode code point (as a number).
* @returns {string} - The translated string based on the provided table.
*/
interface String {
translate(table: Table): string;
}