@ghia/native 0.0.0 → 0.11.0

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 (211) hide show
  1. package/LICENSE +201 -0
  2. package/browser.mjs +7 -0
  3. package/dist/aria.d.ts +72 -0
  4. package/dist/aria.d.ts.map +1 -0
  5. package/dist/aria.js +2 -0
  6. package/dist/aria.js.map +1 -0
  7. package/dist/automation/client.d.ts +243 -0
  8. package/dist/automation/client.d.ts.map +1 -0
  9. package/dist/automation/client.js +801 -0
  10. package/dist/automation/client.js.map +1 -0
  11. package/dist/automation/index.d.ts +5 -0
  12. package/dist/automation/index.d.ts.map +1 -0
  13. package/dist/automation/index.js +4 -0
  14. package/dist/automation/index.js.map +1 -0
  15. package/dist/automation/protocol.d.ts +309 -0
  16. package/dist/automation/protocol.d.ts.map +1 -0
  17. package/dist/automation/protocol.js +320 -0
  18. package/dist/automation/protocol.js.map +1 -0
  19. package/dist/blob-images.d.ts +32 -0
  20. package/dist/blob-images.d.ts.map +1 -0
  21. package/dist/blob-images.js +55 -0
  22. package/dist/blob-images.js.map +1 -0
  23. package/dist/bounds.d.ts +61 -0
  24. package/dist/bounds.d.ts.map +1 -0
  25. package/dist/bounds.js +85 -0
  26. package/dist/bounds.js.map +1 -0
  27. package/dist/clipboard-global.d.ts +11 -0
  28. package/dist/clipboard-global.d.ts.map +1 -0
  29. package/dist/clipboard-global.js +2 -0
  30. package/dist/clipboard-global.js.map +1 -0
  31. package/dist/clipboard.d.ts +19 -0
  32. package/dist/clipboard.d.ts.map +1 -0
  33. package/dist/clipboard.js +41 -0
  34. package/dist/clipboard.js.map +1 -0
  35. package/dist/cpu-throttle.d.ts +6 -0
  36. package/dist/cpu-throttle.d.ts.map +1 -0
  37. package/dist/cpu-throttle.js +42 -0
  38. package/dist/cpu-throttle.js.map +1 -0
  39. package/dist/events/data-transfer.d.ts +23 -0
  40. package/dist/events/data-transfer.d.ts.map +1 -0
  41. package/dist/events/data-transfer.js +97 -0
  42. package/dist/events/data-transfer.js.map +1 -0
  43. package/dist/events/dispatch.d.ts +144 -0
  44. package/dist/events/dispatch.d.ts.map +1 -0
  45. package/dist/events/dispatch.js +241 -0
  46. package/dist/events/dispatch.js.map +1 -0
  47. package/dist/events/drag.d.ts +21 -0
  48. package/dist/events/drag.d.ts.map +1 -0
  49. package/dist/events/drag.js +111 -0
  50. package/dist/events/drag.js.map +1 -0
  51. package/dist/events/event-props.d.ts +19 -0
  52. package/dist/events/event-props.d.ts.map +1 -0
  53. package/dist/events/event-props.js +104 -0
  54. package/dist/events/event-props.js.map +1 -0
  55. package/dist/events/keyboard-defaults.d.ts +18 -0
  56. package/dist/events/keyboard-defaults.d.ts.map +1 -0
  57. package/dist/events/keyboard-defaults.js +121 -0
  58. package/dist/events/keyboard-defaults.js.map +1 -0
  59. package/dist/events/listeners.d.ts +18 -0
  60. package/dist/events/listeners.d.ts.map +1 -0
  61. package/dist/events/listeners.js +49 -0
  62. package/dist/events/listeners.js.map +1 -0
  63. package/dist/events/route.d.ts +17 -0
  64. package/dist/events/route.d.ts.map +1 -0
  65. package/dist/events/route.js +36 -0
  66. package/dist/events/route.js.map +1 -0
  67. package/dist/events/types.d.ts +269 -0
  68. package/dist/events/types.d.ts.map +1 -0
  69. package/dist/events/types.js +2 -0
  70. package/dist/events/types.js.map +1 -0
  71. package/dist/events/window-target.d.ts +120 -0
  72. package/dist/events/window-target.d.ts.map +1 -0
  73. package/dist/events/window-target.js +311 -0
  74. package/dist/events/window-target.js.map +1 -0
  75. package/dist/eyedropper.d.ts +33 -0
  76. package/dist/eyedropper.d.ts.map +1 -0
  77. package/dist/eyedropper.js +66 -0
  78. package/dist/eyedropper.js.map +1 -0
  79. package/dist/focus.d.ts +18 -0
  80. package/dist/focus.d.ts.map +1 -0
  81. package/dist/focus.js +26 -0
  82. package/dist/focus.js.map +1 -0
  83. package/dist/fonts.d.ts +12 -0
  84. package/dist/fonts.d.ts.map +1 -0
  85. package/dist/fonts.js +17 -0
  86. package/dist/fonts.js.map +1 -0
  87. package/dist/forms.d.ts +10 -0
  88. package/dist/forms.d.ts.map +1 -0
  89. package/dist/forms.js +9 -0
  90. package/dist/forms.js.map +1 -0
  91. package/dist/host-runtime.d.ts +108 -0
  92. package/dist/host-runtime.d.ts.map +1 -0
  93. package/dist/host-runtime.js +213 -0
  94. package/dist/host-runtime.js.map +1 -0
  95. package/dist/host.d.ts +2403 -0
  96. package/dist/host.d.ts.map +1 -0
  97. package/dist/host.js +30 -0
  98. package/dist/host.js.map +1 -0
  99. package/dist/idle-gc.d.ts +36 -0
  100. package/dist/idle-gc.d.ts.map +1 -0
  101. package/dist/idle-gc.js +70 -0
  102. package/dist/idle-gc.js.map +1 -0
  103. package/dist/keyframes.d.ts +108 -0
  104. package/dist/keyframes.d.ts.map +1 -0
  105. package/dist/keyframes.js +107 -0
  106. package/dist/keyframes.js.map +1 -0
  107. package/dist/layout-animation.d.ts +38 -0
  108. package/dist/layout-animation.d.ts.map +1 -0
  109. package/dist/layout-animation.js +41 -0
  110. package/dist/layout-animation.js.map +1 -0
  111. package/dist/match-media.d.ts +62 -0
  112. package/dist/match-media.d.ts.map +1 -0
  113. package/dist/match-media.js +272 -0
  114. package/dist/match-media.js.map +1 -0
  115. package/dist/media-query.d.ts +21 -0
  116. package/dist/media-query.d.ts.map +1 -0
  117. package/dist/media-query.js +599 -0
  118. package/dist/media-query.js.map +1 -0
  119. package/dist/motion-bindings.d.ts +36 -0
  120. package/dist/motion-bindings.d.ts.map +1 -0
  121. package/dist/motion-bindings.js +107 -0
  122. package/dist/motion-bindings.js.map +1 -0
  123. package/dist/motion-config.d.ts +20 -0
  124. package/dist/motion-config.d.ts.map +1 -0
  125. package/dist/motion-config.js +51 -0
  126. package/dist/motion-config.js.map +1 -0
  127. package/dist/motion-span.d.ts +57 -0
  128. package/dist/motion-span.d.ts.map +1 -0
  129. package/dist/motion-span.js +150 -0
  130. package/dist/motion-span.js.map +1 -0
  131. package/dist/motion-value.d.ts +269 -0
  132. package/dist/motion-value.d.ts.map +1 -0
  133. package/dist/motion-value.js +941 -0
  134. package/dist/motion-value.js.map +1 -0
  135. package/dist/motion-variants.d.ts +190 -0
  136. package/dist/motion-variants.d.ts.map +1 -0
  137. package/dist/motion-variants.js +249 -0
  138. package/dist/motion-variants.js.map +1 -0
  139. package/dist/mutations.d.ts +65 -0
  140. package/dist/mutations.d.ts.map +1 -0
  141. package/dist/mutations.js +320 -0
  142. package/dist/mutations.js.map +1 -0
  143. package/dist/nativeview.d.ts +10 -0
  144. package/dist/nativeview.d.ts.map +1 -0
  145. package/dist/nativeview.js +92 -0
  146. package/dist/nativeview.js.map +1 -0
  147. package/dist/observers.d.ts +92 -0
  148. package/dist/observers.d.ts.map +1 -0
  149. package/dist/observers.js +579 -0
  150. package/dist/observers.js.map +1 -0
  151. package/dist/presence.d.ts +63 -0
  152. package/dist/presence.d.ts.map +1 -0
  153. package/dist/presence.js +54 -0
  154. package/dist/presence.js.map +1 -0
  155. package/dist/renderer-state.d.ts +155 -0
  156. package/dist/renderer-state.d.ts.map +1 -0
  157. package/dist/renderer-state.js +302 -0
  158. package/dist/renderer-state.js.map +1 -0
  159. package/dist/reorder.d.ts +63 -0
  160. package/dist/reorder.d.ts.map +1 -0
  161. package/dist/reorder.js +303 -0
  162. package/dist/reorder.js.map +1 -0
  163. package/dist/runtime.d.ts +23 -0
  164. package/dist/runtime.d.ts.map +1 -0
  165. package/dist/runtime.js +157 -0
  166. package/dist/runtime.js.map +1 -0
  167. package/dist/screen.d.ts +8 -0
  168. package/dist/screen.d.ts.map +1 -0
  169. package/dist/screen.js +16 -0
  170. package/dist/screen.js.map +1 -0
  171. package/dist/scroll.d.ts +79 -0
  172. package/dist/scroll.d.ts.map +1 -0
  173. package/dist/scroll.js +170 -0
  174. package/dist/scroll.js.map +1 -0
  175. package/dist/style-images.d.ts +20 -0
  176. package/dist/style-images.d.ts.map +1 -0
  177. package/dist/style-images.js +57 -0
  178. package/dist/style-images.js.map +1 -0
  179. package/dist/svg.d.ts +16 -0
  180. package/dist/svg.d.ts.map +1 -0
  181. package/dist/svg.js +119 -0
  182. package/dist/svg.js.map +1 -0
  183. package/dist/testing.d.ts +811 -0
  184. package/dist/testing.d.ts.map +1 -0
  185. package/dist/testing.js +1187 -0
  186. package/dist/testing.js.map +1 -0
  187. package/dist/text-match.d.ts +8 -0
  188. package/dist/text-match.d.ts.map +1 -0
  189. package/dist/text-match.js +10 -0
  190. package/dist/text-match.js.map +1 -0
  191. package/dist/text-selection.d.ts +34 -0
  192. package/dist/text-selection.d.ts.map +1 -0
  193. package/dist/text-selection.js +23 -0
  194. package/dist/text-selection.js.map +1 -0
  195. package/dist/universal-style.d.ts +22 -0
  196. package/dist/universal-style.d.ts.map +1 -0
  197. package/dist/universal-style.js +58 -0
  198. package/dist/universal-style.js.map +1 -0
  199. package/dist/web-animations.d.ts +300 -0
  200. package/dist/web-animations.d.ts.map +1 -0
  201. package/dist/web-animations.js +1032 -0
  202. package/dist/web-animations.js.map +1 -0
  203. package/dist/webview.d.ts +39 -0
  204. package/dist/webview.d.ts.map +1 -0
  205. package/dist/webview.js +26 -0
  206. package/dist/webview.js.map +1 -0
  207. package/gpuix-native.darwin-arm64.node +4 -0
  208. package/index.cjs +789 -0
  209. package/index.d.ts +2603 -0
  210. package/index.js +729 -0
  211. package/package.json +96 -4
package/index.d.ts ADDED
@@ -0,0 +1,2603 @@
1
+ /* auto-generated by NAPI-RS */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * Which binding artifact the generated loader actually loaded: `'native'` for
6
+ * a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
7
+ * flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
8
+ * can point the loader at a WASI artifact this package does not build itself.
9
+ */
10
+ export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
11
+
12
+ /** An update ready to download and install. */
13
+ export declare class AvailableUpdate {
14
+ /** Version currently running. */
15
+ get currentVersion(): string
16
+ /** Version announced by the feed. */
17
+ get version(): string
18
+ /** Release notes, if the feed sent `notes`. */
19
+ get notes(): string | null
20
+ /** RFC 3339 publish date, if the feed sent `pub_date`. */
21
+ get date(): string | null
22
+ /** Download URL from the feed. */
23
+ get downloadUrl(): string
24
+ /** Packager format: `app`, `appimage`, `nsis`, or `wix`. */
25
+ get format(): string
26
+ /**
27
+ * Download, verify the signature, and replace the running app.
28
+ *
29
+ * Does not relaunch. Quit after this returns, or the next start uses the
30
+ * new files.
31
+ */
32
+ downloadAndInstall(): Promise<unknown>
33
+ }
34
+
35
+ /** The main GPUI renderer exposed to Node.js. */
36
+ export declare class GpuixRenderer {
37
+ constructor(eventCallback?: (((err: Error | null, arg: EventPayload) => any)) | undefined | null)
38
+ /** Initialize GPUI using the native event-loop architecture for this OS. */
39
+ init(options?: WindowOptions | undefined | null): void
40
+ /**
41
+ * Apply a batch of mutations in a single FFI call.
42
+ *
43
+ * Accepts a JSON array of mutation tuples. Each tuple is an array where
44
+ * the first element is the operation name (string) and remaining elements
45
+ * are the arguments:
46
+ *
47
+ * ["createElement", id, "type"]
48
+ * ["destroyElement", id]
49
+ * ["appendChild", parentId, childId]
50
+ * ["insertBefore", parentId, childId, beforeId]
51
+ * ["setStyle", id, { ...style }]
52
+ * ["setText", id, "content"]
53
+ * ["setEventListener", id, "eventType", true|false]
54
+ * ["setRoot", id]
55
+ * ["setKeyboardFocusDim", true|false]
56
+ * ["setUniversalStyle", { ...style } | null]
57
+ * ["setCustomProp", id, "key", value]
58
+ *
59
+ * Returns accumulated destroyed IDs from all destroyElement ops.
60
+ * Acquires the tree mutex ONCE for the entire batch.
61
+ */
62
+ applyBatch(json: string): Array<number>
63
+ /** Pump the native event loop. Returns false after the last window closes. */
64
+ tick(): boolean
65
+ isInitialized(): boolean
66
+ /**
67
+ * Registers the function native calls synchronously for events whose
68
+ * default JS can cancel: `keydown`, `keyup`. It takes the `EventPayload`
69
+ * and returns `{ defaultPrevented, propagationStopped }`. Pass `null` to
70
+ * remove it.
71
+ *
72
+ * Synchronous on macOS, where GPUI runs on the JS thread inside `tick()`.
73
+ * Windows and Linux run GPUI on another thread and keep delivering these
74
+ * events through the queue, so their handlers cannot cancel anything.
75
+ */
76
+ setSyncEventHandler(handler?: ((arg: EventPayload) => SyncDispatchResult) | undefined | null): void
77
+ /**
78
+ * Wake JavaScript when the main run loop has work: input, a main-queue block (the
79
+ * display link's frame step among them), a timer. Returns true on macOS, false on
80
+ * other platforms. The callback should schedule the tick rather than run it inline,
81
+ * and tick() never blocks. A wake that lands while a tick is running, or after another
82
+ * wake that has not been ticked yet, is dropped; work that arrived meanwhile wakes
83
+ * again when the tick re-arms the watch. An idle app gets no wakes. Wakes do not keep
84
+ * the process alive.
85
+ * Pass null to clear the callback. Already queued callbacks may still arrive.
86
+ */
87
+ setFrameWakeCallback(callback?: (() => void) | undefined | null): boolean
88
+ /**
89
+ * Whether JavaScript must call tick() until it returns false.
90
+ *
91
+ * macOS: tick() pumps AppKit. Windows/Linux: tick() only reports whether
92
+ * the UI thread is still inside `Platform::run`. Both return false after
93
+ * the last window closes so the JS frame loop can exit the process.
94
+ */
95
+ requiresTick(): boolean
96
+ /**
97
+ * The paintable size of the window in logical pixels, excluding any
98
+ * platform title bar. This used to answer a hardcoded 800x600, so anything
99
+ * that turned a mouse position into layout coordinates pointed at the
100
+ * wrong place on every window that was not exactly that size.
101
+ */
102
+ getWindowSize(): WindowSize
103
+ getWindowInsets(): WindowInsets
104
+ /** `"hidden"` | `"minimal"` | `"full"`. Paints into the scene after layout. */
105
+ setDebugFrameOverlay(mode: string): string
106
+ /** Hidden → minimal → full → hidden. */
107
+ cycleDebugFrameOverlay(): string
108
+ getDebugFrameOverlay(): string
109
+ /** Clears the last 1000 draw samples. Frame count stays. */
110
+ resetDebugFrameOverlayStats(): void
111
+ /** Same numbers as the on-screen overlay: current, p90, p99, max, frames. */
112
+ getDebugFrameOverlayStats(): DebugFrameOverlayStats
113
+ /**
114
+ * How ticks were drawn by patching the frame before them since the window was made, with why
115
+ * the others were drawn whole: subtract two reads for a span of frames.
116
+ */
117
+ getPatchCounters(): PatchCounters
118
+ /**
119
+ * Bring the window forward and give it focus. This is how a window opened
120
+ * with `show: false` or `focus: false` is revealed later.
121
+ */
122
+ activateWindow(): void
123
+ /** Minimize the native window. */
124
+ minimizeWindow(): void
125
+ /** Run the native zoom or maximize operation. */
126
+ zoomWindow(): void
127
+ /** Enter or exit native fullscreen. */
128
+ toggleFullscreen(): void
129
+ setWindowTitle(title: string): void
130
+ /** Open the platform path picker. Returns null when the user cancels. */
131
+ promptForPaths(options?: PathPromptOptions | undefined | null): Promise<Array<string> | null>
132
+ /** Replace the system clipboard's contents with plain text. */
133
+ writeClipboardText(text: string): void
134
+ /** The system clipboard's text, or null when it holds none. */
135
+ readClipboardText(): string | null
136
+ /** Whether `openEyeDropper` exists on this platform. macOS only. */
137
+ supportsEyeDropper(): boolean
138
+ /**
139
+ * Run the screen colour picker. Resolves `#rrggbb`, or null when the user
140
+ * cancels. There is no way to dismiss it from code.
141
+ */
142
+ openEyeDropper(): Promise<string | null>
143
+ /**
144
+ * `loadURL(url)` (with the URL as `argument`), `reload()`, `stop()`, `goBack()` and
145
+ * `goForward()` of a `<webview>`.
146
+ */
147
+ webviewCommand(elementId: number, command: string, argument?: string | undefined | null): void
148
+ /** The URL, the title and the history of a `<webview>`. */
149
+ webviewState(elementId: number): WebviewStateReading
150
+ /**
151
+ * Runs `code` in the page of a `<webview>`. Resolves with the JSON of the result of its last
152
+ * expression, or null when that is `undefined`; rejects with the script's error.
153
+ */
154
+ webviewExecuteJavascript(elementId: number, code: string): Promise<string | null>
155
+ focusElement(elementId: number): void
156
+ /** `element.blur()`: clear focus when `element_id` is the focused element. */
157
+ blurElement(elementId: number): void
158
+ /**
159
+ * `element.matches(selector)` for `:focus`, `:focus-visible`,
160
+ * `:focus-within`, `:hover` and `:active`. Any other selector is an error.
161
+ */
162
+ matchesFocus(elementId: number, selector: string): boolean
163
+ /** Move focus to the next GPUI tab stop. */
164
+ focusNext(): void
165
+ /** Move focus to the previous GPUI tab stop. */
166
+ focusPrevious(): void
167
+ /** Host id of the focused element, or null when nothing is focused. */
168
+ getFocusedElementId(): number | null
169
+ /** Move focus to the next tab stop inside `element_id`, wrapping in that subtree. */
170
+ focusNextWithin(elementId: number): void
171
+ /** Move focus to the previous tab stop inside `element_id`, wrapping in that subtree. */
172
+ focusPreviousWithin(elementId: number): void
173
+ /** Enable the window key events requested by the React renderer. */
174
+ setWindowKeyEvents(keyDown: boolean, keyUp: boolean, eventId: number): void
175
+ blur(): void
176
+ /** Enable the window selectionChange event requested by the React renderer. */
177
+ setWindowSelectionChange(enabled: boolean, eventId: number): void
178
+ /** Enable the window appearanceChange event requested by the React renderer. */
179
+ setWindowAppearanceChange(enabled: boolean, eventId: number): void
180
+ /**
181
+ * Enable the `mediaChange` event behind `matchMedia`. It fires when the OS
182
+ * accessibility preferences or the window appearance change.
183
+ */
184
+ setWindowMediaChange(enabled: boolean): void
185
+ /**
186
+ * The OS accessibility preferences that media queries expose. All false
187
+ * where the OS has no read (everything but macOS).
188
+ */
189
+ getMediaFeatures(): MediaFeatures
190
+ /**
191
+ * `"system"` follows the OS light/dark setting, `"light"` and `"dark"`
192
+ * force it for the whole app. Only macOS applies it; elsewhere GPUI has no
193
+ * override and the call is accepted and ignored.
194
+ */
195
+ setAppearance(appearance: string): void
196
+ /** The effective appearance of the window, `"light"` or `"dark"`. */
197
+ getAppearance(): string
198
+ /** A value that is written with `set` and `jump` or animated. */
199
+ createMotionValue(id: number, initial: any): void
200
+ /**
201
+ * A value mapped from the number value `input` through `inputRange` and
202
+ * `outputRange`. `options` is `{ clamp?: boolean, ease?: ease | ease[] }`.
203
+ */
204
+ createMotionTransform(id: number, input: number, inputRange: Array<number>, outputRange: any, options?: any | undefined | null): void
205
+ /**
206
+ * A spring that chases another value. `config` is a spring transition
207
+ * without the `type`.
208
+ */
209
+ createMotionFollower(id: number, source: number, config: any): void
210
+ /** A spring with a target of its own, which `setMotionValue` moves. */
211
+ createMotionSpring(id: number, initial: any, config: any): void
212
+ /** Whether the value existed. Values that read it fail from then on. */
213
+ disposeMotionValue(id: number): boolean
214
+ getMotionValue(id: number): any
215
+ /** Units per second. Errors for a value that is not a number. */
216
+ getMotionValueVelocity(id: number): number
217
+ isMotionValueAnimating(id: number): boolean
218
+ /**
219
+ * Writes the value. Over a running animation this does not stop it:
220
+ * call `stopMotionValue` first to take the value from the animation.
221
+ */
222
+ setMotionValue(id: number, value: any): void
223
+ /** Writes the value, ending any animation and dropping its velocity. */
224
+ jumpMotionValue(id: number, value: any): void
225
+ /**
226
+ * Animates a value from where it is, with the speed it has. `transition`
227
+ * is the same description `motion` takes, tween by default.
228
+ */
229
+ animateMotionValue(id: number, target: any, transition?: any | undefined | null): void
230
+ /** Ends an animation where it is, keeping the speed for the next one. */
231
+ stopMotionValue(id: number): void
232
+ /**
233
+ * Holds the value's animation where it is. The value stays, its velocity
234
+ * reads 0 and no frame is asked for; `isMotionValueAnimating` stays true.
235
+ */
236
+ pauseMotionValue(id: number): void
237
+ /**
238
+ * Continues a held animation from the time it holds. A finished one plays
239
+ * again from its start, or from its end when its speed is negative.
240
+ */
241
+ playMotionValue(id: number): void
242
+ /**
243
+ * Sets the time of the value's animation, Motion's `time`: it counts the
244
+ * delay, so a time inside the delay shows the first keyframe. A finished
245
+ * animation is held there; one seeked past its end finishes, and its time
246
+ * reads back as set.
247
+ */
248
+ seekMotionValue(id: number, seconds: number): void
249
+ /**
250
+ * Sets the pace of the value's animation: 2 is twice as fast, a negative
251
+ * speed runs it backwards to its first keyframe, 0 holds it while it stays
252
+ * in effect. As in Motion, a hold lasts until `play`, whatever the speed
253
+ * is set to after.
254
+ */
255
+ setMotionValueSpeed(id: number, speed: number): void
256
+ /**
257
+ * Jumps the value's animation to its last keyframe (the first when it runs
258
+ * backwards) and finishes it.
259
+ */
260
+ completeMotionValue(id: number): void
261
+ /**
262
+ * What the controls of the value's animation read, or null if it has none:
263
+ * it was never animated, or was stopped or jumped.
264
+ */
265
+ getMotionValuePlayback(id: number): MotionValuePlayback | null
266
+ /**
267
+ * Takes the frames away from the clock of the value's animation, as Motion's
268
+ * `attachTimeline` does: it holds the time it has until something sets another.
269
+ */
270
+ detachMotionValueClock(id: number): void
271
+ /** Chooses which events the value delivers. Neither removes the listener. */
272
+ setMotionValueListener(id: number, change: boolean, animation: boolean): void
273
+ /**
274
+ * Defines the keyframes `animation-name: name` plays, as the `@keyframes`
275
+ * rule does. `framesJson` is a JSON object of `from`, `to`, `N%` or comma
276
+ * list keys to the animatable style properties plus `animationTimingFunction`.
277
+ * Redefining a name replaces it for running animations too. A bad
278
+ * definition throws and leaves the earlier one. Use `defineKeyframes` from
279
+ * `@ghia/native/host`, which defines it on every renderer.
280
+ */
281
+ defineKeyframes(name: string, framesJson: string): void
282
+ /**
283
+ * The CSS transitions, then the CSS animations, of an element that are
284
+ * running, paused or in effect through a fill, in the order of the DOM's
285
+ * `getAnimations()`, then the animations of a `motion` element that Motion hands to the browser.
286
+ *
287
+ * An element inside skipped content is styled first, as a read of its geometry would: Chrome
288
+ * makes the CSS animations of content it never rendered when one of its elements is read.
289
+ */
290
+ getAnimations(elementId: number): Array<WebAnimationInfo>
291
+ /**
292
+ * `getAnimations({ subtree: true })` of an element: the CSS transitions, then the CSS
293
+ * animations, of the element and the elements below it, each in document order of the
294
+ * elements, with the element each is of. Throws for an element id that is not valid; an
295
+ * element that is not in the tree has none.
296
+ */
297
+ getSubtreeAnimations(elementId: number): Array<ElementWebAnimationInfo>
298
+ /**
299
+ * `document.getAnimations()` of this renderer's window: as `getSubtreeAnimations` for the
300
+ * root of the tree.
301
+ */
302
+ getDocumentAnimations(): Array<ElementWebAnimationInfo>
303
+ /**
304
+ * One CSS animation or transition by the id `getAnimations` gave. A run
305
+ * that finished or was cancelled answers as it ended until
306
+ * `releaseAnimation` says JS consumed its `webanimationfinish` or
307
+ * `webanimationcancel` event; after that, and for a transition whose style
308
+ * moved off its end value, it throws.
309
+ */
310
+ getAnimation(animationId: number): WebAnimationInfo
311
+ /**
312
+ * What `effect.getTiming()` and `effect.getComputedTiming()` read of the run `animationId`,
313
+ * as of the last frame. Throws for a run native no longer has.
314
+ */
315
+ getAnimationEffect(animationId: number): WebAnimationEffectInfo
316
+ /** `effect.getKeyframes()` of the run `animationId`. Throws for a run native no longer has. */
317
+ getAnimationKeyframes(animationId: number): Array<WebAnimationKeyframeInfo>
318
+ /**
319
+ * `effect.updateTiming(timing)` of the run `animationId`: what it sets stays set against a
320
+ * later style. Throws `TypeError: ...` for an easing that does not parse.
321
+ */
322
+ updateAnimationTiming(animationId: number, timing: WebAnimationTimingUpdate): void
323
+ /**
324
+ * JS consumed one `webanimationfinish` or `webanimationcancel` event of the
325
+ * run: native stops answering for what it ended as. Call it for every such
326
+ * event, whether or not an `Animation` object exists for the run.
327
+ */
328
+ releaseAnimation(animationId: number): void
329
+ /**
330
+ * JS no longer holds an `Animation` for the run: native drops what it kept of a run that was
331
+ * cancelled, for a command to bring it back. A run that plays is not affected, and a call
332
+ * for a run native has already dropped is nothing.
333
+ */
334
+ forgetAnimation(animationId: number): void
335
+ /**
336
+ * `animation.pause()`: holds the current time at once, and from here the
337
+ * style's `animation-play-state` no longer decides.
338
+ */
339
+ pauseAnimation(animationId: number): void
340
+ /**
341
+ * `animation.play()`: continues from the held time at the next frame, or
342
+ * from the start (the end when running backwards) if it has finished.
343
+ */
344
+ playAnimation(animationId: number): void
345
+ /** `animation.currentTime = milliseconds`. */
346
+ setAnimationCurrentTime(animationId: number, milliseconds: number): void
347
+ /** `animation.playbackRate = rate`, keeping the current time. */
348
+ setAnimationPlaybackRate(animationId: number, rate: number): void
349
+ /**
350
+ * `animation.cancel()`: the animation is idle, with no current time and out of
351
+ * `getAnimations()`; `play()` brings it back from the start.
352
+ */
353
+ cancelAnimation(animationId: number): void
354
+ /**
355
+ * `animation.finish()`. Throws `InvalidStateError: ...` for a rate of 0 and for an animation
356
+ * that never ends.
357
+ */
358
+ finishAnimation(animationId: number): void
359
+ /**
360
+ * `animation.reverse()`: the rate flips at the next frame. Throws `InvalidStateError: ...`
361
+ * for an animation that never ends, from its start.
362
+ */
363
+ reverseAnimation(animationId: number): void
364
+ /**
365
+ * `animation.updatePlaybackRate(rate)`: at the next frame for a running animation, at once
366
+ * for the others.
367
+ */
368
+ updateAnimationPlaybackRate(animationId: number, rate: number): void
369
+ /**
370
+ * `animation.startTime = startTime`, in milliseconds on the timeline of the animations
371
+ * (`getAnimationTimelineTime`); `null` holds the current time.
372
+ */
373
+ setAnimationStartTime(animationId: number, startTime?: number | undefined | null): void
374
+ /**
375
+ * The time of the timeline of the animations (`animation.timeline.currentTime`): the
376
+ * instant of the last frame, in milliseconds on the clock of the renderer. The same
377
+ * number `startTime` and the `timelineTime` of the events are on.
378
+ */
379
+ getAnimationTimelineTime(): number
380
+ /** The current text selection joined in document order, or null. */
381
+ getSelectedText(): string | null
382
+ /** Drop the current selection and request a repaint. */
383
+ clearSelection(): void
384
+ /**
385
+ * Scroll an element to a DOM scroll position: `left` and `top` are `scrollLeft` and
386
+ * `scrollTop`, zero or more, so scrolling down is a larger `top`.
387
+ *
388
+ * `behavior` is `"instant"`, `"smooth"` or `"auto"` (the default), which follows the
389
+ * element's `scrollBehavior` style. A smooth scroll animates over the next frames.
390
+ */
391
+ scrollTo(elementId: number, left: number, top: number, behavior?: string | undefined | null): void
392
+ /**
393
+ * Scroll a child into view by its index in the children list.
394
+ *
395
+ * For a `<virtual-list>` the scroll is queued and applied on the next
396
+ * render, after that frame's child splice, so indices computed against a
397
+ * just-committed child list are never shifted twice. `offsetInItem` is in
398
+ * pixels and may be negative, which anchors the viewport top above the
399
+ * item and resolves against measured heights at layout time.
400
+ */
401
+ scrollToItem(elementId: number, index: number, offsetInItem?: number | undefined | null): void
402
+ /**
403
+ * The logical scroll anchor of a `<virtual-list>`:
404
+ * `[itemIndex, offsetInItemPx, viewportHeightPx]`, or null for anything
405
+ * else. `itemIndex == item count` is gpui's at-end sentinel.
406
+ *
407
+ * Unlike `getScrollOffset` this is exact even while row heights are still
408
+ * estimates, because it is the anchor gpui itself scrolls by.
409
+ */
410
+ getListScrollTop(elementId: number): Array<number> | null
411
+ /**
412
+ * The DOM scroll position of a scrollable element, `[scrollLeft, scrollTop]` (zero or
413
+ * more), or null if it is not a scroll container or a `<virtual-list>`.
414
+ */
415
+ getScrollOffset(elementId: number): Array<number> | null
416
+ /**
417
+ * The DOM's `scrollIntoView`: scrolls every scrollable ancestor so the element sits where
418
+ * `block` (default `"start"`) and `inline` (default `"nearest"`) ask. Each is `"start"`,
419
+ * `"center"`, `"end"` or `"nearest"`. `behavior` is as for `scrollTo`.
420
+ */
421
+ scrollIntoView(elementId: number, block?: string | undefined | null, inline?: string | undefined | null, behavior?: string | undefined | null): void
422
+ /**
423
+ * The default action of a scrolling key (`"up"`, `"down"`, `"left"`, `"right"`,
424
+ * `"pageup"`, `"pagedown"`, `"home"`, `"end"`, `"space"`): scrolls the innermost scrollable
425
+ * ancestor of the focused element, or the scroller under the pointer if nothing is focused.
426
+ * A focused text input or control keeps its keys.
427
+ *
428
+ * It reports nothing: called while the root view is being updated, it runs once that update
429
+ * has returned, and whether anything scrolled is not known yet at that point.
430
+ */
431
+ scrollByKey(key: string, shift: boolean): void
432
+ /**
433
+ * The DOM scroll geometry of an element:
434
+ * `[scrollLeft, scrollTop, scrollWidth, scrollHeight, clientWidth, clientHeight]`, or null
435
+ * if it has not been painted.
436
+ */
437
+ getScrollMetrics(elementId: number): Array<number> | null
438
+ /** The event types `window` or `document` listens for. Replaces the set. */
439
+ setWindowEventListeners(types: Array<string>): void
440
+ /**
441
+ * Capture the mouse for `element_id`. The request is recorded before this
442
+ * returns, so `hasPointerCapture` answers true and the next pointer input
443
+ * is already aimed at the element; that input fires `gotpointercapture`
444
+ * before its own events, as the DOM does. Ignored while no button is down.
445
+ */
446
+ setPointerCapture(elementId: number, pointerId: number): void
447
+ /**
448
+ * End `element_id`'s capture, if it holds one: recorded now, and the next
449
+ * pointer input fires `lostpointercapture`.
450
+ */
451
+ releasePointerCapture(elementId: number, pointerId: number): void
452
+ /** Whether `element_id` holds, or has been asked to hold, the mouse capture. */
453
+ hasPointerCapture(elementId: number, pointerId: number): boolean
454
+ /**
455
+ * End the element drag in progress, without a `dragend`: JS calls it when
456
+ * `dragstart` was cancelled. Recorded now and read first by the next
457
+ * pointer input, before it builds an event; the moves delivered since
458
+ * `dragstart` were already queued, and JS drops them.
459
+ */
460
+ cancelDrag(): void
461
+ /**
462
+ * Lock the pointer to `element_id`: the cursor hides and stops, and
463
+ * movement is reported as `movementX`/`movementY`. On macOS the lock is
464
+ * taken before this returns, from a handler too, and it fires
465
+ * `pointerlockchange` or, when the element is not connected or the platform
466
+ * refuses, `pointerlockerror`. Elsewhere the next frame applies it.
467
+ */
468
+ requestPointerLock(elementId: number): void
469
+ /** Release the pointer lock, if held. Applied like `requestPointerLock`. */
470
+ exitPointerLock(): void
471
+ /**
472
+ * The element that holds the pointer lock, or null. On macOS it is the
473
+ * element right after `requestPointerLock`.
474
+ */
475
+ pointerLockElement(): number | null
476
+ /**
477
+ * Deliver the click an activation that is not a pointer press makes on
478
+ * `element_id`, such as Enter on a button: a `click` with `detail` 0 that
479
+ * bubbles along the element's path, followed by the activation behaviour
480
+ * a label has. A disabled form control gets none, like
481
+ * `HTMLElement.click()`.
482
+ */
483
+ clickElement(elementId: number): void
484
+ /**
485
+ * Paint packed pixels onto an `<img>` host node. `format` is `"rgba"`
486
+ * (default) or `"bgra"`; BGRA skips the per-pixel swizzle.
487
+ */
488
+ setImagePixels(elementId: number, width: number, height: number, pixels: Buffer, format?: string | undefined | null): void
489
+ /**
490
+ * Decode PNG, JPEG, WebP, GIF, SVG, BMP, TIFF, ICO, or Netpbm bytes onto
491
+ * an `<img>` host node. Prefer `setImagePixels` for live waveforms.
492
+ */
493
+ setImage(elementId: number, bytes: Buffer): void
494
+ /**
495
+ * Encoded bytes for the `blob:` URL a `url()` background image names. The
496
+ * JS layer fetches the blob, because a blob URL only exists in its process.
497
+ */
498
+ setStyleImage(url: string, bytes: Buffer): void
499
+ /** The JS layer could not read the `blob:` URL a `url()` background names. */
500
+ failStyleImage(url: string, message: string): void
501
+ /** `select()` on an `<input>` or `<textarea>`: select all of its text. */
502
+ selectText(elementId: number): void
503
+ /**
504
+ * `setSelectionRange(start, end, direction)` on an `<input>` or
505
+ * `<textarea>`. Offsets are UTF-16 code units; `direction` is
506
+ * `"forward"`, `"backward"` or `"none"`.
507
+ */
508
+ setSelectionRange(elementId: number, start: number, end: number, direction?: string | undefined | null): void
509
+ /**
510
+ * `selectionStart`, `selectionEnd` and `selectionDirection` of an
511
+ * `<input>` or `<textarea>`.
512
+ */
513
+ getTextSelection(elementId: number): TextSelection
514
+ /**
515
+ * `form.requestSubmit()`: validate the form's controls, then emit `submit`.
516
+ * The events are delivered before this returns.
517
+ */
518
+ requestSubmit(elementId: number): void
519
+ /**
520
+ * Make the fonts in a TrueType or OpenType file (or a collection) usable by
521
+ * `fontFamily`, under the family names the file declares. Call it before
522
+ * the text that names the family is first laid out: a family that did not
523
+ * exist then has already fallen back to another font.
524
+ */
525
+ registerFont(data: Buffer): void
526
+ getAutomationTree(): string
527
+ getElementBounds(id: number): ElementBounds | null
528
+ /**
529
+ * The box of an element for the first report of an observer: laid out as `getElementBounds`
530
+ * does, but the content of a skipped ancestor is not, and an element inside it has no box
531
+ * (null), as Chrome's observers see it.
532
+ */
533
+ probeElementBounds(id: number): ElementBounds | null
534
+ /**
535
+ * The elements whose last painted box holds the window point `(x, y)`,
536
+ * topmost first, like the DOM's `elementsFromPoint`. An element that did
537
+ * not paint is never listed, `overflow: hidden | scroll` clips what lies
538
+ * outside it, and `pointer-events: none` is skipped.
539
+ */
540
+ getElementsAt(x: number, y: number): Array<number>
541
+ getAllText(): Array<string>
542
+ getPaintedText(): Array<string>
543
+ /**
544
+ * Every highlight wash painted in the last frame, in paint order.
545
+ *
546
+ * A quad is invisible to `getPaintedText()`, so this is the only way to
547
+ * assert on `highlight` without a screenshot.
548
+ */
549
+ getPaintedHighlights(): Array<HighlightMatch>
550
+ /**
551
+ * Press space-separated keys in Playwright's `keyboard.press` grammar
552
+ * (`"Enter"`, `"Shift+Tab"`, `"Meta+a"`, `"a"`, `"Space"`) through the
553
+ * focused element's input pipeline, each as a keydown then a keyup.
554
+ */
555
+ simulateKeystrokes(keystrokes: string): void
556
+ /** One keydown (one press in the `simulate_keystrokes` grammar), no keyup. */
557
+ simulateKeyDown(keystroke: string, isHeld?: boolean | undefined | null): void
558
+ /** One keyup (one press in the `simulate_keystrokes` grammar). */
559
+ simulateKeyUp(keystroke: string): void
560
+ /** `modifiers` is hyphenated: "cmd", "cmd-shift", "alt". */
561
+ simulateClick(x: number, y: number, button?: number | undefined | null, modifiers?: string | undefined | null): void
562
+ simulateMouseDown(x: number, y: number, button?: number | undefined | null, modifiers?: string | undefined | null): void
563
+ simulateMouseUp(x: number, y: number, button?: number | undefined | null, modifiers?: string | undefined | null): void
564
+ simulateMouseMove(x: number, y: number, pressedButton?: number | undefined | null, modifiers?: string | undefined | null): void
565
+ /**
566
+ * Dispatch a wheel event through the same GPUI hit test the trackpad uses.
567
+ * Deltas are pixels with the DOM's sign, like `WheelEvent.deltaY`: positive
568
+ * `delta_y` scrolls down, positive `delta_x` scrolls right, matching
569
+ * `TestGpuixRenderer::simulate_scroll_wheel`.
570
+ *
571
+ * `phase` is `"started"` (the default, a gesture of its own), `"moved"`,
572
+ * `"ended"` or `"cancelled"`. The scroller that took a gesture's first delta
573
+ * keeps the rest of it, so continue one with `"moved"`.
574
+ */
575
+ simulateScrollWheel(x: number, y: number, deltaX: number, deltaY: number, modifiers?: string | undefined | null, phase?: string | undefined | null): void
576
+ clockPause(): number
577
+ clockSet(nowMs: number): number
578
+ clockFastForward(deltaMs: number): number
579
+ clockResume(): number
580
+ captureScreenshot(path: string): void
581
+ /**
582
+ * Calls the registered frame wake closure from a Rust thread every `intervalMs`, the
583
+ * function the display link calls, so a hidden window gets deterministic wakes.
584
+ * `null` stops it; clearing the wake callback stops it too.
585
+ */
586
+ simulateFrameWakes(intervalMs?: number | undefined | null): void
587
+ /**
588
+ * Posts a real NSEvent for this window from `com.apple.NSEventThread`, the thread AppKit
589
+ * receives WindowServer input on, so an idle app's wake path is exercised the way input
590
+ * reaches it. `kind` is `"keyDown"` (the key `a`), `"mouseMove"`, `"click"` (a left mouse
591
+ * down, then up) or `"scroll"` (3 lines down); the last three need `x` and `y`, in logical
592
+ * pixels from the window's top left. The events go to `NSApplication`'s own queue: nothing
593
+ * is posted to the OS, and the window is not made key.
594
+ */
595
+ postNativeEvent(kind: string, x?: number | undefined | null, y?: number | undefined | null): void
596
+ /** Makes every `tick()` sleep `ms` inside its native call, a forced-slow frame. 0 turns it off. */
597
+ setTickDelay(ms: number): void
598
+ }
599
+
600
+ /**
601
+ * GPU-backed GPUI test renderer. Uses VisualTestAppContext with the native
602
+ * Metal or DirectX renderer and TestDispatcher for deterministic scheduling.
603
+ * Same GpuixView and rendering pipeline as production.
604
+ *
605
+ * Usage from JS:
606
+ * const r = new TestGpuixRenderer()
607
+ * r.applyBatch('[["createElement",1,"div"],["setRoot",1]]')
608
+ * r.flush() // triggers GpuixView::render() on the GPU
609
+ * r.simulateClick(50, 50) // dispatches through GPUI hit testing
610
+ * const events = r.drainEvents()
611
+ * r.captureScreenshot("/tmp/test.png") // saves rendered UI as PNG
612
+ */
613
+ export declare class TestGpuixRenderer {
614
+ /**
615
+ * The same `WindowOptions` the live renderer opens its window with, translated by the
616
+ * same `to_gpui_window_options`. The size defaults to 1280x800 (not the live 800x600),
617
+ * and `focus` to false: the window is offscreen and must not take the OS's keyboard.
618
+ * `fullscreen` is ignored, because a fullscreen window would leave the offscreen
619
+ * position; see docs/reference.md's test renderer section for what else the window cannot
620
+ * represent. `scaleFactor` is the window's device pixels per CSS px, `1` when unset.
621
+ */
622
+ constructor(options?: WindowOptions | undefined | null, scaleFactor?: number | undefined | null)
623
+ /**
624
+ * Tears the window and its GPUI app down. Every call that needs the window
625
+ * throws afterwards; the retained tree stays readable. Call it after the
626
+ * root is unmounted.
627
+ */
628
+ dispose(): void
629
+ /**
630
+ * Wake JavaScript when the main run loop has work, like `GpuixRenderer.setFrameWakeCallback`:
631
+ * input that AppKit receives for the test window (`postNativeEvent`) is the usual wake, since
632
+ * the test window draws no frames. Returns true on macOS, false elsewhere. Pass null to clear.
633
+ */
634
+ setFrameWakeCallback(callback?: (() => void) | undefined | null): boolean
635
+ /**
636
+ * Whether JavaScript must call `tick()` for the frame loop: only where `setFrameWakeCallback`
637
+ * is.
638
+ */
639
+ requiresTick(): boolean
640
+ /**
641
+ * Hands the input AppKit has queued for the test window to it, without waiting, then runs the
642
+ * test context until it is parked. Draws nothing: frames stay `flush` and `drawFrame`.
643
+ * Returns true, since a test window stays open until `dispose`.
644
+ */
645
+ tick(): boolean
646
+ /**
647
+ * Posts a real NSEvent for the test window from `com.apple.NSEventThread`, as
648
+ * `GpuixRenderer.postNativeEvent` does: `kind` is `"keyDown"` (the key `a`), `"mouseMove"`,
649
+ * `"click"` or `"scroll"` (3 lines down); the last three need `x` and `y`, in logical pixels
650
+ * from the window's top left. The window is neither key nor on screen, and nothing reaches
651
+ * the OS. `tick()` is what delivers it to the window.
652
+ */
653
+ postNativeEvent(kind: string, x?: number | undefined | null, y?: number | undefined | null): void
654
+ /**
655
+ * Registers the function native calls synchronously for `keydown` and
656
+ * `keyup`; see `GpuixRenderer::setSyncEventHandler`. Without one, those
657
+ * events are queued for `drainEvents` like every other.
658
+ */
659
+ setSyncEventHandler(handler?: ((arg: EventPayload) => SyncDispatchResult) | undefined | null): void
660
+ /**
661
+ * How many elements the retained tree holds, reachable from the root or
662
+ * not. `getTreeJson` walks from the root, so it cannot see a node that was
663
+ * detached and never destroyed. This is the only way a test can prove a
664
+ * removal actually freed it.
665
+ */
666
+ getRetainedElementCount(): number
667
+ /**
668
+ * What the element build has done since the last `resetBuildCounters`. A draw builds every
669
+ * element, so divide by the frames drawn to get the per-frame figure.
670
+ */
671
+ getBuildCounters(): BuildCounters
672
+ /**
673
+ * What the retained subtrees of the window did since it was made: subtract two reads for a
674
+ * span of frames.
675
+ */
676
+ getRetainedCounters(): RetainedCounters
677
+ /**
678
+ * How the frames that were compared with a build differed from it, one entry each, see
679
+ * `setRetainVerify`.
680
+ */
681
+ getRetentionMismatches(): Array<string>
682
+ /**
683
+ * How many elements the retention bookkeeping holds a record of, and how many of those it
684
+ * takes to have motion running. Like `getRetainedElementCount` it proves a removal freed
685
+ * something: both stay bounded by the elements that are alive.
686
+ */
687
+ getRetainRecordCounts(): Array<number>
688
+ /**
689
+ * Why the last recorded frame built what it built, as JSON: the elements it built by reason,
690
+ * what named them, and the ones a record said could be skipped and were not. Needs
691
+ * `GPUIX_RETAIN_DEBUG=1`, and is empty without it.
692
+ */
693
+ getRetainDebug(): string
694
+ /**
695
+ * Whether a frame skips what it judges unchanged since the frame before, handing it to gpui
696
+ * as a retained subtree that is replayed. On unless `GPUIX_RETAIN_OFF`; turning it on after it
697
+ * was off starts from a frame that builds everything.
698
+ */
699
+ setRetainPlanning(planning: boolean): void
700
+ /**
701
+ * Whether a frame records what it builds at all, which `GPUIX_RETAIN_OFF` turns off for a whole
702
+ * run. Off, a frame costs what it did before retention; turning it on starts from a frame
703
+ * that builds everything.
704
+ */
705
+ setRetainEnabled(enabled: boolean): void
706
+ /**
707
+ * Builds each frame that replayed a retained subtree once more, whole, and compares the two:
708
+ * the scene, the hitboxes, the accessibility tree and the registries gpuix keeps (painted
709
+ * boxes, text and selection regions, measurements). A difference is counted in
710
+ * `getRetainedCounters().mismatches` and described by `getRetentionMismatches`. Every such
711
+ * frame costs two builds, so a benchmark leaves it off; `GPUIX_RETAIN_VERIFY` turns it on
712
+ * for a run.
713
+ */
714
+ setRetainVerify(verify: boolean): void
715
+ /**
716
+ * Counts as if the exclusions named here were lifted, to see which are worth lifting first:
717
+ * `paint-reporter`, `highlight`, `custom-element`, `svg`, `virtual-list`,
718
+ * `collapsed-table`, `display-contents`, `anchored`, `sticky`, `fixed`, `scroller`,
719
+ * `overflow-hidden`, `layout-animation`, `atomic-inline`, `label`. Nothing is reused.
720
+ */
721
+ setRetainLift(names: Array<string>): void
722
+ /** What the elements judged unchanged were built differently by, one line each. */
723
+ getRetainMismatches(): Array<string>
724
+ /**
725
+ * Layout nodes the window's engine made, found again, freed, and the styles and child lists it
726
+ * set, since the window was made: subtract two reads for a span of frames.
727
+ */
728
+ getLayoutCounters(): LayoutCounters
729
+ /**
730
+ * What building and drawing the elements did since the window was made: elements prepainted
731
+ * and painted (culled ones apart), and the scene primitives painting inserted against the
732
+ * ones a replay inserted again. Subtract two reads for a span of frames. Next to
733
+ * `getRetainedCounters`, which counts the replays themselves.
734
+ */
735
+ getFrameWorkCounters(): FrameWorkCounters
736
+ /**
737
+ * Whether the ticks of animations that only change what they paint are drawn by patching the
738
+ * frame before them. On unless `GPUIX_PATCH_OFF`, and never when the retention is off.
739
+ */
740
+ setPatchEnabled(enabled: boolean): void
741
+ /** How ticks were patched since the window was made: subtract two reads for a span of frames. */
742
+ getPatchCounters(): PatchCounters
743
+ resetBuildCounters(): void
744
+ /**
745
+ * How many frames the window has painted. A test that must prove a read did not draw once
746
+ * per call compares this before and after. A bounds or scroll read lays out and paints
747
+ * nothing: those passes are `getLayoutPassCount`.
748
+ */
749
+ getPaintedFrameCount(): number
750
+ /**
751
+ * How many layout-only passes the window has run: what a bounds or scroll read makes of a
752
+ * dirty window, in place of a draw. The next frame draws once more regardless.
753
+ */
754
+ getLayoutPassCount(): number
755
+ /**
756
+ * Pretends a screen reader is connected, or not. The test window starts with one, so every
757
+ * flush builds an accessibility tree. Without one nothing builds it, which is what a benchmark
758
+ * of the draw alone wants.
759
+ */
760
+ setA11yActive(active: boolean): void
761
+ /**
762
+ * How many subtrees the window has skipped as lying outside their clip, over its life: the
763
+ * work `getPaintedFrameCount` frames did not do. A test compares it before and after a frame.
764
+ */
765
+ getCulledSubtreeCount(): number
766
+ /**
767
+ * Apply a batch of mutations in a single FFI call.
768
+ * Same format as GpuixRenderer::apply_batch (string op names).
769
+ * Returns accumulated destroyed IDs from all destroyElement ops.
770
+ */
771
+ applyBatch(json: string): Array<number>
772
+ /**
773
+ * Notify the view entity and run GPUI until parked.
774
+ * This triggers GpuixView::render() → build_element() → GPUI layout.
775
+ * Must be called after mutations and before simulating events (GPUI's
776
+ * hit testing requires elements to be laid out).
777
+ */
778
+ flush(): void
779
+ /**
780
+ * Whether the test window is drawn whenever an update or a simulated input flushes, which
781
+ * is how a test sees the result of what it just did. A live window is drawn by the display
782
+ * link once per frame, however many inputs and reads came in it. A test that counts draws
783
+ * turns this off and ends each frame with `drawFrame`.
784
+ */
785
+ setInlineDraws(enabled: boolean): void
786
+ /**
787
+ * A display-link frame: delivers the frame callbacks the last draw queued, then draws a
788
+ * pending change, once. For use with `setInlineDraws(false)`.
789
+ */
790
+ drawFrame(): void
791
+ /**
792
+ * Draws only what a live window would: a pending change, nothing on a clean window.
793
+ * `flush()` notifies the view, so it draws every call; the `nativeSimulate*` helpers
794
+ * that wrap one input in a flush before and after use this instead, so an input costs
795
+ * the draws a window pays (one for what it changed, more only where a handler read
796
+ * layout in between) and not two more.
797
+ */
798
+ flushIfDirty(): void
799
+ /**
800
+ * Simulate a click at the given window coordinates.
801
+ * Dispatches MouseDown + MouseUp through GPUI's input pipeline,
802
+ * which triggers the same event handlers as production.
803
+ * IMPORTANT: Call flush() before this — hit testing requires laid-out elements.
804
+ * `modifiers` is hyphenated: "cmd", "cmd-shift", "alt".
805
+ */
806
+ simulateClick(x: number, y: number, button?: number | undefined | null, modifiers?: string | undefined | null): void
807
+ /**
808
+ * Press a space-separated sequence of keys through GPUI's input pipeline,
809
+ * in Playwright's `keyboard.press` grammar: a DOM `key` ("Enter", "a",
810
+ * "ArrowDown") or `code` ("Space", "KeyA"), modifiers joined with `+`
811
+ * ("Shift+Tab", "Meta+a", "ControlOrMeta+Shift+P"). Each press is a
812
+ * keydown then a keyup, and typed characters reach the focused input.
813
+ * An unknown name is an error and nothing is pressed.
814
+ */
815
+ simulateKeystrokes(keystrokes: string): void
816
+ /**
817
+ * Dispatch one keydown (one press in the `simulate_keystrokes` grammar)
818
+ * with no keyup after it. Pairs with `simulate_key_up`. A key that types
819
+ * text inserts it, like a keydown does in a browser.
820
+ */
821
+ simulateKeyDown(keystroke: string, isHeld?: boolean | undefined | null): void
822
+ /**
823
+ * A key the platform's input method consumes (one press in the
824
+ * `simulate_keystrokes` grammar), with no keyup after it, as macOS delivers
825
+ * it: the key is announced to the observers of keys that compose, then the
826
+ * input method calls the focused text input. `action` is `"mark"` (set the
827
+ * composition to `text`), `"commit"` (end it with `text`) or `"unmark"` (end
828
+ * it with the text it has; `text` is ignored). Pairs with `simulate_key_up`.
829
+ */
830
+ simulateImeKeyDown(keystroke: string, action: string, text?: string | undefined | null): void
831
+ /** Dispatch one keyup (one press in the `simulate_keystrokes` grammar). */
832
+ simulateKeyUp(keystroke: string): void
833
+ /**
834
+ * Simulate a mouse move to the given coordinates. It reports the buttons held by
835
+ * `simulate_mouse_down` that no `simulate_mouse_up` released, as a real OS does.
836
+ * movement_x, movement_y: the motion the platform reports for this move, which
837
+ * becomes `movementX`/`movementY`. Zero when not given.
838
+ */
839
+ simulateMouseMove(x: number, y: number, modifiers?: string | undefined | null, movementX?: number | undefined | null, movementY?: number | undefined | null): void
840
+ /**
841
+ * Simulate the pointer leaving the window, as the platform reports it when
842
+ * the cursor crosses the window edge: there is no final mouse move.
843
+ */
844
+ simulateMouseExit(x: number, y: number): void
845
+ /**
846
+ * The OS ate the release of `button` (left when not given): forget it as held without
847
+ * dispatching anything. The next move then reports no button, the way a pointer that
848
+ * let go outside the window does, and the page sees a lost release.
849
+ */
850
+ simulateLostMouseUp(button?: number | undefined | null): void
851
+ /**
852
+ * Focus an element by its numeric ID.
853
+ * The element must be DOM-focusable (an enabled input or textarea, or an
854
+ * element with a `tabIndex`), which is what gives it a FocusHandle.
855
+ * Call flush() before this so the element tree and focus handles exist.
856
+ */
857
+ focusElement(id: number): void
858
+ blurElement(id: number): void
859
+ matchesFocus(id: number, selector: string): boolean
860
+ focusNext(): void
861
+ focusPrevious(): void
862
+ promptForPaths(options?: PathPromptOptions | undefined | null): Promise<Array<string> | null>
863
+ /** The test window's own in-memory clipboard, never the system's. */
864
+ writeClipboardText(text: string): void
865
+ readClipboardText(): string | null
866
+ getFocusedElementId(): number | null
867
+ /** Makes the offscreen window key or not, as when the user switches apps. */
868
+ setWindowActive(active: boolean): void
869
+ focusNextWithin(elementId: number): void
870
+ focusPreviousWithin(elementId: number): void
871
+ setWindowKeyEvents(keyDown: boolean, keyUp: boolean, eventId: number): void
872
+ setWindowSelectionChange(enabled: boolean, eventId: number): void
873
+ setWindowAppearanceChange(enabled: boolean, eventId: number): void
874
+ setWindowMediaChange(enabled: boolean): void
875
+ /** The preferences this window reports, which start as "no preference". */
876
+ getMediaFeatures(): MediaFeatures
877
+ /**
878
+ * Change the reported OS preferences. Queues a `mediaChange` event when
879
+ * something changed and a listener is enabled, like the OS notification.
880
+ */
881
+ setMediaFeatures(reducedMotion?: boolean | undefined | null, increasedContrast?: boolean | undefined | null, forcedColors?: boolean | undefined | null): void
882
+ /**
883
+ * Sets the macOS "Show scroll bars" setting this window reports: `"overlay"` (Automatically
884
+ * or When scrolling, the default here) or `"classic"` (Always). The test window never
885
+ * hears from the OS, so this is how a test flips it.
886
+ */
887
+ setScrollbarStyle(style: string): void
888
+ /**
889
+ * `"system"` follows the platform's light/dark setting, `"light"` and `"dark"` force
890
+ * it, as on the live renderer. The override is the platform's (on macOS the process's
891
+ * `NSApplication.appearance`), so it outlives this renderer until a window is made
892
+ * with another `appearance` or `"system"` is set.
893
+ */
894
+ setAppearance(appearance: string): void
895
+ /** The platform window's title, as the title bar shows it. */
896
+ getWindowTitle(): string
897
+ getAppearance(): string
898
+ /**
899
+ * Simulate a mouse down event at the given window coordinates.
900
+ * Button: 0=left, 1=middle, 2=right. Defaults to left (0).
901
+ * `click_count` is what the platform reports for the press: 1 for a single
902
+ * click, 2 for the second press of a double click.
903
+ */
904
+ simulateMouseDown(x: number, y: number, button?: number | undefined | null, modifiers?: string | undefined | null, clickCount?: number | undefined | null): void
905
+ /**
906
+ * Simulate a mouse up event at the given window coordinates.
907
+ * Button: 0=left, 1=middle, 2=right. Defaults to left (0).
908
+ * `click_count` is the count the platform reports for the release.
909
+ */
910
+ simulateMouseUp(x: number, y: number, button?: number | undefined | null, modifiers?: string | undefined | null, clickCount?: number | undefined | null): void
911
+ /**
912
+ * Simulate a scroll wheel event at the given position.
913
+ * delta_x and delta_y are pixels with the DOM's sign, like `WheelEvent.deltaX`
914
+ * and `deltaY`: positive `delta_y` scrolls down, positive `delta_x` scrolls right.
915
+ *
916
+ * `phase` is `"started"` (the default, a gesture of its own), `"moved"`, `"ended"` or
917
+ * `"cancelled"`. The scroller that took a gesture's first delta keeps the rest of it, so
918
+ * continue one with `"moved"`.
919
+ */
920
+ simulateScrollWheel(x: number, y: number, deltaX: number, deltaY: number, modifiers?: string | undefined | null, phase?: string | undefined | null): void
921
+ /**
922
+ * Files from the OS enter the window at `x`, `y` (`FileDropEvent::Entered`).
923
+ * Returns the operation the window answered the drag source with, which the
924
+ * `dragover` it fired decided: `"none"`, `"copy"`, `"move"` or `"link"`, or
925
+ * `null` when the window picked none and the platform keeps its default.
926
+ */
927
+ simulateFileDragEnter(x: number, y: number, paths: Array<string>): string | null
928
+ /**
929
+ * The dragged files move to `x`, `y` (`FileDropEvent::Pending`). Returns the
930
+ * operation the window answered the drag source with, as `simulateFileDragEnter` does.
931
+ */
932
+ simulateFileDragMove(x: number, y: number): string | null
933
+ /** The dragged files are released at `x`, `y` (`FileDropEvent::Submit`). */
934
+ simulateFileDragSubmit(x: number, y: number): void
935
+ /** The dragged files leave the window (`FileDropEvent::Exited`). */
936
+ simulateFileDragExit(): void
937
+ /** The platform's drag session ends (`FileDropEvent::Ended`). */
938
+ simulateFileDragEnd(): void
939
+ /**
940
+ * A whole Finder-style drop at `x`, `y`, in the order the platform sends
941
+ * it: Entered, Submit, then Exited and Ended.
942
+ */
943
+ simulateFileDrop(x: number, y: number, paths: Array<string>): void
944
+ /** The current text selection joined in document order, or null. */
945
+ getSelectedText(): string | null
946
+ /** Drop the current selection. */
947
+ clearSelection(): void
948
+ /**
949
+ * Syntax-cache counters as `[hits, misses, documents]`.
950
+ *
951
+ * GPUIX rebuilds its whole element tree every frame, so a `<code>` block
952
+ * that misses the cache reparses at frame rate. A test can watch the hit
953
+ * count to catch that regression before a profiler does.
954
+ */
955
+ getSyntaxCacheStats(): Array<number>
956
+ /**
957
+ * Every string painted in the last frame, in paint order.
958
+ *
959
+ * `getAllText()` only sees `<text>` nodes in the retained tree. Native
960
+ * elements such as `<code>` and `<diff>` draw their text inside gpui, so
961
+ * this is the only way to assert on what they actually rendered.
962
+ */
963
+ getPaintedText(): Array<string>
964
+ /**
965
+ * Every highlight wash painted in the last frame, in paint order.
966
+ *
967
+ * A quad is invisible to `getPaintedText()`, so this is the only way to
968
+ * assert on `highlight` without a screenshot. Each entry carries its rects,
969
+ * so a soft-wrapped match is provably two boxes.
970
+ */
971
+ getPaintedHighlights(): Array<HighlightMatch>
972
+ /**
973
+ * Drag-select from one point to another: mouse down, move, up.
974
+ *
975
+ * A single helper rather than three calls because the listeners that drive
976
+ * selection are registered during **paint**, so a flush must sit between
977
+ * the down and the move. Getting that order wrong silently selects nothing,
978
+ * which is a miserable thing to debug from JS.
979
+ */
980
+ dragSelect(x1: number, y1: number, x2: number, y2: number): void
981
+ /**
982
+ * Scroll an element to a DOM scroll position: `left` and `top` are `scrollLeft` and
983
+ * `scrollTop`, zero or more, so scrolling down is a larger `top`.
984
+ * The offset is clamped to the layout of the tree as it is, which is laid out first if
985
+ * it changed. The window draws it with the next frame.
986
+ */
987
+ scrollTo(elementId: number, left: number, top: number, behavior?: string | undefined | null): void
988
+ /**
989
+ * Scroll a child into view by its index in the children list.
990
+ * Call flush() after to apply and re-render. For a `<virtual-list>` the
991
+ * scroll is queued and applied on that flush, after the child splice.
992
+ * `offset_in_item` is in pixels and may be negative, which anchors the
993
+ * viewport top above the item.
994
+ */
995
+ scrollToItem(elementId: number, index: number, offsetInItem?: number | undefined | null): void
996
+ /**
997
+ * The DOM's `scrollIntoView`: scrolls every scrollable ancestor until the element sits where
998
+ * `block` (default `"start"`) and `inline` (default `"nearest"`) ask.
999
+ */
1000
+ scrollIntoView(elementId: number, block?: string | undefined | null, inline?: string | undefined | null, behavior?: string | undefined | null): void
1001
+ /** The event types `window` or `document` listens for. Replaces the set. */
1002
+ setWindowEventListeners(types: Array<string>): void
1003
+ /**
1004
+ * Capture the mouse for `element_id`; recorded before this returns, and the
1005
+ * next simulated pointer input fires `gotpointercapture`. Ignored while no
1006
+ * button is down.
1007
+ */
1008
+ setPointerCapture(elementId: number, pointerId: number): void
1009
+ releasePointerCapture(elementId: number, pointerId: number): void
1010
+ hasPointerCapture(elementId: number, pointerId: number): boolean
1011
+ /**
1012
+ * Ends the element drag in progress without a `dragend`; recorded now and
1013
+ * read first by the next simulated pointer input.
1014
+ */
1015
+ cancelDrag(): void
1016
+ /**
1017
+ * Lock the pointer to `element_id`. The simulated platform answers before
1018
+ * this returns, from a handler too, so the outcome is in `drainEvents`.
1019
+ */
1020
+ requestPointerLock(elementId: number): void
1021
+ exitPointerLock(): void
1022
+ pointerLockElement(): number | null
1023
+ /**
1024
+ * Whether the simulated platform grants lock requests, as one that can lock
1025
+ * the pointer does. Off, a request fails the way GPUI's does when the
1026
+ * platform refuses.
1027
+ */
1028
+ simulatePointerLockGranting(granting: boolean): void
1029
+ /**
1030
+ * The platform drops the lock, as it does when the window deactivates. The
1031
+ * next frame notices, so this draws one.
1032
+ */
1033
+ simulatePointerLockLost(): void
1034
+ /**
1035
+ * The window actions a press in an `appRegion: "drag"` box asked for since the last call,
1036
+ * oldest first: `move`, `titlebarDoubleClick`, `zoom` or `showMenu`. The offscreen window
1037
+ * cannot start a real move, so the test renderer records them instead.
1038
+ */
1039
+ takeSimulatedWindowActions(): Array<string>
1040
+ /**
1041
+ * The click an activation that is not a pointer press makes on `element_id`,
1042
+ * and the activation behaviour that follows it; collected for
1043
+ * `drainEvents` like every other event.
1044
+ */
1045
+ clickElement(elementId: number): void
1046
+ /** Packed `"rgba"` (default) or `"bgra"` pixels onto an `<img>` host node. */
1047
+ setImagePixels(elementId: number, width: number, height: number, pixels: Buffer, format?: string | undefined | null): void
1048
+ /** Encoded image bytes onto an `<img>` host node. */
1049
+ setImage(elementId: number, bytes: Buffer): void
1050
+ /** Encoded bytes for the `blob:` URL a `url()` background image names. */
1051
+ setStyleImage(url: string, bytes: Buffer): void
1052
+ /** The `blob:` URL a `url()` background names could not be read. */
1053
+ failStyleImage(url: string, message: string): void
1054
+ /** `select()` on an `<input>` or `<textarea>`. */
1055
+ selectText(elementId: number): void
1056
+ /** `setSelectionRange(start, end, direction)`; offsets are UTF-16 units. */
1057
+ setSelectionRange(elementId: number, start: number, end: number, direction?: string | undefined | null): void
1058
+ /** `form.requestSubmit()`: validate, then emit `submit`. */
1059
+ requestSubmit(id: number): void
1060
+ /** `selectionStart`, `selectionEnd` and `selectionDirection`. */
1061
+ getTextSelection(elementId: number): TextSelection
1062
+ /**
1063
+ * `loadURL(url)` (with the URL as `argument`), `reload()`, `stop()`, `goBack()` and
1064
+ * `goForward()` of a `<webview>`.
1065
+ */
1066
+ webviewCommand(elementId: number, command: string, argument?: string | undefined | null): void
1067
+ /** The URL, the title and the history of a `<webview>`. */
1068
+ webviewState(elementId: number): WebviewStateReading
1069
+ /**
1070
+ * Runs `code` in the page of a `<webview>`. Resolves with the JSON of the result, or null for
1071
+ * `undefined`, once a test settles it (`settleWebviewScript`).
1072
+ */
1073
+ webviewExecuteJavascript(elementId: number, code: string): Promise<string | null>
1074
+ /** What the page of a `<webview>` was asked to do, in order. */
1075
+ getWebviewCommands(elementId: number): Array<WebviewCommandReading>
1076
+ /** The page starts loading: `did-start-loading`. */
1077
+ simulateWebviewStartLoading(elementId: number): void
1078
+ /** The page stops loading: `did-stop-loading`. */
1079
+ simulateWebviewStopLoading(elementId: number): void
1080
+ /** The page commits `url`: `did-navigate`, and `getURL()` answers it. */
1081
+ simulateWebviewNavigate(elementId: number, url: string): void
1082
+ /** The page gets a title: `page-title-updated`, and `getTitle()` answers it. */
1083
+ simulateWebviewTitle(elementId: number, title: string, explicitSet: boolean): void
1084
+ /** A load fails: `did-fail-load`. */
1085
+ simulateWebviewFail(elementId: number, errorCode: number, errorDescription: string, validatedUrl?: string | undefined | null): void
1086
+ /**
1087
+ * The page of a `<webview>` hands the keyboard on, as it does when Tab leaves its last
1088
+ * tabbable element, or Shift+Tab (`backwards`) its first.
1089
+ */
1090
+ simulateWebviewTabOut(elementId: number, backwards: boolean): void
1091
+ /** What `canGoBack()` and `canGoForward()` answer. */
1092
+ setWebviewHistory(elementId: number, canGoBack: boolean, canGoForward: boolean): void
1093
+ /**
1094
+ * Settles the oldest `executeJavaScript` of a `<webview>` that waits: with the JSON of a
1095
+ * result (none for `undefined`), or with the message of the error the script threw.
1096
+ */
1097
+ settleWebviewScript(elementId: number, result?: string | undefined | null, error?: string | undefined | null): void
1098
+ /** Where the last composed frame put the surface of a `<webview>`, null while it has none. */
1099
+ getWebviewSurface(elementId: number): WebviewSurfaceReading | null
1100
+ /** The layers of the last composed frame, bottom to top. */
1101
+ getCompositionLayers(): Array<CompositionLayerReading>
1102
+ /**
1103
+ * The container view AppKit holds for the surface of a `<webview>`, with the placement the
1104
+ * last frame applied.
1105
+ */
1106
+ getWebviewNativeView(elementId: number): WebviewNativeViewReading
1107
+ /**
1108
+ * Where the last composed frame put the native view of a `<nativeview>`, null while it has no
1109
+ * surface or the frame did not place it.
1110
+ */
1111
+ getNativeviewSurface(elementId: number): NativeviewSurfaceReading | null
1112
+ /** The native surfaces the window made and removed, in order. */
1113
+ getNativeSurfaceEvents(): Array<NativeSurfaceEventReading>
1114
+ /** How many warnings a `<nativeview>` has issued. */
1115
+ getNativeviewWarnings(elementId: number): number
1116
+ /** Makes the window refuse native surfaces (`false`), as a platform that cannot compose does. */
1117
+ setNativeSurfacesAvailable(available: boolean): void
1118
+ /** Make the fonts in a TrueType or OpenType file usable by `fontFamily`. */
1119
+ registerFont(data: Buffer): void
1120
+ /**
1121
+ * The logical scroll anchor of a `<virtual-list>`:
1122
+ * `[itemIndex, offsetInItemPx, viewportHeightPx]`, or null for anything
1123
+ * else. `itemIndex == item count` is gpui's at-end sentinel.
1124
+ */
1125
+ getListScrollTop(elementId: number): Array<number> | null
1126
+ /** `"hidden"` | `"minimal"` | `"full"`. */
1127
+ setDebugFrameOverlay(mode: string): string
1128
+ /** Hidden → minimal → full → hidden. */
1129
+ cycleDebugFrameOverlay(): string
1130
+ getDebugFrameOverlay(): string
1131
+ /** Clears the last 1000 draw samples. Frame count stays. */
1132
+ resetDebugFrameOverlayStats(): void
1133
+ /** Same numbers as the on-screen overlay: current, p90, p99, max, frames. */
1134
+ getDebugFrameOverlayStats(): DebugFrameOverlayStats
1135
+ /** The default action of a scrolling key. See `GpuixRenderer::scroll_by_key`. */
1136
+ scrollByKey(key: string, shift: boolean): void
1137
+ /**
1138
+ * The DOM scroll geometry of an element:
1139
+ * `[scrollLeft, scrollTop, scrollWidth, scrollHeight, clientWidth, clientHeight]`, or null
1140
+ * if it has not been painted.
1141
+ */
1142
+ getScrollMetrics(elementId: number): Array<number> | null
1143
+ /**
1144
+ * The DOM scroll position of a scrollable element, `[scrollLeft, scrollTop]` (zero or
1145
+ * more), or null if it is not a scroll container or a `<virtual-list>`.
1146
+ */
1147
+ getScrollOffset(elementId: number): Array<number> | null
1148
+ /**
1149
+ * The CSS keyword of the cursor the window asks the platform for at the pointer's last
1150
+ * hit test (`default` when nothing asks). It is read from the window, not from the OS: the
1151
+ * offscreen window is not active, so the platform is never told. A move (or a draw) is
1152
+ * what updates it.
1153
+ */
1154
+ getCursor(): string
1155
+ /**
1156
+ * Capture a screenshot of the current rendered state and save as PNG.
1157
+ * Supported on macOS through Metal and Windows through DirectX.
1158
+ */
1159
+ captureScreenshot(path: string): void
1160
+ /**
1161
+ * Return and clear all collected events since the last drain.
1162
+ * Events are collected synchronously — no event loop queuing.
1163
+ */
1164
+ drainEvents(): Array<EventPayload>
1165
+ /** Get all text content in the tree (depth-first order). */
1166
+ getAllText(): Array<string>
1167
+ /** Find element IDs matching the given type (e.g. "div", "text"). */
1168
+ findByType(elementType: string): Array<number>
1169
+ /** Check if an element has a specific event listener. */
1170
+ hasEventListener(id: number, eventType: string): boolean
1171
+ /** Get the text content of an element. */
1172
+ getText(id: number): string | null
1173
+ /** Get the full tree as JSON for snapshot testing. */
1174
+ getTreeJson(): string
1175
+ /**
1176
+ * GPUI accessibility dump from the last painted frame.
1177
+ * Empty until a11y is active; the test renderer turns that on at construct.
1178
+ */
1179
+ getA11yTree(): string
1180
+ /** Tree JSON with last-paint bounds. Used by the automation locators. */
1181
+ getAutomationTree(): string
1182
+ /** Last painted bounds for an element, or null if it was not painted. */
1183
+ getElementBounds(id: number): ElementBounds | null
1184
+ /**
1185
+ * The box of an element for the first report of an observer: laid out as `getElementBounds`
1186
+ * does, but the content of a skipped ancestor is not, and an element inside it has no box
1187
+ * (null), as Chrome's observers see it.
1188
+ */
1189
+ probeElementBounds(id: number): ElementBounds | null
1190
+ /**
1191
+ * The box the last layout gave an element, or null if it was not built. Unlike
1192
+ * `getElementBounds`, it does not lay out the content of the skipped ancestors of the element
1193
+ * to answer, so it tells whether the content of a `content-visibility` element is built.
1194
+ */
1195
+ getBuiltElementBounds(id: number): ElementBounds | null
1196
+ /** Ids under the window point, topmost first. See the live renderer. */
1197
+ getElementsAt(x: number, y: number): Array<number>
1198
+ clockPause(): number
1199
+ clockSet(nowMs: number): number
1200
+ clockFastForward(deltaMs: number): number
1201
+ /**
1202
+ * Moves a paused clock as time passing does: the window is not told, as a live window is not
1203
+ * when its clock runs. `clockFastForward` notifies the view, so the frame after it is built
1204
+ * whole; the frame after this one is a tick, which can be drawn by patching the frame before.
1205
+ */
1206
+ clockAdvance(deltaMs: number): number
1207
+ clockResume(): number
1208
+ /** A value that is written with `set` and `jump` or animated. */
1209
+ createMotionValue(id: number, initial: any): void
1210
+ /**
1211
+ * A value mapped from the number value `input` through `inputRange` and
1212
+ * `outputRange`. `options` is `{ clamp?: boolean, ease?: ease | ease[] }`.
1213
+ */
1214
+ createMotionTransform(id: number, input: number, inputRange: Array<number>, outputRange: any, options?: any | undefined | null): void
1215
+ /**
1216
+ * A spring that chases another value. `config` is a spring transition
1217
+ * without the `type`.
1218
+ */
1219
+ createMotionFollower(id: number, source: number, config: any): void
1220
+ /** A spring with a target of its own, which `setMotionValue` moves. */
1221
+ createMotionSpring(id: number, initial: any, config: any): void
1222
+ /** Whether the value existed. Values that read it fail from then on. */
1223
+ disposeMotionValue(id: number): boolean
1224
+ getMotionValue(id: number): any
1225
+ /** Units per second. Errors for a value that is not a number. */
1226
+ getMotionValueVelocity(id: number): number
1227
+ isMotionValueAnimating(id: number): boolean
1228
+ /**
1229
+ * Writes the value. Over a running animation this does not stop it:
1230
+ * call `stopMotionValue` first to take the value from the animation.
1231
+ */
1232
+ setMotionValue(id: number, value: any): void
1233
+ /** Writes the value, ending any animation and dropping its velocity. */
1234
+ jumpMotionValue(id: number, value: any): void
1235
+ /**
1236
+ * Animates a value from where it is, with the speed it has. `transition`
1237
+ * is the same description `motion` takes, tween by default.
1238
+ */
1239
+ animateMotionValue(id: number, target: any, transition?: any | undefined | null): void
1240
+ /** Ends an animation where it is, keeping the speed for the next one. */
1241
+ stopMotionValue(id: number): void
1242
+ /**
1243
+ * Holds the value's animation where it is. The value stays, its velocity
1244
+ * reads 0 and no frame is asked for; `isMotionValueAnimating` stays true.
1245
+ */
1246
+ pauseMotionValue(id: number): void
1247
+ /**
1248
+ * Continues a held animation from the time it holds. A finished one plays
1249
+ * again from its start, or from its end when its speed is negative.
1250
+ */
1251
+ playMotionValue(id: number): void
1252
+ /**
1253
+ * Sets the time of the value's animation, Motion's `time`: it counts the
1254
+ * delay, so a time inside the delay shows the first keyframe. A finished
1255
+ * animation is held there; one seeked past its end finishes, and its time
1256
+ * reads back as set.
1257
+ */
1258
+ seekMotionValue(id: number, seconds: number): void
1259
+ /**
1260
+ * Sets the pace of the value's animation: 2 is twice as fast, a negative
1261
+ * speed runs it backwards to its first keyframe, 0 holds it while it stays
1262
+ * in effect. As in Motion, a hold lasts until `play`, whatever the speed
1263
+ * is set to after.
1264
+ */
1265
+ setMotionValueSpeed(id: number, speed: number): void
1266
+ /**
1267
+ * Jumps the value's animation to its last keyframe (the first when it runs
1268
+ * backwards) and finishes it.
1269
+ */
1270
+ completeMotionValue(id: number): void
1271
+ /**
1272
+ * What the controls of the value's animation read, or null if it has none:
1273
+ * it was never animated, or was stopped or jumped.
1274
+ */
1275
+ getMotionValuePlayback(id: number): MotionValuePlayback | null
1276
+ /**
1277
+ * Takes the frames away from the clock of the value's animation. See
1278
+ * `GpuixRenderer.detachMotionValueClock`.
1279
+ */
1280
+ detachMotionValueClock(id: number): void
1281
+ /** Chooses which events the value delivers. Neither removes the listener. */
1282
+ setMotionValueListener(id: number, change: boolean, animation: boolean): void
1283
+ /**
1284
+ * Defines the keyframes `animation-name: name` plays. See
1285
+ * `GpuixRenderer.defineKeyframes`.
1286
+ */
1287
+ defineKeyframes(name: string, framesJson: string): void
1288
+ /**
1289
+ * The CSS transitions, then the CSS animations, of an element that are
1290
+ * running, paused or in effect through a fill. See `GpuixRenderer.getAnimations`.
1291
+ */
1292
+ getAnimations(elementId: number): Array<WebAnimationInfo>
1293
+ /** `getAnimations({ subtree: true })` of an element. See `GpuixRenderer.getSubtreeAnimations`. */
1294
+ getSubtreeAnimations(elementId: number): Array<ElementWebAnimationInfo>
1295
+ /** `document.getAnimations()` of this renderer. See `GpuixRenderer.getDocumentAnimations`. */
1296
+ getDocumentAnimations(): Array<ElementWebAnimationInfo>
1297
+ /**
1298
+ * The SVG an `<svg>` element with shape children painted in the last
1299
+ * frame, as the XML its shapes were written to, or `null` when it painted
1300
+ * none. Animated attributes are in it as the frame had them.
1301
+ */
1302
+ getSvgMarkup(elementId: number): string | null
1303
+ /**
1304
+ * One CSS animation or transition by the id `getAnimations` gave. See
1305
+ * `GpuixRenderer.getAnimation`.
1306
+ */
1307
+ getAnimation(animationId: number): WebAnimationInfo
1308
+ /** See the renderer's `getAnimationEffect`. */
1309
+ getAnimationEffect(animationId: number): WebAnimationEffectInfo
1310
+ /** See the renderer's `getAnimationKeyframes`. */
1311
+ getAnimationKeyframes(animationId: number): Array<WebAnimationKeyframeInfo>
1312
+ /** See the renderer's `updateAnimationTiming`. */
1313
+ updateAnimationTiming(animationId: number, timing: WebAnimationTimingUpdate): void
1314
+ /** See the renderer's `releaseAnimation`. */
1315
+ releaseAnimation(animationId: number): void
1316
+ /** See the renderer's `forgetAnimation`. */
1317
+ forgetAnimation(animationId: number): void
1318
+ /**
1319
+ * `animation.pause()`: holds the current time at once, and from here the
1320
+ * style's `animation-play-state` no longer decides.
1321
+ */
1322
+ pauseAnimation(animationId: number): void
1323
+ /**
1324
+ * `animation.play()`: continues from the held time at the next frame, or
1325
+ * from the start (the end when running backwards) if it has finished.
1326
+ */
1327
+ playAnimation(animationId: number): void
1328
+ /** `animation.currentTime = milliseconds`. */
1329
+ setAnimationCurrentTime(animationId: number, milliseconds: number): void
1330
+ /** `animation.playbackRate = rate`, keeping the current time. */
1331
+ setAnimationPlaybackRate(animationId: number, rate: number): void
1332
+ /**
1333
+ * `animation.cancel()`: the animation is idle, with no current time and out of
1334
+ * `getAnimations()`; `play()` brings it back from the start.
1335
+ */
1336
+ cancelAnimation(animationId: number): void
1337
+ /**
1338
+ * `animation.finish()`. Throws `InvalidStateError: ...` for a rate of 0 and for an animation
1339
+ * that never ends.
1340
+ */
1341
+ finishAnimation(animationId: number): void
1342
+ /**
1343
+ * `animation.reverse()`: the rate flips at the next frame. Throws `InvalidStateError: ...`
1344
+ * for an animation that never ends, from its start.
1345
+ */
1346
+ reverseAnimation(animationId: number): void
1347
+ /**
1348
+ * `animation.updatePlaybackRate(rate)`: at the next frame for a running animation, at once
1349
+ * for the others.
1350
+ */
1351
+ updateAnimationPlaybackRate(animationId: number, rate: number): void
1352
+ /**
1353
+ * `animation.startTime = startTime`, in milliseconds on the timeline of the animations
1354
+ * (`getAnimationTimelineTime`); `null` holds the current time.
1355
+ */
1356
+ setAnimationStartTime(animationId: number, startTime?: number | undefined | null): void
1357
+ /**
1358
+ * The time of the timeline of the animations (`animation.timeline.currentTime`): the
1359
+ * instant of the last frame, in milliseconds on the clock of the renderer. The same
1360
+ * number `startTime` and the `timelineTime` of the events are on.
1361
+ */
1362
+ getAnimationTimelineTime(): number
1363
+ /** Advance GPUI's deterministic test executor and run due timers. */
1364
+ advanceTime(milliseconds: number): void
1365
+ /** Get the root element ID, or null if no root is set. */
1366
+ getRootId(): number | null
1367
+ /**
1368
+ * The offscreen window size, so `useWindowSize()` reports the same numbers
1369
+ * under test as in a real window instead of falling back to a default.
1370
+ */
1371
+ getWindowSize(): WindowSize
1372
+ /**
1373
+ * Resize the offscreen window's content to `width` x `height`, as a user dragging its
1374
+ * edge would: the size queries of `matchMedia` and `useWindowSize` see it, and a
1375
+ * listening window queues a `mediaChange` event.
1376
+ */
1377
+ setWindowSize(width: number, height: number): void
1378
+ /**
1379
+ * Gives the window the scale factor of a display of another density, `2` for a retina one:
1380
+ * the next frame lays out and paints at it, and a screenshot is the window's size times it.
1381
+ * The factor stays until it is set again: resizing the window does not reset it.
1382
+ */
1383
+ setWindowScaleFactor(scaleFactor: number): void
1384
+ }
1385
+
1386
+ /** Counts of the work the element build did, see `get_build_counters`. */
1387
+ export interface BuildCounters {
1388
+ /** Elements `build_element` ran for. Text and inline boxes a paragraph builds itself are not counted. */
1389
+ elementsBuilt: number
1390
+ /**
1391
+ * Elements a frame did not build because nothing they were built from had changed: they
1392
+ * were replayed, or built later by gpui for a frame that could not replay them (those are
1393
+ * counted in `elementsBuilt` as well).
1394
+ */
1395
+ elementsSkipped: number
1396
+ /** `StyleDesc` values cloned, a state style inside a style counted as its own. */
1397
+ styleDescClones: number
1398
+ inheritedClones: number
1399
+ /** The maximal unchanged subtrees a retained replay could have reused, see `retain`. */
1400
+ retainableRoots: number
1401
+ /** Elements in them, of `elementsBuilt`. */
1402
+ retainableElements: number
1403
+ /** Elements in those roots that hold at least eight. */
1404
+ retainableElementsLarge: number
1405
+ /** Elements judged unchanged that were built differently. Always 0 unless `setRetainVerify`. */
1406
+ retainMismatches: number
1407
+ /** Subtrees built whole as units: running paint-only animations a tick can build again alone. */
1408
+ unitsBuilt: number
1409
+ /** Subtrees that were that but hold more elements than a unit may. */
1410
+ unitsOversized: number
1411
+ /**
1412
+ * Motions a sync read the element of: every motion of the page in a frame built whole, the ones
1413
+ * that move in a tick that is patched.
1414
+ */
1415
+ motionsSynced: number
1416
+ /**
1417
+ * Motion values sampled for the elements that bind them: every value bound in a frame built
1418
+ * whole, the ones that move or were written in a tick that is patched.
1419
+ */
1420
+ motionValuesSampled: number
1421
+ /**
1422
+ * A JSON object: elements by the reason they are, or are not, in a retainable subtree, for
1423
+ * the builds since the reset. `retained` is the share that is; every built element is counted
1424
+ * once.
1425
+ */
1426
+ retainReasons: string
1427
+ }
1428
+
1429
+ /**
1430
+ * Ask the update feed whether a newer signed bundle exists.
1431
+ *
1432
+ * Returns `null` when the feed is 204 or the announced version is not newer.
1433
+ * `downloadAndInstall()` replaces the packaged app. It does not relaunch.
1434
+ */
1435
+ export declare function checkUpdate(currentVersion: string, options: CheckUpdateOptions): Promise<AvailableUpdate | null>
1436
+
1437
+ /** Options for [`check_update`]. */
1438
+ export interface CheckUpdateOptions {
1439
+ /** Feed URLs. Slots `{{target}}`, `{{arch}}`, `{{current_version}}` are filled. */
1440
+ endpoints: Array<string>
1441
+ /** Public key from `cargo packager signer generate`. */
1442
+ pubkey: string
1443
+ /** Extra HTTP headers for the feed request. */
1444
+ headers?: Array<UpdaterHeader>
1445
+ /** Request timeout in milliseconds. */
1446
+ timeoutMs?: number
1447
+ /** Windows NSIS / WiX extra args. */
1448
+ installerArgs?: Array<string>
1449
+ /** Windows install UI: `passive` (default), `quiet`, or `basicUi`. */
1450
+ installMode?: string
1451
+ }
1452
+
1453
+ /** One layer of the last composed frame. */
1454
+ export interface CompositionLayerReading {
1455
+ /** `"gpui"` or `"native"`. */
1456
+ kind: string
1457
+ /** The window's own GPUI layer, the one below every surface. */
1458
+ isBase: boolean
1459
+ /** For a GPUI layer: the primitives and groups of the scene it draws. */
1460
+ primitives: number
1461
+ /** For a native layer: the element of its webview. */
1462
+ webview?: number
1463
+ /** For a native layer: the element of its nativeview. */
1464
+ nativeview?: number
1465
+ /** For a native layer: whether it shows. */
1466
+ visible: boolean
1467
+ }
1468
+
1469
+ /** Recorded draw times from the debug frame overlay. */
1470
+ export interface DebugFrameOverlayStats {
1471
+ currentMs?: number
1472
+ p90Ms?: number
1473
+ p99Ms?: number
1474
+ maxMs?: number
1475
+ frames: number
1476
+ samples: number
1477
+ }
1478
+
1479
+ /**
1480
+ * A display, as Electron's `Display`. Coordinates are CSS px in one global space: the origin is
1481
+ * the top-left of the primary display, y points down, and a display left of or above it has
1482
+ * negative coordinates.
1483
+ */
1484
+ export interface Display {
1485
+ id: number
1486
+ /** The name the OS gives the display, such as "Built-in Retina Display". */
1487
+ label: string
1488
+ bounds: Rectangle
1489
+ /** `bounds` without the menu bar and the Dock. */
1490
+ workArea: Rectangle
1491
+ /** Device pixels per CSS px. */
1492
+ scaleFactor: number
1493
+ /** Degrees clockwise: 0, 90, 180 or 270. */
1494
+ rotation: number
1495
+ /** True for the display built into the machine. */
1496
+ internal: boolean
1497
+ /** The size of `bounds`. */
1498
+ size: Size
1499
+ /** The size of `workArea`. */
1500
+ workAreaSize: Size
1501
+ }
1502
+
1503
+ /**
1504
+ * One file of an OS file drag, as the DOM `File` plus the path the browser
1505
+ * would hide.
1506
+ */
1507
+ export interface DroppedFile {
1508
+ path: string
1509
+ name: string
1510
+ size: number
1511
+ /** MIME type guessed from the extension, empty when unknown. */
1512
+ type: string
1513
+ /** Milliseconds since the Unix epoch. */
1514
+ lastModified: number
1515
+ }
1516
+
1517
+ export interface EdgeInsets {
1518
+ top: number
1519
+ right: number
1520
+ bottom: number
1521
+ left: number
1522
+ }
1523
+
1524
+ /**
1525
+ * Last box of a host element, as layout computed it: fractional, in 1/64 of a pixel, as
1526
+ * `getBoundingClientRect` reports it, and not the box snapped to device pixels that is painted.
1527
+ * The box of a transformed element, or one inside a transformed element, is the smallest box that
1528
+ * holds its corners after the transforms.
1529
+ */
1530
+ export interface ElementBounds {
1531
+ x: number
1532
+ y: number
1533
+ width: number
1534
+ height: number
1535
+ /**
1536
+ * The DOM's `clientLeft` and `clientTop`: the left and top border widths, rounded to whole
1537
+ * pixels as the DOM does.
1538
+ */
1539
+ clientLeft: number
1540
+ clientTop: number
1541
+ }
1542
+
1543
+ /** A [`WebAnimationInfo`] with the element the run is of, for a read that spans elements. */
1544
+ export interface ElementWebAnimationInfo {
1545
+ elementId: number
1546
+ info: WebAnimationInfo
1547
+ }
1548
+
1549
+ export interface EventModifiers {
1550
+ shift: boolean
1551
+ ctrl: boolean
1552
+ alt: boolean
1553
+ cmd: boolean
1554
+ }
1555
+
1556
+ /** Event payload sent back to JS when a user interacts with an element. */
1557
+ export interface EventPayload {
1558
+ /**
1559
+ * Numeric element ID (matches the ID assigned in JS via createElement).
1560
+ * This payload is what native sends: `target`, `path` and `related_target`
1561
+ * are ids. JS turns them into elements before a handler sees the event, and
1562
+ * `elementId` stays the id on the event a handler gets.
1563
+ */
1564
+ elementId: number
1565
+ /**
1566
+ * Event type string — matches the key used in EVENT_PROPS on the JS side.
1567
+ * e.g. "click", "mousedown", "mouseenter", "keydown", "wheel", etc. Pointer,
1568
+ * mouse and drag types are the lowercase DOM names.
1569
+ */
1570
+ eventType: string
1571
+ /** Mouse X position in window coordinates (pixels). */
1572
+ x?: number
1573
+ /** Mouse Y position in window coordinates (pixels). */
1574
+ y?: number
1575
+ /**
1576
+ * Which mouse button: 0=left, 1=middle, 2=right.
1577
+ * Populated for: mousedown, mouseup, click, auxclick, contextmenu, mousedownoutside.
1578
+ */
1579
+ button?: number
1580
+ /**
1581
+ * Number of consecutive clicks (1=single, 2=double, 3=triple).
1582
+ * Populated for: the click-family and down/up events; `detail` carries the same count.
1583
+ */
1584
+ clickCount?: number
1585
+ /**
1586
+ * Whether this is a right-click (convenience for click events).
1587
+ * true when button==2 or ClickEvent::is_right_click().
1588
+ */
1589
+ isRightClick?: boolean
1590
+ /**
1591
+ * Which mouse button is currently held during a mouseMove.
1592
+ * Same encoding as `button`: 0=left, 1=middle, 2=right.
1593
+ * Populated for: mousemove.
1594
+ */
1595
+ pressedButton?: number
1596
+ /**
1597
+ * DOM `KeyboardEvent.key`: "a", "A", "Enter", "Escape", "ArrowDown", " ",
1598
+ * "F1", "Shift". On macOS the character the keyboard layout types, with
1599
+ * shift and option applied. See `events/key_names.rs`.
1600
+ * Populated for: keydown, keyup.
1601
+ */
1602
+ key?: string
1603
+ /**
1604
+ * DOM `KeyboardEvent.code`, the physical key: "KeyA", "Digit1", "Enter",
1605
+ * "ArrowLeft". From the key code where the platform reports one (macOS),
1606
+ * otherwise derived from the key assuming a US QWERTY layout, and empty
1607
+ * when it cannot be derived.
1608
+ * Populated for: keydown, keyup.
1609
+ */
1610
+ code?: string
1611
+ /**
1612
+ * Legacy `KeyboardEvent.keyCode`, a Windows virtual-key code with the
1613
+ * numbers Chrome on macOS reports: 65-90 for letters, 48-57 for the digit
1614
+ * row, 13 for Enter, 37-40 for the arrows, 229 for a key the input method
1615
+ * took ("Process"), and 0 for a key Chrome gives no code. See
1616
+ * `events/key_codes.rs`.
1617
+ * Populated for: keydown, keyup.
1618
+ */
1619
+ keyCode?: number
1620
+ /**
1621
+ * Legacy `KeyboardEvent.which`, equal to `key_code`.
1622
+ * Populated for: keydown, keyup.
1623
+ */
1624
+ which?: number
1625
+ /**
1626
+ * The character produced by the key press (e.g. "ß" for option-s).
1627
+ * May differ from `key` when modifiers are active.
1628
+ * Populated for: keydown, keyup.
1629
+ */
1630
+ keyChar?: string
1631
+ /**
1632
+ * Whether this is a key-repeat event (key held down). Same as `repeat`.
1633
+ * Populated for: keydown.
1634
+ */
1635
+ isHeld?: boolean
1636
+ /**
1637
+ * DOM `KeyboardEvent.repeat`.
1638
+ * Populated for: keydown, keyup.
1639
+ */
1640
+ repeat?: boolean
1641
+ /**
1642
+ * DOM `KeyboardEvent.isComposing`: an input method composition is in
1643
+ * progress. Only macOS reports it; elsewhere it is always false.
1644
+ * Populated for: keydown, keyup, change.
1645
+ */
1646
+ isComposing?: boolean
1647
+ /**
1648
+ * DOM `CompositionEvent.data`: the text the composition replaces on
1649
+ * compositionstart (the selection), the composition's current text on
1650
+ * compositionupdate and the text it ended with on compositionend.
1651
+ * Populated for: compositionstart, compositionupdate, compositionend.
1652
+ */
1653
+ data?: string
1654
+ /**
1655
+ * DOM `InputEvent.inputType` of an edit of the text (`insertText`,
1656
+ * `deleteContentBackward`, `historyUndo`, ...), `""` for the number
1657
+ * stepper. `data` is the inserted text for the insert types and absent
1658
+ * otherwise; `isComposing` says the edit belongs to a composition.
1659
+ * Populated for: change.
1660
+ */
1661
+ inputType?: string
1662
+ /**
1663
+ * DOM `shiftKey`, `ctrlKey`, `altKey`, `metaKey`: the booleans of
1664
+ * `modifiers`, under the DOM names.
1665
+ * Populated for: keydown, keyup.
1666
+ */
1667
+ shiftKey?: boolean
1668
+ ctrlKey?: boolean
1669
+ altKey?: boolean
1670
+ metaKey?: boolean
1671
+ /**
1672
+ * Wheel delta on the X axis in pixels, positive towards the end, like the DOM.
1673
+ * Populated for: wheel.
1674
+ */
1675
+ deltaX?: number
1676
+ /**
1677
+ * Wheel delta on the Y axis in pixels, positive towards the end, like the DOM.
1678
+ * Populated for: wheel.
1679
+ */
1680
+ deltaY?: number
1681
+ /**
1682
+ * DOM `WheelEvent.deltaMode`. Always 0 (pixels): a mouse wheel's lines are
1683
+ * converted natively.
1684
+ * Populated for: wheel.
1685
+ */
1686
+ deltaMode?: number
1687
+ /**
1688
+ * true = pixel-precise (trackpad), false = line-based (mouse wheel).
1689
+ * Populated for: wheel.
1690
+ */
1691
+ precise?: boolean
1692
+ /**
1693
+ * Touch phase for scroll: "started", "moved", "ended".
1694
+ * Populated for: wheel (trackpad gestures).
1695
+ */
1696
+ touchPhase?: string
1697
+ /**
1698
+ * true = mouse entered element, false = mouse left element.
1699
+ * Populated for: mouseenter, mouseleave.
1700
+ */
1701
+ hovered?: boolean
1702
+ /**
1703
+ * Element-defined string payload.
1704
+ * Populated for: `<diff>` toggleFile (the file path), showMore (the
1705
+ * hidden line count), and lineClick (the line text); `<markdown>`
1706
+ * linkClick (the URL); `selectionChange` (joined selected text, or
1707
+ * absent when the selection is empty).
1708
+ */
1709
+ value?: string
1710
+ /** Line number on the pre-change side. Populated for: `<diff>` lineClick. */
1711
+ oldLine?: number
1712
+ /** Line number on the post-change side. Populated for: `<diff>` lineClick. */
1713
+ newLine?: number
1714
+ /** First visible logical index. Populated for: `<virtual-list>` visibleRange. */
1715
+ startIndex?: number
1716
+ /** Exclusive end of the visible logical range. Populated for: visibleRange. */
1717
+ endIndex?: number
1718
+ /**
1719
+ * Intrinsic size of the decoded image, in pixels.
1720
+ * Populated for: `<img>` load.
1721
+ */
1722
+ naturalWidth?: number
1723
+ naturalHeight?: number
1724
+ /**
1725
+ * Border-box size of the element, in pixels. With `x` and `y`, its position
1726
+ * in window coordinates. Populated for: layout.
1727
+ */
1728
+ width?: number
1729
+ height?: number
1730
+ /**
1731
+ * Scroll offset of the element, the pair `getScrollOffset` returns: 0 at the
1732
+ * start and negative as the content moves. Populated for: scroll.
1733
+ */
1734
+ scrollX?: number
1735
+ scrollY?: number
1736
+ /**
1737
+ * Where an `<anchored>` layer settled: `"top"`, `"right"`, `"bottom"` or `"left"`, and
1738
+ * the requested alignment. With the room left for the layer in whole pixels.
1739
+ * Populated for: placement.
1740
+ */
1741
+ side?: string
1742
+ align?: string
1743
+ availableWidth?: number
1744
+ availableHeight?: number
1745
+ /**
1746
+ * Border-box size of the trigger an `<anchored>` layer is placed against.
1747
+ * Populated for: placement.
1748
+ */
1749
+ anchorWidth?: number
1750
+ anchorHeight?: number
1751
+ /**
1752
+ * Matches found by this element's `highlight` prop. Counted once per match
1753
+ * even when it is split across several painted runs, and it counts every
1754
+ * retained match, not only the ones currently on screen.
1755
+ * Populated for: highlight.
1756
+ */
1757
+ matchCount?: number
1758
+ /**
1759
+ * Logical native motion target that reached completion.
1760
+ * Populated for: motionComplete.
1761
+ */
1762
+ motionGeneration?: number
1763
+ /**
1764
+ * The files of an OS file drag (`dataTransfer.files`). Sent once per drag,
1765
+ * with its first event, a `dragenter`.
1766
+ */
1767
+ files?: Array<DroppedFile>
1768
+ /**
1769
+ * `[name, value]` of every named, enabled control in the form, in document
1770
+ * order. Populated for: `<form>` submit.
1771
+ */
1772
+ formEntries?: Array<Array<string>>
1773
+ /**
1774
+ * Id of the element the event was aimed at (JS makes it `event.target`, the
1775
+ * element itself). Absent means `element_id` is the target. Ids are `f64`
1776
+ * like `element_id`: `u64` would reach JS as a `bigint` and never match the
1777
+ * `number` keys of the handler map.
1778
+ */
1779
+ target?: number
1780
+ /**
1781
+ * Propagation path, target first and then each ancestor up to the root.
1782
+ * JS runs capture over it root to target and bubble target to root, and
1783
+ * gives handlers the elements as `composedPath()`. Absent means the event is
1784
+ * handled at `element_id` only.
1785
+ */
1786
+ path?: Array<number>
1787
+ /**
1788
+ * Id of the other element of a boundary or focus event (JS makes it
1789
+ * `event.relatedTarget`, the element itself, or `null` when absent).
1790
+ * Populated for: mouseover, mouseout, mouseenter, mouseleave and the pointer equivalents,
1791
+ * the drag enter and leave events, and the focus events: the element gaining focus on
1792
+ * blur and focusout, the one losing it on focus and focusin. Absent when focus came
1793
+ * from or went to nothing.
1794
+ */
1795
+ relatedTarget?: number
1796
+ /**
1797
+ * Pointer position in window coordinates, the DOM `clientX`/`clientY`.
1798
+ * Same values as `x`/`y`, which stay for existing handlers.
1799
+ */
1800
+ clientX?: number
1801
+ clientY?: number
1802
+ /**
1803
+ * Pointer position relative to the target's padding edge (its border box
1804
+ * minus its border widths), the DOM `offsetX`/`offsetY`.
1805
+ */
1806
+ offsetX?: number
1807
+ offsetY?: number
1808
+ /**
1809
+ * Pointer motion since the previous move, in logical pixels, the DOM
1810
+ * `movementX`/`movementY`. Set on every pointer, mouse, wheel and drag
1811
+ * event: the motion on pointermove and mousemove, 0 on the rest. Zero on a
1812
+ * move too where the platform reports no relative motion.
1813
+ */
1814
+ movementX?: number
1815
+ movementY?: number
1816
+ /**
1817
+ * Buttons held while the event fires, as the DOM bitmask: 1 primary,
1818
+ * 2 secondary, 4 auxiliary, 8 back, 16 forward.
1819
+ */
1820
+ buttons?: number
1821
+ /**
1822
+ * The DOM `detail`: the consecutive click count on click-family and
1823
+ * down/up events.
1824
+ */
1825
+ detail?: number
1826
+ /** The DOM `pointerId`. 1 for the mouse, -1 for a click no pointer made. */
1827
+ pointerId?: number
1828
+ /** The DOM `pointerType`. "mouse" for the mouse, empty for a click no pointer made. */
1829
+ pointerType?: string
1830
+ /**
1831
+ * Whether the element matches `:focus-visible`: the new focus for `focus`
1832
+ * and `focusin`, the focus being left for `blur` and `focusout`.
1833
+ * Populated for: focus, blur, focusin, focusout.
1834
+ */
1835
+ focusVisible?: boolean
1836
+ /**
1837
+ * Whether the element skips its content (`content-visibility: auto`).
1838
+ * Populated for: contentvisibilityautostatechange.
1839
+ */
1840
+ skipped?: boolean
1841
+ /**
1842
+ * Content box, visible rect and viewport for an observer.
1843
+ * Populated for: resizeObserve, intersectObserve. With `x`, `y`, `width`
1844
+ * and `height` as the border box.
1845
+ */
1846
+ observation?: Observation
1847
+ /**
1848
+ * CSS name of the property a transition animates, `background-color`.
1849
+ * Populated for: transitionrun, transitionstart, transitionend,
1850
+ * transitioncancel.
1851
+ */
1852
+ propertyName?: string
1853
+ /**
1854
+ * The `animation-name` of the animation, as the DOM `animationName`.
1855
+ * Populated for: animationstart, animationiteration, animationend,
1856
+ * animationcancel.
1857
+ */
1858
+ animationName?: string
1859
+ /**
1860
+ * The id of the CSS animation or transition (`getAnimation`) the event is
1861
+ * about. Populated for: webanimationfinish, webanimationcancel, which are
1862
+ * internal events for the `Animation` objects of `getAnimations()`: they
1863
+ * carry no path, so they reach no handler of the app.
1864
+ */
1865
+ animationId?: number
1866
+ /**
1867
+ * Milliseconds, the `currentTime` of the `AnimationPlaybackEvent`. Populated for:
1868
+ * webanimationfinish.
1869
+ */
1870
+ currentTime?: number
1871
+ /**
1872
+ * Milliseconds on the renderer's clock, the `timelineTime` of the
1873
+ * `AnimationPlaybackEvent`: the timeline time the event was made at. Populated for:
1874
+ * webanimationfinish, webanimationcancel.
1875
+ */
1876
+ timelineTime?: number
1877
+ /**
1878
+ * Seconds of the transition's or animation's active time, as the DOM
1879
+ * `elapsedTime`. Populated for: the transition and animation events.
1880
+ */
1881
+ elapsedTime?: number
1882
+ /**
1883
+ * Always `""`: gpuix has no pseudo-elements. Populated for: the transition
1884
+ * and animation events.
1885
+ */
1886
+ pseudoElement?: string
1887
+ /** The URL a `<webview>` committed. Populated for: did-navigate. */
1888
+ url?: string
1889
+ /** The title of the page of a `<webview>`. Populated for: page-title-updated. */
1890
+ title?: string
1891
+ /**
1892
+ * Whether the page set its title (`document.title`) and not the browser from the URL.
1893
+ * Populated for: page-title-updated.
1894
+ */
1895
+ explicitSet?: boolean
1896
+ /**
1897
+ * The `NSURLError` code of a failed `<webview>` load (`-1009` for no network), not a
1898
+ * Chromium net error. Populated for: did-fail-load.
1899
+ */
1900
+ errorCode?: number
1901
+ /** The localized description of the failure. Populated for: did-fail-load. */
1902
+ errorDescription?: string
1903
+ /** The URL that failed to load. Populated for: did-fail-load. */
1904
+ validatedUrl?: string
1905
+ /**
1906
+ * The address of the content `NSView` of a `<nativeview>` as a decimal string: a pointer
1907
+ * does not survive a round trip through an `f64` on every platform, and JS makes a `bigint`
1908
+ * of it. Populated for: attach, detach.
1909
+ */
1910
+ nativeHandle?: string
1911
+ modifiers?: EventModifiers
1912
+ }
1913
+
1914
+ /**
1915
+ * What building and drawing the elements did in the window since it was made, see
1916
+ * `get_frame_work_counters`.
1917
+ */
1918
+ export interface FrameWorkCounters {
1919
+ /**
1920
+ * Elements whose own prepaint ran, outside a subtree the clip hides. A retained subtree that
1921
+ * is replayed prepaints none of its elements, and its root wrapper is not counted.
1922
+ */
1923
+ prepainted: number
1924
+ /** Elements prepainted inside a subtree the clip hides (culled). */
1925
+ culledPrepainted: number
1926
+ /** Elements whose own paint ran. */
1927
+ painted: number
1928
+ /** Elements painted inside a culled subtree. */
1929
+ culledPainted: number
1930
+ /** Primitives painting put into the scene, after what is hidden or clipped away is left out. */
1931
+ paintedPrimitives: number
1932
+ /** Primitives a replay put into the scene again, which are not painted ones. */
1933
+ replayedPrimitives: number
1934
+ /**
1935
+ * Draw orders worked out with a scene's bounds tree. A scene a patch makes again from the
1936
+ * orders it had pays none, so the cost of a patched tick is not that of the page.
1937
+ */
1938
+ boundsInserts: number
1939
+ /**
1940
+ * Glyphs rasterized because the atlas did not have them. A glyph of a patched root that the
1941
+ * clip hides is not rasterized until it shows.
1942
+ */
1943
+ rasterizedGlyphs: number
1944
+ /**
1945
+ * Frame callbacks that carried the animations of culled content on without drawing
1946
+ * (`GpuixView::dormant_tick`).
1947
+ */
1948
+ dormantTicks: number
1949
+ }
1950
+
1951
+ /** Every display, in the order the OS lists them. */
1952
+ export declare function getAllDisplays(): Array<Display>
1953
+
1954
+ /** The display with the menu bar. Its `bounds` start at 0, 0. */
1955
+ export declare function getPrimaryDisplay(): Display
1956
+
1957
+ /** True only when this binary compiled the real GPU test renderer. */
1958
+ export declare function hasTestGpuixRenderer(): boolean
1959
+
1960
+ /**
1961
+ * One highlight wash painted in the last frame, with the boxes it drew.
1962
+ *
1963
+ * The rects matter: a quad never lands in `getPaintedText()`, and a match that
1964
+ * soft-wraps must produce one box per visual row. Without the geometry the only
1965
+ * way to assert either is a screenshot.
1966
+ */
1967
+ export interface HighlightMatch {
1968
+ /** Numeric id of the element that painted the run. */
1969
+ elementId: number
1970
+ /** Index of the run within that element. 0 for a plain `<text>`. */
1971
+ sub: number
1972
+ /** The full string of the run, so `text.slice(start, end)` is the match. */
1973
+ text: string
1974
+ /** UTF-16 code-unit offsets into `text`, the units JS strings use. */
1975
+ start: number
1976
+ end: number
1977
+ active: boolean
1978
+ rects: Array<HighlightRect>
1979
+ }
1980
+
1981
+ export interface HighlightRect {
1982
+ x: number
1983
+ y: number
1984
+ width: number
1985
+ height: number
1986
+ }
1987
+
1988
+ /**
1989
+ * Wayland `wlr-layer-shell` surface options. Linux/Wayland only; ignored on
1990
+ * every other platform. When present on `WindowOptions`, the window is opened
1991
+ * as a compositor-anchored surface (a bar, dock, notification overlay or
1992
+ * wallpaper) with no native titlebar instead of a normal floating window.
1993
+ * `width` / `height` then only constrain the axis the surface is not
1994
+ * stretched along by its `anchor`.
1995
+ */
1996
+ export interface LayerShellOptions {
1997
+ /**
1998
+ * Compositor surface namespace, used for window rules. Cannot be changed
1999
+ * after the surface is created. Defaults to the empty string.
2000
+ */
2001
+ namespace?: string
2002
+ /** `"background"` | `"bottom"` | `"top"` | `"overlay"`. Defaults to `"top"`. */
2003
+ layer?: string
2004
+ /**
2005
+ * Screen edges to anchor to: any combination of `"top"`, `"bottom"`,
2006
+ * `"left"`, `"right"`. Anchoring two opposite edges stretches the surface
2007
+ * across that axis. Defaults to `["top", "left", "right"]` (a top bar).
2008
+ */
2009
+ anchor?: Array<string>
2010
+ /**
2011
+ * Logical pixels to reserve along the anchored edge so other windows do
2012
+ * not overlap the surface. `0` lets the compositor decide, a negative
2013
+ * value asks it not to reserve any space.
2014
+ */
2015
+ exclusiveZone?: number
2016
+ /**
2017
+ * Which edge the exclusive zone applies to when it cannot be inferred from
2018
+ * a single-edge `anchor`. Same values as one `anchor` entry.
2019
+ */
2020
+ exclusiveEdge?: string
2021
+ /**
2022
+ * Gap between the surface and its anchor edge(s), in CSS order:
2023
+ * `[top, right, bottom, left]`. Must have exactly four entries or it is
2024
+ * ignored.
2025
+ */
2026
+ margin?: Array<number>
2027
+ /**
2028
+ * `"none"` | `"on-demand"` | `"exclusive"`. Defaults to `"none"`: a bar or
2029
+ * overlay that never takes keyboard focus.
2030
+ */
2031
+ keyboardInteractivity?: string
2032
+ }
2033
+
2034
+ /** What the layout engine of the window has done since the window was made, see `get_layout_counters`. */
2035
+ export interface LayoutCounters {
2036
+ nodesCreated: number
2037
+ nodesReused: number
2038
+ nodesRemoved: number
2039
+ stylesSet: number
2040
+ childrenSet: number
2041
+ passes: number
2042
+ /** Calls to the measure functions of text and other measured leaves. */
2043
+ measures: number
2044
+ /**
2045
+ * Nodes whose layout algorithm ran to place them: taffy's cache misses. A change to one leaf
2046
+ * costs its chain of ancestors (and what their new sizes reach), not the size of the tree.
2047
+ */
2048
+ nodesLaidOut: number
2049
+ /**
2050
+ * Nodes whose layout algorithm ran only to size them, which a parent does to learn what a
2051
+ * child contributes before it places it. Not counted in `nodesLaidOut`.
2052
+ */
2053
+ nodesSized: number
2054
+ /**
2055
+ * Elements the accessibility links read to resolve labels and `aria-*` id references, since the
2056
+ * tree was made. A tree with none of either reads none.
2057
+ */
2058
+ relationVisits: number
2059
+ /** Lines the platform shaped, since the window was made: the line layout cache missed. */
2060
+ shapes: number
2061
+ /**
2062
+ * Wrapped line layouts computed (shaped and wrapped) because neither the frame nor the one
2063
+ * before had them.
2064
+ */
2065
+ wrappedLayouts: number
2066
+ /** Line layout lookups that found a layout of this frame or the frame before. */
2067
+ lineLayoutHits: number
2068
+ /**
2069
+ * Line layout lookups that neither frame had but the window's shape store did: a layout shaped
2070
+ * some frames ago, found again without shaping. Not counted in `shapes`.
2071
+ */
2072
+ shapeCacheHits: number
2073
+ /**
2074
+ * Subtrees whose painted extent (what culling reads) was worked out from their children,
2075
+ * not found as an earlier pass or frame left it.
2076
+ */
2077
+ extentWalks: number
2078
+ /** Subtrees whose scrollable overflow was worked out from their children. */
2079
+ overflowWalks: number
2080
+ /**
2081
+ * Like `overflowWalks`, for the overflow from the unsnapped boxes that `scrollWidth` and
2082
+ * `scrollHeight` read.
2083
+ */
2084
+ unsnappedOverflowWalks: number
2085
+ }
2086
+
2087
+ /** `animateMotionValue` of a value that holds `from`, measured. Throws what it would. */
2088
+ export declare function measureMotionAnimation(from: any, target: any, transition?: any | undefined | null): MotionAnimationLength
2089
+
2090
+ /** The OS accessibility preferences that media queries expose. */
2091
+ export interface MediaFeatures {
2092
+ /** `prefers-reduced-motion: reduce`. */
2093
+ reducedMotion: boolean
2094
+ /** `prefers-contrast: more`. */
2095
+ increasedContrast: boolean
2096
+ /** `forced-colors: active`. macOS has no forced colors mode. */
2097
+ forcedColors: boolean
2098
+ }
2099
+
2100
+ /**
2101
+ * How long an animation of a motion value lasts, found without a renderer from the transition
2102
+ * and keyframes the renderer would run, so the controls can say before the value is bound.
2103
+ */
2104
+ export interface MotionAnimationLength {
2105
+ /** One iteration, without the delay or the repeats. */
2106
+ duration: number
2107
+ /** `duration` plus the delay. */
2108
+ iterationDuration: number
2109
+ }
2110
+
2111
+ /** What the controls of a motion value's animation read, in seconds. */
2112
+ export interface MotionValuePlayback {
2113
+ /**
2114
+ * Since the delay ended. Not held at the end of the last repeat: Motion's `time` goes on
2115
+ * counting, and a seek past the end reads back as set.
2116
+ */
2117
+ time: number
2118
+ /** The pace: 1 is real time, negative runs backwards. */
2119
+ speed: number
2120
+ /**
2121
+ * One iteration, without the delay or the repeats. `Infinity` for a spring
2122
+ * that has not come to rest in 20 seconds.
2123
+ */
2124
+ duration: number
2125
+ /** `duration` plus the delay. */
2126
+ iterationDuration: number
2127
+ /** `"running"`, `"paused"` or `"finished"`. */
2128
+ state: string
2129
+ /**
2130
+ * Motion's `startTime`: milliseconds on the renderer's clock since its origin, `null` before
2131
+ * the animation starts and once it has finished.
2132
+ */
2133
+ startTime?: number
2134
+ }
2135
+
2136
+ /** What the test platform did to a native surface. */
2137
+ export interface NativeSurfaceEventReading {
2138
+ /** `"created"` when an element made its surface, `"removed"` when it dropped it. */
2139
+ kind: string
2140
+ /** The content view of the surface: the `handle` `attach` carries. */
2141
+ handle: string
2142
+ }
2143
+
2144
+ export interface NativeviewRect {
2145
+ x: number
2146
+ y: number
2147
+ width: number
2148
+ height: number
2149
+ }
2150
+
2151
+ /** Where the last composed frame put the native view of a `<nativeview>`, in window pixels. */
2152
+ export interface NativeviewSurfaceReading {
2153
+ /**
2154
+ * The content view JS got with `attach`, as a decimal string: the address of the `NSView`
2155
+ * of the window's offscreen platform, a number like 516333569280 that differs per run. The
2156
+ * Rust unit tests run on gpui's test platform, where it is the index of the attachment.
2157
+ */
2158
+ handle: string
2159
+ /** The whole surface, not cut by its clip. */
2160
+ bounds: NativeviewRect
2161
+ /**
2162
+ * What shows of it: for an element that does not clip, the content mask around it, which
2163
+ * can be larger than `bounds`.
2164
+ */
2165
+ clip: NativeviewRect
2166
+ opacity: number
2167
+ cornerRadius: number
2168
+ capturesPointer: boolean
2169
+ }
2170
+
2171
+ /**
2172
+ * What one observation event carries beyond the element's border box, which
2173
+ * travels in the payload's `x`, `y`, `width` and `height`.
2174
+ */
2175
+ export interface Observation {
2176
+ /**
2177
+ * False when the element did not paint this frame (a virtual list row outside
2178
+ * its window, removed). Every number is then 0. A `visibility: hidden`
2179
+ * element keeps its box and is present.
2180
+ */
2181
+ present: boolean
2182
+ /** Size of the content box: the border box minus border and padding. */
2183
+ contentWidth: number
2184
+ contentHeight: number
2185
+ /**
2186
+ * Padding on the left and top, which is where the content box starts
2187
+ * inside the padding box (`ResizeObserverEntry.contentRect.x` and `.y`).
2188
+ */
2189
+ paddingLeft: number
2190
+ paddingTop: number
2191
+ /**
2192
+ * The border widths of an intersection report, and the room a classic scrollbar takes on
2193
+ * the right and at the bottom. The client box, which is what an `IntersectionObserver`
2194
+ * root exposes, is the border box minus these.
2195
+ */
2196
+ borderLeft: number
2197
+ borderTop: number
2198
+ borderRight: number
2199
+ borderBottom: number
2200
+ scrollbarWidth: number
2201
+ scrollbarHeight: number
2202
+ /**
2203
+ * The `overflow` clips of the ancestors, nearest first, in window
2204
+ * coordinates. JS applies the ones below its root. The window edge is not
2205
+ * one of them: an `IntersectionObserver` with a `rootMargin` sees past it.
2206
+ */
2207
+ clips: Array<ObservationClip>
2208
+ /**
2209
+ * The window's paintable size, which is the viewport of an
2210
+ * `IntersectionObserver` with no `root`.
2211
+ */
2212
+ viewportWidth: number
2213
+ viewportHeight: number
2214
+ }
2215
+
2216
+ /**
2217
+ * One ancestor's clip rect. An axis the ancestor does not clip spans
2218
+ * `UNCLIPPED` either way.
2219
+ */
2220
+ export interface ObservationClip {
2221
+ /** The clipping ancestor's element id. */
2222
+ id: number
2223
+ x: number
2224
+ y: number
2225
+ width: number
2226
+ height: number
2227
+ }
2228
+
2229
+ /**
2230
+ * How ticks were drawn by patching the frame before them, over the life of the window, see
2231
+ * `get_patch_counters`.
2232
+ */
2233
+ export interface PatchCounters {
2234
+ /** Frames drawn by patching. */
2235
+ patchedFrames: number
2236
+ /** Units painted again by those frames. */
2237
+ patchedUnits: number
2238
+ /**
2239
+ * Ticks that changed nothing that is drawn (every change was in skipped or sleeping content):
2240
+ * no frame was built or presented.
2241
+ */
2242
+ emptyTicks: number
2243
+ /** JSON object: ticks gpui drew whole after the patcher tried, by reason (`PatchDecline`). */
2244
+ declines: string
2245
+ /**
2246
+ * JSON object: ticks gpuix did not try to patch, by kind (`Unpatchable`, and the units it
2247
+ * could not build).
2248
+ */
2249
+ unpatchable: string
2250
+ }
2251
+
2252
+ export interface PathPromptOptions {
2253
+ /** Select files. Defaults to true unless `directories` is true. */
2254
+ files?: boolean
2255
+ /** Select directories. Defaults to false. */
2256
+ directories?: boolean
2257
+ /** Allow several paths. Defaults to false. */
2258
+ multiple?: boolean
2259
+ /** Label for the picker confirmation button. */
2260
+ prompt?: string
2261
+ /**
2262
+ * Restrict the selectable files with the HTML `accept` syntax, such as
2263
+ * ".png,.jpg,image/*,application/pdf". Directories are never filtered.
2264
+ */
2265
+ accept?: string
2266
+ }
2267
+
2268
+ /** A rectangle in CSS px. */
2269
+ export interface Rectangle {
2270
+ x: number
2271
+ y: number
2272
+ width: number
2273
+ height: number
2274
+ }
2275
+
2276
+ /** What the retained subtrees of the window did since it was made, see `get_retained_counters`. */
2277
+ export interface RetainedCounters {
2278
+ /** Subtrees a frame did not build, because the frame before left them recorded as the same. */
2279
+ hits: number
2280
+ /** Subtrees whose prepaint was replayed from the recording. */
2281
+ replays: number
2282
+ /**
2283
+ * Subtrees skipped for layout that had to be built for prepaint, because the place or the
2284
+ * surroundings they were recorded in changed.
2285
+ */
2286
+ lazyBuilds: number
2287
+ /** Subtrees built for layout. */
2288
+ builds: number
2289
+ layoutFallbacks: number
2290
+ /**
2291
+ * Subtrees a layout-only pass (a bounds read on a dirty window) did not build, because the
2292
+ * last presented frame left them recorded as the same.
2293
+ */
2294
+ layoutSkips: number
2295
+ /**
2296
+ * Of those, the subtrees it published from their recording instead of building them for
2297
+ * prepaint as it does the ones that moved.
2298
+ */
2299
+ layoutReplays: number
2300
+ /** Subtrees built by a layout-only pass. */
2301
+ layoutBuilds: number
2302
+ /**
2303
+ * Of the subtrees skipped with a layout record, those that a layout moved by a whole number
2304
+ * of device pixels and that were put where they are, not built again.
2305
+ */
2306
+ layoutTranslations: number
2307
+ /**
2308
+ * Of those, the subtrees that left a layout record, which the next layout-only pass skips
2309
+ * them with until a frame is drawn.
2310
+ */
2311
+ layoutRecords: number
2312
+ /**
2313
+ * Frames that replayed something and were compared with a build of the same frame; always 0
2314
+ * unless `setRetainVerify`.
2315
+ */
2316
+ verified: number
2317
+ /** Of those, the frames that differed. */
2318
+ mismatches: number
2319
+ /** A JSON object: the recordings that could not be replayed, by the first reason. */
2320
+ nonReusable: string
2321
+ /** Replays of a subtree that a scroller had moved, which are builds that were not made. */
2322
+ relocations: number
2323
+ /**
2324
+ * A JSON object: the recordings of subtrees that a scroller moves that cannot be put
2325
+ * elsewhere, by the first reason.
2326
+ */
2327
+ nonRelocatable: string
2328
+ /**
2329
+ * A JSON object: the subtrees that a scroller had moved and that were built again though
2330
+ * they were the same but for where they are, by the reason.
2331
+ */
2332
+ relocationMisses: string
2333
+ }
2334
+
2335
+ /** A size in CSS px. */
2336
+ export interface Size {
2337
+ width: number
2338
+ height: number
2339
+ }
2340
+
2341
+ /** What the sync handler returns. */
2342
+ export interface SyncDispatchResult {
2343
+ defaultPrevented: boolean
2344
+ propagationStopped: boolean
2345
+ /** The `dropEffect` a `dragover` ended with. */
2346
+ dropEffect?: string
2347
+ }
2348
+
2349
+ /** `selectionStart`, `selectionEnd` and `selectionDirection` of a text control. */
2350
+ export interface TextSelection {
2351
+ start: number
2352
+ end: number
2353
+ /** `"forward"`, `"backward"` or `"none"`. */
2354
+ direction: string
2355
+ }
2356
+
2357
+ /** One extra HTTP header on the feed or download request. */
2358
+ export interface UpdaterHeader {
2359
+ name: string
2360
+ value: string
2361
+ }
2362
+
2363
+ /**
2364
+ * Checks a keyframes definition the way `GpuixRenderer.defineKeyframes` does,
2365
+ * without a renderer. `defineKeyframes` from `@ghia/native/host` runs it
2366
+ * first so a bad definition throws where it is written.
2367
+ */
2368
+ export declare function validateKeyframes(name: string, framesJson: string): void
2369
+
2370
+ /**
2371
+ * What `getTiming()` and `getComputedTiming()` read of a CSS animation or transition, in
2372
+ * milliseconds.
2373
+ */
2374
+ export interface WebAnimationEffectInfo {
2375
+ delay: number
2376
+ /** `null` is `"auto"`. */
2377
+ duration?: number
2378
+ endDelay: number
2379
+ fill: string
2380
+ iterationStart: number
2381
+ /** `Infinity` for an effect that repeats for ever. */
2382
+ iterations: number
2383
+ direction: string
2384
+ easing: string
2385
+ endTime: number
2386
+ activeDuration: number
2387
+ /** `null` for a run that was cancelled, which has no current time. */
2388
+ localTime?: number
2389
+ /** `null` outside the active phase when no fill holds the effect, and for a cancelled run. */
2390
+ progress?: number
2391
+ currentIteration?: number
2392
+ }
2393
+
2394
+ /**
2395
+ * A CSS animation or transition, or an animation of the motion engine, as `Animation.currentTime`,
2396
+ * `playbackRate` and `playState` show it. `animationName` is set for a CSS animation and
2397
+ * `transitionProperty` for a CSS transition; an animation of the motion engine has neither.
2398
+ */
2399
+ export interface WebAnimationInfo {
2400
+ /**
2401
+ * Unique among the animations and transitions of the process, and the same
2402
+ * for one run from its start to its end.
2403
+ */
2404
+ id: number
2405
+ /** `"animation"`, `"transition"` or `"script"`. */
2406
+ kind: string
2407
+ /** The `animation-name`. */
2408
+ animationName?: string
2409
+ /** The CSS name of the transitioned property, `background-color`. */
2410
+ transitionProperty?: string
2411
+ /**
2412
+ * Milliseconds from the start of the animation, the delay inside it, as of
2413
+ * the last frame.
2414
+ */
2415
+ currentTime: number
2416
+ /**
2417
+ * Milliseconds where the effect ends, the delay inside it: what
2418
+ * `currentTime` is at the end of a transition that finished. `Infinity`
2419
+ * for an animation that repeats forever.
2420
+ */
2421
+ endTime: number
2422
+ playbackRate: number
2423
+ /**
2424
+ * `"running"`, `"paused"`, `"finished"`, or `"idle"` for a run that was
2425
+ * cancelled (`currentTime` is not meant then).
2426
+ */
2427
+ playState: string
2428
+ /** A play or pause waits for the next frame. */
2429
+ pending: boolean
2430
+ /**
2431
+ * The `startTime`: milliseconds on the renderer's clock since its origin, as the timeline
2432
+ * of the animations reads (`getAnimationTimelineTime`). `null` while it has none.
2433
+ */
2434
+ startTime?: number
2435
+ }
2436
+
2437
+ /** One keyframe of a CSS animation or transition, as `getKeyframes()` has it. */
2438
+ export interface WebAnimationKeyframeInfo {
2439
+ /** The `computedOffset`. */
2440
+ computedOffset: number
2441
+ /** `null` for a keyframe of an animation of the motion engine that was given no offset or time. */
2442
+ offset?: number
2443
+ easing: string
2444
+ /** `"auto"`, `"replace"`, `"add"` or `"accumulate"`. */
2445
+ composite: string
2446
+ values: Array<WebAnimationKeyframeValue>
2447
+ }
2448
+
2449
+ /** One property of a keyframe of a CSS animation or transition, as `getKeyframes()` has it. */
2450
+ export interface WebAnimationKeyframeValue {
2451
+ /** The camelCase name, `marginLeft`. */
2452
+ property: string
2453
+ /** The computed value as Chrome writes it: `16px`, `rgb(255, 0, 0)`. */
2454
+ value: string
2455
+ }
2456
+
2457
+ /**
2458
+ * What `updateTiming()` sets, checked by JS: milliseconds, and the names of the DOM. A member
2459
+ * left out is left as it is.
2460
+ */
2461
+ export interface WebAnimationTimingUpdate {
2462
+ delay?: number
2463
+ /** `"auto"` or a number. */
2464
+ duration?: number | string
2465
+ endDelay?: number
2466
+ fill?: string
2467
+ iterationStart?: number
2468
+ /** `Infinity` repeats for ever. */
2469
+ iterations?: number
2470
+ direction?: string
2471
+ easing?: string
2472
+ }
2473
+
2474
+ export interface WebviewCommandReading {
2475
+ /**
2476
+ * `loadURL`, `reload`, `stop`, `goBack`, `goForward`, `executeJavaScript` or
2477
+ * `setFirstResponder`.
2478
+ */
2479
+ name: string
2480
+ /**
2481
+ * The URL, the code, or for the first responder `"false"` (the window's view), `"true"` (the
2482
+ * page), `"forward"` or `"backward"` (the page, entered by Tab or Shift+Tab).
2483
+ */
2484
+ argument?: string
2485
+ }
2486
+
2487
+ /** The container view AppKit applied the placement to, in window points from the top left. */
2488
+ export interface WebviewNativeViewReading {
2489
+ hidden: boolean
2490
+ x: number
2491
+ y: number
2492
+ width: number
2493
+ height: number
2494
+ contentX: number
2495
+ contentY: number
2496
+ contentWidth: number
2497
+ contentHeight: number
2498
+ opacity: number
2499
+ /** A corner radius is cut into it. */
2500
+ masked: boolean
2501
+ }
2502
+
2503
+ /** What `getURL()`, `getTitle()`, `canGoBack()` and `canGoForward()` read. */
2504
+ export interface WebviewStateReading {
2505
+ url: string
2506
+ title: string
2507
+ canGoBack: boolean
2508
+ canGoForward: boolean
2509
+ }
2510
+
2511
+ /** Where the last composed frame put the surface of a webview, in window pixels. */
2512
+ export interface WebviewSurfaceReading {
2513
+ /** The surface is shown: it was painted and something of it is not clipped away. */
2514
+ visible: boolean
2515
+ /** The whole surface, not cut by its clip. */
2516
+ x: number
2517
+ y: number
2518
+ width: number
2519
+ height: number
2520
+ /** What shows of it. Zero while it is not visible. */
2521
+ clipX: number
2522
+ clipY: number
2523
+ clipWidth: number
2524
+ clipHeight: number
2525
+ opacity: number
2526
+ cornerRadius: number
2527
+ /** The position of the layer among the frame's layers, bottom to top. */
2528
+ layer: number
2529
+ }
2530
+
2531
+ export interface WindowInsets {
2532
+ safeArea: EdgeInsets
2533
+ ime: EdgeInsets
2534
+ effective: EdgeInsets
2535
+ }
2536
+
2537
+ export interface WindowOptions {
2538
+ title?: string
2539
+ /**
2540
+ * The name used inside the macOS "Hide" and "Quit" menu items. Defaults to
2541
+ * `title`. It does NOT set the title of the application menu itself: macOS
2542
+ * takes that from the executable, and only a `.app` bundle changes it.
2543
+ */
2544
+ appName?: string
2545
+ width?: number
2546
+ height?: number
2547
+ /**
2548
+ * Where the window's top-left corner opens, in CSS px in the global space
2549
+ * `getAllDisplays()` reports (origin at the primary display's top-left, y down).
2550
+ * The display that contains the point, else the nearest, is the one the window
2551
+ * opens on. Both `x` and `y` are needed; otherwise the window is centred, as in
2552
+ * Electron. Ignored by `TestGpuixRenderer`.
2553
+ */
2554
+ x?: number
2555
+ /** See `x`. */
2556
+ y?: number
2557
+ minWidth?: number
2558
+ minHeight?: number
2559
+ resizable?: boolean
2560
+ fullscreen?: boolean
2561
+ /** Plain alpha transparency. Prefer `window_background` when you need blur. */
2562
+ transparent?: boolean
2563
+ /** Hide the native titlebar so the app can draw chrome under the traffic lights. */
2564
+ titlebarTransparent?: boolean
2565
+ /**
2566
+ * `"opaque"` | `"transparent"` | `"blurred"`. `transparent: true` is the
2567
+ * same as `"transparent"` when this is unset.
2568
+ */
2569
+ windowBackground?: string
2570
+ /**
2571
+ * `"system"` | `"light"` | `"dark"`. Defaults to `"system"`: follow the OS
2572
+ * setting. Applies to the whole app on macOS and is ignored elsewhere.
2573
+ */
2574
+ appearance?: string
2575
+ trafficLightX?: number
2576
+ trafficLightY?: number
2577
+ /**
2578
+ * Give the window key focus when it opens. `false` opens it behind the
2579
+ * active app, like `open -g`. Ignored on Linux.
2580
+ */
2581
+ focus?: boolean
2582
+ /**
2583
+ * Show the window when it opens. `false` opens it hidden; call
2584
+ * `activateWindow()` to reveal it. Ignored on Linux.
2585
+ */
2586
+ show?: boolean
2587
+ /**
2588
+ * Application id: Wayland `app_id` / X11 `WM_CLASS`. Desktop environments
2589
+ * use it to group windows and match window rules. Required in practice for
2590
+ * a `layerShell` surface a compositor is meant to target by rule.
2591
+ */
2592
+ appId?: string
2593
+ /**
2594
+ * Open the window as a Wayland `wlr-layer-shell` surface instead of a
2595
+ * normal window. Linux/Wayland only; ignored elsewhere.
2596
+ */
2597
+ layerShell?: LayerShellOptions
2598
+ }
2599
+
2600
+ export interface WindowSize {
2601
+ width: number
2602
+ height: number
2603
+ }