gestament 0.5.0 → 0.7.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.
- package/dist/displaySession.d.ts +2 -2
- package/dist/displaySession.d.ts.map +1 -1
- package/dist/element.d.ts +2 -2
- package/dist/element.d.ts.map +1 -1
- package/dist/errors.d.ts +2 -2
- package/dist/generated/packageMetadata.d.ts +4 -4
- package/dist/gestament-config.d.ts +2 -2
- package/dist/gestament-launcher-driver.cjs +46 -1
- package/dist/gestament-launcher-driver.cjs.map +1 -1
- package/dist/gestament-launcher-driver.d.ts +2 -2
- package/dist/gestament-launcher-driver.mjs +46 -1
- package/dist/gestament-launcher-driver.mjs.map +1 -1
- package/dist/gestament-tray-host.cjs +1 -1
- package/dist/gestament-tray-host.d.ts +2 -2
- package/dist/gestament-tray-host.mjs +1 -1
- package/dist/gestament-xvfb-pool-probe.cjs +1 -1
- package/dist/gestament-xvfb-pool-probe.d.ts +2 -2
- package/dist/gestament-xvfb-pool-probe.mjs +1 -1
- package/dist/gestament-xvfb-worker.d.ts +2 -2
- package/dist/gestament-xvfb.d.ts +2 -2
- package/dist/gestament.cjs +1 -1
- package/dist/gestament.d.ts +2 -2
- package/dist/gestament.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/input.d.ts +21 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/{launchGtkApp-EI6OIpPI.js → launchGtkApp-BTBwPwyj.js} +216 -2
- package/dist/launchGtkApp-BTBwPwyj.js.map +1 -0
- package/dist/{launchGtkApp-CzYcrc9f.cjs → launchGtkApp-Csx4r7AQ.cjs} +218 -4
- package/dist/launchGtkApp-Csx4r7AQ.cjs.map +1 -0
- package/dist/launchGtkApp.d.ts +2 -2
- package/dist/launchGtkApp.d.ts.map +1 -1
- package/dist/launcherDriverProtocol.d.ts +37 -4
- package/dist/launcherDriverProtocol.d.ts.map +1 -1
- package/dist/{native-DlCBBWlV.js → native-BRWJbzfa.js} +53 -11
- package/dist/native-BRWJbzfa.js.map +1 -0
- package/dist/{native-Kfm95Uxw.cjs → native-C1llTPc6.cjs} +46 -4
- package/dist/native-C1llTPc6.cjs.map +1 -0
- package/dist/native.d.ts +22 -2
- package/dist/native.d.ts.map +1 -1
- package/dist/output.d.ts +2 -2
- package/dist/packageMetadata-DSIckEfC.cjs +4 -0
- package/dist/{packageMetadata-CewXH0iF.cjs.map → packageMetadata-DSIckEfC.cjs.map} +1 -1
- package/dist/packageMetadata-__qCDuxC.js +5 -0
- package/dist/{packageMetadata-DjxyJCJm.js.map → packageMetadata-__qCDuxC.js.map} +1 -1
- package/dist/prerequisites.d.ts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/tray.d.ts +2 -2
- package/dist/types.d.ts +106 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/wait.d.ts +2 -2
- package/package.json +7 -7
- package/prebuilds/linux-arm/gtk3/node.napi.armv7.glibc.node +0 -0
- package/prebuilds/linux-arm/gtk4/node.napi.armv7.glibc.node +0 -0
- package/prebuilds/linux-arm64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-arm64/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-ia32/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-ia32/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-riscv64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-riscv64/gtk4/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/gtk3/node.napi.glibc.node +0 -0
- package/prebuilds/linux-x64/gtk4/node.napi.glibc.node +0 -0
- package/dist/launchGtkApp-CzYcrc9f.cjs.map +0 -1
- package/dist/launchGtkApp-EI6OIpPI.js.map +0 -1
- package/dist/native-DlCBBWlV.js.map +0 -1
- package/dist/native-Kfm95Uxw.cjs.map +0 -1
- package/dist/packageMetadata-CewXH0iF.cjs +0 -4
- package/dist/packageMetadata-DjxyJCJm.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native-Kfm95Uxw.cjs","sources":["../src/native.ts"],"sourcesContent":["// gestament - TypeScript based test driver for GTK.\n// Copyright (c) Kouji Matsui. (@kekyo@mi.kekyo.net)\n// Under MIT.\n// https://github.com/kekyo/gestament\n\nimport { createRequire } from 'node:module';\nimport { existsSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { normalizeNativeError } from './errors';\nimport { version as packageVersion } from './generated/packageMetadata';\nimport { appendPrerequisiteInstallHint } from './prerequisites';\nimport type { GtkAutomationError } from './types';\n\n/////////////////////////////////////////////////////////////////////////////////////////\n\ninterface NativeInfo {\n readonly version: string;\n readonly arch: string;\n readonly gtkBackend: GtkBackend;\n readonly napiVersion: number;\n}\n\nexport interface NativeCaptureBounds {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\n\nexport interface NativeCapture {\n readonly image: Buffer;\n readonly bounds: NativeCaptureBounds;\n readonly visibleBounds: NativeCaptureBounds;\n readonly clipped: boolean;\n}\n\nexport interface NativeWindowResizeHints {\n readonly baseWidth: number;\n readonly baseHeight: number;\n readonly minWidth: number;\n readonly minHeight: number;\n readonly widthIncrement: number;\n readonly heightIncrement: number;\n}\n\nexport interface NativeX11WindowInfo {\n readonly windowId: string;\n readonly title: string;\n readonly className: string;\n readonly instanceName: string;\n readonly normalHints: NativeWindowResizeHints;\n}\n\nexport interface NativeElementInfo {\n readonly roleName: string;\n readonly localizedRoleName: string;\n readonly accessibleId: string;\n readonly name: string;\n readonly description: string;\n readonly interfaces: string[];\n readonly states: string[];\n}\n\n/** AT-SPI Value metadata returned by the native layer. */\nexport interface NativeValueInfo {\n /** Current numeric value. */\n readonly value: number;\n\n /** Minimum accepted numeric value. */\n readonly minimum: number;\n\n /** Maximum accepted numeric value. */\n readonly maximum: number;\n\n /** Minimum increment used by step-based controls. */\n readonly minimumIncrement: number;\n\n /** Text representation reported by AT-SPI, when available. */\n readonly text: string;\n}\n\n/** Point returned by the native layer. */\nexport interface NativeImagePoint {\n /** Horizontal pixel coordinate. */\n readonly x: number;\n\n /** Vertical pixel coordinate. */\n readonly y: number;\n}\n\n/** Image size returned by the native layer. */\nexport interface NativeImageSize {\n /** Image width in physical pixels. */\n readonly width: number;\n\n /** Image height in physical pixels. */\n readonly height: number;\n}\n\n/** AT-SPI Image metadata returned by the native layer. */\nexport interface NativeImageInfo {\n /** Text description reported by AT-SPI. */\n readonly description: string;\n\n /** Image locale reported by AT-SPI. */\n readonly locale: string;\n\n /** Image position reported by AT-SPI. */\n readonly position: NativeImagePoint;\n\n /** Image size reported by AT-SPI. */\n readonly size: NativeImageSize;\n\n /** Screen-relative image bounds reported by AT-SPI. */\n readonly bounds: NativeCaptureBounds;\n}\n\n/** Opaque native element handle backed by an AT-SPI accessible proxy. */\nexport type NativeElementHandle = object;\n\n/** AT-SPI readiness state reported by the native layer. */\nexport type NativeAtspiReadiness =\n | 'ready'\n | 'missing-bus-name'\n | 'missing-root'\n | 'missing-cache';\n\n/** StatusNotifier tray item metadata reported by the native layer. */\nexport interface NativeTrayItem {\n readonly busName: string;\n readonly objectPath: string;\n readonly id: string;\n readonly title: string;\n readonly status: string;\n readonly iconName: string;\n readonly accessibleId: string;\n}\n\ninterface NativeAddon {\n readonly findById: (\n processId: number,\n id: string\n ) => NativeElementHandle | undefined;\n readonly processAtspiReadiness: (processId: number) => NativeAtspiReadiness;\n readonly findAnyById: (id: string) => NativeElementHandle | undefined;\n readonly setTextById: (processId: number, id: string, text: string) => void;\n readonly clickById: (processId: number, id: string) => void;\n readonly textById: (processId: number, id: string) => string;\n readonly captureById: (processId: number, id: string) => NativeCapture;\n readonly windowCount: (processId: number) => number;\n readonly windowAt: (\n processId: number,\n index: number\n ) => NativeElementHandle | undefined;\n readonly childCount: (element: NativeElementHandle) => number;\n readonly childAt: (\n element: NativeElementHandle,\n index: number\n ) => NativeElementHandle | undefined;\n readonly selectedChildCount: (element: NativeElementHandle) => number;\n readonly selectedChildAt: (\n element: NativeElementHandle,\n index: number\n ) => NativeElementHandle | undefined;\n readonly isChildSelected: (\n element: NativeElementHandle,\n index: number\n ) => boolean;\n readonly selectChildAt: (element: NativeElementHandle, index: number) => void;\n readonly deselectChildAt: (\n element: NativeElementHandle,\n index: number\n ) => void;\n readonly selectAllChildren: (element: NativeElementHandle) => void;\n readonly clearSelection: (element: NativeElementHandle) => void;\n readonly tableRowCount: (element: NativeElementHandle) => number;\n readonly tableColumnCount: (element: NativeElementHandle) => number;\n readonly tableCellAt: (\n element: NativeElementHandle,\n row: number,\n column: number\n ) => NativeElementHandle | undefined;\n readonly tableSelectedRows: (element: NativeElementHandle) => number[];\n readonly tableSelectedColumns: (element: NativeElementHandle) => number[];\n readonly tableIsRowSelected: (\n element: NativeElementHandle,\n row: number\n ) => boolean;\n readonly tableIsColumnSelected: (\n element: NativeElementHandle,\n column: number\n ) => boolean;\n readonly tableIsCellSelected: (\n element: NativeElementHandle,\n row: number,\n column: number\n ) => boolean;\n readonly tableSelectRow: (element: NativeElementHandle, row: number) => void;\n readonly tableDeselectRow: (\n element: NativeElementHandle,\n row: number\n ) => void;\n readonly tableSelectColumn: (\n element: NativeElementHandle,\n column: number\n ) => void;\n readonly tableDeselectColumn: (\n element: NativeElementHandle,\n column: number\n ) => void;\n readonly setText: (element: NativeElementHandle, text: string) => void;\n readonly click: (element: NativeElementHandle) => void;\n readonly text: (element: NativeElementHandle) => string;\n readonly valueInfo: (element: NativeElementHandle) => NativeValueInfo;\n readonly imageInfo: (element: NativeElementHandle) => NativeImageInfo;\n readonly setValue: (element: NativeElementHandle, value: number) => void;\n readonly capture: (element: NativeElementHandle) => NativeCapture;\n readonly bounds: (element: NativeElementHandle) => NativeCaptureBounds;\n readonly resizeHints: (\n element: NativeElementHandle\n ) => NativeWindowResizeHints;\n readonly x11Info: (element: NativeElementHandle) => NativeX11WindowInfo;\n readonly captureScreen: () => NativeCapture;\n readonly captureBounds: (\n x: number,\n y: number,\n width: number,\n height: number\n ) => NativeCapture;\n readonly mappedX11WindowCount: () => number;\n readonly elementInfo: (element: NativeElementHandle) => NativeElementInfo;\n readonly trayItems: (processId: number) => NativeTrayItem[];\n readonly runTrayHost: () => void;\n readonly nativeInfo: () => NativeInfo;\n}\n\ntype GtkBackend = 'gtk3' | 'gtk4';\ntype GtkBackendSelection = GtkBackend | 'auto';\n\nconst require = createRequire(import.meta.url);\nconst packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');\n\nlet loadedAddon: NativeAddon | undefined;\n\nconst createNativeLoadError = (message: string): GtkAutomationError => {\n const loadError = new Error(message) as GtkAutomationError;\n Object.defineProperty(loadError, 'code', {\n enumerable: true,\n value: 'NATIVE_LOAD_FAILED',\n });\n return loadError;\n};\n\nconst selectedGtkBackend = (): GtkBackendSelection => {\n const value = process.env.GESTAMENT_GTK_BACKEND;\n if (value === undefined || value.length === 0) {\n return 'gtk3';\n }\n if (value === 'gtk3' || value === 'gtk4' || value === 'auto') {\n return value;\n }\n throw createNativeLoadError(\n `Unsupported GESTAMENT_GTK_BACKEND: ${value}. Expected gtk3, gtk4, or auto.`\n );\n};\n\nconst candidateGtkBackends = (): readonly GtkBackend[] => {\n const selected = selectedGtkBackend();\n return selected === 'auto' ? ['gtk3', 'gtk4'] : [selected];\n};\n\nconst prebuildDirectory = (): string => {\n if (process.platform !== 'linux') {\n throw createNativeLoadError(\n `Unsupported platform for gestament native prebuilds: ${process.platform}.`\n );\n }\n\n switch (process.arch) {\n case 'x64':\n return 'linux-x64';\n case 'ia32':\n return 'linux-ia32';\n case 'arm64':\n return 'linux-arm64';\n case 'arm':\n return 'linux-arm';\n case 'riscv64':\n return 'linux-riscv64';\n default:\n throw createNativeLoadError(\n `Unsupported architecture for gestament native prebuilds: ${process.arch}.`\n );\n }\n};\n\nconst prebuildFile = (): string =>\n process.arch === 'arm'\n ? 'node.napi.armv7.glibc.node'\n : 'node.napi.glibc.node';\n\nconst prebuildPath = (backend: GtkBackend): string =>\n resolve(\n packageRoot,\n 'prebuilds',\n prebuildDirectory(),\n backend,\n prebuildFile()\n );\n\nconst loadNativePrebuild = (backend: GtkBackend): NativeAddon => {\n const path = prebuildPath(backend);\n if (!existsSync(path)) {\n throw new Error(`Missing ${backend} native prebuild: ${path}`);\n }\n return require(path) as NativeAddon;\n};\n\nconst loadNativeAddon = (): NativeAddon => {\n if (loadedAddon !== undefined) {\n return loadedAddon;\n }\n\n const errors: string[] = [];\n for (const backend of candidateGtkBackends()) {\n try {\n const addon = loadNativePrebuild(backend);\n const nativeInfo = addon.nativeInfo();\n if (nativeInfo.version !== packageVersion) {\n throw new Error(\n `gestament native prebuild version mismatch: native=${nativeInfo.version}, package=${packageVersion}`\n );\n }\n if (nativeInfo.gtkBackend !== backend) {\n throw new Error(\n `gestament native prebuild backend mismatch: native=${nativeInfo.gtkBackend}, requested=${backend}`\n );\n }\n loadedAddon = addon;\n return loadedAddon;\n } catch (error) {\n const message =\n error instanceof Error\n ? error.message\n : `Unknown error: ${String(error)}`;\n errors.push(`${backend}: ${message}`);\n }\n }\n\n throw createNativeLoadError(\n appendPrerequisiteInstallHint(\n `Failed to load a compatible gestament native prebuild from ${packageRoot} ` +\n `(GESTAMENT_GTK_BACKEND=${selectedGtkBackend()}). Ensure this package ` +\n 'includes prebuilds for the current Linux/glibc architecture and selected ' +\n 'GTK backend, and that runtime libraries such as libatspi, glib, gio, ' +\n `GTK, X11, and dbus are installed. Original errors: ${errors.join(' | ')}`\n )\n );\n};\n\nconst callNative = <Result>(operation: () => Result): Result => {\n try {\n return operation();\n } catch (error) {\n throw normalizeNativeError(error);\n }\n};\n\n/////////////////////////////////////////////////////////////////////////////////////////\n\n/** Resolves an accessible id to a native element when it exists. */\nexport const nativeFindById = (\n processId: number,\n id: string\n): NativeElementHandle | undefined =>\n callNative(() => loadNativeAddon().findById(processId, id));\n\n/** Checks whether a GTK process has completed AT-SPI root/cache registration. */\nexport const nativeProcessAtspiReadiness = (\n processId: number\n): NativeAtspiReadiness =>\n callNative(() => loadNativeAddon().processAtspiReadiness(processId));\n\n/** Resolves an accessible id to a native element across all exposed processes. */\nexport const nativeFindAnyById = (\n id: string\n): NativeElementHandle | undefined =>\n callNative(() => loadNativeAddon().findAnyById(id));\n\n/** Sets text contents on the accessible with the given id. */\nexport const nativeSetTextById = (\n processId: number,\n id: string,\n text: string\n): void => {\n callNative(() => loadNativeAddon().setTextById(processId, id, text));\n};\n\n/** Executes the first action on the accessible with the given id. */\nexport const nativeClickById = (processId: number, id: string): void => {\n callNative(() => loadNativeAddon().clickById(processId, id));\n};\n\n/** Reads text from the accessible with the given id. */\nexport const nativeTextById = (processId: number, id: string): string =>\n callNative(() => loadNativeAddon().textById(processId, id));\n\n/** Captures real screen pixels for the accessible with the given id. */\nexport const nativeCaptureById = (\n processId: number,\n id: string\n): NativeCapture =>\n callNative(() => loadNativeAddon().captureById(processId, id));\n\n/** Counts top-level windows hosted by the process. */\nexport const nativeWindowCount = (processId: number): number =>\n callNative(() => loadNativeAddon().windowCount(processId));\n\n/** Resolves a top-level window index to an element handle when it exists. */\nexport const nativeWindowAt = (\n processId: number,\n index: number\n): NativeElementHandle | undefined =>\n callNative(() => loadNativeAddon().windowAt(processId, index));\n\n/** Counts direct children for an element handle. */\nexport const nativeChildCount = (element: NativeElementHandle): number =>\n callNative(() => loadNativeAddon().childCount(element));\n\n/** Resolves a direct child index to an element handle when it exists. */\nexport const nativeChildAt = (\n element: NativeElementHandle,\n index: number\n): NativeElementHandle | undefined =>\n callNative(() => loadNativeAddon().childAt(element, index));\n\n/** Counts selected children for a selectable element handle. */\nexport const nativeSelectedChildCount = (\n element: NativeElementHandle\n): number => callNative(() => loadNativeAddon().selectedChildCount(element));\n\n/** Resolves a selected child index to an element handle when it exists. */\nexport const nativeSelectedChildAt = (\n element: NativeElementHandle,\n index: number\n): NativeElementHandle | undefined =>\n callNative(() => loadNativeAddon().selectedChildAt(element, index));\n\n/** Reads whether a direct child is selected. */\nexport const nativeIsChildSelected = (\n element: NativeElementHandle,\n index: number\n): boolean =>\n callNative(() => loadNativeAddon().isChildSelected(element, index));\n\n/** Selects a direct child for a selectable element handle. */\nexport const nativeSelectChildAt = (\n element: NativeElementHandle,\n index: number\n): void => {\n callNative(() => loadNativeAddon().selectChildAt(element, index));\n};\n\n/** Deselects a direct child for a selectable element handle. */\nexport const nativeDeselectChildAt = (\n element: NativeElementHandle,\n index: number\n): void => {\n callNative(() => loadNativeAddon().deselectChildAt(element, index));\n};\n\n/** Selects all children for a selectable element handle. */\nexport const nativeSelectAllChildren = (element: NativeElementHandle): void => {\n callNative(() => loadNativeAddon().selectAllChildren(element));\n};\n\n/** Clears child selection for a selectable element handle. */\nexport const nativeClearSelection = (element: NativeElementHandle): void => {\n callNative(() => loadNativeAddon().clearSelection(element));\n};\n\n/** Counts table rows for a table element handle. */\nexport const nativeTableRowCount = (element: NativeElementHandle): number =>\n callNative(() => loadNativeAddon().tableRowCount(element));\n\n/** Counts table columns for a table element handle. */\nexport const nativeTableColumnCount = (element: NativeElementHandle): number =>\n callNative(() => loadNativeAddon().tableColumnCount(element));\n\n/** Resolves a table cell element handle by row and column when it exists. */\nexport const nativeTableCellAt = (\n element: NativeElementHandle,\n row: number,\n column: number\n): NativeElementHandle | undefined =>\n callNative(() => loadNativeAddon().tableCellAt(element, row, column));\n\n/** Reads selected table row indexes. */\nexport const nativeTableSelectedRows = (\n element: NativeElementHandle\n): number[] => callNative(() => loadNativeAddon().tableSelectedRows(element));\n\n/** Reads selected table column indexes. */\nexport const nativeTableSelectedColumns = (\n element: NativeElementHandle\n): number[] =>\n callNative(() => loadNativeAddon().tableSelectedColumns(element));\n\n/** Reads whether a table row is selected. */\nexport const nativeTableIsRowSelected = (\n element: NativeElementHandle,\n row: number\n): boolean =>\n callNative(() => loadNativeAddon().tableIsRowSelected(element, row));\n\n/** Reads whether a table column is selected. */\nexport const nativeTableIsColumnSelected = (\n element: NativeElementHandle,\n column: number\n): boolean =>\n callNative(() => loadNativeAddon().tableIsColumnSelected(element, column));\n\n/** Reads whether a table cell is selected. */\nexport const nativeTableIsCellSelected = (\n element: NativeElementHandle,\n row: number,\n column: number\n): boolean =>\n callNative(() => loadNativeAddon().tableIsCellSelected(element, row, column));\n\n/** Selects a table row. */\nexport const nativeTableSelectRow = (\n element: NativeElementHandle,\n row: number\n): void => {\n callNative(() => loadNativeAddon().tableSelectRow(element, row));\n};\n\n/** Deselects a table row. */\nexport const nativeTableDeselectRow = (\n element: NativeElementHandle,\n row: number\n): void => {\n callNative(() => loadNativeAddon().tableDeselectRow(element, row));\n};\n\n/** Selects a table column. */\nexport const nativeTableSelectColumn = (\n element: NativeElementHandle,\n column: number\n): void => {\n callNative(() => loadNativeAddon().tableSelectColumn(element, column));\n};\n\n/** Deselects a table column. */\nexport const nativeTableDeselectColumn = (\n element: NativeElementHandle,\n column: number\n): void => {\n callNative(() => loadNativeAddon().tableDeselectColumn(element, column));\n};\n\n/** Sets text contents on the accessible resolved by an element handle. */\nexport const nativeSetText = (\n element: NativeElementHandle,\n text: string\n): void => {\n callNative(() => loadNativeAddon().setText(element, text));\n};\n\n/** Executes the first action on the accessible resolved by an element handle. */\nexport const nativeClick = (element: NativeElementHandle): void => {\n callNative(() => loadNativeAddon().click(element));\n};\n\n/** Reads text from the accessible resolved by an element handle. */\nexport const nativeText = (element: NativeElementHandle): string =>\n callNative(() => loadNativeAddon().text(element));\n\n/** Reads value metadata from the accessible resolved by an element handle. */\nexport const nativeValueInfo = (\n element: NativeElementHandle\n): NativeValueInfo => callNative(() => loadNativeAddon().valueInfo(element));\n\n/** Reads image metadata from the accessible resolved by an element handle. */\nexport const nativeImageInfo = (\n element: NativeElementHandle\n): NativeImageInfo => callNative(() => loadNativeAddon().imageInfo(element));\n\n/** Sets a numeric value on the accessible resolved by an element handle. */\nexport const nativeSetValue = (\n element: NativeElementHandle,\n value: number\n): void => {\n callNative(() => loadNativeAddon().setValue(element, value));\n};\n\n/** Captures real screen pixels for the accessible resolved by an element handle. */\nexport const nativeCapture = (element: NativeElementHandle): NativeCapture =>\n callNative(() => loadNativeAddon().capture(element));\n\n/** Reads screen-relative bounds for the accessible resolved by an element handle. */\nexport const nativeBounds = (\n element: NativeElementHandle\n): NativeCaptureBounds => callNative(() => loadNativeAddon().bounds(element));\n\n/** Reads X11 WM_NORMAL_HINTS for the accessible resolved by an element handle. */\nexport const nativeResizeHints = (\n element: NativeElementHandle\n): NativeWindowResizeHints =>\n callNative(() => loadNativeAddon().resizeHints(element));\n\n/** Reads X11 window metadata for the accessible resolved by an element handle. */\nexport const nativeX11Info = (\n element: NativeElementHandle\n): NativeX11WindowInfo => callNative(() => loadNativeAddon().x11Info(element));\n\n/** Captures the full X11 root window currently addressed by DISPLAY. */\nexport const nativeCaptureScreen = (): NativeCapture =>\n callNative(() => loadNativeAddon().captureScreen());\n\n/** Captures real screen pixels for explicit screen-relative bounds. */\nexport const nativeCaptureBounds = (\n bounds: NativeCaptureBounds\n): NativeCapture =>\n callNative(() =>\n loadNativeAddon().captureBounds(\n bounds.x,\n bounds.y,\n bounds.width,\n bounds.height\n )\n );\n\n/** Counts mapped top-level X11 windows currently addressed by DISPLAY. */\nexport const nativeMappedX11WindowCount = (): number =>\n callNative(() => loadNativeAddon().mappedX11WindowCount());\n\n/** Reads AT-SPI metadata for the accessible resolved by an element handle. */\nexport const nativeElementInfo = (\n element: NativeElementHandle\n): NativeElementInfo =>\n callNative(() => loadNativeAddon().elementInfo(element));\n\n/** Lists StatusNotifier tray items owned by the process. */\nexport const nativeTrayItems = (processId: number): NativeTrayItem[] =>\n callNative(() => loadNativeAddon().trayItems(processId));\n\n/** Runs the test tray host until the process is terminated. */\nexport const nativeRunTrayHost = (): void => {\n callNative(() => loadNativeAddon().runTrayHost());\n};\n"],"names":["require","createRequire","resolve","dirname","fileURLToPath","existsSync","errors","packageVersion","appendPrerequisiteInstallHint","normalizeNativeError"],"mappings":";;;;;;;;;AAiPA,MAAMA,YAAUC,YAAA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