@reddb-io/ui 0.3.1 → 0.3.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.
Files changed (74) hide show
  1. package/build/_app/immutable/assets/0.CEQwbG0J.css +1 -0
  2. package/build/_app/immutable/chunks/C-kqMbRi.js +1 -0
  3. package/build/_app/immutable/chunks/{CLBx21Hz.js → C3SGj6Qd.js} +2 -2
  4. package/build/_app/immutable/chunks/{DV9PDoM3.js → C9pP73gT.js} +1 -1
  5. package/build/_app/immutable/chunks/{CJFJ501n.js → CEBul73-.js} +1 -1
  6. package/build/_app/immutable/chunks/CHvQYbpl.js +1 -0
  7. package/build/_app/immutable/chunks/{8zg2gJwV.js → CXuFZWQe.js} +1 -1
  8. package/build/_app/immutable/chunks/CgIoFKBK.js +1 -0
  9. package/build/_app/immutable/chunks/D02PB2u7.js +1 -0
  10. package/build/_app/immutable/chunks/D6XJvoMn.js +404 -0
  11. package/build/_app/immutable/chunks/DLDgyIn5.js +1164 -0
  12. package/build/_app/immutable/chunks/{Bq4DTWK2.js → DN7v3Tar.js} +1 -1
  13. package/build/_app/immutable/entry/{app.BDog2y0J.js → app.BBk9O_OI.js} +2 -2
  14. package/build/_app/immutable/entry/start.C9qfj9ex.js +1 -0
  15. package/build/_app/immutable/nodes/0.BBf1ZyjL.js +2 -0
  16. package/build/_app/immutable/nodes/1.BmVeJAGw.js +1 -0
  17. package/build/_app/immutable/nodes/{10.D_FCLs0Z.js → 10.DZmZgLvj.js} +1 -1
  18. package/build/_app/immutable/nodes/{12.DPE6v6Zf.js → 12.CzMvqoYS.js} +2 -2
  19. package/build/_app/immutable/nodes/15.CRwZaU1B.js +60 -0
  20. package/build/_app/version.json +1 -1
  21. package/build/index.html +13 -13
  22. package/dist/embed/{AnalyticsView-D8z1Nsed.js → AnalyticsView-BWwvQS2I.js} +849 -849
  23. package/dist/embed/{AnalyticsView-D8z1Nsed.js.map → AnalyticsView-BWwvQS2I.js.map} +1 -1
  24. package/dist/embed/RedUiEmbedRoot-DAB-6DEr.js +35587 -0
  25. package/dist/embed/RedUiEmbedRoot-DAB-6DEr.js.map +1 -0
  26. package/dist/embed/event-BvRbkLjD.js +46 -0
  27. package/dist/embed/event-BvRbkLjD.js.map +1 -0
  28. package/dist/embed/index-BVxMkfHe.js +8 -0
  29. package/dist/embed/index-BVxMkfHe.js.map +1 -0
  30. package/dist/embed/index-Bgo4yw4C.js +856 -0
  31. package/dist/embed/index-Bgo4yw4C.js.map +1 -0
  32. package/dist/embed/{index-client-BeiP-va5.js → index-client-BHUUkI8H.js} +121 -120
  33. package/dist/embed/{index-client-BeiP-va5.js.map → index-client-BHUUkI8H.js.map} +1 -1
  34. package/dist/embed/index.js +1 -1
  35. package/dist/embed/{sigma.esm-qqKBpvin.js → sigma.esm-BOgYLguI.js} +2 -2
  36. package/dist/embed/{sigma.esm-qqKBpvin.js.map → sigma.esm-BOgYLguI.js.map} +1 -1
  37. package/dist/embed/window-ZR8_mM8o.js +1889 -0
  38. package/dist/embed/window-ZR8_mM8o.js.map +1 -0
  39. package/package.json +5 -3
  40. package/src/app.css +5 -0
  41. package/src/lib/ConnectDropdown.svelte +60 -3
  42. package/src/lib/DevConsole.svelte +155 -0
  43. package/src/lib/ErrorBoundary.fixture.svelte +11 -0
  44. package/src/lib/ErrorBoundary.fixtures.svelte.ts +5 -0
  45. package/src/lib/ErrorBoundary.svelte +78 -0
  46. package/src/lib/ErrorBoundaryCrashChild.fixture.svelte +9 -0
  47. package/src/lib/LoadingOverlay.svelte +109 -0
  48. package/src/lib/StatusBar.svelte +19 -1
  49. package/src/lib/Workspace.svelte +118 -2
  50. package/src/lib/connections.svelte.ts +95 -1
  51. package/src/lib/embed/RedUiEmbedRoot.svelte +13 -8
  52. package/src/lib/embed/index.ts +34 -1
  53. package/src/lib/index.ts +7 -0
  54. package/src/lib/loading.svelte.ts +142 -0
  55. package/src/lib/reddb/client.ts +133 -15
  56. package/src/lib/reddb/desktop-error.ts +89 -0
  57. package/src/lib/reddb/dev-console.ts +186 -0
  58. package/src/lib/reddb/index.ts +2 -0
  59. package/src/lib/reddb/local-url-provider.ts +4 -8
  60. package/src/lib/reddb/tauri-encrypted-store.ts +4 -9
  61. package/src/lib/tabs.svelte.ts +5 -0
  62. package/src/lib/workspace-session.ts +81 -0
  63. package/build/_app/immutable/assets/0.DgbuWrJy.css +0 -1
  64. package/build/_app/immutable/chunks/85-Fh5Zp.js +0 -404
  65. package/build/_app/immutable/chunks/CnD4hwxC.js +0 -1106
  66. package/build/_app/immutable/chunks/DQCYUNtS.js +0 -1
  67. package/build/_app/immutable/entry/start.D1J45dq5.js +0 -1
  68. package/build/_app/immutable/nodes/0.BTrC4th2.js +0 -1
  69. package/build/_app/immutable/nodes/1.Ds1Tbjsm.js +0 -1
  70. package/build/_app/immutable/nodes/15.CcJlZGxa.js +0 -60
  71. package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js +0 -31302
  72. package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js.map +0 -1
  73. package/dist/embed/index-w1Qo_uW0.js +0 -677
  74. package/dist/embed/index-w1Qo_uW0.js.map +0 -1
@@ -0,0 +1,1889 @@
1
+ import { SERIALIZE_TO_IPC_FN as a, Resource as O, invoke as i } from "./core-QuRYvMt8.js";
2
+ import { listen as S, once as L, emit as P, emitTo as k, TauriEvent as o } from "./event-BvRbkLjD.js";
3
+ class x {
4
+ constructor(...e) {
5
+ this.type = "Logical", e.length === 1 ? "Logical" in e[0] ? (this.width = e[0].Logical.width, this.height = e[0].Logical.height) : (this.width = e[0].width, this.height = e[0].height) : (this.width = e[0], this.height = e[1]);
6
+ }
7
+ /**
8
+ * Converts the logical size to a physical one.
9
+ * @example
10
+ * ```typescript
11
+ * import { LogicalSize } from '@tauri-apps/api/dpi';
12
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
13
+ *
14
+ * const appWindow = getCurrentWindow();
15
+ * const factor = await appWindow.scaleFactor();
16
+ * const size = new LogicalSize(400, 500);
17
+ * const physical = size.toPhysical(factor);
18
+ * ```
19
+ *
20
+ * @since 2.0.0
21
+ */
22
+ toPhysical(e) {
23
+ return new c(this.width * e, this.height * e);
24
+ }
25
+ [a]() {
26
+ return {
27
+ width: this.width,
28
+ height: this.height
29
+ };
30
+ }
31
+ toJSON() {
32
+ return this[a]();
33
+ }
34
+ }
35
+ class c {
36
+ constructor(...e) {
37
+ this.type = "Physical", e.length === 1 ? "Physical" in e[0] ? (this.width = e[0].Physical.width, this.height = e[0].Physical.height) : (this.width = e[0].width, this.height = e[0].height) : (this.width = e[0], this.height = e[1]);
38
+ }
39
+ /**
40
+ * Converts the physical size to a logical one.
41
+ * @example
42
+ * ```typescript
43
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
44
+ * const appWindow = getCurrentWindow();
45
+ * const factor = await appWindow.scaleFactor();
46
+ * const size = await appWindow.innerSize(); // PhysicalSize
47
+ * const logical = size.toLogical(factor);
48
+ * ```
49
+ */
50
+ toLogical(e) {
51
+ return new x(this.width / e, this.height / e);
52
+ }
53
+ [a]() {
54
+ return {
55
+ width: this.width,
56
+ height: this.height
57
+ };
58
+ }
59
+ toJSON() {
60
+ return this[a]();
61
+ }
62
+ }
63
+ class h {
64
+ constructor(e) {
65
+ this.size = e;
66
+ }
67
+ toLogical(e) {
68
+ return this.size instanceof x ? this.size : this.size.toLogical(e);
69
+ }
70
+ toPhysical(e) {
71
+ return this.size instanceof c ? this.size : this.size.toPhysical(e);
72
+ }
73
+ [a]() {
74
+ return {
75
+ [`${this.size.type}`]: {
76
+ width: this.size.width,
77
+ height: this.size.height
78
+ }
79
+ };
80
+ }
81
+ toJSON() {
82
+ return this[a]();
83
+ }
84
+ }
85
+ class D {
86
+ constructor(...e) {
87
+ this.type = "Logical", e.length === 1 ? "Logical" in e[0] ? (this.x = e[0].Logical.x, this.y = e[0].Logical.y) : (this.x = e[0].x, this.y = e[0].y) : (this.x = e[0], this.y = e[1]);
88
+ }
89
+ /**
90
+ * Converts the logical position to a physical one.
91
+ * @example
92
+ * ```typescript
93
+ * import { LogicalPosition } from '@tauri-apps/api/dpi';
94
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
95
+ *
96
+ * const appWindow = getCurrentWindow();
97
+ * const factor = await appWindow.scaleFactor();
98
+ * const position = new LogicalPosition(400, 500);
99
+ * const physical = position.toPhysical(factor);
100
+ * ```
101
+ *
102
+ * @since 2.0.0
103
+ */
104
+ toPhysical(e) {
105
+ return new u(this.x * e, this.y * e);
106
+ }
107
+ [a]() {
108
+ return {
109
+ x: this.x,
110
+ y: this.y
111
+ };
112
+ }
113
+ toJSON() {
114
+ return this[a]();
115
+ }
116
+ }
117
+ class u {
118
+ constructor(...e) {
119
+ this.type = "Physical", e.length === 1 ? "Physical" in e[0] ? (this.x = e[0].Physical.x, this.y = e[0].Physical.y) : (this.x = e[0].x, this.y = e[0].y) : (this.x = e[0], this.y = e[1]);
120
+ }
121
+ /**
122
+ * Converts the physical position to a logical one.
123
+ * @example
124
+ * ```typescript
125
+ * import { PhysicalPosition } from '@tauri-apps/api/dpi';
126
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
127
+ *
128
+ * const appWindow = getCurrentWindow();
129
+ * const factor = await appWindow.scaleFactor();
130
+ * const position = new PhysicalPosition(400, 500);
131
+ * const physical = position.toLogical(factor);
132
+ * ```
133
+ *
134
+ * @since 2.0.0
135
+ */
136
+ toLogical(e) {
137
+ return new D(this.x / e, this.y / e);
138
+ }
139
+ [a]() {
140
+ return {
141
+ x: this.x,
142
+ y: this.y
143
+ };
144
+ }
145
+ toJSON() {
146
+ return this[a]();
147
+ }
148
+ }
149
+ class w {
150
+ constructor(e) {
151
+ this.position = e;
152
+ }
153
+ toLogical(e) {
154
+ return this.position instanceof D ? this.position : this.position.toLogical(e);
155
+ }
156
+ toPhysical(e) {
157
+ return this.position instanceof u ? this.position : this.position.toPhysical(e);
158
+ }
159
+ [a]() {
160
+ return {
161
+ [`${this.position.type}`]: {
162
+ x: this.position.x,
163
+ y: this.position.y
164
+ }
165
+ };
166
+ }
167
+ toJSON() {
168
+ return this[a]();
169
+ }
170
+ }
171
+ class d extends O {
172
+ /**
173
+ * Creates an Image from a resource ID. For internal use only.
174
+ *
175
+ * @ignore
176
+ */
177
+ constructor(e) {
178
+ super(e);
179
+ }
180
+ /** Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height. */
181
+ static async new(e, n, l) {
182
+ return i("plugin:image|new", {
183
+ rgba: b(e),
184
+ width: n,
185
+ height: l
186
+ }).then((r) => new d(r));
187
+ }
188
+ /**
189
+ * Creates a new image using the provided bytes by inferring the file format.
190
+ * If the format is known, prefer [@link Image.fromPngBytes] or [@link Image.fromIcoBytes].
191
+ *
192
+ * Only `ico` and `png` are supported (based on activated feature flag).
193
+ *
194
+ * Note that you need the `image-ico` or `image-png` Cargo features to use this API.
195
+ * To enable it, change your Cargo.toml file:
196
+ * ```toml
197
+ * [dependencies]
198
+ * tauri = { version = "...", features = ["...", "image-png"] }
199
+ * ```
200
+ */
201
+ static async fromBytes(e) {
202
+ return i("plugin:image|from_bytes", {
203
+ bytes: b(e)
204
+ }).then((n) => new d(n));
205
+ }
206
+ /**
207
+ * Creates a new image using the provided path.
208
+ *
209
+ * Only `ico` and `png` are supported (based on activated feature flag).
210
+ *
211
+ * Note that you need the `image-ico` or `image-png` Cargo features to use this API.
212
+ * To enable it, change your Cargo.toml file:
213
+ * ```toml
214
+ * [dependencies]
215
+ * tauri = { version = "...", features = ["...", "image-png"] }
216
+ * ```
217
+ */
218
+ static async fromPath(e) {
219
+ return i("plugin:image|from_path", { path: e }).then((n) => new d(n));
220
+ }
221
+ /** Returns the RGBA data for this image, in row-major order from top to bottom. */
222
+ async rgba() {
223
+ return i("plugin:image|rgba", {
224
+ rid: this.rid
225
+ }).then((e) => new Uint8Array(e));
226
+ }
227
+ /** Returns the size of this image. */
228
+ async size() {
229
+ return i("plugin:image|size", { rid: this.rid });
230
+ }
231
+ }
232
+ function b(t) {
233
+ return t == null ? null : typeof t == "string" ? t : t instanceof d ? t.rid : t;
234
+ }
235
+ var g;
236
+ (function(t) {
237
+ t[t.Critical = 1] = "Critical", t[t.Informational = 2] = "Informational";
238
+ })(g || (g = {}));
239
+ class I {
240
+ constructor(e) {
241
+ this._preventDefault = !1, this.event = e.event, this.id = e.id;
242
+ }
243
+ preventDefault() {
244
+ this._preventDefault = !0;
245
+ }
246
+ isPreventDefault() {
247
+ return this._preventDefault;
248
+ }
249
+ }
250
+ var _;
251
+ (function(t) {
252
+ t.None = "none", t.Normal = "normal", t.Indeterminate = "indeterminate", t.Paused = "paused", t.Error = "error";
253
+ })(_ || (_ = {}));
254
+ function T() {
255
+ return new W(window.__TAURI_INTERNALS__.metadata.currentWindow.label, {
256
+ // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor
257
+ skip: !0
258
+ });
259
+ }
260
+ async function y() {
261
+ return i("plugin:window|get_all_windows").then((t) => t.map((e) => new W(e, {
262
+ // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor
263
+ skip: !0
264
+ })));
265
+ }
266
+ const p = ["tauri://created", "tauri://error"];
267
+ class W {
268
+ /**
269
+ * Creates a new Window.
270
+ * @example
271
+ * ```typescript
272
+ * import { Window } from '@tauri-apps/api/window';
273
+ * const appWindow = new Window('my-label');
274
+ * appWindow.once('tauri://created', function () {
275
+ * // window successfully created
276
+ * });
277
+ * appWindow.once('tauri://error', function (e) {
278
+ * // an error happened creating the window
279
+ * });
280
+ * ```
281
+ *
282
+ * @param label The unique window label. Must be alphanumeric: `a-zA-Z-/:_`.
283
+ * @returns The {@link Window} instance to communicate with the window.
284
+ */
285
+ constructor(e, n = {}) {
286
+ var l;
287
+ this.label = e, this.listeners = /* @__PURE__ */ Object.create(null), n != null && n.skip || i("plugin:window|create", {
288
+ options: {
289
+ ...n,
290
+ parent: typeof n.parent == "string" ? n.parent : (l = n.parent) === null || l === void 0 ? void 0 : l.label,
291
+ label: e
292
+ }
293
+ }).then(async () => this.emit("tauri://created")).catch(async (r) => this.emit("tauri://error", r));
294
+ }
295
+ /**
296
+ * Gets the Window associated with the given label.
297
+ * @example
298
+ * ```typescript
299
+ * import { Window } from '@tauri-apps/api/window';
300
+ * const mainWindow = Window.getByLabel('main');
301
+ * ```
302
+ *
303
+ * @param label The window label.
304
+ * @returns The Window instance to communicate with the window or null if the window doesn't exist.
305
+ */
306
+ static async getByLabel(e) {
307
+ var n;
308
+ return (n = (await y()).find((l) => l.label === e)) !== null && n !== void 0 ? n : null;
309
+ }
310
+ /**
311
+ * Get an instance of `Window` for the current window.
312
+ */
313
+ static getCurrent() {
314
+ return T();
315
+ }
316
+ /**
317
+ * Gets a list of instances of `Window` for all available windows.
318
+ */
319
+ static async getAll() {
320
+ return y();
321
+ }
322
+ /**
323
+ * Gets the focused window.
324
+ * @example
325
+ * ```typescript
326
+ * import { Window } from '@tauri-apps/api/window';
327
+ * const focusedWindow = Window.getFocusedWindow();
328
+ * ```
329
+ *
330
+ * @returns The Window instance or `undefined` if there is not any focused window.
331
+ */
332
+ static async getFocusedWindow() {
333
+ for (const e of await y())
334
+ if (await e.isFocused())
335
+ return e;
336
+ return null;
337
+ }
338
+ /**
339
+ * Listen to an emitted event on this window.
340
+ *
341
+ * @example
342
+ * ```typescript
343
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
344
+ * const unlisten = await getCurrentWindow().listen<string>('state-changed', (event) => {
345
+ * console.log(`Got error: ${payload}`);
346
+ * });
347
+ *
348
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
349
+ * unlisten();
350
+ * ```
351
+ *
352
+ * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.
353
+ * @param handler Event handler.
354
+ * @returns A promise resolving to a function to unlisten to the event.
355
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
356
+ */
357
+ async listen(e, n) {
358
+ return this._handleTauriEvent(e, n) ? () => {
359
+ const l = this.listeners[e];
360
+ l.splice(l.indexOf(n), 1);
361
+ } : S(e, n, {
362
+ target: { kind: "Window", label: this.label }
363
+ });
364
+ }
365
+ /**
366
+ * Listen to an emitted event on this window only once.
367
+ *
368
+ * @example
369
+ * ```typescript
370
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
371
+ * const unlisten = await getCurrentWindow().once<null>('initialized', (event) => {
372
+ * console.log(`Window initialized!`);
373
+ * });
374
+ *
375
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
376
+ * unlisten();
377
+ * ```
378
+ *
379
+ * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.
380
+ * @param handler Event handler.
381
+ * @returns A promise resolving to a function to unlisten to the event.
382
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
383
+ */
384
+ async once(e, n) {
385
+ return this._handleTauriEvent(e, n) ? () => {
386
+ const l = this.listeners[e];
387
+ l.splice(l.indexOf(n), 1);
388
+ } : L(e, n, {
389
+ target: { kind: "Window", label: this.label }
390
+ });
391
+ }
392
+ /**
393
+ * Emits an event to all {@link EventTarget|targets}.
394
+ * @example
395
+ * ```typescript
396
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
397
+ * await getCurrentWindow().emit('window-loaded', { loggedIn: true, token: 'authToken' });
398
+ * ```
399
+ *
400
+ * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.
401
+ * @param payload Event payload.
402
+ */
403
+ async emit(e, n) {
404
+ if (p.includes(e)) {
405
+ for (const l of this.listeners[e] || [])
406
+ l({
407
+ event: e,
408
+ id: -1,
409
+ payload: n
410
+ });
411
+ return;
412
+ }
413
+ return P(e, n);
414
+ }
415
+ /**
416
+ * Emits an event to all {@link EventTarget|targets} matching the given target.
417
+ *
418
+ * @example
419
+ * ```typescript
420
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
421
+ * await getCurrentWindow().emit('main', 'window-loaded', { loggedIn: true, token: 'authToken' });
422
+ * ```
423
+ * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.
424
+ * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.
425
+ * @param payload Event payload.
426
+ */
427
+ async emitTo(e, n, l) {
428
+ if (p.includes(n)) {
429
+ for (const r of this.listeners[n] || [])
430
+ r({
431
+ event: n,
432
+ id: -1,
433
+ payload: l
434
+ });
435
+ return;
436
+ }
437
+ return k(e, n, l);
438
+ }
439
+ /** @ignore */
440
+ _handleTauriEvent(e, n) {
441
+ return p.includes(e) ? (e in this.listeners ? this.listeners[e].push(n) : this.listeners[e] = [n], !0) : !1;
442
+ }
443
+ // Getters
444
+ /**
445
+ * The scale factor that can be used to map physical pixels to logical pixels.
446
+ * @example
447
+ * ```typescript
448
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
449
+ * const factor = await getCurrentWindow().scaleFactor();
450
+ * ```
451
+ *
452
+ * @returns The window's monitor scale factor.
453
+ */
454
+ async scaleFactor() {
455
+ return i("plugin:window|scale_factor", {
456
+ label: this.label
457
+ });
458
+ }
459
+ /**
460
+ * The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop.
461
+ * @example
462
+ * ```typescript
463
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
464
+ * const position = await getCurrentWindow().innerPosition();
465
+ * ```
466
+ *
467
+ * @returns The window's inner position.
468
+ */
469
+ async innerPosition() {
470
+ return i("plugin:window|inner_position", {
471
+ label: this.label
472
+ }).then((e) => new u(e));
473
+ }
474
+ /**
475
+ * The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.
476
+ * @example
477
+ * ```typescript
478
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
479
+ * const position = await getCurrentWindow().outerPosition();
480
+ * ```
481
+ *
482
+ * @returns The window's outer position.
483
+ */
484
+ async outerPosition() {
485
+ return i("plugin:window|outer_position", {
486
+ label: this.label
487
+ }).then((e) => new u(e));
488
+ }
489
+ /**
490
+ * The physical size of the window's client area.
491
+ * The client area is the content of the window, excluding the title bar and borders.
492
+ * @example
493
+ * ```typescript
494
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
495
+ * const size = await getCurrentWindow().innerSize();
496
+ * ```
497
+ *
498
+ * @returns The window's inner size.
499
+ */
500
+ async innerSize() {
501
+ return i("plugin:window|inner_size", {
502
+ label: this.label
503
+ }).then((e) => new c(e));
504
+ }
505
+ /**
506
+ * The physical size of the entire window.
507
+ * These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead.
508
+ * @example
509
+ * ```typescript
510
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
511
+ * const size = await getCurrentWindow().outerSize();
512
+ * ```
513
+ *
514
+ * @returns The window's outer size.
515
+ */
516
+ async outerSize() {
517
+ return i("plugin:window|outer_size", {
518
+ label: this.label
519
+ }).then((e) => new c(e));
520
+ }
521
+ /**
522
+ * Gets the window's current fullscreen state.
523
+ * @example
524
+ * ```typescript
525
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
526
+ * const fullscreen = await getCurrentWindow().isFullscreen();
527
+ * ```
528
+ *
529
+ * @returns Whether the window is in fullscreen mode or not.
530
+ */
531
+ async isFullscreen() {
532
+ return i("plugin:window|is_fullscreen", {
533
+ label: this.label
534
+ });
535
+ }
536
+ /**
537
+ * Gets the window's current minimized state.
538
+ * @example
539
+ * ```typescript
540
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
541
+ * const minimized = await getCurrentWindow().isMinimized();
542
+ * ```
543
+ */
544
+ async isMinimized() {
545
+ return i("plugin:window|is_minimized", {
546
+ label: this.label
547
+ });
548
+ }
549
+ /**
550
+ * Gets the window's current maximized state.
551
+ * @example
552
+ * ```typescript
553
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
554
+ * const maximized = await getCurrentWindow().isMaximized();
555
+ * ```
556
+ *
557
+ * @returns Whether the window is maximized or not.
558
+ */
559
+ async isMaximized() {
560
+ return i("plugin:window|is_maximized", {
561
+ label: this.label
562
+ });
563
+ }
564
+ /**
565
+ * Gets the window's current focus state.
566
+ * @example
567
+ * ```typescript
568
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
569
+ * const focused = await getCurrentWindow().isFocused();
570
+ * ```
571
+ *
572
+ * @returns Whether the window is focused or not.
573
+ */
574
+ async isFocused() {
575
+ return i("plugin:window|is_focused", {
576
+ label: this.label
577
+ });
578
+ }
579
+ /**
580
+ * Gets the window's current decorated state.
581
+ * @example
582
+ * ```typescript
583
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
584
+ * const decorated = await getCurrentWindow().isDecorated();
585
+ * ```
586
+ *
587
+ * @returns Whether the window is decorated or not.
588
+ */
589
+ async isDecorated() {
590
+ return i("plugin:window|is_decorated", {
591
+ label: this.label
592
+ });
593
+ }
594
+ /**
595
+ * Gets the window's current resizable state.
596
+ * @example
597
+ * ```typescript
598
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
599
+ * const resizable = await getCurrentWindow().isResizable();
600
+ * ```
601
+ *
602
+ * @returns Whether the window is resizable or not.
603
+ */
604
+ async isResizable() {
605
+ return i("plugin:window|is_resizable", {
606
+ label: this.label
607
+ });
608
+ }
609
+ /**
610
+ * Gets the window's native maximize button state.
611
+ *
612
+ * #### Platform-specific
613
+ *
614
+ * - **Linux / iOS / Android:** Unsupported.
615
+ *
616
+ * @example
617
+ * ```typescript
618
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
619
+ * const maximizable = await getCurrentWindow().isMaximizable();
620
+ * ```
621
+ *
622
+ * @returns Whether the window's native maximize button is enabled or not.
623
+ */
624
+ async isMaximizable() {
625
+ return i("plugin:window|is_maximizable", {
626
+ label: this.label
627
+ });
628
+ }
629
+ /**
630
+ * Gets the window's native minimize button state.
631
+ *
632
+ * #### Platform-specific
633
+ *
634
+ * - **Linux / iOS / Android:** Unsupported.
635
+ *
636
+ * @example
637
+ * ```typescript
638
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
639
+ * const minimizable = await getCurrentWindow().isMinimizable();
640
+ * ```
641
+ *
642
+ * @returns Whether the window's native minimize button is enabled or not.
643
+ */
644
+ async isMinimizable() {
645
+ return i("plugin:window|is_minimizable", {
646
+ label: this.label
647
+ });
648
+ }
649
+ /**
650
+ * Gets the window's native close button state.
651
+ *
652
+ * #### Platform-specific
653
+ *
654
+ * - **iOS / Android:** Unsupported.
655
+ *
656
+ * @example
657
+ * ```typescript
658
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
659
+ * const closable = await getCurrentWindow().isClosable();
660
+ * ```
661
+ *
662
+ * @returns Whether the window's native close button is enabled or not.
663
+ */
664
+ async isClosable() {
665
+ return i("plugin:window|is_closable", {
666
+ label: this.label
667
+ });
668
+ }
669
+ /**
670
+ * Gets the window's current visible state.
671
+ * @example
672
+ * ```typescript
673
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
674
+ * const visible = await getCurrentWindow().isVisible();
675
+ * ```
676
+ *
677
+ * @returns Whether the window is visible or not.
678
+ */
679
+ async isVisible() {
680
+ return i("plugin:window|is_visible", {
681
+ label: this.label
682
+ });
683
+ }
684
+ /**
685
+ * Gets the window's current title.
686
+ * @example
687
+ * ```typescript
688
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
689
+ * const title = await getCurrentWindow().title();
690
+ * ```
691
+ */
692
+ async title() {
693
+ return i("plugin:window|title", {
694
+ label: this.label
695
+ });
696
+ }
697
+ /**
698
+ * Gets the window's current theme.
699
+ *
700
+ * #### Platform-specific
701
+ *
702
+ * - **macOS:** Theme was introduced on macOS 10.14. Returns `light` on macOS 10.13 and below.
703
+ *
704
+ * @example
705
+ * ```typescript
706
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
707
+ * const theme = await getCurrentWindow().theme();
708
+ * ```
709
+ *
710
+ * @returns The window theme.
711
+ */
712
+ async theme() {
713
+ return i("plugin:window|theme", {
714
+ label: this.label
715
+ });
716
+ }
717
+ /**
718
+ * Whether the window is configured to be always on top of other windows or not.
719
+ * @example
720
+ * ```typescript
721
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
722
+ * const alwaysOnTop = await getCurrentWindow().isAlwaysOnTop();
723
+ * ```
724
+ *
725
+ * @returns Whether the window is visible or not.
726
+ */
727
+ async isAlwaysOnTop() {
728
+ return i("plugin:window|is_always_on_top", {
729
+ label: this.label
730
+ });
731
+ }
732
+ async activityName() {
733
+ return i("plugin:window|activity_name", {
734
+ label: this.label
735
+ });
736
+ }
737
+ async sceneIdentifier() {
738
+ return i("plugin:window|scene_identifier", {
739
+ label: this.label
740
+ });
741
+ }
742
+ // Setters
743
+ /**
744
+ * Centers the window.
745
+ * @example
746
+ * ```typescript
747
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
748
+ * await getCurrentWindow().center();
749
+ * ```
750
+ *
751
+ * @returns A promise indicating the success or failure of the operation.
752
+ */
753
+ async center() {
754
+ return i("plugin:window|center", {
755
+ label: this.label
756
+ });
757
+ }
758
+ /**
759
+ * Requests user attention to the window, this has no effect if the application
760
+ * is already focused. How requesting for user attention manifests is platform dependent,
761
+ * see `UserAttentionType` for details.
762
+ *
763
+ * Providing `null` will unset the request for user attention. Unsetting the request for
764
+ * user attention might not be done automatically by the WM when the window receives input.
765
+ *
766
+ * #### Platform-specific
767
+ *
768
+ * - **macOS:** `null` has no effect.
769
+ * - **Linux:** Urgency levels have the same effect.
770
+ * @example
771
+ * ```typescript
772
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
773
+ * await getCurrentWindow().requestUserAttention();
774
+ * ```
775
+ *
776
+ * @returns A promise indicating the success or failure of the operation.
777
+ */
778
+ async requestUserAttention(e) {
779
+ let n = null;
780
+ return e && (e === g.Critical ? n = { type: "Critical" } : n = { type: "Informational" }), i("plugin:window|request_user_attention", {
781
+ label: this.label,
782
+ value: n
783
+ });
784
+ }
785
+ /**
786
+ * Updates the window resizable flag.
787
+ * @example
788
+ * ```typescript
789
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
790
+ * await getCurrentWindow().setResizable(false);
791
+ * ```
792
+ *
793
+ * @returns A promise indicating the success or failure of the operation.
794
+ */
795
+ async setResizable(e) {
796
+ return i("plugin:window|set_resizable", {
797
+ label: this.label,
798
+ value: e
799
+ });
800
+ }
801
+ /**
802
+ * Enable or disable the window.
803
+ * @example
804
+ * ```typescript
805
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
806
+ * await getCurrentWindow().setEnabled(false);
807
+ * ```
808
+ *
809
+ * @returns A promise indicating the success or failure of the operation.
810
+ *
811
+ * @since 2.0.0
812
+ */
813
+ async setEnabled(e) {
814
+ return i("plugin:window|set_enabled", {
815
+ label: this.label,
816
+ value: e
817
+ });
818
+ }
819
+ /**
820
+ * Whether the window is enabled or disabled.
821
+ * @example
822
+ * ```typescript
823
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
824
+ * await getCurrentWindow().setEnabled(false);
825
+ * ```
826
+ *
827
+ * @returns A promise indicating the success or failure of the operation.
828
+ *
829
+ * @since 2.0.0
830
+ */
831
+ async isEnabled() {
832
+ return i("plugin:window|is_enabled", {
833
+ label: this.label
834
+ });
835
+ }
836
+ /**
837
+ * Sets whether the window's native maximize button is enabled or not.
838
+ * If resizable is set to false, this setting is ignored.
839
+ *
840
+ * #### Platform-specific
841
+ *
842
+ * - **macOS:** Disables the "zoom" button in the window titlebar, which is also used to enter fullscreen mode.
843
+ * - **Linux / iOS / Android:** Unsupported.
844
+ *
845
+ * @example
846
+ * ```typescript
847
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
848
+ * await getCurrentWindow().setMaximizable(false);
849
+ * ```
850
+ *
851
+ * @returns A promise indicating the success or failure of the operation.
852
+ */
853
+ async setMaximizable(e) {
854
+ return i("plugin:window|set_maximizable", {
855
+ label: this.label,
856
+ value: e
857
+ });
858
+ }
859
+ /**
860
+ * Sets whether the window's native minimize button is enabled or not.
861
+ *
862
+ * #### Platform-specific
863
+ *
864
+ * - **Linux / iOS / Android:** Unsupported.
865
+ *
866
+ * @example
867
+ * ```typescript
868
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
869
+ * await getCurrentWindow().setMinimizable(false);
870
+ * ```
871
+ *
872
+ * @returns A promise indicating the success or failure of the operation.
873
+ */
874
+ async setMinimizable(e) {
875
+ return i("plugin:window|set_minimizable", {
876
+ label: this.label,
877
+ value: e
878
+ });
879
+ }
880
+ /**
881
+ * Sets whether the window's native close button is enabled or not.
882
+ *
883
+ * #### Platform-specific
884
+ *
885
+ * - **Linux:** GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible
886
+ * - **iOS / Android:** Unsupported.
887
+ *
888
+ * @example
889
+ * ```typescript
890
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
891
+ * await getCurrentWindow().setClosable(false);
892
+ * ```
893
+ *
894
+ * @returns A promise indicating the success or failure of the operation.
895
+ */
896
+ async setClosable(e) {
897
+ return i("plugin:window|set_closable", {
898
+ label: this.label,
899
+ value: e
900
+ });
901
+ }
902
+ /**
903
+ * Sets the window title.
904
+ * @example
905
+ * ```typescript
906
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
907
+ * await getCurrentWindow().setTitle('Tauri');
908
+ * ```
909
+ *
910
+ * @param title The new title
911
+ * @returns A promise indicating the success or failure of the operation.
912
+ */
913
+ async setTitle(e) {
914
+ return i("plugin:window|set_title", {
915
+ label: this.label,
916
+ value: e
917
+ });
918
+ }
919
+ /**
920
+ * Maximizes the window.
921
+ * @example
922
+ * ```typescript
923
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
924
+ * await getCurrentWindow().maximize();
925
+ * ```
926
+ *
927
+ * @returns A promise indicating the success or failure of the operation.
928
+ */
929
+ async maximize() {
930
+ return i("plugin:window|maximize", {
931
+ label: this.label
932
+ });
933
+ }
934
+ /**
935
+ * Unmaximizes the window.
936
+ * @example
937
+ * ```typescript
938
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
939
+ * await getCurrentWindow().unmaximize();
940
+ * ```
941
+ *
942
+ * @returns A promise indicating the success or failure of the operation.
943
+ */
944
+ async unmaximize() {
945
+ return i("plugin:window|unmaximize", {
946
+ label: this.label
947
+ });
948
+ }
949
+ /**
950
+ * Toggles the window maximized state.
951
+ * @example
952
+ * ```typescript
953
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
954
+ * await getCurrentWindow().toggleMaximize();
955
+ * ```
956
+ *
957
+ * @returns A promise indicating the success or failure of the operation.
958
+ */
959
+ async toggleMaximize() {
960
+ return i("plugin:window|toggle_maximize", {
961
+ label: this.label
962
+ });
963
+ }
964
+ /**
965
+ * Minimizes the window.
966
+ * @example
967
+ * ```typescript
968
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
969
+ * await getCurrentWindow().minimize();
970
+ * ```
971
+ *
972
+ * @returns A promise indicating the success or failure of the operation.
973
+ */
974
+ async minimize() {
975
+ return i("plugin:window|minimize", {
976
+ label: this.label
977
+ });
978
+ }
979
+ /**
980
+ * Unminimizes the window.
981
+ * @example
982
+ * ```typescript
983
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
984
+ * await getCurrentWindow().unminimize();
985
+ * ```
986
+ *
987
+ * @returns A promise indicating the success or failure of the operation.
988
+ */
989
+ async unminimize() {
990
+ return i("plugin:window|unminimize", {
991
+ label: this.label
992
+ });
993
+ }
994
+ /**
995
+ * Sets the window visibility to true.
996
+ * @example
997
+ * ```typescript
998
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
999
+ * await getCurrentWindow().show();
1000
+ * ```
1001
+ *
1002
+ * @returns A promise indicating the success or failure of the operation.
1003
+ */
1004
+ async show() {
1005
+ return i("plugin:window|show", {
1006
+ label: this.label
1007
+ });
1008
+ }
1009
+ /**
1010
+ * Sets the window visibility to false.
1011
+ * @example
1012
+ * ```typescript
1013
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1014
+ * await getCurrentWindow().hide();
1015
+ * ```
1016
+ *
1017
+ * @returns A promise indicating the success or failure of the operation.
1018
+ */
1019
+ async hide() {
1020
+ return i("plugin:window|hide", {
1021
+ label: this.label
1022
+ });
1023
+ }
1024
+ /**
1025
+ * Closes the window.
1026
+ *
1027
+ * Note this emits a closeRequested event so you can intercept it. To force window close, use {@link Window.destroy}.
1028
+ * @example
1029
+ * ```typescript
1030
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1031
+ * await getCurrentWindow().close();
1032
+ * ```
1033
+ *
1034
+ * @returns A promise indicating the success or failure of the operation.
1035
+ */
1036
+ async close() {
1037
+ return i("plugin:window|close", {
1038
+ label: this.label
1039
+ });
1040
+ }
1041
+ /**
1042
+ * Destroys the window. Behaves like {@link Window.close} but forces the window close instead of emitting a closeRequested event.
1043
+ * @example
1044
+ * ```typescript
1045
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1046
+ * await getCurrentWindow().destroy();
1047
+ * ```
1048
+ *
1049
+ * @returns A promise indicating the success or failure of the operation.
1050
+ */
1051
+ async destroy() {
1052
+ return i("plugin:window|destroy", {
1053
+ label: this.label
1054
+ });
1055
+ }
1056
+ /**
1057
+ * Whether the window should have borders and bars.
1058
+ * @example
1059
+ * ```typescript
1060
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1061
+ * await getCurrentWindow().setDecorations(false);
1062
+ * ```
1063
+ *
1064
+ * @param decorations Whether the window should have borders and bars.
1065
+ * @returns A promise indicating the success or failure of the operation.
1066
+ */
1067
+ async setDecorations(e) {
1068
+ return i("plugin:window|set_decorations", {
1069
+ label: this.label,
1070
+ value: e
1071
+ });
1072
+ }
1073
+ /**
1074
+ * Whether or not the window should have shadow.
1075
+ *
1076
+ * #### Platform-specific
1077
+ *
1078
+ * - **Windows:**
1079
+ * - `false` has no effect on decorated window, shadows are always ON.
1080
+ * - `true` will make undecorated window have a 1px white border,
1081
+ * and on Windows 11, it will have a rounded corners.
1082
+ * - **Linux:** Unsupported.
1083
+ *
1084
+ * @example
1085
+ * ```typescript
1086
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1087
+ * await getCurrentWindow().setShadow(false);
1088
+ * ```
1089
+ *
1090
+ * @returns A promise indicating the success or failure of the operation.
1091
+ */
1092
+ async setShadow(e) {
1093
+ return i("plugin:window|set_shadow", {
1094
+ label: this.label,
1095
+ value: e
1096
+ });
1097
+ }
1098
+ /**
1099
+ * Set window effects.
1100
+ */
1101
+ async setEffects(e) {
1102
+ return i("plugin:window|set_effects", {
1103
+ label: this.label,
1104
+ value: e
1105
+ });
1106
+ }
1107
+ /**
1108
+ * Clear any applied effects if possible.
1109
+ */
1110
+ async clearEffects() {
1111
+ return i("plugin:window|set_effects", {
1112
+ label: this.label,
1113
+ value: null
1114
+ });
1115
+ }
1116
+ /**
1117
+ * Whether the window should always be on top of other windows.
1118
+ * @example
1119
+ * ```typescript
1120
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1121
+ * await getCurrentWindow().setAlwaysOnTop(true);
1122
+ * ```
1123
+ *
1124
+ * @param alwaysOnTop Whether the window should always be on top of other windows or not.
1125
+ * @returns A promise indicating the success or failure of the operation.
1126
+ */
1127
+ async setAlwaysOnTop(e) {
1128
+ return i("plugin:window|set_always_on_top", {
1129
+ label: this.label,
1130
+ value: e
1131
+ });
1132
+ }
1133
+ /**
1134
+ * Whether the window should always be below other windows.
1135
+ * @example
1136
+ * ```typescript
1137
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1138
+ * await getCurrentWindow().setAlwaysOnBottom(true);
1139
+ * ```
1140
+ *
1141
+ * @param alwaysOnBottom Whether the window should always be below other windows or not.
1142
+ * @returns A promise indicating the success or failure of the operation.
1143
+ */
1144
+ async setAlwaysOnBottom(e) {
1145
+ return i("plugin:window|set_always_on_bottom", {
1146
+ label: this.label,
1147
+ value: e
1148
+ });
1149
+ }
1150
+ /**
1151
+ * Prevents the window contents from being captured by other apps.
1152
+ * @example
1153
+ * ```typescript
1154
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1155
+ * await getCurrentWindow().setContentProtected(true);
1156
+ * ```
1157
+ *
1158
+ * @returns A promise indicating the success or failure of the operation.
1159
+ */
1160
+ async setContentProtected(e) {
1161
+ return i("plugin:window|set_content_protected", {
1162
+ label: this.label,
1163
+ value: e
1164
+ });
1165
+ }
1166
+ /**
1167
+ * Resizes the window with a new inner size.
1168
+ * @example
1169
+ * ```typescript
1170
+ * import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window';
1171
+ * await getCurrentWindow().setSize(new LogicalSize(600, 500));
1172
+ * ```
1173
+ *
1174
+ * @param size The logical or physical inner size.
1175
+ * @returns A promise indicating the success or failure of the operation.
1176
+ */
1177
+ async setSize(e) {
1178
+ return i("plugin:window|set_size", {
1179
+ label: this.label,
1180
+ value: e instanceof h ? e : new h(e)
1181
+ });
1182
+ }
1183
+ /**
1184
+ * Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset.
1185
+ * @example
1186
+ * ```typescript
1187
+ * import { getCurrentWindow, PhysicalSize } from '@tauri-apps/api/window';
1188
+ * await getCurrentWindow().setMinSize(new PhysicalSize(600, 500));
1189
+ * ```
1190
+ *
1191
+ * @param size The logical or physical inner size, or `null` to unset the constraint.
1192
+ * @returns A promise indicating the success or failure of the operation.
1193
+ */
1194
+ async setMinSize(e) {
1195
+ return i("plugin:window|set_min_size", {
1196
+ label: this.label,
1197
+ value: e instanceof h ? e : e ? new h(e) : null
1198
+ });
1199
+ }
1200
+ /**
1201
+ * Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset.
1202
+ * @example
1203
+ * ```typescript
1204
+ * import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window';
1205
+ * await getCurrentWindow().setMaxSize(new LogicalSize(600, 500));
1206
+ * ```
1207
+ *
1208
+ * @param size The logical or physical inner size, or `null` to unset the constraint.
1209
+ * @returns A promise indicating the success or failure of the operation.
1210
+ */
1211
+ async setMaxSize(e) {
1212
+ return i("plugin:window|set_max_size", {
1213
+ label: this.label,
1214
+ value: e instanceof h ? e : e ? new h(e) : null
1215
+ });
1216
+ }
1217
+ /**
1218
+ * Sets the window inner size constraints.
1219
+ * @example
1220
+ * ```typescript
1221
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1222
+ * await getCurrentWindow().setSizeConstraints({ minWidth: 300 });
1223
+ * ```
1224
+ *
1225
+ * @param constraints The logical or physical inner size, or `null` to unset the constraint.
1226
+ * @returns A promise indicating the success or failure of the operation.
1227
+ */
1228
+ async setSizeConstraints(e) {
1229
+ function n(l) {
1230
+ return l ? { Logical: l } : null;
1231
+ }
1232
+ return i("plugin:window|set_size_constraints", {
1233
+ label: this.label,
1234
+ value: {
1235
+ minWidth: n(e == null ? void 0 : e.minWidth),
1236
+ minHeight: n(e == null ? void 0 : e.minHeight),
1237
+ maxWidth: n(e == null ? void 0 : e.maxWidth),
1238
+ maxHeight: n(e == null ? void 0 : e.maxHeight)
1239
+ }
1240
+ });
1241
+ }
1242
+ /**
1243
+ * Sets the window outer position.
1244
+ * @example
1245
+ * ```typescript
1246
+ * import { getCurrentWindow, LogicalPosition } from '@tauri-apps/api/window';
1247
+ * await getCurrentWindow().setPosition(new LogicalPosition(600, 500));
1248
+ * ```
1249
+ *
1250
+ * @param position The new position, in logical or physical pixels.
1251
+ * @returns A promise indicating the success or failure of the operation.
1252
+ */
1253
+ async setPosition(e) {
1254
+ return i("plugin:window|set_position", {
1255
+ label: this.label,
1256
+ value: e instanceof w ? e : new w(e)
1257
+ });
1258
+ }
1259
+ /**
1260
+ * Sets the window fullscreen state.
1261
+ * @example
1262
+ * ```typescript
1263
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1264
+ * await getCurrentWindow().setFullscreen(true);
1265
+ * ```
1266
+ *
1267
+ * @param fullscreen Whether the window should go to fullscreen or not.
1268
+ * @returns A promise indicating the success or failure of the operation.
1269
+ */
1270
+ async setFullscreen(e) {
1271
+ return i("plugin:window|set_fullscreen", {
1272
+ label: this.label,
1273
+ value: e
1274
+ });
1275
+ }
1276
+ /**
1277
+ * On macOS, Toggles a fullscreen mode that doesn’t require a new macOS space. Returns a boolean indicating whether the transition was successful (this won’t work if the window was already in the native fullscreen).
1278
+ * This is how fullscreen used to work on macOS in versions before Lion. And allows the user to have a fullscreen window without using another space or taking control over the entire monitor.
1279
+ *
1280
+ * On other platforms, this is the same as {@link Window.setFullscreen}.
1281
+ *
1282
+ * @param fullscreen Whether the window should go to simple fullscreen or not.
1283
+ * @returns A promise indicating the success or failure of the operation.
1284
+ */
1285
+ async setSimpleFullscreen(e) {
1286
+ return i("plugin:window|set_simple_fullscreen", {
1287
+ label: this.label,
1288
+ value: e
1289
+ });
1290
+ }
1291
+ /**
1292
+ * Bring the window to front and focus.
1293
+ * @example
1294
+ * ```typescript
1295
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1296
+ * await getCurrentWindow().setFocus();
1297
+ * ```
1298
+ *
1299
+ * @returns A promise indicating the success or failure of the operation.
1300
+ */
1301
+ async setFocus() {
1302
+ return i("plugin:window|set_focus", {
1303
+ label: this.label
1304
+ });
1305
+ }
1306
+ /**
1307
+ * Sets whether the window can be focused.
1308
+ *
1309
+ * #### Platform-specific
1310
+ *
1311
+ * - **macOS**: If the window is already focused, it is not possible to unfocus it after calling `set_focusable(false)`.
1312
+ * In this case, you might consider calling {@link Window.setFocus} but it will move the window to the back i.e. at the bottom in terms of z-order.
1313
+ *
1314
+ * @example
1315
+ * ```typescript
1316
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1317
+ * await getCurrentWindow().setFocusable(true);
1318
+ * ```
1319
+ *
1320
+ * @param focusable Whether the window can be focused.
1321
+ * @returns A promise indicating the success or failure of the operation.
1322
+ */
1323
+ async setFocusable(e) {
1324
+ return i("plugin:window|set_focusable", {
1325
+ label: this.label,
1326
+ value: e
1327
+ });
1328
+ }
1329
+ /**
1330
+ * Sets the window icon.
1331
+ * @example
1332
+ * ```typescript
1333
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1334
+ * await getCurrentWindow().setIcon('/tauri/awesome.png');
1335
+ * ```
1336
+ *
1337
+ * Note that you may need the `image-ico` or `image-png` Cargo features to use this API.
1338
+ * To enable it, change your Cargo.toml file:
1339
+ * ```toml
1340
+ * [dependencies]
1341
+ * tauri = { version = "...", features = ["...", "image-png"] }
1342
+ * ```
1343
+ *
1344
+ * @param icon Icon bytes or path to the icon file.
1345
+ * @returns A promise indicating the success or failure of the operation.
1346
+ */
1347
+ async setIcon(e) {
1348
+ return i("plugin:window|set_icon", {
1349
+ label: this.label,
1350
+ value: b(e)
1351
+ });
1352
+ }
1353
+ /**
1354
+ * Whether the window icon should be hidden from the taskbar or not.
1355
+ *
1356
+ * #### Platform-specific
1357
+ *
1358
+ * - **macOS:** Unsupported.
1359
+ * @example
1360
+ * ```typescript
1361
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1362
+ * await getCurrentWindow().setSkipTaskbar(true);
1363
+ * ```
1364
+ *
1365
+ * @param skip true to hide window icon, false to show it.
1366
+ * @returns A promise indicating the success or failure of the operation.
1367
+ */
1368
+ async setSkipTaskbar(e) {
1369
+ return i("plugin:window|set_skip_taskbar", {
1370
+ label: this.label,
1371
+ value: e
1372
+ });
1373
+ }
1374
+ /**
1375
+ * Grabs the cursor, preventing it from leaving the window.
1376
+ *
1377
+ * There's no guarantee that the cursor will be hidden. You should
1378
+ * hide it by yourself if you want so.
1379
+ *
1380
+ * #### Platform-specific
1381
+ *
1382
+ * - **Linux:** Unsupported.
1383
+ * - **macOS:** This locks the cursor in a fixed location, which looks visually awkward.
1384
+ * @example
1385
+ * ```typescript
1386
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1387
+ * await getCurrentWindow().setCursorGrab(true);
1388
+ * ```
1389
+ *
1390
+ * @param grab `true` to grab the cursor icon, `false` to release it.
1391
+ * @returns A promise indicating the success or failure of the operation.
1392
+ */
1393
+ async setCursorGrab(e) {
1394
+ return i("plugin:window|set_cursor_grab", {
1395
+ label: this.label,
1396
+ value: e
1397
+ });
1398
+ }
1399
+ /**
1400
+ * Modifies the cursor's visibility.
1401
+ *
1402
+ * #### Platform-specific
1403
+ *
1404
+ * - **Windows:** The cursor is only hidden within the confines of the window.
1405
+ * - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is
1406
+ * outside of the window.
1407
+ * @example
1408
+ * ```typescript
1409
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1410
+ * await getCurrentWindow().setCursorVisible(false);
1411
+ * ```
1412
+ *
1413
+ * @param visible If `false`, this will hide the cursor. If `true`, this will show the cursor.
1414
+ * @returns A promise indicating the success or failure of the operation.
1415
+ */
1416
+ async setCursorVisible(e) {
1417
+ return i("plugin:window|set_cursor_visible", {
1418
+ label: this.label,
1419
+ value: e
1420
+ });
1421
+ }
1422
+ /**
1423
+ * Modifies the cursor icon of the window.
1424
+ * @example
1425
+ * ```typescript
1426
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1427
+ * await getCurrentWindow().setCursorIcon('help');
1428
+ * ```
1429
+ *
1430
+ * @param icon The new cursor icon.
1431
+ * @returns A promise indicating the success or failure of the operation.
1432
+ */
1433
+ async setCursorIcon(e) {
1434
+ return i("plugin:window|set_cursor_icon", {
1435
+ label: this.label,
1436
+ value: e
1437
+ });
1438
+ }
1439
+ /**
1440
+ * Sets the window background color.
1441
+ *
1442
+ * #### Platform-specific:
1443
+ *
1444
+ * - **Windows:** alpha channel is ignored.
1445
+ * - **iOS / Android:** Unsupported.
1446
+ *
1447
+ * @returns A promise indicating the success or failure of the operation.
1448
+ *
1449
+ * @since 2.1.0
1450
+ */
1451
+ async setBackgroundColor(e) {
1452
+ return i("plugin:window|set_background_color", { color: e });
1453
+ }
1454
+ /**
1455
+ * Changes the position of the cursor in window coordinates.
1456
+ * @example
1457
+ * ```typescript
1458
+ * import { getCurrentWindow, LogicalPosition } from '@tauri-apps/api/window';
1459
+ * await getCurrentWindow().setCursorPosition(new LogicalPosition(600, 300));
1460
+ * ```
1461
+ *
1462
+ * @param position The new cursor position.
1463
+ * @returns A promise indicating the success or failure of the operation.
1464
+ */
1465
+ async setCursorPosition(e) {
1466
+ return i("plugin:window|set_cursor_position", {
1467
+ label: this.label,
1468
+ value: e instanceof w ? e : new w(e)
1469
+ });
1470
+ }
1471
+ /**
1472
+ * Changes the cursor events behavior.
1473
+ *
1474
+ * @example
1475
+ * ```typescript
1476
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1477
+ * await getCurrentWindow().setIgnoreCursorEvents(true);
1478
+ * ```
1479
+ *
1480
+ * @param ignore `true` to ignore the cursor events; `false` to process them as usual.
1481
+ * @returns A promise indicating the success or failure of the operation.
1482
+ */
1483
+ async setIgnoreCursorEvents(e) {
1484
+ return i("plugin:window|set_ignore_cursor_events", {
1485
+ label: this.label,
1486
+ value: e
1487
+ });
1488
+ }
1489
+ /**
1490
+ * Starts dragging the window.
1491
+ * @example
1492
+ * ```typescript
1493
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1494
+ * await getCurrentWindow().startDragging();
1495
+ * ```
1496
+ *
1497
+ * @return A promise indicating the success or failure of the operation.
1498
+ */
1499
+ async startDragging() {
1500
+ return i("plugin:window|start_dragging", {
1501
+ label: this.label
1502
+ });
1503
+ }
1504
+ /**
1505
+ * Starts resize-dragging the window.
1506
+ * @example
1507
+ * ```typescript
1508
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1509
+ * await getCurrentWindow().startResizeDragging();
1510
+ * ```
1511
+ *
1512
+ * @return A promise indicating the success or failure of the operation.
1513
+ */
1514
+ async startResizeDragging(e) {
1515
+ return i("plugin:window|start_resize_dragging", {
1516
+ label: this.label,
1517
+ value: e
1518
+ });
1519
+ }
1520
+ /**
1521
+ * Sets the badge count. It is app wide and not specific to this window.
1522
+ *
1523
+ * #### Platform-specific
1524
+ *
1525
+ * - **Windows**: Unsupported. Use @{linkcode Window.setOverlayIcon} instead.
1526
+ *
1527
+ * @example
1528
+ * ```typescript
1529
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1530
+ * await getCurrentWindow().setBadgeCount(5);
1531
+ * ```
1532
+ *
1533
+ * @param count The badge count. Use `undefined` to remove the badge.
1534
+ * @return A promise indicating the success or failure of the operation.
1535
+ */
1536
+ async setBadgeCount(e) {
1537
+ return i("plugin:window|set_badge_count", {
1538
+ label: this.label,
1539
+ value: e
1540
+ });
1541
+ }
1542
+ /**
1543
+ * Sets the badge cont **macOS only**.
1544
+ *
1545
+ * @example
1546
+ * ```typescript
1547
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1548
+ * await getCurrentWindow().setBadgeLabel("Hello");
1549
+ * ```
1550
+ *
1551
+ * @param label The badge label. Use `undefined` to remove the badge.
1552
+ * @return A promise indicating the success or failure of the operation.
1553
+ */
1554
+ async setBadgeLabel(e) {
1555
+ return i("plugin:window|set_badge_label", {
1556
+ label: this.label,
1557
+ value: e
1558
+ });
1559
+ }
1560
+ /**
1561
+ * Sets the overlay icon. **Windows only**
1562
+ * The overlay icon can be set for every window.
1563
+ *
1564
+ *
1565
+ * Note that you may need the `image-ico` or `image-png` Cargo features to use this API.
1566
+ * To enable it, change your Cargo.toml file:
1567
+ *
1568
+ * ```toml
1569
+ * [dependencies]
1570
+ * tauri = { version = "...", features = ["...", "image-png"] }
1571
+ * ```
1572
+ *
1573
+ * @example
1574
+ * ```typescript
1575
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
1576
+ * await getCurrentWindow().setOverlayIcon("/tauri/awesome.png");
1577
+ * ```
1578
+ *
1579
+ * @param icon Icon bytes or path to the icon file. Use `undefined` to remove the overlay icon.
1580
+ * @return A promise indicating the success or failure of the operation.
1581
+ */
1582
+ async setOverlayIcon(e) {
1583
+ return i("plugin:window|set_overlay_icon", {
1584
+ label: this.label,
1585
+ value: e ? b(e) : void 0
1586
+ });
1587
+ }
1588
+ /**
1589
+ * Sets the taskbar progress state.
1590
+ *
1591
+ * #### Platform-specific
1592
+ *
1593
+ * - **Linux / macOS**: Progress bar is app-wide and not specific to this window.
1594
+ * - **Linux**: Only supported desktop environments with `libunity` (e.g. GNOME).
1595
+ *
1596
+ * @example
1597
+ * ```typescript
1598
+ * import { getCurrentWindow, ProgressBarStatus } from '@tauri-apps/api/window';
1599
+ * await getCurrentWindow().setProgressBar({
1600
+ * status: ProgressBarStatus.Normal,
1601
+ * progress: 50,
1602
+ * });
1603
+ * ```
1604
+ *
1605
+ * @return A promise indicating the success or failure of the operation.
1606
+ */
1607
+ async setProgressBar(e) {
1608
+ return i("plugin:window|set_progress_bar", {
1609
+ label: this.label,
1610
+ value: e
1611
+ });
1612
+ }
1613
+ /**
1614
+ * Sets whether the window should be visible on all workspaces or virtual desktops.
1615
+ *
1616
+ * #### Platform-specific
1617
+ *
1618
+ * - **Windows / iOS / Android:** Unsupported.
1619
+ *
1620
+ * @since 2.0.0
1621
+ */
1622
+ async setVisibleOnAllWorkspaces(e) {
1623
+ return i("plugin:window|set_visible_on_all_workspaces", {
1624
+ label: this.label,
1625
+ value: e
1626
+ });
1627
+ }
1628
+ /**
1629
+ * Sets the title bar style. **macOS only**.
1630
+ *
1631
+ * @since 2.0.0
1632
+ */
1633
+ async setTitleBarStyle(e) {
1634
+ return i("plugin:window|set_title_bar_style", {
1635
+ label: this.label,
1636
+ value: e
1637
+ });
1638
+ }
1639
+ /**
1640
+ * Set window theme, pass in `null` or `undefined` to follow system theme
1641
+ *
1642
+ * #### Platform-specific
1643
+ *
1644
+ * - **Linux / macOS**: Theme is app-wide and not specific to this window.
1645
+ * - **iOS / Android:** Unsupported.
1646
+ *
1647
+ * @since 2.0.0
1648
+ */
1649
+ async setTheme(e) {
1650
+ return i("plugin:window|set_theme", {
1651
+ label: this.label,
1652
+ value: e
1653
+ });
1654
+ }
1655
+ // Listeners
1656
+ /**
1657
+ * Listen to window resize.
1658
+ *
1659
+ * @example
1660
+ * ```typescript
1661
+ * import { getCurrentWindow } from "@tauri-apps/api/window";
1662
+ * const unlisten = await getCurrentWindow().onResized(({ payload: size }) => {
1663
+ * console.log('Window resized', size);
1664
+ * });
1665
+ *
1666
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
1667
+ * unlisten();
1668
+ * ```
1669
+ *
1670
+ * @returns A promise resolving to a function to unlisten to the event.
1671
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
1672
+ */
1673
+ async onResized(e) {
1674
+ return this.listen(o.WINDOW_RESIZED, (n) => {
1675
+ n.payload = new c(n.payload), e(n);
1676
+ });
1677
+ }
1678
+ /**
1679
+ * Listen to window move.
1680
+ *
1681
+ * @example
1682
+ * ```typescript
1683
+ * import { getCurrentWindow } from "@tauri-apps/api/window";
1684
+ * const unlisten = await getCurrentWindow().onMoved(({ payload: position }) => {
1685
+ * console.log('Window moved', position);
1686
+ * });
1687
+ *
1688
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
1689
+ * unlisten();
1690
+ * ```
1691
+ *
1692
+ * @returns A promise resolving to a function to unlisten to the event.
1693
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
1694
+ */
1695
+ async onMoved(e) {
1696
+ return this.listen(o.WINDOW_MOVED, (n) => {
1697
+ n.payload = new u(n.payload), e(n);
1698
+ });
1699
+ }
1700
+ /**
1701
+ * Listen to window close requested. Emitted when the user requests to closes the window.
1702
+ *
1703
+ * @example
1704
+ * ```typescript
1705
+ * import { getCurrentWindow } from "@tauri-apps/api/window";
1706
+ * import { confirm } from '@tauri-apps/api/dialog';
1707
+ * const unlisten = await getCurrentWindow().onCloseRequested(async (event) => {
1708
+ * const confirmed = await confirm('Are you sure?');
1709
+ * if (!confirmed) {
1710
+ * // user did not confirm closing the window; let's prevent it
1711
+ * event.preventDefault();
1712
+ * }
1713
+ * });
1714
+ *
1715
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
1716
+ * unlisten();
1717
+ * ```
1718
+ *
1719
+ * @returns A promise resolving to a function to unlisten to the event.
1720
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
1721
+ */
1722
+ async onCloseRequested(e) {
1723
+ return this.listen(o.WINDOW_CLOSE_REQUESTED, async (n) => {
1724
+ const l = new I(n);
1725
+ await e(l), l.isPreventDefault() || await this.destroy();
1726
+ });
1727
+ }
1728
+ /**
1729
+ * Listen to a file drop event.
1730
+ * The listener is triggered when the user hovers the selected files on the webview,
1731
+ * drops the files or cancels the operation.
1732
+ *
1733
+ * @example
1734
+ * ```typescript
1735
+ * import { getCurrentWindow } from "@tauri-apps/api/webview";
1736
+ * const unlisten = await getCurrentWindow().onDragDropEvent((event) => {
1737
+ * if (event.payload.type === 'over') {
1738
+ * console.log('User hovering', event.payload.position);
1739
+ * } else if (event.payload.type === 'drop') {
1740
+ * console.log('User dropped', event.payload.paths);
1741
+ * } else {
1742
+ * console.log('File drop cancelled');
1743
+ * }
1744
+ * });
1745
+ *
1746
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
1747
+ * unlisten();
1748
+ * ```
1749
+ *
1750
+ * @returns A promise resolving to a function to unlisten to the event.
1751
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
1752
+ */
1753
+ async onDragDropEvent(e) {
1754
+ const n = await this.listen(o.DRAG_ENTER, (s) => {
1755
+ e({
1756
+ ...s,
1757
+ payload: {
1758
+ type: "enter",
1759
+ paths: s.payload.paths,
1760
+ position: new u(s.payload.position)
1761
+ }
1762
+ });
1763
+ }), l = await this.listen(o.DRAG_OVER, (s) => {
1764
+ e({
1765
+ ...s,
1766
+ payload: {
1767
+ type: "over",
1768
+ position: new u(s.payload.position)
1769
+ }
1770
+ });
1771
+ }), r = await this.listen(o.DRAG_DROP, (s) => {
1772
+ e({
1773
+ ...s,
1774
+ payload: {
1775
+ type: "drop",
1776
+ paths: s.payload.paths,
1777
+ position: new u(s.payload.position)
1778
+ }
1779
+ });
1780
+ }), C = await this.listen(o.DRAG_LEAVE, (s) => {
1781
+ e({ ...s, payload: { type: "leave" } });
1782
+ });
1783
+ return () => {
1784
+ n(), r(), l(), C();
1785
+ };
1786
+ }
1787
+ /**
1788
+ * Listen to window focus change.
1789
+ *
1790
+ * @example
1791
+ * ```typescript
1792
+ * import { getCurrentWindow } from "@tauri-apps/api/window";
1793
+ * const unlisten = await getCurrentWindow().onFocusChanged(({ payload: focused }) => {
1794
+ * console.log('Focus changed, window is focused? ' + focused);
1795
+ * });
1796
+ *
1797
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
1798
+ * unlisten();
1799
+ * ```
1800
+ *
1801
+ * @returns A promise resolving to a function to unlisten to the event.
1802
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
1803
+ */
1804
+ async onFocusChanged(e) {
1805
+ const n = await this.listen(o.WINDOW_FOCUS, (r) => {
1806
+ e({ ...r, payload: !0 });
1807
+ }), l = await this.listen(o.WINDOW_BLUR, (r) => {
1808
+ e({ ...r, payload: !1 });
1809
+ });
1810
+ return () => {
1811
+ n(), l();
1812
+ };
1813
+ }
1814
+ /**
1815
+ * Listen to window scale change. Emitted when the window's scale factor has changed.
1816
+ * The following user actions can cause DPI changes:
1817
+ * - Changing the display's resolution.
1818
+ * - Changing the display's scale factor (e.g. in Control Panel on Windows).
1819
+ * - Moving the window to a display with a different scale factor.
1820
+ *
1821
+ * @example
1822
+ * ```typescript
1823
+ * import { getCurrentWindow } from "@tauri-apps/api/window";
1824
+ * const unlisten = await getCurrentWindow().onScaleChanged(({ payload }) => {
1825
+ * console.log('Scale changed', payload.scaleFactor, payload.size);
1826
+ * });
1827
+ *
1828
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
1829
+ * unlisten();
1830
+ * ```
1831
+ *
1832
+ * @returns A promise resolving to a function to unlisten to the event.
1833
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
1834
+ */
1835
+ async onScaleChanged(e) {
1836
+ return this.listen(o.WINDOW_SCALE_FACTOR_CHANGED, e);
1837
+ }
1838
+ /**
1839
+ * Listen to the system theme change.
1840
+ *
1841
+ * @example
1842
+ * ```typescript
1843
+ * import { getCurrentWindow } from "@tauri-apps/api/window";
1844
+ * const unlisten = await getCurrentWindow().onThemeChanged(({ payload: theme }) => {
1845
+ * console.log('New theme: ' + theme);
1846
+ * });
1847
+ *
1848
+ * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
1849
+ * unlisten();
1850
+ * ```
1851
+ *
1852
+ * @returns A promise resolving to a function to unlisten to the event.
1853
+ * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.
1854
+ */
1855
+ async onThemeChanged(e) {
1856
+ return this.listen(o.WINDOW_THEME_CHANGED, e);
1857
+ }
1858
+ }
1859
+ var m;
1860
+ (function(t) {
1861
+ t.Disabled = "disabled", t.Throttle = "throttle", t.Suspend = "suspend";
1862
+ })(m || (m = {}));
1863
+ var v;
1864
+ (function(t) {
1865
+ t.Default = "default", t.FluentOverlay = "fluentOverlay";
1866
+ })(v || (v = {}));
1867
+ var z;
1868
+ (function(t) {
1869
+ t.AppearanceBased = "appearanceBased", t.Light = "light", t.Dark = "dark", t.MediumLight = "mediumLight", t.UltraDark = "ultraDark", t.Titlebar = "titlebar", t.Selection = "selection", t.Menu = "menu", t.Popover = "popover", t.Sidebar = "sidebar", t.HeaderView = "headerView", t.Sheet = "sheet", t.WindowBackground = "windowBackground", t.HudWindow = "hudWindow", t.FullScreenUI = "fullScreenUI", t.Tooltip = "tooltip", t.ContentBackground = "contentBackground", t.UnderWindowBackground = "underWindowBackground", t.UnderPageBackground = "underPageBackground", t.Mica = "mica", t.Blur = "blur", t.Acrylic = "acrylic", t.Tabbed = "tabbed", t.TabbedDark = "tabbedDark", t.TabbedLight = "tabbedLight";
1870
+ })(z || (z = {}));
1871
+ var f;
1872
+ (function(t) {
1873
+ t.FollowsWindowActiveState = "followsWindowActiveState", t.Active = "active", t.Inactive = "inactive";
1874
+ })(f || (f = {}));
1875
+ export {
1876
+ I as CloseRequestedEvent,
1877
+ z as Effect,
1878
+ f as EffectState,
1879
+ D as LogicalPosition,
1880
+ x as LogicalSize,
1881
+ u as PhysicalPosition,
1882
+ c as PhysicalSize,
1883
+ _ as ProgressBarStatus,
1884
+ g as UserAttentionType,
1885
+ W as Window,
1886
+ y as getAllWindows,
1887
+ T as getCurrentWindow
1888
+ };
1889
+ //# sourceMappingURL=window-ZR8_mM8o.js.map