-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFcitx5.d.ts
71 lines (64 loc) · 1.66 KB
/
Fcitx5.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
60
61
62
63
64
65
66
67
68
69
70
71
type Child = ({
Description: string
Option: string
Type: string
Value: string
} & ({
Children: null
DefaultValue: any
} | {
Children: Child[]
}) & { [key: string]: any })
export type Config = {
Children: Child[]
} | {
ERROR: string
}
export interface MenuAction {
id: number
desc: string
checked?: boolean
separator?: boolean
children?: MenuAction[]
}
interface AddonCategory {
addons: {
comment: string
id: string
name: string
}[]
id: number
name: string
}
interface FS {
mkdir: (path: string) => void
readdir: (path: string) => string[]
writeFile: (path: string, data: Uint8Array) => void
}
interface EM_MODULE {
ccall: (name: string, retType: WASM_TYPE, argsType: WASM_TYPE[], args: any[]) => any
onRuntimeInitialized: () => void
FS: FS
}
export interface FCITX {
enable: () => void
disable: () => void
currentInputMethod: () => string
setCurrentInputMethod: (im: string) => void
getInputMethods: () => { name: string, displayName: string }[]
setInputMethods: (ims: string[]) => void
getAllInputMethods: () => { name: string, displayName: string, languageCode: string }[]
setStatusAreaCallback: (callback: () => void) => void
updateStatusArea: () => void
getConfig: (uri: string) => Config
setConfig: (uri: string, json: object) => void
getAddons: () => AddonCategory[]
jsKeyToFcitxString: (event: KeyboardEvent) => string
getMenuActions: () => MenuAction[]
activateMenuAction: (id: number) => void
installPlugin: (buffer: ArrayBuffer) => string
getInstalledPlugins: () => string[]
unzip: (buffer: ArrayBuffer, dir: string) => void
Module: EM_MODULE
}
export const fcitxReady: Promise<null>