-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypings.d.ts
46 lines (43 loc) · 1.72 KB
/
typings.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
declare module 'ext.gadget.HanAssist' {
export type CandidateKey = 'other' | 'zh' | 'hans' | 'hant' | 'cn' | 'tw' | 'hk' | 'sg' | 'mo' | 'my';
export type Candidates = Partial<Record<CandidateKey, string>>;
/**
* Select between candidates based on user language.
* @param candidates an object of candidates
* @param locale locale, defaults to `wgUserLanguage`
* @returns selected value
*/
export function conv(candidates: Candidates, locale?: string): string;
/**
* Select between candidates based on user variant.
* @param candidates an object of candidates
* @returns selected value
*/
export function convByVar(candidates: Candidates): string;
/**
* Perform selection for each item in a candidates dictionary.
* @param candidatesDict the dictionary of candidates
* @param locale locale, defaults to `wgUserLanguage`
* @returns converted candidates dictionary
*/
export function batchConv<T extends string>(
candidatesDict: Record<T, string | Candidates>, locale?: string,
): Record<T, string>;
global {
/** @deprecated Use `HanAssist.conv` instead */
function wgULS(
hans?: string, hant?: string, cn?: string, tw?: string,
hk?: string, sg?: string, zh?: string, mo?: string, my?: string,
): string;
/** @deprecated Use `HanAssist.convByVar` instead */
function wgUVS(
hans?: string, hant?: string, cn?: string, tw?: string,
hk?: string, sg?: string, zh?: string, mo?: string, my?: string,
): string;
/** @deprecated Use `HanAssist` instead */
function wgUXS(
locale: string, hans?: string, hant?: string, cn?: string, tw?: string,
hk?: string, sg?: string, zh?: string, mo?: string, my?: string,
): string;
}
}