@reset-framework/sdk 1.2.1 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +41 -41
- package/package.json +1 -1
- package/src/client.js +932 -846
- package/src/errors.js +33 -33
- package/src/events.js +123 -123
- package/src/index.d.ts +664 -574
- package/src/index.js +40 -39
- package/src/transport.js +180 -180
package/src/index.d.ts
CHANGED
|
@@ -1,574 +1,664 @@
|
|
|
1
|
-
export type ResetInvokeSuccess<T = unknown> = {
|
|
2
|
-
ok: true;
|
|
3
|
-
result: T;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export type ResetInvokeError = {
|
|
7
|
-
ok: false;
|
|
8
|
-
error: string;
|
|
9
|
-
code?: string;
|
|
10
|
-
details?: unknown;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type ResetInvokeResponse<T = unknown> =
|
|
14
|
-
| ResetInvokeSuccess<T>
|
|
15
|
-
| ResetInvokeError;
|
|
16
|
-
|
|
17
|
-
export type ResetPlatform = "macos" | "windows" | "linux" | "unknown";
|
|
18
|
-
|
|
19
|
-
export type ResetArchitecture = "arm64" | "x64" | "x86" | "unknown";
|
|
20
|
-
|
|
21
|
-
export interface ResetRuntime {
|
|
22
|
-
invoke<T = unknown>(
|
|
23
|
-
command: string,
|
|
24
|
-
payload?: unknown
|
|
25
|
-
): Promise<ResetInvokeResponse<T>>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface ResetRuntimeWindow {
|
|
29
|
-
reset?: ResetRuntime;
|
|
30
|
-
__resetEventState?: {
|
|
31
|
-
listeners: Map<string, Set<(payload: unknown) => void>>;
|
|
32
|
-
dispatch(envelope: { event: string; payload: unknown }): void;
|
|
33
|
-
};
|
|
34
|
-
__resetDispatchEvent?: (envelope: { event: string; payload: unknown }) => void;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface ResetRuntimeSourceOptions {
|
|
38
|
-
target?: ResetRuntimeWindow;
|
|
39
|
-
runtime?: ResetRuntime;
|
|
40
|
-
resolveRuntime?: () => ResetRuntime | undefined;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type ResetRuntimeSource =
|
|
44
|
-
| ResetRuntime
|
|
45
|
-
| ResetRuntimeWindow
|
|
46
|
-
| ResetRuntimeSourceOptions
|
|
47
|
-
| (() => ResetRuntime | undefined)
|
|
48
|
-
| undefined;
|
|
49
|
-
|
|
50
|
-
export interface ResetTransport {
|
|
51
|
-
isAvailable(): boolean;
|
|
52
|
-
getRuntime(): ResetRuntime;
|
|
53
|
-
invokeRaw<T = unknown>(
|
|
54
|
-
command: string,
|
|
55
|
-
payload?: unknown
|
|
56
|
-
): Promise<ResetInvokeResponse<T>>;
|
|
57
|
-
invoke<T = unknown>(command: string, payload?: unknown): Promise<T>;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface ResetCommandApi {
|
|
61
|
-
invoke<T = unknown>(command: string, payload?: unknown): Promise<T>;
|
|
62
|
-
invokeRaw<T = unknown>(
|
|
63
|
-
command: string,
|
|
64
|
-
payload?: unknown
|
|
65
|
-
): Promise<ResetInvokeResponse<T>>;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface ResetAppInfo {
|
|
69
|
-
id: string;
|
|
70
|
-
name: string;
|
|
71
|
-
slug: string;
|
|
72
|
-
version: string;
|
|
73
|
-
windowTitle: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface ResetPoint {
|
|
77
|
-
x: number;
|
|
78
|
-
y: number;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface ResetSize {
|
|
82
|
-
width: number;
|
|
83
|
-
height: number;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface ResetRect extends ResetPoint, ResetSize {}
|
|
87
|
-
|
|
88
|
-
export interface ResetWindowInfo {
|
|
89
|
-
id: string;
|
|
90
|
-
title: string;
|
|
91
|
-
frame: ResetRect;
|
|
92
|
-
position: ResetPoint;
|
|
93
|
-
size: ResetSize;
|
|
94
|
-
visible: boolean;
|
|
95
|
-
focused: boolean;
|
|
96
|
-
minimized: boolean;
|
|
97
|
-
maximized: boolean;
|
|
98
|
-
resizable: boolean;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface ResetDisplayInfo {
|
|
102
|
-
id: string;
|
|
103
|
-
frame: ResetRect;
|
|
104
|
-
visibleFrame: ResetRect;
|
|
105
|
-
scaleFactor: number;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface ResetRuntimeInfo {
|
|
109
|
-
platform: ResetPlatform;
|
|
110
|
-
arch: ResetArchitecture;
|
|
111
|
-
frameworkVersion: string;
|
|
112
|
-
bridgeVersion: string;
|
|
113
|
-
debug: boolean;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface ResetCommandDescriptor {
|
|
117
|
-
command: string;
|
|
118
|
-
permission: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface ResetCapabilitiesInfo {
|
|
122
|
-
commands: ReadonlyArray<ResetCommandDescriptor>;
|
|
123
|
-
permissions: ReadonlyArray<string>;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export interface ResetAppApi {
|
|
127
|
-
getId(): Promise<string>;
|
|
128
|
-
getName(): Promise<string>;
|
|
129
|
-
getSlug(): Promise<string>;
|
|
130
|
-
getVersion(): Promise<string>;
|
|
131
|
-
getInfo(): Promise<ResetAppInfo>;
|
|
132
|
-
show(): Promise<{ visible: boolean }>;
|
|
133
|
-
hide(): Promise<{ hidden: boolean }>;
|
|
134
|
-
quit(): Promise<{ quitting: boolean }>;
|
|
135
|
-
relaunch(): Promise<{ relaunching: boolean }>;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export interface ResetRuntimeApi {
|
|
139
|
-
getPlatform(): Promise<ResetPlatform>;
|
|
140
|
-
getArchitecture(): Promise<ResetArchitecture>;
|
|
141
|
-
getFrameworkVersion(): Promise<string>;
|
|
142
|
-
getBridgeVersion(): Promise<string>;
|
|
143
|
-
getInfo(): Promise<ResetRuntimeInfo>;
|
|
144
|
-
getCapabilities(): Promise<ResetCapabilitiesInfo>;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export interface ResetWindowApi {
|
|
148
|
-
getCurrent(): Promise<ResetWindowInfo>;
|
|
149
|
-
getInfo(): Promise<ResetWindowInfo>;
|
|
150
|
-
list(): Promise<{ windows: ResetWindowInfo[] }>;
|
|
151
|
-
show(): Promise<ResetWindowInfo>;
|
|
152
|
-
hide(): Promise<ResetWindowInfo>;
|
|
153
|
-
focus(): Promise<ResetWindowInfo>;
|
|
154
|
-
close(): Promise<{ closed: boolean }>;
|
|
155
|
-
minimize(): Promise<ResetWindowInfo>;
|
|
156
|
-
maximize(): Promise<ResetWindowInfo>;
|
|
157
|
-
center(): Promise<ResetWindowInfo>;
|
|
158
|
-
setTitle(title: string): Promise<ResetWindowInfo>;
|
|
159
|
-
setSize(width: number, height: number): Promise<ResetWindowInfo>;
|
|
160
|
-
setResizable(resizable: boolean): Promise<ResetWindowInfo>;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export interface ResetDialogOpenFileOptions {
|
|
164
|
-
title?: string;
|
|
165
|
-
multiple?: boolean;
|
|
166
|
-
directory?: boolean;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export interface ResetDialogSaveFileOptions {
|
|
170
|
-
title?: string;
|
|
171
|
-
defaultPath?: string;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export interface ResetDialogApi {
|
|
175
|
-
openFile(options?: ResetDialogOpenFileOptions): Promise<{
|
|
176
|
-
canceled: boolean;
|
|
177
|
-
paths: string[];
|
|
178
|
-
}>;
|
|
179
|
-
saveFile(options?: ResetDialogSaveFileOptions): Promise<{
|
|
180
|
-
canceled: boolean;
|
|
181
|
-
path?: string;
|
|
182
|
-
}>;
|
|
183
|
-
message(title: string, message: string): Promise<{ confirmed: boolean }>;
|
|
184
|
-
confirm(title: string, message: string): Promise<{ confirmed: boolean }>;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export interface ResetDirectoryEntry {
|
|
188
|
-
name: string;
|
|
189
|
-
path: string;
|
|
190
|
-
kind: "file" | "directory" | "symlink" | "other";
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export interface ResetFsApi {
|
|
194
|
-
readTextFile(path: string): Promise<string>;
|
|
195
|
-
writeTextFile(
|
|
196
|
-
path: string,
|
|
197
|
-
text: string,
|
|
198
|
-
options?: { createDirectories?: boolean }
|
|
199
|
-
): Promise<{ written: boolean }>;
|
|
200
|
-
exists(path: string): Promise<boolean>;
|
|
201
|
-
mkdir(
|
|
202
|
-
path: string,
|
|
203
|
-
options?: { recursive?: boolean }
|
|
204
|
-
): Promise<{ created: boolean }>;
|
|
205
|
-
remove(
|
|
206
|
-
path: string,
|
|
207
|
-
options?: { recursive?: boolean }
|
|
208
|
-
): Promise<{ removed: boolean; count: number }>;
|
|
209
|
-
rename(from: string, to: string): Promise<{ renamed: boolean }>;
|
|
210
|
-
readDir(path: string): Promise<ResetDirectoryEntry[]>;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export interface ResetPathInfo {
|
|
214
|
-
homeDir: string;
|
|
215
|
-
tempDir: string;
|
|
216
|
-
appDataDir: string;
|
|
217
|
-
appConfigDir: string;
|
|
218
|
-
cacheDir: string;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export interface ResetPathApi {
|
|
222
|
-
join(...segments: string[]): Promise<string>;
|
|
223
|
-
basename(path: string): Promise<string>;
|
|
224
|
-
dirname(path: string): Promise<string>;
|
|
225
|
-
resolve(path: string, base?: string): Promise<string>;
|
|
226
|
-
getHomeDir(): Promise<string>;
|
|
227
|
-
getTempDir(): Promise<string>;
|
|
228
|
-
getAppDataDir(): Promise<string>;
|
|
229
|
-
getAppConfigDir(): Promise<string>;
|
|
230
|
-
getCacheDir(): Promise<string>;
|
|
231
|
-
getInfo(): Promise<ResetPathInfo>;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export interface ResetShellApi {
|
|
235
|
-
openExternal(url: string): Promise<{ opened: boolean }>;
|
|
236
|
-
openPath(path: string): Promise<{ opened: boolean }>;
|
|
237
|
-
showItemInFolder(path: string): Promise<{ shown: boolean }>;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export interface ResetClipboardApi {
|
|
241
|
-
readText(): Promise<string>;
|
|
242
|
-
writeText(text: string): Promise<{ written: boolean }>;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export interface ResetNotificationApi {
|
|
246
|
-
isSupported(): Promise<boolean>;
|
|
247
|
-
requestPermission(): Promise<{
|
|
248
|
-
supported: boolean;
|
|
249
|
-
authorized: boolean;
|
|
250
|
-
status: string;
|
|
251
|
-
}>;
|
|
252
|
-
show(options: { title: string; body?: string }): Promise<{
|
|
253
|
-
shown: boolean;
|
|
254
|
-
authorized: boolean;
|
|
255
|
-
id?: string;
|
|
256
|
-
}>;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export interface ResetScreenApi {
|
|
260
|
-
getCursorPosition(): Promise<ResetPoint>;
|
|
261
|
-
getPrimaryDisplay(): Promise<ResetDisplayInfo | null>;
|
|
262
|
-
getDisplays(): Promise<ResetDisplayInfo[]>;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export interface ResetStorageApi {
|
|
266
|
-
get<T = unknown>(key: string): Promise<T | null>;
|
|
267
|
-
set(key: string, value: unknown): Promise<{ key: string; stored: boolean }>;
|
|
268
|
-
remove(key: string): Promise<{ key: string; removed: boolean }>;
|
|
269
|
-
clear(): Promise<{ cleared: boolean }>;
|
|
270
|
-
getAll(): Promise<Record<string, unknown>>;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export interface ResetWebViewInfo {
|
|
274
|
-
title: string;
|
|
275
|
-
url: string;
|
|
276
|
-
canGoBack: boolean;
|
|
277
|
-
canGoForward: boolean;
|
|
278
|
-
loading: boolean;
|
|
279
|
-
estimatedProgress: number;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export interface ResetWebViewApi {
|
|
283
|
-
getInfo(): Promise<ResetWebViewInfo>;
|
|
284
|
-
reload(): Promise<ResetWebViewInfo>;
|
|
285
|
-
goBack(): Promise<ResetWebViewInfo>;
|
|
286
|
-
goForward(): Promise<ResetWebViewInfo>;
|
|
287
|
-
navigate(options: { url?: string; path?: string }): Promise<ResetWebViewInfo>;
|
|
288
|
-
setZoomFactor(factor: number): Promise<ResetWebViewInfo>;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
export interface ResetCryptoApi {
|
|
292
|
-
getInfo(): Promise<{
|
|
293
|
-
supported: boolean;
|
|
294
|
-
encodings: string[];
|
|
295
|
-
maxRandomBytes: number;
|
|
296
|
-
}>;
|
|
297
|
-
randomBytes(
|
|
298
|
-
size: number,
|
|
299
|
-
options?: { encoding?: "hex" | "base64url" }
|
|
300
|
-
): Promise<{
|
|
301
|
-
size: number;
|
|
302
|
-
encoding: "hex" | "base64url";
|
|
303
|
-
value: string;
|
|
304
|
-
}>;
|
|
305
|
-
randomUuid(): Promise<string>;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export interface ResetProcessInfo {
|
|
309
|
-
pid: number;
|
|
310
|
-
cwd: string;
|
|
311
|
-
platform: ResetPlatform;
|
|
312
|
-
arch: ResetArchitecture;
|
|
313
|
-
debug: boolean;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export interface ResetProcessApi {
|
|
317
|
-
getPid(): Promise<number>;
|
|
318
|
-
getCwd(): Promise<string>;
|
|
319
|
-
getInfo(): Promise<ResetProcessInfo>;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export interface
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export interface
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
export interface
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
export
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
):
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
export
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
1
|
+
export type ResetInvokeSuccess<T = unknown> = {
|
|
2
|
+
ok: true;
|
|
3
|
+
result: T;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type ResetInvokeError = {
|
|
7
|
+
ok: false;
|
|
8
|
+
error: string;
|
|
9
|
+
code?: string;
|
|
10
|
+
details?: unknown;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type ResetInvokeResponse<T = unknown> =
|
|
14
|
+
| ResetInvokeSuccess<T>
|
|
15
|
+
| ResetInvokeError;
|
|
16
|
+
|
|
17
|
+
export type ResetPlatform = "macos" | "windows" | "linux" | "unknown";
|
|
18
|
+
|
|
19
|
+
export type ResetArchitecture = "arm64" | "x64" | "x86" | "unknown";
|
|
20
|
+
|
|
21
|
+
export interface ResetRuntime {
|
|
22
|
+
invoke<T = unknown>(
|
|
23
|
+
command: string,
|
|
24
|
+
payload?: unknown
|
|
25
|
+
): Promise<ResetInvokeResponse<T>>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ResetRuntimeWindow {
|
|
29
|
+
reset?: ResetRuntime;
|
|
30
|
+
__resetEventState?: {
|
|
31
|
+
listeners: Map<string, Set<(payload: unknown) => void>>;
|
|
32
|
+
dispatch(envelope: { event: string; payload: unknown }): void;
|
|
33
|
+
};
|
|
34
|
+
__resetDispatchEvent?: (envelope: { event: string; payload: unknown }) => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ResetRuntimeSourceOptions {
|
|
38
|
+
target?: ResetRuntimeWindow;
|
|
39
|
+
runtime?: ResetRuntime;
|
|
40
|
+
resolveRuntime?: () => ResetRuntime | undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type ResetRuntimeSource =
|
|
44
|
+
| ResetRuntime
|
|
45
|
+
| ResetRuntimeWindow
|
|
46
|
+
| ResetRuntimeSourceOptions
|
|
47
|
+
| (() => ResetRuntime | undefined)
|
|
48
|
+
| undefined;
|
|
49
|
+
|
|
50
|
+
export interface ResetTransport {
|
|
51
|
+
isAvailable(): boolean;
|
|
52
|
+
getRuntime(): ResetRuntime;
|
|
53
|
+
invokeRaw<T = unknown>(
|
|
54
|
+
command: string,
|
|
55
|
+
payload?: unknown
|
|
56
|
+
): Promise<ResetInvokeResponse<T>>;
|
|
57
|
+
invoke<T = unknown>(command: string, payload?: unknown): Promise<T>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ResetCommandApi {
|
|
61
|
+
invoke<T = unknown>(command: string, payload?: unknown): Promise<T>;
|
|
62
|
+
invokeRaw<T = unknown>(
|
|
63
|
+
command: string,
|
|
64
|
+
payload?: unknown
|
|
65
|
+
): Promise<ResetInvokeResponse<T>>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ResetAppInfo {
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
slug: string;
|
|
72
|
+
version: string;
|
|
73
|
+
windowTitle: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ResetPoint {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface ResetSize {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface ResetRect extends ResetPoint, ResetSize {}
|
|
87
|
+
|
|
88
|
+
export interface ResetWindowInfo {
|
|
89
|
+
id: string;
|
|
90
|
+
title: string;
|
|
91
|
+
frame: ResetRect;
|
|
92
|
+
position: ResetPoint;
|
|
93
|
+
size: ResetSize;
|
|
94
|
+
visible: boolean;
|
|
95
|
+
focused: boolean;
|
|
96
|
+
minimized: boolean;
|
|
97
|
+
maximized: boolean;
|
|
98
|
+
resizable: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface ResetDisplayInfo {
|
|
102
|
+
id: string;
|
|
103
|
+
frame: ResetRect;
|
|
104
|
+
visibleFrame: ResetRect;
|
|
105
|
+
scaleFactor: number;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface ResetRuntimeInfo {
|
|
109
|
+
platform: ResetPlatform;
|
|
110
|
+
arch: ResetArchitecture;
|
|
111
|
+
frameworkVersion: string;
|
|
112
|
+
bridgeVersion: string;
|
|
113
|
+
debug: boolean;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface ResetCommandDescriptor {
|
|
117
|
+
command: string;
|
|
118
|
+
permission: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface ResetCapabilitiesInfo {
|
|
122
|
+
commands: ReadonlyArray<ResetCommandDescriptor>;
|
|
123
|
+
permissions: ReadonlyArray<string>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface ResetAppApi {
|
|
127
|
+
getId(): Promise<string>;
|
|
128
|
+
getName(): Promise<string>;
|
|
129
|
+
getSlug(): Promise<string>;
|
|
130
|
+
getVersion(): Promise<string>;
|
|
131
|
+
getInfo(): Promise<ResetAppInfo>;
|
|
132
|
+
show(): Promise<{ visible: boolean }>;
|
|
133
|
+
hide(): Promise<{ hidden: boolean }>;
|
|
134
|
+
quit(): Promise<{ quitting: boolean }>;
|
|
135
|
+
relaunch(): Promise<{ relaunching: boolean }>;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface ResetRuntimeApi {
|
|
139
|
+
getPlatform(): Promise<ResetPlatform>;
|
|
140
|
+
getArchitecture(): Promise<ResetArchitecture>;
|
|
141
|
+
getFrameworkVersion(): Promise<string>;
|
|
142
|
+
getBridgeVersion(): Promise<string>;
|
|
143
|
+
getInfo(): Promise<ResetRuntimeInfo>;
|
|
144
|
+
getCapabilities(): Promise<ResetCapabilitiesInfo>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface ResetWindowApi {
|
|
148
|
+
getCurrent(): Promise<ResetWindowInfo>;
|
|
149
|
+
getInfo(): Promise<ResetWindowInfo>;
|
|
150
|
+
list(): Promise<{ windows: ResetWindowInfo[] }>;
|
|
151
|
+
show(): Promise<ResetWindowInfo>;
|
|
152
|
+
hide(): Promise<ResetWindowInfo>;
|
|
153
|
+
focus(): Promise<ResetWindowInfo>;
|
|
154
|
+
close(): Promise<{ closed: boolean }>;
|
|
155
|
+
minimize(): Promise<ResetWindowInfo>;
|
|
156
|
+
maximize(): Promise<ResetWindowInfo>;
|
|
157
|
+
center(): Promise<ResetWindowInfo>;
|
|
158
|
+
setTitle(title: string): Promise<ResetWindowInfo>;
|
|
159
|
+
setSize(width: number, height: number): Promise<ResetWindowInfo>;
|
|
160
|
+
setResizable(resizable: boolean): Promise<ResetWindowInfo>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface ResetDialogOpenFileOptions {
|
|
164
|
+
title?: string;
|
|
165
|
+
multiple?: boolean;
|
|
166
|
+
directory?: boolean;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface ResetDialogSaveFileOptions {
|
|
170
|
+
title?: string;
|
|
171
|
+
defaultPath?: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface ResetDialogApi {
|
|
175
|
+
openFile(options?: ResetDialogOpenFileOptions): Promise<{
|
|
176
|
+
canceled: boolean;
|
|
177
|
+
paths: string[];
|
|
178
|
+
}>;
|
|
179
|
+
saveFile(options?: ResetDialogSaveFileOptions): Promise<{
|
|
180
|
+
canceled: boolean;
|
|
181
|
+
path?: string;
|
|
182
|
+
}>;
|
|
183
|
+
message(title: string, message: string): Promise<{ confirmed: boolean }>;
|
|
184
|
+
confirm(title: string, message: string): Promise<{ confirmed: boolean }>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface ResetDirectoryEntry {
|
|
188
|
+
name: string;
|
|
189
|
+
path: string;
|
|
190
|
+
kind: "file" | "directory" | "symlink" | "other";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface ResetFsApi {
|
|
194
|
+
readTextFile(path: string): Promise<string>;
|
|
195
|
+
writeTextFile(
|
|
196
|
+
path: string,
|
|
197
|
+
text: string,
|
|
198
|
+
options?: { createDirectories?: boolean }
|
|
199
|
+
): Promise<{ written: boolean }>;
|
|
200
|
+
exists(path: string): Promise<boolean>;
|
|
201
|
+
mkdir(
|
|
202
|
+
path: string,
|
|
203
|
+
options?: { recursive?: boolean }
|
|
204
|
+
): Promise<{ created: boolean }>;
|
|
205
|
+
remove(
|
|
206
|
+
path: string,
|
|
207
|
+
options?: { recursive?: boolean }
|
|
208
|
+
): Promise<{ removed: boolean; count: number }>;
|
|
209
|
+
rename(from: string, to: string): Promise<{ renamed: boolean }>;
|
|
210
|
+
readDir(path: string): Promise<ResetDirectoryEntry[]>;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface ResetPathInfo {
|
|
214
|
+
homeDir: string;
|
|
215
|
+
tempDir: string;
|
|
216
|
+
appDataDir: string;
|
|
217
|
+
appConfigDir: string;
|
|
218
|
+
cacheDir: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface ResetPathApi {
|
|
222
|
+
join(...segments: string[]): Promise<string>;
|
|
223
|
+
basename(path: string): Promise<string>;
|
|
224
|
+
dirname(path: string): Promise<string>;
|
|
225
|
+
resolve(path: string, base?: string): Promise<string>;
|
|
226
|
+
getHomeDir(): Promise<string>;
|
|
227
|
+
getTempDir(): Promise<string>;
|
|
228
|
+
getAppDataDir(): Promise<string>;
|
|
229
|
+
getAppConfigDir(): Promise<string>;
|
|
230
|
+
getCacheDir(): Promise<string>;
|
|
231
|
+
getInfo(): Promise<ResetPathInfo>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface ResetShellApi {
|
|
235
|
+
openExternal(url: string): Promise<{ opened: boolean }>;
|
|
236
|
+
openPath(path: string): Promise<{ opened: boolean }>;
|
|
237
|
+
showItemInFolder(path: string): Promise<{ shown: boolean }>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface ResetClipboardApi {
|
|
241
|
+
readText(): Promise<string>;
|
|
242
|
+
writeText(text: string): Promise<{ written: boolean }>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export interface ResetNotificationApi {
|
|
246
|
+
isSupported(): Promise<boolean>;
|
|
247
|
+
requestPermission(): Promise<{
|
|
248
|
+
supported: boolean;
|
|
249
|
+
authorized: boolean;
|
|
250
|
+
status: string;
|
|
251
|
+
}>;
|
|
252
|
+
show(options: { title: string; body?: string }): Promise<{
|
|
253
|
+
shown: boolean;
|
|
254
|
+
authorized: boolean;
|
|
255
|
+
id?: string;
|
|
256
|
+
}>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface ResetScreenApi {
|
|
260
|
+
getCursorPosition(): Promise<ResetPoint>;
|
|
261
|
+
getPrimaryDisplay(): Promise<ResetDisplayInfo | null>;
|
|
262
|
+
getDisplays(): Promise<ResetDisplayInfo[]>;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export interface ResetStorageApi {
|
|
266
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
267
|
+
set(key: string, value: unknown): Promise<{ key: string; stored: boolean }>;
|
|
268
|
+
remove(key: string): Promise<{ key: string; removed: boolean }>;
|
|
269
|
+
clear(): Promise<{ cleared: boolean }>;
|
|
270
|
+
getAll(): Promise<Record<string, unknown>>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface ResetWebViewInfo {
|
|
274
|
+
title: string;
|
|
275
|
+
url: string;
|
|
276
|
+
canGoBack: boolean;
|
|
277
|
+
canGoForward: boolean;
|
|
278
|
+
loading: boolean;
|
|
279
|
+
estimatedProgress: number;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface ResetWebViewApi {
|
|
283
|
+
getInfo(): Promise<ResetWebViewInfo>;
|
|
284
|
+
reload(): Promise<ResetWebViewInfo>;
|
|
285
|
+
goBack(): Promise<ResetWebViewInfo>;
|
|
286
|
+
goForward(): Promise<ResetWebViewInfo>;
|
|
287
|
+
navigate(options: { url?: string; path?: string }): Promise<ResetWebViewInfo>;
|
|
288
|
+
setZoomFactor(factor: number): Promise<ResetWebViewInfo>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface ResetCryptoApi {
|
|
292
|
+
getInfo(): Promise<{
|
|
293
|
+
supported: boolean;
|
|
294
|
+
encodings: string[];
|
|
295
|
+
maxRandomBytes: number;
|
|
296
|
+
}>;
|
|
297
|
+
randomBytes(
|
|
298
|
+
size: number,
|
|
299
|
+
options?: { encoding?: "hex" | "base64url" }
|
|
300
|
+
): Promise<{
|
|
301
|
+
size: number;
|
|
302
|
+
encoding: "hex" | "base64url";
|
|
303
|
+
value: string;
|
|
304
|
+
}>;
|
|
305
|
+
randomUuid(): Promise<string>;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface ResetProcessInfo {
|
|
309
|
+
pid: number;
|
|
310
|
+
cwd: string;
|
|
311
|
+
platform: ResetPlatform;
|
|
312
|
+
arch: ResetArchitecture;
|
|
313
|
+
debug: boolean;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface ResetProcessApi {
|
|
317
|
+
getPid(): Promise<number>;
|
|
318
|
+
getCwd(): Promise<string>;
|
|
319
|
+
getInfo(): Promise<ResetProcessInfo>;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export interface ResetBackendRuntimeInfo {
|
|
323
|
+
name: string;
|
|
324
|
+
version: string;
|
|
325
|
+
platform: string;
|
|
326
|
+
arch: string;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export interface ResetBackendInfo {
|
|
330
|
+
supported: boolean;
|
|
331
|
+
configured: boolean;
|
|
332
|
+
running: boolean;
|
|
333
|
+
available: boolean;
|
|
334
|
+
protocol: string;
|
|
335
|
+
pid: number | null;
|
|
336
|
+
entryPath: string;
|
|
337
|
+
runnerPath: string;
|
|
338
|
+
executablePath: string;
|
|
339
|
+
workingDirectory: string;
|
|
340
|
+
methods: ReadonlyArray<string>;
|
|
341
|
+
runtime: ResetBackendRuntimeInfo;
|
|
342
|
+
lastError: string;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export interface ResetBackendProcessInfo {
|
|
346
|
+
id: string;
|
|
347
|
+
pid: number;
|
|
348
|
+
command: string;
|
|
349
|
+
args: string[];
|
|
350
|
+
cwd: string;
|
|
351
|
+
running: boolean;
|
|
352
|
+
startedAt: string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface ResetBackendProcessRunOptions {
|
|
356
|
+
command: string;
|
|
357
|
+
args?: string[];
|
|
358
|
+
cwd?: string;
|
|
359
|
+
env?: Record<string, string>;
|
|
360
|
+
shell?: boolean;
|
|
361
|
+
input?: string;
|
|
362
|
+
timeoutMs?: number;
|
|
363
|
+
maxBufferBytes?: number;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export interface ResetBackendProcessRunResult {
|
|
367
|
+
command: string;
|
|
368
|
+
args: string[];
|
|
369
|
+
cwd: string;
|
|
370
|
+
exitCode: number | null;
|
|
371
|
+
signal: string | null;
|
|
372
|
+
stdout: string;
|
|
373
|
+
stderr: string;
|
|
374
|
+
timedOut: boolean;
|
|
375
|
+
failed: boolean;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export interface ResetBackendProcessApi {
|
|
379
|
+
spawn(options: {
|
|
380
|
+
command: string;
|
|
381
|
+
args?: string[];
|
|
382
|
+
cwd?: string;
|
|
383
|
+
env?: Record<string, string>;
|
|
384
|
+
shell?: boolean;
|
|
385
|
+
}): Promise<ResetBackendProcessInfo>;
|
|
386
|
+
run(options: ResetBackendProcessRunOptions): Promise<ResetBackendProcessRunResult>;
|
|
387
|
+
write(processId: string, data: string): Promise<{ written: boolean }>;
|
|
388
|
+
kill(
|
|
389
|
+
processId: string,
|
|
390
|
+
options?: { signal?: string }
|
|
391
|
+
): Promise<{ killed: boolean }>;
|
|
392
|
+
list(): Promise<{ processes: ResetBackendProcessInfo[] }>;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export interface ResetBackendApi {
|
|
396
|
+
getInfo(): Promise<ResetBackendInfo>;
|
|
397
|
+
isAvailable(): Promise<boolean>;
|
|
398
|
+
invoke<TResult = unknown>(method: string, params?: unknown): Promise<TResult>;
|
|
399
|
+
listen<T = unknown>(
|
|
400
|
+
eventName: string,
|
|
401
|
+
handler: (payload: T) => void
|
|
402
|
+
): () => void;
|
|
403
|
+
once<T = unknown>(
|
|
404
|
+
eventName: string,
|
|
405
|
+
handler: (payload: T) => void
|
|
406
|
+
): () => void;
|
|
407
|
+
process: ResetBackendProcessApi;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export interface ResetPowerInfo {
|
|
411
|
+
supported: boolean;
|
|
412
|
+
lowPowerMode: boolean;
|
|
413
|
+
thermalState: string;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export interface ResetPowerApi {
|
|
417
|
+
getInfo(): Promise<ResetPowerInfo>;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export interface ResetSupportInfo {
|
|
421
|
+
supported: boolean;
|
|
422
|
+
module: string;
|
|
423
|
+
platform: ResetPlatform | string;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export interface ResetMenuInfo extends ResetSupportInfo {
|
|
427
|
+
installed: boolean;
|
|
428
|
+
topLevelCount: number;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export interface ResetTrayInfo extends ResetSupportInfo {
|
|
432
|
+
created: boolean;
|
|
433
|
+
title: string;
|
|
434
|
+
tooltip: string;
|
|
435
|
+
hasMenu: boolean;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export interface ResetMenuItem {
|
|
439
|
+
id?: string;
|
|
440
|
+
label?: string;
|
|
441
|
+
enabled?: boolean;
|
|
442
|
+
checked?: boolean;
|
|
443
|
+
separator?: boolean;
|
|
444
|
+
submenu?: ResetMenuItem[];
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export interface ResetMenuApi {
|
|
448
|
+
getInfo(): Promise<ResetMenuInfo>;
|
|
449
|
+
setApplicationMenu(items: ResetMenuItem[]): Promise<ResetMenuInfo>;
|
|
450
|
+
clearApplicationMenu(): Promise<ResetMenuInfo>;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export interface ResetTrayApi {
|
|
454
|
+
getInfo(): Promise<ResetTrayInfo>;
|
|
455
|
+
create(options?: {
|
|
456
|
+
title?: string;
|
|
457
|
+
tooltip?: string;
|
|
458
|
+
items?: ResetMenuItem[];
|
|
459
|
+
}): Promise<ResetTrayInfo>;
|
|
460
|
+
setTitle(title: string): Promise<ResetTrayInfo>;
|
|
461
|
+
setTooltip(tooltip: string): Promise<ResetTrayInfo>;
|
|
462
|
+
setMenu(items: ResetMenuItem[]): Promise<ResetTrayInfo>;
|
|
463
|
+
destroy(): Promise<{ destroyed: boolean }>;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export interface ResetShortcutApi {
|
|
467
|
+
getInfo(): Promise<ResetSupportInfo>;
|
|
468
|
+
register(accelerator: string): Promise<unknown>;
|
|
469
|
+
unregister(accelerator: string): Promise<unknown>;
|
|
470
|
+
unregisterAll(): Promise<unknown>;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export interface ResetProtocolLaunch {
|
|
474
|
+
id: string;
|
|
475
|
+
url: string;
|
|
476
|
+
scheme: string;
|
|
477
|
+
host: string;
|
|
478
|
+
path: string;
|
|
479
|
+
query: string;
|
|
480
|
+
fragment: string;
|
|
481
|
+
source: string;
|
|
482
|
+
coldStart: boolean;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export interface ResetProtocolInfo extends ResetSupportInfo {
|
|
486
|
+
configuredSchemes: ReadonlyArray<string>;
|
|
487
|
+
bundledSchemes: ReadonlyArray<string>;
|
|
488
|
+
eventName: string;
|
|
489
|
+
pendingCount: number;
|
|
490
|
+
eventStreamActive: boolean;
|
|
491
|
+
runtimeRegistration: boolean;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export interface ResetProtocolApi {
|
|
495
|
+
getInfo(): Promise<ResetProtocolInfo>;
|
|
496
|
+
activate(): Promise<{ active: boolean }>;
|
|
497
|
+
getCurrentLaunch(): Promise<ResetProtocolLaunch | null>;
|
|
498
|
+
getPendingLaunches(): Promise<ReadonlyArray<ResetProtocolLaunch>>;
|
|
499
|
+
consumePendingLaunches(): Promise<ReadonlyArray<ResetProtocolLaunch>>;
|
|
500
|
+
listen(
|
|
501
|
+
handler: (launch: ResetProtocolLaunch) => void,
|
|
502
|
+
options?: { consumePending?: boolean }
|
|
503
|
+
): Promise<() => void>;
|
|
504
|
+
register(options?: {
|
|
505
|
+
scheme?: string;
|
|
506
|
+
}): Promise<unknown>;
|
|
507
|
+
unregister(options?: {
|
|
508
|
+
scheme?: string;
|
|
509
|
+
}): Promise<unknown>;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export interface ResetUpdaterApi {
|
|
513
|
+
getInfo(): Promise<ResetSupportInfo>;
|
|
514
|
+
check(options?: Record<string, unknown>): Promise<unknown>;
|
|
515
|
+
download(options?: Record<string, unknown>): Promise<unknown>;
|
|
516
|
+
install(options?: Record<string, unknown>): Promise<unknown>;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export interface ResetNetResponse {
|
|
520
|
+
url: string;
|
|
521
|
+
status: number;
|
|
522
|
+
ok: boolean;
|
|
523
|
+
headers: Record<string, string>;
|
|
524
|
+
body: string;
|
|
525
|
+
bodyEncoding: "utf8" | "base64" | string;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
export interface ResetNetApi {
|
|
529
|
+
request(options: {
|
|
530
|
+
url: string;
|
|
531
|
+
method?: string;
|
|
532
|
+
headers?: Record<string, string>;
|
|
533
|
+
body?: string;
|
|
534
|
+
timeoutMs?: number;
|
|
535
|
+
}): Promise<ResetNetResponse>;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export interface ResetClient {
|
|
539
|
+
isAvailable(): boolean;
|
|
540
|
+
getRuntime(): ResetRuntime;
|
|
541
|
+
commands: ResetCommandApi;
|
|
542
|
+
app: ResetAppApi;
|
|
543
|
+
runtime: ResetRuntimeApi;
|
|
544
|
+
events: ResetEventApi;
|
|
545
|
+
window: ResetWindowApi;
|
|
546
|
+
dialog: ResetDialogApi;
|
|
547
|
+
fs: ResetFsApi;
|
|
548
|
+
path: ResetPathApi;
|
|
549
|
+
shell: ResetShellApi;
|
|
550
|
+
clipboard: ResetClipboardApi;
|
|
551
|
+
notification: ResetNotificationApi;
|
|
552
|
+
screen: ResetScreenApi;
|
|
553
|
+
storage: ResetStorageApi;
|
|
554
|
+
webview: ResetWebViewApi;
|
|
555
|
+
crypto: ResetCryptoApi;
|
|
556
|
+
process: ResetProcessApi;
|
|
557
|
+
power: ResetPowerApi;
|
|
558
|
+
menu: ResetMenuApi;
|
|
559
|
+
tray: ResetTrayApi;
|
|
560
|
+
shortcut: ResetShortcutApi;
|
|
561
|
+
protocol: ResetProtocolApi;
|
|
562
|
+
updater: ResetUpdaterApi;
|
|
563
|
+
net: ResetNetApi;
|
|
564
|
+
backend: ResetBackendApi;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export interface ResetEventApi {
|
|
568
|
+
listen<T = unknown>(
|
|
569
|
+
eventName: string,
|
|
570
|
+
handler: (payload: T) => void
|
|
571
|
+
): () => void;
|
|
572
|
+
once<T = unknown>(
|
|
573
|
+
eventName: string,
|
|
574
|
+
handler: (payload: T) => void
|
|
575
|
+
): () => void;
|
|
576
|
+
emitLocal<T = unknown>(eventName: string, payload: T): void;
|
|
577
|
+
emit<T = unknown>(eventName: string, payload?: T): Promise<{
|
|
578
|
+
delivered: boolean;
|
|
579
|
+
event: string;
|
|
580
|
+
}>;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
declare global {
|
|
584
|
+
interface Window extends ResetRuntimeWindow {}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export class ResetRuntimeError extends Error {
|
|
588
|
+
cause?: unknown;
|
|
589
|
+
constructor(message?: string, options?: { cause?: unknown });
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
export class ResetRuntimeUnavailableError extends ResetRuntimeError {
|
|
593
|
+
constructor(message?: string);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export class ResetProtocolError extends ResetRuntimeError {
|
|
597
|
+
command?: string;
|
|
598
|
+
constructor(message?: string, options?: { command?: string; cause?: unknown });
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export class ResetInvocationError extends ResetRuntimeError {
|
|
602
|
+
command: string;
|
|
603
|
+
response: ResetInvokeError;
|
|
604
|
+
code?: string;
|
|
605
|
+
details?: unknown;
|
|
606
|
+
constructor(
|
|
607
|
+
command: string,
|
|
608
|
+
message: string,
|
|
609
|
+
response: ResetInvokeError,
|
|
610
|
+
options?: { cause?: unknown }
|
|
611
|
+
);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
export function isResetRuntimeAvailable(
|
|
615
|
+
source?: ResetRuntimeSource
|
|
616
|
+
): boolean;
|
|
617
|
+
|
|
618
|
+
export function getResetRuntime(
|
|
619
|
+
source?: ResetRuntimeSource
|
|
620
|
+
): ResetRuntime;
|
|
621
|
+
|
|
622
|
+
export function createResetTransport(
|
|
623
|
+
source?: ResetRuntimeSource
|
|
624
|
+
): ResetTransport;
|
|
625
|
+
|
|
626
|
+
export function invokeRaw<T = unknown>(
|
|
627
|
+
command: string,
|
|
628
|
+
payload?: unknown,
|
|
629
|
+
source?: ResetRuntimeSource
|
|
630
|
+
): Promise<ResetInvokeResponse<T>>;
|
|
631
|
+
|
|
632
|
+
export function invoke<T = unknown>(
|
|
633
|
+
command: string,
|
|
634
|
+
payload?: unknown,
|
|
635
|
+
source?: ResetRuntimeSource
|
|
636
|
+
): Promise<T>;
|
|
637
|
+
|
|
638
|
+
export function createResetClient(source?: ResetRuntimeSource): ResetClient;
|
|
639
|
+
|
|
640
|
+
export const reset: ResetClient;
|
|
641
|
+
export const commands: ResetCommandApi;
|
|
642
|
+
export const app: ResetAppApi;
|
|
643
|
+
export const runtime: ResetRuntimeApi;
|
|
644
|
+
export const events: ResetEventApi;
|
|
645
|
+
export const window: ResetWindowApi;
|
|
646
|
+
export const dialog: ResetDialogApi;
|
|
647
|
+
export const fs: ResetFsApi;
|
|
648
|
+
export const path: ResetPathApi;
|
|
649
|
+
export const shell: ResetShellApi;
|
|
650
|
+
export const clipboard: ResetClipboardApi;
|
|
651
|
+
export const notification: ResetNotificationApi;
|
|
652
|
+
export const screen: ResetScreenApi;
|
|
653
|
+
export const storage: ResetStorageApi;
|
|
654
|
+
export const webview: ResetWebViewApi;
|
|
655
|
+
export const crypto: ResetCryptoApi;
|
|
656
|
+
export const process: ResetProcessApi;
|
|
657
|
+
export const power: ResetPowerApi;
|
|
658
|
+
export const menu: ResetMenuApi;
|
|
659
|
+
export const tray: ResetTrayApi;
|
|
660
|
+
export const shortcut: ResetShortcutApi;
|
|
661
|
+
export const protocol: ResetProtocolApi;
|
|
662
|
+
export const updater: ResetUpdaterApi;
|
|
663
|
+
export const net: ResetNetApi;
|
|
664
|
+
export const backend: ResetBackendApi;
|