webview-napi 0.1.5

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/index.d.ts ADDED
@@ -0,0 +1,1596 @@
1
+ /* auto-generated by NAPI-RS */
2
+ /* eslint-disable */
3
+ export declare class Application {
4
+ constructor(options?: ApplicationOptions | undefined | null)
5
+ onEvent(handler?: (((err: Error | null, arg: ApplicationEvent) => any)) | undefined | null): void
6
+ bind(handler?: (((err: Error | null, arg: ApplicationEvent) => any)) | undefined | null): void
7
+ createBrowserWindow(options?: BrowserWindowOptions | undefined | null): BrowserWindow
8
+ exit(): void
9
+ run(): void
10
+ runIteration(): boolean
11
+ }
12
+
13
+ export declare class BrowserWindow {
14
+ get id(): string
15
+ createWebview(options?: WebviewOptions | undefined | null): Webview
16
+ get isChild(): boolean
17
+ isFocused(): boolean
18
+ isVisible(): boolean
19
+ isDecorated(): boolean
20
+ isMinimizable(): boolean
21
+ isMaximized(): boolean
22
+ isMinimized(): boolean
23
+ isResizable(): boolean
24
+ setClosable(closable: boolean): void
25
+ setMaximizable(maximizable: boolean): void
26
+ setMinimizable(minimizable: boolean): void
27
+ setTitle(title: string): void
28
+ get title(): string
29
+ get theme(): Theme
30
+ set theme(theme: Theme)
31
+ setWindowIcon(icon: Buffer | string, width: number, height: number): void
32
+ removeWindowIcon(): void
33
+ setVisible(visible: boolean): void
34
+ setProgressBar(state: ProgressBarState): void
35
+ setMaximized(value: boolean): void
36
+ setMinimized(value: boolean): void
37
+ focus(): void
38
+ getAvailableMonitors(): Array<Monitor>
39
+ getPrimaryMonitor(): Monitor | null
40
+ setContentProtection(enabled: boolean): void
41
+ setAlwaysOnTop(enabled: boolean): void
42
+ setAlwaysOnBottom(enabled: boolean): void
43
+ setDecorations(enabled: boolean): void
44
+ get fullscreen(): FullscreenType | null
45
+ show(): void
46
+ }
47
+
48
+ /** Event loop for handling window events. */
49
+ export declare class EventLoop {
50
+ /** Creates a new event loop. */
51
+ constructor()
52
+ /** Runs the event loop. */
53
+ run(): void
54
+ /** Runs a single iteration of the event loop. */
55
+ runIteration(): boolean
56
+ /** Creates an event loop proxy. */
57
+ createProxy(): EventLoopProxy
58
+ }
59
+
60
+ /** Builder for creating event loops. */
61
+ export declare class EventLoopBuilder {
62
+ /** Creates a new event loop builder. */
63
+ constructor()
64
+ /**
65
+ * Forces X11 backend on Linux.
66
+ * This must be called before build() to take effect.
67
+ */
68
+ withForceX11(force: boolean): this
69
+ /**
70
+ * Forces Wayland backend on Linux.
71
+ * This must be called before build() to take effect.
72
+ */
73
+ withForceWayland(force: boolean): this
74
+ /** Builds the event loop. */
75
+ build(): EventLoop
76
+ }
77
+
78
+ /** Proxy for sending events to an event loop. */
79
+ export declare class EventLoopProxy {
80
+ /** Sends an event to the event loop. */
81
+ sendEvent(): void
82
+ /** Wakes up the event loop. */
83
+ wakeUp(): void
84
+ }
85
+
86
+ /** Target for event loop operations. */
87
+ export declare class EventLoopWindowTarget {
88
+
89
+ }
90
+
91
+ /** Simple pixel renderer for Tao windows */
92
+ export declare class PixelRenderer {
93
+ /** Creates a new pixel renderer with the given buffer dimensions */
94
+ constructor(bufferWidth: number, bufferHeight: number)
95
+ /** Creates a new pixel renderer with options */
96
+ static withOptions(options: RenderOptions): PixelRenderer
97
+ /** Sets the scaling mode */
98
+ setScaleMode(mode: ScaleMode): void
99
+ /** Sets the background color */
100
+ setBackgroundColor(r: number, g: number, b: number, a: number): void
101
+ /**
102
+ * Renders a pixel buffer to the given window
103
+ *
104
+ * # Arguments
105
+ * * `window` - The Tao window to render to
106
+ * * `buffer` - RGBA pixel buffer (must be buffer_width * buffer_height * 4 bytes)
107
+ */
108
+ render(window: Window, buffer: Buffer): void
109
+ }
110
+
111
+ /** The web context for a webview. */
112
+ export declare class WebContext {
113
+ /** Creates a new web context with the given data directory. */
114
+ constructor(dataDirectory?: string | undefined | null)
115
+ /** Gets the data directory for this web context. */
116
+ dataDirectory(): string | null
117
+ }
118
+
119
+ export declare class Webview {
120
+ get id(): string
121
+ get label(): string
122
+ onIpcMessage(handler?: IpcHandler | undefined | null): void
123
+ on(handler: IpcHandler): void
124
+ send(message: string): void
125
+ loadUrl(url: string): void
126
+ loadHtml(html: string): void
127
+ evaluateScript(js: string): void
128
+ openDevtools(): void
129
+ closeDevtools(): void
130
+ isDevtoolsOpen(): boolean
131
+ reload(): void
132
+ print(): void
133
+ }
134
+
135
+ /** The main webview struct. */
136
+ export declare class WebView {
137
+ /** Gets the native ID of the webview. */
138
+ get id(): string
139
+ /** Gets the label of the webview. */
140
+ get label(): string
141
+ /** Evaluates JavaScript code in the webview. */
142
+ evaluateScript(js: string): void
143
+ /** Opens the developer tools. */
144
+ openDevtools(): void
145
+ /** Closes the developer tools. */
146
+ closeDevtools(): void
147
+ /** Checks if the developer tools are open. */
148
+ isDevtoolsOpen(): boolean
149
+ /** Reloads the current page. */
150
+ reload(): void
151
+ /** Prints the current page. */
152
+ print(): void
153
+ /** Loads a new URL in the webview. */
154
+ loadUrl(url: string): void
155
+ /** Loads HTML content in the webview. */
156
+ loadHtml(html: string): void
157
+ /** Registers a callback for IPC messages. */
158
+ on(callback: (error: Error | null, message: string) => void): void
159
+ /**
160
+ * Sends a message to the webview.
161
+ * This calls window.__webview_on_message__(message) in JavaScript.
162
+ */
163
+ send(message: string): void
164
+ /** Gets the GTK widget for the webview (Unix only). */
165
+ gtkWidget(): bigint
166
+ }
167
+
168
+ /** Builder for creating webviews. */
169
+ export declare class WebViewBuilder {
170
+ /** Creates a new webview builder. */
171
+ constructor()
172
+ /** Sets the URL to load. */
173
+ withUrl(url: string): this
174
+ /** Sets the HTML content to load. */
175
+ withHtml(html: string): this
176
+ /** Sets the width of the webview. */
177
+ withWidth(width: number): this
178
+ /** Sets the height of the webview. */
179
+ withHeight(height: number): this
180
+ /** Sets the X coordinate of the webview. */
181
+ withX(x: number): this
182
+ /** Sets the Y coordinate of the webview. */
183
+ withY(y: number): this
184
+ /** Sets whether the webview is resizable. */
185
+ withResizable(resizable: boolean): this
186
+ /** Sets the title of the webview. */
187
+ withTitle(title: string): this
188
+ /** Sets whether the webview has a menubar. */
189
+ withMenubar(menubar: boolean): this
190
+ /** Sets whether the webview is maximized. */
191
+ withMaximized(maximized: boolean): this
192
+ /** Sets whether the webview is minimized. */
193
+ withMinimized(minimized: boolean): this
194
+ /** Sets whether the webview is visible. */
195
+ withVisible(visible: boolean): this
196
+ /** Sets whether the webview has decorations. */
197
+ withDecorated(decorations: boolean): this
198
+ /** Sets whether the webview is always on top. */
199
+ withAlwaysOnTop(alwaysOnTop: boolean): this
200
+ /** Sets whether the webview is transparent. */
201
+ withTransparent(transparent: boolean): this
202
+ /** Sets whether the webview has focus. */
203
+ withFocused(focused: boolean): this
204
+ /** Sets the icon of the webview. */
205
+ withIcon(icon: Buffer): this
206
+ /** Sets the theme of the webview. */
207
+ withTheme(theme: WryTheme): this
208
+ /** Sets the user agent of the webview. */
209
+ withUserAgent(userAgent: string): this
210
+ /** Adds an initialization script to run when creating the webview. */
211
+ withInitializationScript(script: InitializationScript): this
212
+ /** Sets whether to enable drag drop. */
213
+ withDragDrop(dragDrop: boolean): this
214
+ /** Sets the background color of the webview. */
215
+ withBackgroundColor(color: Buffer): this
216
+ /** Sets whether to enable devtools. */
217
+ withDevtools(devtools: boolean): this
218
+ /** Sets whether to enable incognito mode. */
219
+ withIncognito(incognito: boolean): this
220
+ /** Sets whether to enable zoom hotkeys. */
221
+ withHotkeysZoom(hotkeysZoom: boolean): this
222
+ /** Sets whether to enable clipboard access. */
223
+ withClipboard(clipboard: boolean): this
224
+ /** Sets whether to enable autoplay. */
225
+ withAutoplay(autoplay: boolean): this
226
+ /** Sets whether to enable back/forward navigation gestures. */
227
+ withBackForwardNavigationGestures(backForwardNavigationGestures: boolean): this
228
+ /** Sets the IPC handler for the webview. */
229
+ withIpcHandler(callback: (error: Error | null, message: string) => void): this
230
+ /** Adds multiple IPC handlers for the webview. */
231
+ withIpcHandlers(handlers: Array<IpcHandler>): this
232
+ /** Builds the webview on an existing window. */
233
+ buildOnWindow(window: Window, label: string, ipcListenersOverride?: Array<IpcHandler> | undefined | null): WebView
234
+ /** Builds the webview. */
235
+ build(eventLoop: EventLoop, label: string, ipcListenersOverride?: Array<IpcHandler> | undefined | null): WebView
236
+ }
237
+
238
+ /** Window for displaying content. */
239
+ export declare class Window {
240
+ /** Creates a new window with default attributes. */
241
+ constructor()
242
+ /** Gets the window ID. */
243
+ get id(): bigint
244
+ /** Gets the window title. */
245
+ title(): string
246
+ /** Sets the window title. */
247
+ setTitle(title: string): void
248
+ /** Gets whether the window is visible. */
249
+ isVisible(): boolean
250
+ /** Sets whether the window is visible. */
251
+ setVisible(visible: boolean): void
252
+ /** Gets whether the window is resizable. */
253
+ isResizable(): boolean
254
+ /** Sets whether the window is resizable. */
255
+ setResizable(resizable: boolean): void
256
+ /** Gets whether the window is decorated. */
257
+ isDecorated(): boolean
258
+ /** Sets whether the window is decorated. */
259
+ setDecorated(decorated: boolean): void
260
+ /** Gets the window position. */
261
+ outerPosition(): Position
262
+ /** Sets the window position. */
263
+ setOuterPosition(x: number, y: number): void
264
+ /** Gets the window size. */
265
+ innerSize(): Size
266
+ /** Sets the window size. */
267
+ setInnerSize(width: number, height: number): void
268
+ /** Gets whether the window is maximized. */
269
+ isMaximized(): boolean
270
+ /** Sets whether the window is maximized. */
271
+ setMaximized(maximized: boolean): void
272
+ /** Gets whether the window is minimized. */
273
+ isMinimized(): boolean
274
+ /** Sets whether the window is minimized. */
275
+ setMinimized(minimized: boolean): void
276
+ /** Gets whether the window is always on top. */
277
+ isAlwaysOnTop(): boolean
278
+ /** Sets whether the window is always on top. */
279
+ setAlwaysOnTop(alwaysOnTop: boolean): void
280
+ /** Gets whether the window is focused. */
281
+ isFocused(): boolean
282
+ /** Requests the window to be focused. */
283
+ requestFocus(): void
284
+ /** Gets the current cursor icon. */
285
+ cursorIcon(): CursorIcon
286
+ /** Sets the cursor icon. */
287
+ setCursorIcon(cursor: CursorIcon): void
288
+ /** Sets the cursor position. */
289
+ setCursorPosition(x: number, y: number): void
290
+ /** Gets the cursor position. */
291
+ cursorPosition(): Position
292
+ /** Drags the window. */
293
+ dragWindow(): boolean
294
+ /** Sets the window theme. */
295
+ setTheme(theme: TaoTheme): void
296
+ /** Gets the window theme. */
297
+ theme(): TaoTheme | null
298
+ /** Sets the window icon. */
299
+ setWindowIcon(width: number, height: number, rgba: Buffer): void
300
+ /** Sets whether to ignore cursor events. */
301
+ setIgnoreCursorEvents(ignore: boolean): void
302
+ /** Requests a redrawing of the window. */
303
+ requestRedraw(): void
304
+ /** Closes the window. */
305
+ close(): void
306
+ }
307
+
308
+ /** Builder for creating windows. */
309
+ export declare class WindowBuilder {
310
+ /** Creates a new window builder. */
311
+ constructor()
312
+ /** Sets the window title. */
313
+ withTitle(title: string): this
314
+ /** Sets the window size. */
315
+ withInnerSize(width: number, height: number): this
316
+ /** Sets the window position. */
317
+ withPosition(x: number, y: number): this
318
+ /** Sets whether the window is resizable. */
319
+ withResizable(resizable: boolean): this
320
+ /** Sets whether the window has decorations. */
321
+ withDecorated(decorated: boolean): this
322
+ /** Sets whether the window is always on top. */
323
+ withAlwaysOnTop(alwaysOnTop: boolean): this
324
+ /** Sets whether the window is visible. */
325
+ withVisible(visible: boolean): this
326
+ /** Sets whether the window is transparent. */
327
+ withTransparent(transparent: boolean): this
328
+ /** Sets whether the window is maximized. */
329
+ withMaximized(maximized: boolean): this
330
+ /** Sets whether the window is focused. */
331
+ withFocused(focused: boolean): this
332
+ /** Sets whether the window has a menubar. */
333
+ withMenubar(menubar: boolean): this
334
+ /** Sets the window icon. */
335
+ withWindowIcon(icon: Buffer): this
336
+ /** Sets the window theme. */
337
+ withTheme(theme: TaoTheme): this
338
+ /** Forces X11 backend on Linux. */
339
+ withForceX11(force: boolean): this
340
+ /** Forces Wayland backend on Linux. */
341
+ withForceWayland(force: boolean): this
342
+ /** Builds the window. */
343
+ build(eventLoop: EventLoop): Window
344
+ }
345
+
346
+ export interface ApplicationEvent {
347
+ event: WebviewApplicationEvent
348
+ }
349
+
350
+ export interface ApplicationOptions {
351
+ controlFlow?: ControlFlow
352
+ waitTime?: number
353
+ exitCode?: number
354
+ }
355
+
356
+ /** Returns a list of all available monitors. */
357
+ export declare function availableMonitors(): Array<MonitorInfo>
358
+
359
+ /** Background throttling policy for webviews. */
360
+ export declare const enum BackgroundThrottlingPolicy {
361
+ /** Throttling is suspended when the page is in the background. */
362
+ Suspend = 0,
363
+ /** Throttling is not suspended when the page is in the background. */
364
+ Unsuspend = 1,
365
+ /** Throttling is suspended when the page is in the background and the webview is not visible. */
366
+ UnsuspendWhenFirstVisible = 2
367
+ }
368
+
369
+ /** Bad icon error. */
370
+ export declare const enum BadIcon {
371
+ /** No icon data provided. */
372
+ NoData = 0,
373
+ /** Icon data is too large. */
374
+ TooLarge = 1,
375
+ /** Icon format is invalid. */
376
+ Format = 2
377
+ }
378
+
379
+ export interface BrowserWindowOptions {
380
+ resizable?: boolean
381
+ title?: string
382
+ width?: number
383
+ height?: number
384
+ x?: number
385
+ y?: number
386
+ contentProtection?: boolean
387
+ alwaysOnTop?: boolean
388
+ alwaysOnBottom?: boolean
389
+ visible?: boolean
390
+ decorations?: boolean
391
+ visibleOnAllWorkspaces?: boolean
392
+ maximized?: boolean
393
+ maximizable?: boolean
394
+ minimizable?: boolean
395
+ focused?: boolean
396
+ transparent?: boolean
397
+ fullscreen?: FullscreenType
398
+ }
399
+
400
+ export declare const enum ControlFlow {
401
+ Poll = 0,
402
+ WaitUntil = 1,
403
+ Exit = 2,
404
+ ExitWithCode = 3
405
+ }
406
+
407
+ /** Cursor icon change details. */
408
+ export interface CursorChangeDetails {
409
+ /** The new cursor icon. */
410
+ newCursor: CursorIcon
411
+ }
412
+
413
+ /** Cursor icon. */
414
+ export declare const enum CursorIcon {
415
+ Default = 0,
416
+ Crosshair = 1,
417
+ Hand = 2,
418
+ Arrow = 3,
419
+ Move = 4,
420
+ Text = 5,
421
+ Wait = 6,
422
+ Help = 7,
423
+ Progress = 8,
424
+ NotAllowed = 9,
425
+ EastResize = 10,
426
+ NorthResize = 11,
427
+ NortheastResize = 12,
428
+ NorthwestResize = 13,
429
+ SouthResize = 14,
430
+ SoutheastResize = 15,
431
+ SouthwestResize = 16,
432
+ WestResize = 17,
433
+ NorthSouthResize = 18,
434
+ EastWestResize = 19,
435
+ NortheastSouthwestResize = 20,
436
+ NorthwestSoutheastResize = 21,
437
+ ColumnResize = 22,
438
+ RowResize = 23,
439
+ AllScroll = 24,
440
+ ZoomIn = 25,
441
+ ZoomOut = 26
442
+ }
443
+
444
+ /** Cursor position. */
445
+ export interface CursorPosition {
446
+ /** The X coordinate. */
447
+ x: number
448
+ /** The Y coordinate. */
449
+ y: number
450
+ }
451
+
452
+ /** Device event type. */
453
+ export type DeviceEvent =
454
+ | { type: 'MouseMotion', deltaX: number, deltaY: number }
455
+ | { type: 'MouseButton', button: number, state: MouseButtonState }
456
+ | { type: 'Key', keyCode: number, state: MouseButtonState }
457
+
458
+ /** Device event filter. */
459
+ export declare const enum DeviceEventFilter {
460
+ Allow = 0,
461
+ AllowRepeated = 1,
462
+ Ignore = 2
463
+ }
464
+
465
+ export interface Dimensions {
466
+ width: number
467
+ height: number
468
+ }
469
+
470
+ /** Drag drop event. */
471
+ export declare const enum DragDropEvent {
472
+ /** The drag has entered the webview area. */
473
+ Entered = 0,
474
+ /** The drag is hovering over the webview area. */
475
+ Hovered = 1,
476
+ /** The drag has left the webview area. */
477
+ Left = 2,
478
+ /** The drag has been dropped on the webview. */
479
+ Dropped = 3
480
+ }
481
+
482
+ /** Element state for input devices. */
483
+ export declare const enum ElementState {
484
+ Pressed = 0,
485
+ Released = 1
486
+ }
487
+
488
+ /** Error type for webview operations. */
489
+ export declare const enum Error {
490
+ /** The webview was not initialized. */
491
+ Uninitialized = 0,
492
+ /** The webview has already been destroyed. */
493
+ AlreadyDestroyed = 1,
494
+ /** The script call failed. */
495
+ ScriptCallFailed = 2,
496
+ /** An IPC error occurred. */
497
+ Ipc = 3,
498
+ /** The webview is invalid. */
499
+ InvalidWebview = 4,
500
+ /** The URL is invalid. */
501
+ InvalidUrl = 5,
502
+ /** The operation is not supported on this platform. */
503
+ Unsupported = 6,
504
+ /** The icon is invalid. */
505
+ InvalidIcon = 7
506
+ }
507
+
508
+ /** External error type. */
509
+ export type ExternalError =
510
+ | { type: 'NotSupported' }
511
+ | { type: 'Os', field0: string }
512
+
513
+ /** Force touch/pen pressure. */
514
+ export type Force =
515
+ | { type: 'Calibrated', force: number, stage: number }
516
+ | { type: 'Normalized', field0: number }
517
+
518
+ /** Fullscreen mode. */
519
+ export type Fullscreen =
520
+ | { type: 'Exclusive', field0: MonitorInfo }
521
+ | { type: 'Borderless', field0?: MonitorInfo }
522
+
523
+ export declare const enum FullscreenType {
524
+ Exclusive = 0,
525
+ Borderless = 1
526
+ }
527
+
528
+ /** Gesture event data. */
529
+ export interface GestureEvent {
530
+ /** The gesture type. */
531
+ gestureType: string
532
+ /** The position of gesture. */
533
+ position: Position
534
+ /** The amount of gesture. */
535
+ amount: number
536
+ }
537
+
538
+ export declare function getWebviewVersion(): string
539
+
540
+ export interface HeaderData {
541
+ key: string
542
+ value?: string
543
+ }
544
+
545
+ /** HiDPI scaling information. */
546
+ export interface HiDpiScaling {
547
+ /** The scale factor. */
548
+ scaleFactor: number
549
+ /** The position in pixels. */
550
+ positionInPixels: Position
551
+ }
552
+
553
+ /** Icon data. */
554
+ export interface Icon {
555
+ /** The width of icon. */
556
+ width: number
557
+ /** The height of icon. */
558
+ height: number
559
+ /** The RGBA pixel data. */
560
+ rgba: Buffer
561
+ }
562
+
563
+ /** Ime state. */
564
+ export declare const enum ImeState {
565
+ /** IME is disabled. */
566
+ Disabled = 0,
567
+ /** IME is enabled. */
568
+ Enabled = 1
569
+ }
570
+
571
+ /** An initialization script to be run when creating a webview. */
572
+ export interface InitializationScript {
573
+ /** The JavaScript code to run. */
574
+ js: string
575
+ /** Whether to run the script only once. */
576
+ once: boolean
577
+ }
578
+
579
+ export type IpcHandler =
580
+ ((err: Error | null, arg: string) => any)
581
+
582
+ export interface IpcMessage {
583
+ body: Buffer
584
+ method: string
585
+ headers: Array<HeaderData>
586
+ uri: string
587
+ }
588
+
589
+ /** Keyboard key. */
590
+ export declare const enum Key {
591
+ /** The '1' key. */
592
+ Key1 = 0,
593
+ /** The '2' key. */
594
+ Key2 = 1,
595
+ /** The '3' key. */
596
+ Key3 = 2,
597
+ /** The '4' key. */
598
+ Key4 = 3,
599
+ /** The '5' key. */
600
+ Key5 = 4,
601
+ /** The '6' key. */
602
+ Key6 = 5,
603
+ /** The '7' key. */
604
+ Key7 = 6,
605
+ /** The '8' key. */
606
+ Key8 = 7,
607
+ /** The '9' key. */
608
+ Key9 = 8,
609
+ /** The '0' key. */
610
+ Key0 = 9,
611
+ /** The 'A' key. */
612
+ KeyA = 10,
613
+ /** The 'B' key. */
614
+ KeyB = 11,
615
+ /** The 'C' key. */
616
+ KeyC = 12,
617
+ /** The 'D' key. */
618
+ KeyD = 13,
619
+ /** The 'E' key. */
620
+ KeyE = 14,
621
+ /** The 'F' key. */
622
+ KeyF = 15,
623
+ /** The 'G' key. */
624
+ KeyG = 16,
625
+ /** The 'H' key. */
626
+ KeyH = 17,
627
+ /** The 'I' key. */
628
+ KeyI = 18,
629
+ /** The 'J' key. */
630
+ KeyJ = 19,
631
+ /** The 'K' key. */
632
+ KeyK = 20,
633
+ /** The 'L' key. */
634
+ KeyL = 21,
635
+ /** The 'M' key. */
636
+ KeyM = 22,
637
+ /** The 'N' key. */
638
+ KeyN = 23,
639
+ /** The 'O' key. */
640
+ KeyO = 24,
641
+ /** The 'P' key. */
642
+ KeyP = 25,
643
+ /** The 'Q' key. */
644
+ KeyQ = 26,
645
+ /** The 'R' key. */
646
+ KeyR = 27,
647
+ /** The 'S' key. */
648
+ KeyS = 28,
649
+ /** The 'T' key. */
650
+ KeyT = 29,
651
+ /** The 'U' key. */
652
+ KeyU = 30,
653
+ /** The 'V' key. */
654
+ KeyV = 31,
655
+ /** The 'W' key. */
656
+ KeyW = 32,
657
+ /** The 'X' key. */
658
+ KeyX = 33,
659
+ /** The 'Y' key. */
660
+ KeyY = 34,
661
+ /** The 'Z' key. */
662
+ KeyZ = 35,
663
+ /** The Escape key. */
664
+ Escape = 36,
665
+ /** The F1 key. */
666
+ F1 = 37,
667
+ /** The F2 key. */
668
+ F2 = 38,
669
+ /** The F3 key. */
670
+ F3 = 39,
671
+ /** The F4 key. */
672
+ F4 = 40,
673
+ /** The F5 key. */
674
+ F5 = 41,
675
+ /** The F6 key. */
676
+ F6 = 42,
677
+ /** The F7 key. */
678
+ F7 = 43,
679
+ /** The F8 key. */
680
+ F8 = 44,
681
+ /** The F9 key. */
682
+ F9 = 45,
683
+ /** The F10 key. */
684
+ F10 = 46,
685
+ /** The F11 key. */
686
+ F11 = 47,
687
+ /** The F12 key. */
688
+ F12 = 48,
689
+ /** The Snapshot key. */
690
+ Snapshot = 49,
691
+ /** The Scroll key. */
692
+ Scroll = 50,
693
+ /** The Pause key. */
694
+ Pause = 51,
695
+ /** The Insert key. */
696
+ Insert = 52,
697
+ /** The Home key. */
698
+ Home = 53,
699
+ /** The Delete key. */
700
+ Delete = 54,
701
+ /** The End key. */
702
+ End = 55,
703
+ /** The PageDown key. */
704
+ PageDown = 56,
705
+ /** The PageUp key. */
706
+ PageUp = 57,
707
+ /** The Left arrow key. */
708
+ Left = 58,
709
+ /** The Up arrow key. */
710
+ Up = 59,
711
+ /** The Right arrow key. */
712
+ Right = 60,
713
+ /** The Down arrow key. */
714
+ Down = 61,
715
+ /** The Backspace key. */
716
+ Backspace = 62,
717
+ /** The Enter key. */
718
+ Enter = 63,
719
+ /** The Space key. */
720
+ Space = 64,
721
+ /** The Compose key. */
722
+ Compose = 65,
723
+ /** The Numlock key. */
724
+ Numlock = 66,
725
+ /** The Numpad '0' key. */
726
+ Numpad0 = 67,
727
+ /** The Numpad '1' key. */
728
+ Numpad1 = 68,
729
+ /** The Numpad '2' key. */
730
+ Numpad2 = 69,
731
+ /** The Numpad '3' key. */
732
+ Numpad3 = 70,
733
+ /** The Numpad '4' key. */
734
+ Numpad4 = 71,
735
+ /** The Numpad '5' key. */
736
+ Numpad5 = 72,
737
+ /** The Numpad '6' key. */
738
+ Numpad6 = 73,
739
+ /** The Numpad '7' key. */
740
+ Numpad7 = 74,
741
+ /** The Numpad '8' key. */
742
+ Numpad8 = 75,
743
+ /** The Numpad '9' key. */
744
+ Numpad9 = 76,
745
+ /** The Numpad Add key. */
746
+ NumpadAdd = 77,
747
+ /** The Numpad Divide key. */
748
+ NumpadDivide = 78,
749
+ /** The Numpad Decimal key. */
750
+ NumpadDecimal = 79,
751
+ /** The Numpad Enter key. */
752
+ NumpadEnter = 80,
753
+ /** The Numpad Equals key. */
754
+ NumpadEquals = 81,
755
+ /** The Numpad Multiply key. */
756
+ NumpadMultiply = 82,
757
+ /** The Numpad Subtract key. */
758
+ NumpadSubtract = 83,
759
+ /** The Apostrophe key. */
760
+ Apostrophe = 84,
761
+ /** The CapsLock key. */
762
+ CapsLock = 85,
763
+ /** The Comma key. */
764
+ Comma = 86,
765
+ /** The Convert key. */
766
+ Convert = 87,
767
+ /** The Equal key. */
768
+ Equal = 88,
769
+ /** The Grave key. */
770
+ Grave = 89,
771
+ /** The LAlt key. */
772
+ LAlt = 90,
773
+ /** The LBracket key. */
774
+ LBracket = 91,
775
+ /** The LControl key. */
776
+ LControl = 92,
777
+ /** The LShift key. */
778
+ LShift = 93,
779
+ /** The LWin key. */
780
+ LWin = 94,
781
+ /** The NonConvert key. */
782
+ NonConvert = 95,
783
+ /** The Period key. */
784
+ Period = 96,
785
+ /** The RAlt key. */
786
+ RAlt = 97,
787
+ /** The RBracket key. */
788
+ RBracket = 98,
789
+ /** The RControl key. */
790
+ RControl = 99,
791
+ /** The RShift key. */
792
+ RShift = 100,
793
+ /** The RWin key. */
794
+ RWin = 101,
795
+ /** The Semicolon key. */
796
+ Semicolon = 102,
797
+ /** The Slash key. */
798
+ Slash = 103,
799
+ /** The Alt key (mapped). */
800
+ Alt = 104,
801
+ /** The Control key (mapped). */
802
+ Control = 105,
803
+ /** The Shift key (mapped). */
804
+ Shift = 106,
805
+ /** The Backslash key. */
806
+ Backslash = 107,
807
+ /** The NonUS# key. */
808
+ NonUsBackslash = 108,
809
+ /** The Tab key. */
810
+ Tab = 109
811
+ }
812
+
813
+ /** Keyboard event data. */
814
+ export interface KeyboardEvent {
815
+ /** The key that was pressed. */
816
+ key: string
817
+ /** The key code. */
818
+ code: string
819
+ /** The key state. */
820
+ state: MouseButtonState
821
+ /** The modifiers state. */
822
+ modifiers: ModifiersState
823
+ }
824
+
825
+ /** Key code. */
826
+ export declare const enum KeyCode {
827
+ Key1 = 0,
828
+ Key2 = 1,
829
+ Key3 = 2,
830
+ Key4 = 3,
831
+ Key5 = 4,
832
+ Key6 = 5,
833
+ Key7 = 6,
834
+ Key8 = 7,
835
+ Key9 = 8,
836
+ Key0 = 9,
837
+ A = 10,
838
+ B = 11,
839
+ C = 12,
840
+ D = 13,
841
+ E = 14,
842
+ F = 15,
843
+ G = 16,
844
+ H = 17,
845
+ I = 18,
846
+ J = 19,
847
+ K = 20,
848
+ L = 21,
849
+ M = 22,
850
+ N = 23,
851
+ O = 24,
852
+ P = 25,
853
+ Q = 26,
854
+ R = 27,
855
+ S = 28,
856
+ T = 29,
857
+ U = 30,
858
+ V = 31,
859
+ W = 32,
860
+ X = 33,
861
+ Y = 34,
862
+ Z = 35,
863
+ Escape = 36,
864
+ F1 = 37,
865
+ F2 = 38,
866
+ F3 = 39,
867
+ F4 = 40,
868
+ F5 = 41,
869
+ F6 = 42,
870
+ F7 = 43,
871
+ F8 = 44,
872
+ F9 = 45,
873
+ F10 = 46,
874
+ F11 = 47,
875
+ F12 = 48,
876
+ F13 = 49,
877
+ F14 = 50,
878
+ F15 = 51,
879
+ F16 = 52,
880
+ F17 = 53,
881
+ F18 = 54,
882
+ F19 = 55,
883
+ F20 = 56,
884
+ F21 = 57,
885
+ F22 = 58,
886
+ F23 = 59,
887
+ F24 = 60,
888
+ Snapshot = 61,
889
+ Scroll = 62,
890
+ Pause = 63,
891
+ Insert = 64,
892
+ Home = 65,
893
+ Delete = 66,
894
+ End = 67,
895
+ PageDown = 68,
896
+ PageUp = 69,
897
+ Left = 70,
898
+ Up = 71,
899
+ Right = 72,
900
+ Down = 73,
901
+ Backspace = 74,
902
+ Enter = 75,
903
+ Space = 76,
904
+ Compose = 77,
905
+ CapsLock = 78,
906
+ Numlock = 79,
907
+ Numpad0 = 80,
908
+ Numpad1 = 81,
909
+ Numpad2 = 82,
910
+ Numpad3 = 83,
911
+ Numpad4 = 84,
912
+ Numpad5 = 85,
913
+ Numpad6 = 86,
914
+ Numpad7 = 87,
915
+ Numpad8 = 88,
916
+ Numpad9 = 89,
917
+ NumpadAdd = 90,
918
+ NumpadDivide = 91,
919
+ NumpadDecimal = 92,
920
+ NumpadEnter = 93,
921
+ NumpadEquals = 94,
922
+ NumpadMultiply = 95,
923
+ NumpadSubtract = 96,
924
+ Apostrophe = 97,
925
+ Comma = 98,
926
+ Equal = 99,
927
+ Grave = 100,
928
+ LAlt = 101,
929
+ LBracket = 102,
930
+ LControl = 103,
931
+ LShift = 104,
932
+ LWin = 105,
933
+ Period = 106,
934
+ RAlt = 107,
935
+ RBracket = 108,
936
+ RControl = 109,
937
+ RShift = 110,
938
+ RWin = 111,
939
+ Semicolon = 112,
940
+ Slash = 113,
941
+ Backslash = 114,
942
+ NonUsBackslash = 115,
943
+ Tab = 116
944
+ }
945
+
946
+ /** Key location on the keyboard. */
947
+ export declare const enum KeyLocation {
948
+ Standard = 0,
949
+ Left = 1,
950
+ Right = 2,
951
+ Numpad = 3
952
+ }
953
+
954
+ /** Modifier key state. */
955
+ export declare const enum ModifiersState {
956
+ /** The Shift key is pressed. */
957
+ Shift = 0,
958
+ /** The Control key is pressed. */
959
+ Control = 1,
960
+ /** The Alt key is pressed. */
961
+ Alt = 2,
962
+ /** The Super key is pressed. */
963
+ Super = 3
964
+ }
965
+
966
+ export interface Monitor {
967
+ name?: string
968
+ scaleFactor: number
969
+ size: Dimensions
970
+ position: Position
971
+ videoModes: Array<VideoMode>
972
+ }
973
+
974
+ /** Forward declaration for MonitorInfo to avoid circular dependencies */
975
+ export interface MonitorInfo {
976
+ /** The name of monitor. */
977
+ name?: string
978
+ /** The size of monitor. */
979
+ size: Size
980
+ /** The position of monitor. */
981
+ position: Position
982
+ /** The scale factor of monitor. */
983
+ scaleFactor: number
984
+ }
985
+
986
+ /** Mouse button event. */
987
+ export type MouseButton =
988
+ | { type: 'Left' }
989
+ | { type: 'Right' }
990
+ | { type: 'Middle' }
991
+ | { type: 'Other', field0: number }
992
+
993
+ /** Mouse button state. */
994
+ export declare const enum MouseButtonState {
995
+ /** The button was pressed. */
996
+ Pressed = 0,
997
+ /** The button was released. */
998
+ Released = 1
999
+ }
1000
+
1001
+ /** Mouse event data. */
1002
+ export interface MouseEvent {
1003
+ /** The button that was pressed/released. */
1004
+ button: MouseButton
1005
+ /** The state of button. */
1006
+ state: MouseButtonState
1007
+ /** The position of mouse. */
1008
+ position: Position
1009
+ /** The number of clicks. */
1010
+ clickCount: number
1011
+ /** The modifiers state. */
1012
+ modifiers: ModifiersState
1013
+ }
1014
+
1015
+ /** Mouse scroll delta. */
1016
+ export type MouseScrollDelta =
1017
+ | { type: 'LineDelta', field0: number, field1: number }
1018
+ | { type: 'PixelDelta', field0: number, field1: number }
1019
+
1020
+ /** Features to configure a new window. */
1021
+ export interface NewWindowFeatures {
1022
+ /** Whether the new window should have a menubar. */
1023
+ menubar: boolean
1024
+ /** Whether the new window should be visible. */
1025
+ visible: boolean
1026
+ /** The width of the new window. */
1027
+ width: number
1028
+ /** The height of the new window. */
1029
+ height: number
1030
+ /** The X coordinate of the new window. */
1031
+ x: number
1032
+ /** The Y coordinate of the new window. */
1033
+ y: number
1034
+ /** Whether the new window should be maximized. */
1035
+ maximized: boolean
1036
+ /** Whether the new window should be focused. */
1037
+ focused: boolean
1038
+ /** Whether the new window should have decorations. */
1039
+ decorations: boolean
1040
+ /** Whether the new window should always be on top. */
1041
+ alwaysOnTop: boolean
1042
+ /** Whether the new window should be transparent. */
1043
+ transparent: boolean
1044
+ }
1045
+
1046
+ /** The opener of a new window. */
1047
+ export interface NewWindowOpener {
1048
+ /** The label of the opener webview. */
1049
+ label: string
1050
+ /** The native ID of the opener webview. */
1051
+ nativeId: number
1052
+ }
1053
+
1054
+ /** Response to a new window request. */
1055
+ export declare const enum NewWindowResponse {
1056
+ /** Deny the new window request. */
1057
+ Deny = 0,
1058
+ /** Allow the new window request. */
1059
+ Allow = 1,
1060
+ /** Allow the new window request and navigate to the URL. */
1061
+ AllowAndNavigate = 2
1062
+ }
1063
+
1064
+ /** Not supported error. */
1065
+ export interface NotSupportedError {
1066
+ /** The error message. */
1067
+ message: string
1068
+ }
1069
+
1070
+ /** OS error. */
1071
+ export interface OsError {
1072
+ /** The OS error code. */
1073
+ code: number
1074
+ /** The error message. */
1075
+ message: string
1076
+ }
1077
+
1078
+ /** Page load event. */
1079
+ export declare const enum PageLoadEvent {
1080
+ /** The page has started loading. */
1081
+ Started = 0,
1082
+ /** The page has completed loading. */
1083
+ Completed = 1
1084
+ }
1085
+
1086
+ /** 2D position. */
1087
+ export interface Position {
1088
+ /** The X coordinate. */
1089
+ x: number
1090
+ /** The Y coordinate. */
1091
+ y: number
1092
+ }
1093
+
1094
+ /** Returns the primary monitor information. */
1095
+ export declare function primaryMonitor(): MonitorInfo
1096
+
1097
+ export interface ProgressBarState {
1098
+ /** The progress status. */
1099
+ status: ProgressBarStatus
1100
+ /** The progress value (0-100). */
1101
+ progress: number
1102
+ }
1103
+
1104
+ export declare const enum ProgressBarStatus {
1105
+ None = 0,
1106
+ Normal = 1,
1107
+ Indeterminate = 2,
1108
+ Paused = 3,
1109
+ Error = 4
1110
+ }
1111
+
1112
+ /** Progress state for progress bar. */
1113
+ export declare const enum ProgressState {
1114
+ None = 0,
1115
+ Normal = 1,
1116
+ Indeterminate = 2,
1117
+ Paused = 3,
1118
+ Error = 4
1119
+ }
1120
+
1121
+ /** Proxy configuration. */
1122
+ export type ProxyConfig =
1123
+ | { type: 'None' }
1124
+ | { type: 'Http', field0: string }
1125
+ | { type: 'Https', field0: string }
1126
+ | { type: 'Socks5', field0: string }
1127
+
1128
+ /** A proxy endpoint for web content. */
1129
+ export interface ProxyEndpoint {
1130
+ /** The host of the proxy. */
1131
+ host: string
1132
+ /** The port of the proxy. */
1133
+ port: number
1134
+ }
1135
+
1136
+ /** Raw keyboard event data. */
1137
+ export interface RawKeyEvent {
1138
+ /** The key code. */
1139
+ keyCode: number
1140
+ /** The key state. */
1141
+ state: MouseButtonState
1142
+ /** The modifiers state. */
1143
+ modifiers: ModifiersState
1144
+ }
1145
+
1146
+ /** A rectangle area. */
1147
+ export interface Rect {
1148
+ /** The X coordinate of the top-left corner. */
1149
+ x: number
1150
+ /** The Y coordinate of the top-left corner. */
1151
+ y: number
1152
+ /** The width of the rectangle. */
1153
+ width: number
1154
+ /** The height of the rectangle. */
1155
+ height: number
1156
+ }
1157
+
1158
+ /** 2D rectangle. */
1159
+ export interface Rectangle {
1160
+ /** The position. */
1161
+ origin: Position
1162
+ /** The size. */
1163
+ size: Size
1164
+ }
1165
+
1166
+ /** Render options for pixel buffer display */
1167
+ export interface RenderOptions {
1168
+ /** Width of the source buffer in pixels */
1169
+ bufferWidth: number
1170
+ /** Height of the source buffer in pixels */
1171
+ bufferHeight: number
1172
+ /** Scaling mode (default: Fit) */
1173
+ scaleMode?: ScaleMode
1174
+ /** Background color for letterboxing [R, G, B, A] (default: [0, 0, 0, 255]) */
1175
+ backgroundColor?: Array<number>
1176
+ }
1177
+
1178
+ /**
1179
+ * Simple function to render a pixel buffer to a window
1180
+ *
1181
+ * This is a convenience function for one-off renders.
1182
+ * For repeated rendering, use [`PixelRenderer`] instead.
1183
+ */
1184
+ export declare function renderPixels(window: Window, buffer: Buffer, bufferWidth: number, bufferHeight: number): void
1185
+
1186
+ /** A responder for a request. */
1187
+ export interface RequestAsyncResponder {
1188
+ /** The URI of the request. */
1189
+ uri: string
1190
+ /** The HTTP method of the request. */
1191
+ method: string
1192
+ /** The body of the request. */
1193
+ body: Buffer
1194
+ }
1195
+
1196
+ /** Window resize details. */
1197
+ export interface ResizeDetails {
1198
+ /** The new width. */
1199
+ width: number
1200
+ /** The new height. */
1201
+ height: number
1202
+ }
1203
+
1204
+ /** Resize direction for window resizing. */
1205
+ export declare const enum ResizeDirection {
1206
+ East = 0,
1207
+ North = 1,
1208
+ Northeast = 2,
1209
+ Northwest = 3,
1210
+ South = 4,
1211
+ Southeast = 5,
1212
+ Southwest = 6,
1213
+ West = 7
1214
+ }
1215
+
1216
+ /** Window scale factor change details. */
1217
+ export interface ScaleFactorChangeDetails {
1218
+ /** The new scale factor. */
1219
+ scaleFactor: number
1220
+ /** The new inner size in logical pixels. */
1221
+ newInnerSize: Size
1222
+ }
1223
+
1224
+ /** Scale mode for rendering when window is resized. */
1225
+ export declare const enum ScaleMode {
1226
+ /** Stretch the buffer to fit the window (may distort aspect ratio). */
1227
+ Stretch = 0,
1228
+ /** Maintain aspect ratio with black bars (letterbox/pillarbox). */
1229
+ Fit = 1,
1230
+ /** Maintain aspect ratio and crop to fill the window. */
1231
+ Fill = 2,
1232
+ /** Integer scaling for pixel-perfect rendering. */
1233
+ Integer = 3,
1234
+ /** No scaling - keep original size (centered). */
1235
+ None = 4
1236
+ }
1237
+
1238
+ /** 2D size. */
1239
+ export interface Size {
1240
+ /** The width. */
1241
+ width: number
1242
+ /** The height. */
1243
+ height: number
1244
+ }
1245
+
1246
+ /** Start cause of the event loop. */
1247
+ export declare const enum StartCause {
1248
+ Wait = 0,
1249
+ WaitCancelled = 1,
1250
+ Poll = 2,
1251
+ ResumeCancelled = 3,
1252
+ Init = 4
1253
+ }
1254
+
1255
+ /** Control flow of the application event loop. */
1256
+ export declare const enum TaoControlFlow {
1257
+ /** The application will continue running normally. */
1258
+ Poll = 0,
1259
+ /** The application will wait until the specified time. */
1260
+ WaitUntil = 1,
1261
+ /** The application will exit. */
1262
+ Exit = 2,
1263
+ /** The application will exit with the given exit code. */
1264
+ ExitWithCode = 3
1265
+ }
1266
+
1267
+ /** Fullscreen type. */
1268
+ export declare const enum TaoFullscreenType {
1269
+ /** Exclusive fullscreen. */
1270
+ Exclusive = 0,
1271
+ /** Borderless fullscreen. */
1272
+ Borderless = 1
1273
+ }
1274
+
1275
+ /** Progress bar data from Tao. */
1276
+ export interface TaoProgressBar {
1277
+ /** The progress state. */
1278
+ state: string
1279
+ /** The progress value (0-100). */
1280
+ progress: number
1281
+ }
1282
+
1283
+ /** Window theme. */
1284
+ export declare const enum TaoTheme {
1285
+ /** Light theme. */
1286
+ Light = 0,
1287
+ /** Dark theme. */
1288
+ Dark = 1
1289
+ }
1290
+
1291
+ /** Returns the current version of the tao crate. */
1292
+ export declare function taoVersion(): string
1293
+
1294
+ export declare const enum Theme {
1295
+ Light = 0,
1296
+ Dark = 1,
1297
+ System = 2
1298
+ }
1299
+
1300
+ /** Theme change details. */
1301
+ export interface ThemeChangeDetails {
1302
+ /** The new theme. */
1303
+ newTheme: TaoTheme
1304
+ }
1305
+
1306
+ /** Touch event data. */
1307
+ export interface Touch {
1308
+ /** The touch identifier. */
1309
+ id: number
1310
+ /** The position of touch. */
1311
+ position: Position
1312
+ /** The force of touch. */
1313
+ force?: number
1314
+ /** The device ID. */
1315
+ deviceId: number
1316
+ }
1317
+
1318
+ /** Touch phase. */
1319
+ export declare const enum TouchPhase {
1320
+ Started = 0,
1321
+ Moved = 1,
1322
+ Ended = 2,
1323
+ Cancelled = 3
1324
+ }
1325
+
1326
+ /** User attention type. */
1327
+ export declare const enum UserAttentionType {
1328
+ Critical = 0,
1329
+ Informational = 1
1330
+ }
1331
+
1332
+ /** Video mode information. */
1333
+ export interface VideoMode {
1334
+ /** The size of video mode. */
1335
+ size: Size
1336
+ /** The bit depth. */
1337
+ bitDepth: number
1338
+ /** The refresh rate. */
1339
+ refreshRate: number
1340
+ }
1341
+
1342
+ export interface VideoMode {
1343
+ size: Dimensions
1344
+ bitDepth: number
1345
+ refreshRate: number
1346
+ }
1347
+
1348
+ export declare const enum WebviewApplicationEvent {
1349
+ WindowCloseRequested = 0,
1350
+ ApplicationCloseRequested = 1
1351
+ }
1352
+
1353
+ /** Attributes for creating a webview. */
1354
+ export interface WebViewAttributes {
1355
+ /** The URL to load. */
1356
+ url?: string
1357
+ /** The HTML content to load. */
1358
+ html?: string
1359
+ /** The width of the webview. */
1360
+ width: number
1361
+ /** The height of the webview. */
1362
+ height: number
1363
+ /** The X coordinate of the webview. */
1364
+ x: number
1365
+ /** The Y coordinate of the webview. */
1366
+ y: number
1367
+ /** Whether the webview is resizable. */
1368
+ resizable: boolean
1369
+ /** The title of the webview. */
1370
+ title?: string
1371
+ /** Whether the webview has a menubar. */
1372
+ menubar: boolean
1373
+ /** Whether the webview is maximized. */
1374
+ maximized: boolean
1375
+ /** Whether the webview is minimized. */
1376
+ minimized: boolean
1377
+ /** Whether the webview is visible. */
1378
+ visible: boolean
1379
+ /** Whether the webview has decorations. */
1380
+ decorations: boolean
1381
+ /** Whether the webview is always on top. */
1382
+ alwaysOnTop: boolean
1383
+ /** Whether the webview is transparent. */
1384
+ transparent: boolean
1385
+ /** Whether the webview has focus. */
1386
+ focused: boolean
1387
+ /** The icon of the webview. */
1388
+ icon?: Buffer
1389
+ /** The theme of the webview. */
1390
+ theme?: WryTheme
1391
+ /** The user agent of the webview. */
1392
+ userAgent?: string
1393
+ /** Initialization scripts to run. */
1394
+ initializationScripts: Array<InitializationScript>
1395
+ /** Whether to enable drag drop. */
1396
+ dragDrop: boolean
1397
+ /** The background color of the webview. */
1398
+ backgroundColor?: Buffer
1399
+ /** Whether to enable devtools. */
1400
+ devtools: boolean
1401
+ /** Whether to enable incognito mode. */
1402
+ incognito: boolean
1403
+ /** Whether to enable zoom hotkeys. */
1404
+ hotkeysZoom: boolean
1405
+ /** Whether to enable clipboard access. */
1406
+ clipboard: boolean
1407
+ /** Whether to enable autoplay. */
1408
+ autoplay: boolean
1409
+ /** Whether to enable back/forward navigation gestures. */
1410
+ backForwardNavigationGestures: boolean
1411
+ }
1412
+
1413
+ export interface WebviewOptions {
1414
+ url?: string
1415
+ html?: string
1416
+ width?: number
1417
+ height?: number
1418
+ x?: number
1419
+ y?: number
1420
+ enableDevtools?: boolean
1421
+ incognito?: boolean
1422
+ userAgent?: string
1423
+ child?: boolean
1424
+ preload?: string
1425
+ transparent?: boolean
1426
+ theme?: Theme
1427
+ hotkeysZoom?: boolean
1428
+ clipboard?: boolean
1429
+ autoplay?: boolean
1430
+ backForwardNavigationGestures?: boolean
1431
+ }
1432
+
1433
+ /** Returns the version of the webview library. */
1434
+ export declare function webviewVersion(): [number, number, number]
1435
+
1436
+ /** Window attributes. */
1437
+ export interface WindowAttributes {
1438
+ /** The title of window. */
1439
+ title: string
1440
+ /** The width of window. */
1441
+ width: number
1442
+ /** The height of window. */
1443
+ height: number
1444
+ /** The X position of window. */
1445
+ x?: number
1446
+ /** The Y position of window. */
1447
+ y?: number
1448
+ /** Whether window is resizable. */
1449
+ resizable: boolean
1450
+ /** Whether window has decorations. */
1451
+ decorated: boolean
1452
+ /** Whether window is always on top. */
1453
+ alwaysOnTop: boolean
1454
+ /** Whether window is visible. */
1455
+ visible: boolean
1456
+ /** Whether window is transparent. */
1457
+ transparent: boolean
1458
+ /** Whether window is maximized. */
1459
+ maximized: boolean
1460
+ /** Whether window is focused. */
1461
+ focused: boolean
1462
+ /** Whether window has a menubar. */
1463
+ menubar: boolean
1464
+ /** The icon of window. */
1465
+ icon?: Buffer
1466
+ /** The theme of window. */
1467
+ theme?: TaoTheme
1468
+ /** Whether to force X11 backend on Linux (default: auto-detect) */
1469
+ forceX11?: boolean
1470
+ /** Whether to force Wayland backend on Linux (default: auto-detect) */
1471
+ forceWayland?: boolean
1472
+ }
1473
+
1474
+ /** Window drag details. */
1475
+ export interface WindowDragOptions {
1476
+ /** The window to drag. */
1477
+ windowId: number
1478
+ }
1479
+
1480
+ /** Window event type. */
1481
+ export declare const enum WindowEvent {
1482
+ /** The window has been created. */
1483
+ Created = 0,
1484
+ /** The window is about to be closed. */
1485
+ CloseRequested = 1,
1486
+ /** The window has been destroyed. */
1487
+ Destroyed = 2,
1488
+ /** The window gained focus. */
1489
+ Focused = 3,
1490
+ /** The window lost focus. */
1491
+ Unfocused = 4,
1492
+ /** The window was moved. */
1493
+ Moved = 5,
1494
+ /** The window was resized. */
1495
+ Resized = 6,
1496
+ /** The window scale factor changed. */
1497
+ ScaleFactorChanged = 7,
1498
+ /** The window theme changed. */
1499
+ ThemeChanged = 8,
1500
+ /** The window was minimized. */
1501
+ Minimized = 9,
1502
+ /** The window was maximized. */
1503
+ Maximized = 10,
1504
+ /** The window was restored from minimized state. */
1505
+ Restored = 11,
1506
+ /** The window became visible. */
1507
+ Visible = 12,
1508
+ /** The window became invisible. */
1509
+ Invisible = 13
1510
+ }
1511
+
1512
+ /** Window event data. */
1513
+ export interface WindowEventData {
1514
+ /** The window event type. */
1515
+ event: WindowEvent
1516
+ /** The window ID. */
1517
+ windowId: number
1518
+ }
1519
+
1520
+ /** Window jump options. */
1521
+ export interface WindowJumpOptions {
1522
+ /** The window to jump. */
1523
+ windowId: number
1524
+ /** The options to pass. */
1525
+ options?: WindowOptions
1526
+ }
1527
+
1528
+ /** Window level. */
1529
+ export declare const enum WindowLevel {
1530
+ /** Normal window level. */
1531
+ Normal = 0,
1532
+ /** Always on top level. */
1533
+ AlwaysOnTop = 1,
1534
+ /** Always on bottom level. */
1535
+ AlwaysOnBottom = 2
1536
+ }
1537
+
1538
+ /** Window options for creating a window. */
1539
+ export interface WindowOptions {
1540
+ /** The title of window. */
1541
+ title: string
1542
+ /** The width of window. */
1543
+ width: number
1544
+ /** The height of window. */
1545
+ height: number
1546
+ /** The X position of window. */
1547
+ x?: number
1548
+ /** The Y position of window. */
1549
+ y?: number
1550
+ /** Whether window is resizable. */
1551
+ resizable: boolean
1552
+ /** Whether window has a decorations. */
1553
+ decorations: boolean
1554
+ /** Whether window is always on top. */
1555
+ alwaysOnTop: boolean
1556
+ /** Whether window is visible. */
1557
+ visible: boolean
1558
+ /** Whether window is transparent. */
1559
+ transparent: boolean
1560
+ /** Whether window is maximized. */
1561
+ maximized: boolean
1562
+ /** Whether window is focused. */
1563
+ focused: boolean
1564
+ /** Whether window has a menubar. */
1565
+ menubar: boolean
1566
+ /** The icon of window. */
1567
+ icon?: Buffer
1568
+ /** The theme of window. */
1569
+ theme?: TaoTheme
1570
+ /** Whether to force X11 backend on Linux (default: auto-detect) */
1571
+ forceX11?: boolean
1572
+ /** Whether to force Wayland backend on Linux (default: auto-detect) */
1573
+ forceWayland?: boolean
1574
+ }
1575
+
1576
+ /** Window size limits. */
1577
+ export interface WindowSizeConstraints {
1578
+ /** The minimum width. */
1579
+ minWidth?: number
1580
+ /** The minimum height. */
1581
+ minHeight?: number
1582
+ /** The maximum width. */
1583
+ maxWidth?: number
1584
+ /** The maximum height. */
1585
+ maxHeight?: number
1586
+ }
1587
+
1588
+ /** Theme for the webview. */
1589
+ export declare const enum WryTheme {
1590
+ /** Light theme. */
1591
+ Light = 0,
1592
+ /** Dark theme. */
1593
+ Dark = 1,
1594
+ /** System theme. */
1595
+ Auto = 2
1596
+ }