@lynx-js/lynxtron 0.0.1 → 0.0.3
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/README.md +80 -0
- package/apis/api/app.d.ts +1848 -0
- package/apis/api/asar.d.ts +124 -0
- package/apis/api/base-window.d.ts +1712 -0
- package/apis/api/clipboard.d.ts +54 -0
- package/apis/api/command-line.d.ts +46 -0
- package/apis/api/context-bridge.d.ts +8 -0
- package/apis/api/devtool.d.ts +34 -0
- package/apis/api/dialog.d.ts +633 -0
- package/apis/api/dock.d.ts +88 -0
- package/apis/api/environment.d.ts +9 -0
- package/apis/api/event.d.ts +8 -0
- package/apis/api/jump-list-item.d.ts +83 -0
- package/apis/api/lynx-library.d.ts +7 -0
- package/apis/api/lynx-template-bundle.d.ts +32 -0
- package/apis/api/lynx-template-data.d.ts +10 -0
- package/apis/api/lynx-update-meta.d.ts +16 -0
- package/apis/api/lynx-window.d.ts +405 -0
- package/apis/api/menu.d.ts +96 -0
- package/apis/api/native-image.d.ts +268 -0
- package/apis/api/notification-response.d.ts +26 -0
- package/apis/api/notification.d.ts +242 -0
- package/apis/api/power-monitor.d.ts +121 -0
- package/apis/api/process-metric.d.ts +93 -0
- package/apis/api/protocol.d.ts +54 -0
- package/apis/api/screen.d.ts +222 -0
- package/apis/api/shell.d.ts +124 -0
- package/apis/api/task.d.ts +39 -0
- package/apis/api/touch-bar.d.ts +206 -0
- package/apis/api/tray.d.ts +44 -0
- package/apis/api/utility-process.d.ts +73 -0
- package/apis/lynx.d.ts +15 -0
- package/apis/lynxtron.d.ts +39 -0
- package/apis/structures/point.d.ts +10 -0
- package/apis/structures/rectangle.d.ts +22 -0
- package/apis/structures/size.d.ts +8 -0
- package/apis/web-host.d.ts +24 -0
- package/cli.js +28 -0
- package/context-bridge.js +6 -0
- package/fuses-cli.js +143 -0
- package/fuses.js +299 -0
- package/install.js +127 -0
- package/lynx.js +1 -0
- package/lynxtron.js +43 -0
- package/lynxtron_bin.js +10 -0
- package/native-paths.cjs +38 -0
- package/package.json +71 -4
- package/utils/download.js +72 -0
- package/utils/env-config.js +35 -0
- package/web-host/index.js +110 -0
- package/web-worker.js +12 -0
|
@@ -0,0 +1,633 @@
|
|
|
1
|
+
// Copyright 2026 The Lynxtron Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { NativeImage } from './native-image';
|
|
6
|
+
import { BaseWindow } from './base-window';
|
|
7
|
+
|
|
8
|
+
export interface FileFilter {
|
|
9
|
+
extensions: string[];
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface MessageBoxOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Content of the message box.
|
|
16
|
+
*/
|
|
17
|
+
message: string;
|
|
18
|
+
/**
|
|
19
|
+
* Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
|
|
20
|
+
* displays the same icon as `info`, unless you set an icon using the `icon`
|
|
21
|
+
* option. On macOS, both `warning` and `error` display the same warning icon.
|
|
22
|
+
*/
|
|
23
|
+
type?: 'none' | 'info' | 'error' | 'question' | 'warning';
|
|
24
|
+
/**
|
|
25
|
+
* Array of texts for buttons. On Windows, an empty array will result in one button
|
|
26
|
+
* labeled "OK".
|
|
27
|
+
*/
|
|
28
|
+
buttons?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Index of the button in the buttons array which will be selected by default when
|
|
31
|
+
* the message box opens.
|
|
32
|
+
*/
|
|
33
|
+
defaultId?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Pass an instance of AbortSignal to optionally close the message box, the message
|
|
36
|
+
* box will behave as if it was cancelled by the user. On macOS, `signal` does not
|
|
37
|
+
* work with message boxes that do not have a parent window, since those message
|
|
38
|
+
* boxes run synchronously due to platform limitations.
|
|
39
|
+
*/
|
|
40
|
+
signal?: AbortSignal;
|
|
41
|
+
/**
|
|
42
|
+
* Title of the message box, some platforms will not show it.
|
|
43
|
+
*/
|
|
44
|
+
title?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Extra information of the message.
|
|
47
|
+
*/
|
|
48
|
+
detail?: string;
|
|
49
|
+
/**
|
|
50
|
+
* If provided, the message box will include a checkbox with the given label.
|
|
51
|
+
*/
|
|
52
|
+
checkboxLabel?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Initial checked state of the checkbox. `false` by default.
|
|
55
|
+
*/
|
|
56
|
+
checkboxChecked?: boolean;
|
|
57
|
+
icon?: NativeImage | string;
|
|
58
|
+
/**
|
|
59
|
+
* Custom width of the text in the message box.
|
|
60
|
+
*
|
|
61
|
+
* @platform darwin
|
|
62
|
+
*/
|
|
63
|
+
textWidth?: number;
|
|
64
|
+
/**
|
|
65
|
+
* The index of the button to be used to cancel the dialog, via the `Esc` key. By
|
|
66
|
+
* default this is assigned to the first button with "cancel" or "no" as the label.
|
|
67
|
+
* If no such labeled buttons exist and this option is not set, `0` will be used as
|
|
68
|
+
* the return value.
|
|
69
|
+
*/
|
|
70
|
+
cancelId?: number;
|
|
71
|
+
/**
|
|
72
|
+
* On Windows, Lynxtron will try to figure out which of the `buttons` are common
|
|
73
|
+
* buttons (like "Cancel" or "Yes"), and show the others as command links in the
|
|
74
|
+
* dialog. This can make the dialog appear in the style of modern Windows apps. If
|
|
75
|
+
* you don't like this behavior, you can set `noLink` to `true`.
|
|
76
|
+
*/
|
|
77
|
+
noLink?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Normalize the keyboard access keys across platforms. Default is `false`.
|
|
80
|
+
* Enabling this assumes `&` is used in the button labels for the placement of the
|
|
81
|
+
* keyboard shortcut access key and labels will be converted so they work correctly
|
|
82
|
+
* on each platform, `&` characters are removed on macOS, converted to `_` on
|
|
83
|
+
* Linux, and left untouched on Windows. For example, a button label of `Vie&w`
|
|
84
|
+
* will be converted to `Vie_w` on Linux and `View` on macOS and can be selected
|
|
85
|
+
* via `Alt-W` on Windows and Linux.
|
|
86
|
+
*/
|
|
87
|
+
normalizeAccessKeys?: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface MessageBoxReturnValue {
|
|
91
|
+
/**
|
|
92
|
+
* The index of the clicked button.
|
|
93
|
+
*/
|
|
94
|
+
response: number;
|
|
95
|
+
/**
|
|
96
|
+
* The checked state of the checkbox if `checkboxLabel` was set. Otherwise `false`.
|
|
97
|
+
*/
|
|
98
|
+
checkboxChecked: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface MessageBoxSyncOptions {
|
|
102
|
+
/**
|
|
103
|
+
* Content of the message box.
|
|
104
|
+
*/
|
|
105
|
+
message: string;
|
|
106
|
+
/**
|
|
107
|
+
* Can be `none`, `info`, `error`, `question` or `warning`. On Windows, `question`
|
|
108
|
+
* displays the same icon as `info`, unless you set an icon using the `icon`
|
|
109
|
+
* option. On macOS, both `warning` and `error` display the same warning icon.
|
|
110
|
+
*/
|
|
111
|
+
type?: 'none' | 'info' | 'error' | 'question' | 'warning';
|
|
112
|
+
/**
|
|
113
|
+
* Array of texts for buttons. On Windows, an empty array will result in one button
|
|
114
|
+
* labeled "OK".
|
|
115
|
+
*/
|
|
116
|
+
buttons?: string[];
|
|
117
|
+
/**
|
|
118
|
+
* Index of the button in the buttons array which will be selected by default when
|
|
119
|
+
* the message box opens.
|
|
120
|
+
*/
|
|
121
|
+
defaultId?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Title of the message box, some platforms will not show it.
|
|
124
|
+
*/
|
|
125
|
+
title?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Extra information of the message.
|
|
128
|
+
*/
|
|
129
|
+
detail?: string;
|
|
130
|
+
icon?: NativeImage | string;
|
|
131
|
+
/**
|
|
132
|
+
* Custom width of the text in the message box.
|
|
133
|
+
*
|
|
134
|
+
* @platform darwin
|
|
135
|
+
*/
|
|
136
|
+
textWidth?: number;
|
|
137
|
+
/**
|
|
138
|
+
* The index of the button to be used to cancel the dialog, via the `Esc` key. By
|
|
139
|
+
* default this is assigned to the first button with "cancel" or "no" as the label.
|
|
140
|
+
* If no such labeled buttons exist and this option is not set, `0` will be used as
|
|
141
|
+
* the return value.
|
|
142
|
+
*/
|
|
143
|
+
cancelId?: number;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface Certificate {
|
|
147
|
+
data: string;
|
|
148
|
+
fingerprint: string;
|
|
149
|
+
issuer: CertificatePrincipal;
|
|
150
|
+
issuerCert: Certificate;
|
|
151
|
+
issuerName: string;
|
|
152
|
+
serialNumber: string;
|
|
153
|
+
subject: CertificatePrincipal;
|
|
154
|
+
subjectName: string;
|
|
155
|
+
validExpiry: number;
|
|
156
|
+
validStart: number;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface CertificatePrincipal {
|
|
160
|
+
commonName: string;
|
|
161
|
+
country: string;
|
|
162
|
+
locality: string;
|
|
163
|
+
organizations: string[];
|
|
164
|
+
organizationUnits: string[];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface CertificateTrustDialogOptions {
|
|
168
|
+
certificate: Certificate;
|
|
169
|
+
message: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface OpenDialogOptions {
|
|
173
|
+
title?: string;
|
|
174
|
+
defaultPath?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Custom label for the confirmation button, when left empty the default label will
|
|
177
|
+
* be used.
|
|
178
|
+
*/
|
|
179
|
+
buttonLabel?: string;
|
|
180
|
+
filters?: FileFilter[];
|
|
181
|
+
/**
|
|
182
|
+
* Contains which features the dialog should use. The following values are
|
|
183
|
+
* supported:
|
|
184
|
+
*/
|
|
185
|
+
properties?: Array<
|
|
186
|
+
| 'openFile'
|
|
187
|
+
| 'openDirectory'
|
|
188
|
+
| 'multiSelections'
|
|
189
|
+
| 'showHiddenFiles'
|
|
190
|
+
| 'createDirectory'
|
|
191
|
+
| 'promptToCreate'
|
|
192
|
+
| 'noResolveAliases'
|
|
193
|
+
| 'treatPackageAsDirectory'
|
|
194
|
+
| 'dontAddToRecent'
|
|
195
|
+
>;
|
|
196
|
+
/**
|
|
197
|
+
* Message to display above input boxes.
|
|
198
|
+
*
|
|
199
|
+
* @platform darwin
|
|
200
|
+
*/
|
|
201
|
+
message?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Create security scoped bookmarks when packaged for the Mac App Store.
|
|
204
|
+
*
|
|
205
|
+
* @platform darwin,mas
|
|
206
|
+
*/
|
|
207
|
+
securityScopedBookmarks?: boolean;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface OpenDialogReturnValue {
|
|
211
|
+
/**
|
|
212
|
+
* whether or not the dialog was canceled.
|
|
213
|
+
*/
|
|
214
|
+
canceled: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* An array of file paths chosen by the user. If the dialog is cancelled this will
|
|
217
|
+
* be an empty array.
|
|
218
|
+
*/
|
|
219
|
+
filePaths: string[];
|
|
220
|
+
/**
|
|
221
|
+
* An array matching the `filePaths` array of base64 encoded strings which contains
|
|
222
|
+
* security scoped bookmark data. `securityScopedBookmarks` must be enabled for
|
|
223
|
+
* this to be populated. (For return values, see table here.)
|
|
224
|
+
*
|
|
225
|
+
* @platform darwin,mas
|
|
226
|
+
*/
|
|
227
|
+
bookmarks?: string[];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface OpenDialogSyncOptions {
|
|
231
|
+
title?: string;
|
|
232
|
+
defaultPath?: string;
|
|
233
|
+
/**
|
|
234
|
+
* Custom label for the confirmation button, when left empty the default label will
|
|
235
|
+
* be used.
|
|
236
|
+
*/
|
|
237
|
+
buttonLabel?: string;
|
|
238
|
+
filters?: FileFilter[];
|
|
239
|
+
/**
|
|
240
|
+
* Contains which features the dialog should use. The following values are
|
|
241
|
+
* supported:
|
|
242
|
+
*/
|
|
243
|
+
properties?: Array<
|
|
244
|
+
| 'openFile'
|
|
245
|
+
| 'openDirectory'
|
|
246
|
+
| 'multiSelections'
|
|
247
|
+
| 'showHiddenFiles'
|
|
248
|
+
| 'createDirectory'
|
|
249
|
+
| 'promptToCreate'
|
|
250
|
+
| 'noResolveAliases'
|
|
251
|
+
| 'treatPackageAsDirectory'
|
|
252
|
+
| 'dontAddToRecent'
|
|
253
|
+
>;
|
|
254
|
+
/**
|
|
255
|
+
* Message to display above input boxes.
|
|
256
|
+
*
|
|
257
|
+
* @platform darwin
|
|
258
|
+
*/
|
|
259
|
+
message?: string;
|
|
260
|
+
/**
|
|
261
|
+
* Create security scoped bookmarks when packaged for the Mac App Store.
|
|
262
|
+
*
|
|
263
|
+
* @platform darwin,mas
|
|
264
|
+
*/
|
|
265
|
+
securityScopedBookmarks?: boolean;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface SaveDialogOptions {
|
|
269
|
+
/**
|
|
270
|
+
* The dialog title. Cannot be displayed on some _Linux_ desktop environments.
|
|
271
|
+
*/
|
|
272
|
+
title?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Absolute directory path, absolute file path, or file name to use by default.
|
|
275
|
+
*/
|
|
276
|
+
defaultPath?: string;
|
|
277
|
+
/**
|
|
278
|
+
* Custom label for the confirmation button, when left empty the default label will
|
|
279
|
+
* be used.
|
|
280
|
+
*/
|
|
281
|
+
buttonLabel?: string;
|
|
282
|
+
filters?: FileFilter[];
|
|
283
|
+
/**
|
|
284
|
+
* Message to display above text fields.
|
|
285
|
+
*
|
|
286
|
+
* @platform darwin
|
|
287
|
+
*/
|
|
288
|
+
message?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Custom label for the text displayed in front of the filename text field.
|
|
291
|
+
*
|
|
292
|
+
* @platform darwin
|
|
293
|
+
*/
|
|
294
|
+
nameFieldLabel?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Show the tags input box, defaults to `true`.
|
|
297
|
+
*
|
|
298
|
+
* @platform darwin
|
|
299
|
+
*/
|
|
300
|
+
showsTagField?: boolean;
|
|
301
|
+
properties?: Array<
|
|
302
|
+
| 'showHiddenFiles'
|
|
303
|
+
| 'createDirectory'
|
|
304
|
+
| 'treatPackageAsDirectory'
|
|
305
|
+
| 'showOverwriteConfirmation'
|
|
306
|
+
| 'dontAddToRecent'
|
|
307
|
+
>;
|
|
308
|
+
/**
|
|
309
|
+
* Create a security scoped bookmark when packaged for the Mac App Store. If this
|
|
310
|
+
* option is enabled and the file doesn't already exist a blank file will be
|
|
311
|
+
* created at the chosen path.
|
|
312
|
+
*
|
|
313
|
+
* @platform darwin,mas
|
|
314
|
+
*/
|
|
315
|
+
securityScopedBookmarks?: boolean;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface SaveDialogReturnValue {
|
|
319
|
+
/**
|
|
320
|
+
* whether or not the dialog was canceled.
|
|
321
|
+
*/
|
|
322
|
+
canceled: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* If the dialog is canceled, this will be an empty string.
|
|
325
|
+
*/
|
|
326
|
+
filePath: string;
|
|
327
|
+
/**
|
|
328
|
+
* Base64 encoded string which contains the security scoped bookmark data for the
|
|
329
|
+
* saved file. `securityScopedBookmarks` must be enabled for this to be present.
|
|
330
|
+
* (For return values, see table here.)
|
|
331
|
+
*
|
|
332
|
+
* @platform darwin,mas
|
|
333
|
+
*/
|
|
334
|
+
bookmark?: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export interface SaveDialogSyncOptions {
|
|
338
|
+
/**
|
|
339
|
+
* The dialog title. Cannot be displayed on some _Linux_ desktop environments.
|
|
340
|
+
*/
|
|
341
|
+
title?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Absolute directory path, absolute file path, or file name to use by default.
|
|
344
|
+
*/
|
|
345
|
+
defaultPath?: string;
|
|
346
|
+
/**
|
|
347
|
+
* Custom label for the confirmation button, when left empty the default label will
|
|
348
|
+
* be used.
|
|
349
|
+
*/
|
|
350
|
+
buttonLabel?: string;
|
|
351
|
+
filters?: FileFilter[];
|
|
352
|
+
/**
|
|
353
|
+
* Message to display above text fields.
|
|
354
|
+
*
|
|
355
|
+
* @platform darwin
|
|
356
|
+
*/
|
|
357
|
+
message?: string;
|
|
358
|
+
/**
|
|
359
|
+
* Custom label for the text displayed in front of the filename text field.
|
|
360
|
+
*
|
|
361
|
+
* @platform darwin
|
|
362
|
+
*/
|
|
363
|
+
nameFieldLabel?: string;
|
|
364
|
+
/**
|
|
365
|
+
* Show the tags input box, defaults to `true`.
|
|
366
|
+
*
|
|
367
|
+
* @platform darwin
|
|
368
|
+
*/
|
|
369
|
+
showsTagField?: boolean;
|
|
370
|
+
properties?: Array<
|
|
371
|
+
| 'showHiddenFiles'
|
|
372
|
+
| 'createDirectory'
|
|
373
|
+
| 'treatPackageAsDirectory'
|
|
374
|
+
| 'showOverwriteConfirmation'
|
|
375
|
+
| 'dontAddToRecent'
|
|
376
|
+
>;
|
|
377
|
+
/**
|
|
378
|
+
* Create a security scoped bookmark when packaged for the Mac App Store. If this
|
|
379
|
+
* option is enabled and the file doesn't already exist a blank file will be
|
|
380
|
+
* created at the chosen path.
|
|
381
|
+
*
|
|
382
|
+
* @platform darwin,mas
|
|
383
|
+
*/
|
|
384
|
+
securityScopedBookmarks?: boolean;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export interface Dialog {
|
|
388
|
+
/**
|
|
389
|
+
* Displays a modal dialog that shows an error message.
|
|
390
|
+
*
|
|
391
|
+
* This API can be called safely before the `ready` event the `app` module emits,
|
|
392
|
+
* it is usually used to report errors in early stage of startup. If called before
|
|
393
|
+
* the app `ready`event on Linux, the message will be emitted to stderr, and no GUI
|
|
394
|
+
* dialog will appear.
|
|
395
|
+
*/
|
|
396
|
+
showErrorBox(title: string, content: string): void;
|
|
397
|
+
/**
|
|
398
|
+
* resolves with a promise containing the following properties:
|
|
399
|
+
*
|
|
400
|
+
* * `response` number - The index of the clicked button.
|
|
401
|
+
* * `checkboxChecked` boolean - The checked state of the checkbox if
|
|
402
|
+
* `checkboxLabel` was set. Otherwise `false`.
|
|
403
|
+
*
|
|
404
|
+
* Shows a message box.
|
|
405
|
+
*
|
|
406
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
407
|
+
* making it modal.
|
|
408
|
+
*/
|
|
409
|
+
showMessageBox(
|
|
410
|
+
window: BaseWindow,
|
|
411
|
+
options: MessageBoxOptions
|
|
412
|
+
): Promise<MessageBoxReturnValue>;
|
|
413
|
+
/**
|
|
414
|
+
* resolves with a promise containing the following properties:
|
|
415
|
+
*
|
|
416
|
+
* * `response` number - The index of the clicked button.
|
|
417
|
+
* * `checkboxChecked` boolean - The checked state of the checkbox if
|
|
418
|
+
* `checkboxLabel` was set. Otherwise `false`.
|
|
419
|
+
*
|
|
420
|
+
* Shows a message box.
|
|
421
|
+
*
|
|
422
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
423
|
+
* making it modal.
|
|
424
|
+
*/
|
|
425
|
+
showMessageBox(options: MessageBoxOptions): Promise<MessageBoxReturnValue>;
|
|
426
|
+
/**
|
|
427
|
+
* the index of the clicked button.
|
|
428
|
+
*
|
|
429
|
+
* Shows a message box, it will block the process until the message box is closed.
|
|
430
|
+
* It returns the index of the clicked button.
|
|
431
|
+
*
|
|
432
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
433
|
+
* making it modal. If `window` is not shown dialog will not be attached to it. In
|
|
434
|
+
* such case it will be displayed as an independent window.
|
|
435
|
+
*/
|
|
436
|
+
showMessageBoxSync(
|
|
437
|
+
window: BaseWindow,
|
|
438
|
+
options: MessageBoxSyncOptions
|
|
439
|
+
): number;
|
|
440
|
+
/**
|
|
441
|
+
* the index of the clicked button.
|
|
442
|
+
*
|
|
443
|
+
* Shows a message box, it will block the process until the message box is closed.
|
|
444
|
+
* It returns the index of the clicked button.
|
|
445
|
+
*
|
|
446
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
447
|
+
* making it modal. If `window` is not shown dialog will not be attached to it. In
|
|
448
|
+
* such case it will be displayed as an independent window.
|
|
449
|
+
*/
|
|
450
|
+
showMessageBoxSync(options: MessageBoxSyncOptions): number;
|
|
451
|
+
/**
|
|
452
|
+
* Resolve with an object containing the following:
|
|
453
|
+
*
|
|
454
|
+
* * `canceled` boolean - whether or not the dialog was canceled.
|
|
455
|
+
* * `filePaths` string[] - An array of file paths chosen by the user. If the
|
|
456
|
+
* dialog is cancelled this will be an empty array.
|
|
457
|
+
* * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
|
|
458
|
+
* `filePaths` array of base64 encoded strings which contains security scoped
|
|
459
|
+
* bookmark data. `securityScopedBookmarks` must be enabled for this to be
|
|
460
|
+
* populated. (For return values, see table here.)
|
|
461
|
+
*
|
|
462
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
463
|
+
* making it modal.
|
|
464
|
+
*
|
|
465
|
+
* The `filters` specifies an array of file types that can be displayed or selected
|
|
466
|
+
* when you want to limit the user to a specific type. For example:
|
|
467
|
+
*
|
|
468
|
+
* The `extensions` array should contain extensions without wildcards or dots (e.g.
|
|
469
|
+
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
470
|
+
* `'*'` wildcard (no other wildcard is supported).
|
|
471
|
+
*
|
|
472
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
473
|
+
* and a directory selector, so if you set `properties` to `['openFile',
|
|
474
|
+
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
475
|
+
*
|
|
476
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
477
|
+
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
478
|
+
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
479
|
+
*/
|
|
480
|
+
showOpenDialog(
|
|
481
|
+
window: BaseWindow,
|
|
482
|
+
options: OpenDialogOptions
|
|
483
|
+
): Promise<OpenDialogReturnValue>;
|
|
484
|
+
/**
|
|
485
|
+
* Resolve with an object containing the following:
|
|
486
|
+
*
|
|
487
|
+
* * `canceled` boolean - whether or not the dialog was canceled.
|
|
488
|
+
* * `filePaths` string[] - An array of file paths chosen by the user. If the
|
|
489
|
+
* dialog is cancelled this will be an empty array.
|
|
490
|
+
* * `bookmarks` string[] (optional) _macOS_ _mas_ - An array matching the
|
|
491
|
+
* `filePaths` array of base64 encoded strings which contains security scoped
|
|
492
|
+
* bookmark data. `securityScopedBookmarks` must be enabled for this to be
|
|
493
|
+
* populated. (For return values, see table here.)
|
|
494
|
+
*
|
|
495
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
496
|
+
* making it modal.
|
|
497
|
+
*
|
|
498
|
+
* The `filters` specifies an array of file types that can be displayed or selected
|
|
499
|
+
* when you want to limit the user to a specific type. For example:
|
|
500
|
+
*
|
|
501
|
+
* The `extensions` array should contain extensions without wildcards or dots (e.g.
|
|
502
|
+
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
503
|
+
* `'*'` wildcard (no other wildcard is supported).
|
|
504
|
+
*
|
|
505
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
506
|
+
* and a directory selector, so if you set `properties` to `['openFile',
|
|
507
|
+
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
508
|
+
*
|
|
509
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
510
|
+
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
511
|
+
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
512
|
+
*/
|
|
513
|
+
showOpenDialog(options: OpenDialogOptions): Promise<OpenDialogReturnValue>;
|
|
514
|
+
/**
|
|
515
|
+
* the file paths chosen by the user; if the dialog is cancelled it returns
|
|
516
|
+
* `undefined`.
|
|
517
|
+
*
|
|
518
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
519
|
+
* making it modal.
|
|
520
|
+
*
|
|
521
|
+
* The `filters` specifies an array of file types that can be displayed or selected
|
|
522
|
+
* when you want to limit the user to a specific type. For example:
|
|
523
|
+
*
|
|
524
|
+
* The `extensions` array should contain extensions without wildcards or dots (e.g.
|
|
525
|
+
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
526
|
+
* `'*'` wildcard (no other wildcard is supported).
|
|
527
|
+
*
|
|
528
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
529
|
+
* and a directory selector, so if you set `properties` to `['openFile',
|
|
530
|
+
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
531
|
+
*
|
|
532
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
533
|
+
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
534
|
+
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
535
|
+
*/
|
|
536
|
+
showOpenDialogSync(
|
|
537
|
+
window: BaseWindow,
|
|
538
|
+
options: OpenDialogSyncOptions
|
|
539
|
+
): string[] | undefined;
|
|
540
|
+
/**
|
|
541
|
+
* the file paths chosen by the user; if the dialog is cancelled it returns
|
|
542
|
+
* `undefined`.
|
|
543
|
+
*
|
|
544
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
545
|
+
* making it modal.
|
|
546
|
+
*
|
|
547
|
+
* The `filters` specifies an array of file types that can be displayed or selected
|
|
548
|
+
* when you want to limit the user to a specific type. For example:
|
|
549
|
+
*
|
|
550
|
+
* The `extensions` array should contain extensions without wildcards or dots (e.g.
|
|
551
|
+
* `'png'` is good but `'.png'` and `'*.png'` are bad). To show all files, use the
|
|
552
|
+
* `'*'` wildcard (no other wildcard is supported).
|
|
553
|
+
*
|
|
554
|
+
* > [!NOTE] On Windows and Linux an open dialog can not be both a file selector
|
|
555
|
+
* and a directory selector, so if you set `properties` to `['openFile',
|
|
556
|
+
* 'openDirectory']` on these platforms, a directory selector will be shown.
|
|
557
|
+
*
|
|
558
|
+
* > [!NOTE] On Linux `defaultPath` is not supported when using portal file chooser
|
|
559
|
+
* dialogs unless the portal backend is version 4 or higher. You can use
|
|
560
|
+
* `--xdg-portal-required-version` command-line switch to force gtk or kde dialogs.
|
|
561
|
+
*/
|
|
562
|
+
showOpenDialogSync(options: OpenDialogSyncOptions): string[] | undefined;
|
|
563
|
+
/**
|
|
564
|
+
* Resolve with an object containing the following:
|
|
565
|
+
*
|
|
566
|
+
* * `canceled` boolean - whether or not the dialog was canceled.
|
|
567
|
+
* * `filePath` string - If the dialog is canceled, this will be an empty string.
|
|
568
|
+
* * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
|
|
569
|
+
* contains the security scoped bookmark data for the saved file.
|
|
570
|
+
* `securityScopedBookmarks` must be enabled for this to be present. (For return
|
|
571
|
+
* values, see table here.)
|
|
572
|
+
*
|
|
573
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
574
|
+
* making it modal.
|
|
575
|
+
*
|
|
576
|
+
* The `filters` specifies an array of file types that can be displayed, see
|
|
577
|
+
* `dialog.showOpenDialog` for an example.
|
|
578
|
+
*
|
|
579
|
+
* > [!NOTE] On macOS, using the asynchronous version is recommended to avoid
|
|
580
|
+
* issues when expanding and collapsing the dialog.
|
|
581
|
+
*/
|
|
582
|
+
showSaveDialog(
|
|
583
|
+
window: BaseWindow,
|
|
584
|
+
options: SaveDialogOptions
|
|
585
|
+
): Promise<SaveDialogReturnValue>;
|
|
586
|
+
/**
|
|
587
|
+
* Resolve with an object containing the following:
|
|
588
|
+
*
|
|
589
|
+
* * `canceled` boolean - whether or not the dialog was canceled.
|
|
590
|
+
* * `filePath` string - If the dialog is canceled, this will be an empty string.
|
|
591
|
+
* * `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which
|
|
592
|
+
* contains the security scoped bookmark data for the saved file.
|
|
593
|
+
* `securityScopedBookmarks` must be enabled for this to be present. (For return
|
|
594
|
+
* values, see table here.)
|
|
595
|
+
*
|
|
596
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
597
|
+
* making it modal.
|
|
598
|
+
*
|
|
599
|
+
* The `filters` specifies an array of file types that can be displayed, see
|
|
600
|
+
* `dialog.showOpenDialog` for an example.
|
|
601
|
+
*
|
|
602
|
+
* > [!NOTE] On macOS, using the asynchronous version is recommended to avoid
|
|
603
|
+
* issues when expanding and collapsing the dialog.
|
|
604
|
+
*/
|
|
605
|
+
showSaveDialog(options: SaveDialogOptions): Promise<SaveDialogReturnValue>;
|
|
606
|
+
/**
|
|
607
|
+
* the path of the file chosen by the user; if the dialog is cancelled it returns
|
|
608
|
+
* an empty string.
|
|
609
|
+
*
|
|
610
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
611
|
+
* making it modal.
|
|
612
|
+
*
|
|
613
|
+
* The `filters` specifies an array of file types that can be displayed, see
|
|
614
|
+
* `dialog.showOpenDialog` for an example.
|
|
615
|
+
*/
|
|
616
|
+
showSaveDialogSync(
|
|
617
|
+
window: BaseWindow,
|
|
618
|
+
options: SaveDialogSyncOptions
|
|
619
|
+
): string;
|
|
620
|
+
/**
|
|
621
|
+
* the path of the file chosen by the user; if the dialog is cancelled it returns
|
|
622
|
+
* an empty string.
|
|
623
|
+
*
|
|
624
|
+
* The `window` argument allows the dialog to attach itself to a parent window,
|
|
625
|
+
* making it modal.
|
|
626
|
+
*
|
|
627
|
+
* The `filters` specifies an array of file types that can be displayed, see
|
|
628
|
+
* `dialog.showOpenDialog` for an example.
|
|
629
|
+
*/
|
|
630
|
+
showSaveDialogSync(options: SaveDialogSyncOptions): string;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export declare const dialog: Dialog;
|