forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.d.ts
123 lines (114 loc) · 2.74 KB
/
globals.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
declare var __HOT__: boolean
declare var __REMOTEDEV__: boolean
declare var __VERSION__: string
declare var __STORYBOOK__: boolean
declare var __STORYSHOT__: boolean
type Values<T extends object> = T[keyof T]
type Unpacked<T> = T extends (infer U)[]
? U
: T extends (...args: any[]) => infer U
? U
: T extends Promise<infer U>
? U
: T
type RequestIdleCallbackHandle = any
type RequestIdleCallbackOptions = {
timeout: number
}
type RequestIdleCallbackDeadline = {
readonly didTimeout: boolean
timeRemaining: () => number
}
declare type KBElectronOpenDialogOptions = {
allowFiles?: boolean
allowDirectories?: boolean
allowMultiselect?: boolean
buttonLabel?: string
defaultPath?: string
filters?: Array<{extensions: Array<string>; name: string}>
message?: string
title?: string
}
declare type KBElectronSaveDialogOptions = {
title?: string
defaultPath?: string
buttonLabel?: string
message?: string
}
interface Window {
requestIdleCallback: (
callback: (deadline: RequestIdleCallbackDeadline) => void,
opts?: RequestIdleCallbackOptions
) => RequestIdleCallbackHandle
cancelIdleCallback: (handle: RequestIdleCallbackHandle) => void
DEBUGEffectById: any
DEBUGLogSagas: any
DEBUGLogSagasWithNames: any
DEBUGRootEffects: any
KB: typeof KB
}
interface Console {
_log: any
_warn: any
_error: any
_info: any
}
declare var KB: {
__dirname: string
DEV?: any
/** Use this for debug logs you don't want commited **/
debugConsoleLog: (nope: never) => void
electron: {
app: {
appPath: string
}
dialog: {
showOpenDialog: (options: KBElectronOpenDialogOptions) => Promise<Array<string> | undefined>
showSaveDialog: (options: KBElectronSaveDialogOptions) => Promise<string | undefined>
}
}
kb: {
darwinCopyToKBFSTempUploadFile: (p: string) => Promise<string>
darwinCopyToChatTempUploadFile: (
p: string
) => Promise<{
outboxID: Buffer
path: string
}>
setEngine: (e: any) => void
}
os: {
homedir: string
}
path: {
basename: (p: string, ext?: string) => string
dirname: (p: string) => string
extname: (p: string) => string
join: (...paths: Array<string>) => string
resolve: (...pathSegments: Array<string>) => string
sep: '\\' | '/'
}
process: {
argv: Array<string>
env: NodeJS.ProcessEnv
pid: number
platform: NodeJS.Platform
type: string
}
}
declare namespace NodeJS {
interface Global {
DEBUGActionLoop: () => void
DEBUGEffectById: any
DEBUGEngine: any
DEBUGLoaded: boolean
DEBUGLogSagas: any
DEBUGLogSagasWithNames: any
DEBUGNavigator: any
DEBUGRootEffects: any
DEBUGSagaMiddleware: any
DEBUGStore: any
globalLogger: any
KB: typeof KB
}
}