-
-
Notifications
You must be signed in to change notification settings - Fork 261
/
common.d.ts
59 lines (50 loc) · 1.19 KB
/
common.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
52
53
54
55
56
57
58
59
import {ICnChar, ToneType} from '.';
export interface Json<T = any> {
[prop: string]: T
}
export interface ISpellInfoReturn {
spell: string;
initial: string;
final: string;
tone: ToneType;
index: number;
}
export interface ISpellInfo extends Function {
(spell: string): ISpellInfoReturn;
tones: Array<string>,
initials: Array<string>
}
export interface ITransformReturn {
spell: string,
tone: ToneType,
index: number,
isTrans: boolean
}
export interface IPluginBase {
pluginName: string;
dict?: Json;
}
export interface IPlugin extends Json {
pluginName: string;
dict?: Json;
args?: Json;
install?(cnchar: ICnChar): void | Json;
getCnChar?(): ICnChar;
installed?: boolean;
}
export interface IPluginObject extends IPluginBase {
}
export interface ConvertInterface {
simpleToSpark(sentence: string): string;
simpleToTrad(sentence: string): string;
sparkToSimple(sentence: string): string;
sparkToTrad(sentence: string): string;
tradToSimple(sentence: string): string;
tradToSpark(sentence: string): string;
}
declare global {
interface Window {
cnchar: ICnChar,
CnChar: ICnChar,
}
}