gestament 0.5.0 → 0.6.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 (67) hide show
  1. package/dist/displaySession.d.ts +2 -2
  2. package/dist/displaySession.d.ts.map +1 -1
  3. package/dist/element.d.ts +2 -2
  4. package/dist/element.d.ts.map +1 -1
  5. package/dist/errors.d.ts +2 -2
  6. package/dist/generated/packageMetadata.d.ts +4 -4
  7. package/dist/gestament-config.d.ts +2 -2
  8. package/dist/gestament-launcher-driver.cjs +13 -1
  9. package/dist/gestament-launcher-driver.cjs.map +1 -1
  10. package/dist/gestament-launcher-driver.d.ts +2 -2
  11. package/dist/gestament-launcher-driver.mjs +13 -1
  12. package/dist/gestament-launcher-driver.mjs.map +1 -1
  13. package/dist/gestament-tray-host.cjs +1 -1
  14. package/dist/gestament-tray-host.d.ts +2 -2
  15. package/dist/gestament-tray-host.mjs +1 -1
  16. package/dist/gestament-xvfb-pool-probe.cjs +1 -1
  17. package/dist/gestament-xvfb-pool-probe.d.ts +2 -2
  18. package/dist/gestament-xvfb-pool-probe.mjs +1 -1
  19. package/dist/gestament-xvfb-worker.d.ts +2 -2
  20. package/dist/gestament-xvfb.d.ts +2 -2
  21. package/dist/gestament.cjs +1 -1
  22. package/dist/gestament.d.ts +2 -2
  23. package/dist/gestament.mjs +1 -1
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.mjs +1 -1
  27. package/dist/{launchGtkApp-EI6OIpPI.js → launchGtkApp-B3FMzhrc.js} +52 -2
  28. package/dist/launchGtkApp-B3FMzhrc.js.map +1 -0
  29. package/dist/{launchGtkApp-CzYcrc9f.cjs → launchGtkApp-OggUtTTC.cjs} +54 -4
  30. package/dist/launchGtkApp-OggUtTTC.cjs.map +1 -0
  31. package/dist/launchGtkApp.d.ts +2 -2
  32. package/dist/launcherDriverProtocol.d.ts +14 -3
  33. package/dist/launcherDriverProtocol.d.ts.map +1 -1
  34. package/dist/{native-DlCBBWlV.js → native-C2tzSvVW.js} +25 -11
  35. package/dist/native-C2tzSvVW.js.map +1 -0
  36. package/dist/{native-Kfm95Uxw.cjs → native-Xz0gjKti.cjs} +18 -4
  37. package/dist/native-Xz0gjKti.cjs.map +1 -0
  38. package/dist/native.d.ts +8 -2
  39. package/dist/native.d.ts.map +1 -1
  40. package/dist/output.d.ts +2 -2
  41. package/dist/packageMetadata-BQE2KNaa.js +5 -0
  42. package/dist/{packageMetadata-DjxyJCJm.js.map → packageMetadata-BQE2KNaa.js.map} +1 -1
  43. package/dist/packageMetadata-BqAHZ5WO.cjs +4 -0
  44. package/dist/{packageMetadata-CewXH0iF.cjs.map → packageMetadata-BqAHZ5WO.cjs.map} +1 -1
  45. package/dist/prerequisites.d.ts +2 -2
  46. package/dist/testing.d.ts +2 -2
  47. package/dist/tray.d.ts +2 -2
  48. package/dist/types.d.ts +25 -2
  49. package/dist/types.d.ts.map +1 -1
  50. package/dist/wait.d.ts +2 -2
  51. package/package.json +7 -7
  52. package/prebuilds/linux-arm/gtk3/node.napi.armv7.glibc.node +0 -0
  53. package/prebuilds/linux-arm/gtk4/node.napi.armv7.glibc.node +0 -0
  54. package/prebuilds/linux-arm64/gtk3/node.napi.glibc.node +0 -0
  55. package/prebuilds/linux-arm64/gtk4/node.napi.glibc.node +0 -0
  56. package/prebuilds/linux-ia32/gtk3/node.napi.glibc.node +0 -0
  57. package/prebuilds/linux-ia32/gtk4/node.napi.glibc.node +0 -0
  58. package/prebuilds/linux-riscv64/gtk3/node.napi.glibc.node +0 -0
  59. package/prebuilds/linux-riscv64/gtk4/node.napi.glibc.node +0 -0
  60. package/prebuilds/linux-x64/gtk3/node.napi.glibc.node +0 -0
  61. package/prebuilds/linux-x64/gtk4/node.napi.glibc.node +0 -0
  62. package/dist/launchGtkApp-CzYcrc9f.cjs.map +0 -1
  63. package/dist/launchGtkApp-EI6OIpPI.js.map +0 -1
  64. package/dist/native-DlCBBWlV.js.map +0 -1
  65. package/dist/native-Kfm95Uxw.cjs.map +0 -1
  66. package/dist/packageMetadata-CewXH0iF.cjs +0 -4
  67. package/dist/packageMetadata-DjxyJCJm.js +0 -5
@@ -8,7 +8,7 @@ const node_os = require("node:os");
8
8
  const node_path = require("node:path");
9
9
  const node_url = require("node:url");
10
10
  const prerequisites = require("./prerequisites-BuZST2Dy.cjs");
11
- const native = require("./native-Kfm95Uxw.cjs");
11
+ const native = require("./native-Xz0gjKti.cjs");
12
12
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
13
13
  const normalizeOutputBufferBytes = (value, optionName = "outputBufferBytes") => {
14
14
  if (value === void 0) {
@@ -684,7 +684,7 @@ const resolveLauncherEnvironment = (options, effective) => {
684
684
  };
685
685
  const resolveDriverPath = () => {
686
686
  const driverPath = node_path.resolve(
687
- node_path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("launchGtkApp-CzYcrc9f.cjs", document.baseURI).href)),
687
+ node_path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("launchGtkApp-OggUtTTC.cjs", document.baseURI).href)),
688
688
  "..",
689
689
  "dist",
690
690
  "gestament-launcher-driver.cjs"
@@ -698,7 +698,7 @@ const resolveDriverPath = () => {
698
698
  };
699
699
  const resolveXvfbPoolProbePath = () => {
700
700
  const probePath = node_path.resolve(
701
- node_path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("launchGtkApp-CzYcrc9f.cjs", document.baseURI).href)),
701
+ node_path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("launchGtkApp-OggUtTTC.cjs", document.baseURI).href)),
702
702
  "..",
703
703
  "dist",
704
704
  "gestament-xvfb-pool-probe.cjs"
@@ -1782,9 +1782,23 @@ const createProxyGtkElement = (session, ref) => {
1782
1782
  switch (ref.kind) {
1783
1783
  case "window":
1784
1784
  target.bounds = () => session.request("element.bounds", { elementId });
1785
+ target.moveTo = (x, y) => session.request("window.moveTo", {
1786
+ elementId,
1787
+ x,
1788
+ y
1789
+ });
1785
1790
  target.resizeHints = () => session.request("window.resizeHints", {
1786
1791
  elementId
1787
1792
  });
1793
+ target.resizeTo = (width, height) => session.request("window.resizeTo", {
1794
+ elementId,
1795
+ height,
1796
+ width
1797
+ });
1798
+ target.setBounds = (bounds) => session.request("window.setBounds", {
1799
+ bounds,
1800
+ elementId
1801
+ });
1788
1802
  target.x11Info = () => session.request("window.x11Info", { elementId });
1789
1803
  addChildContainerProxyOperations(session, elementId, target);
1790
1804
  break;
@@ -2007,6 +2021,19 @@ const assertFiniteNumber = (name, value) => {
2007
2021
  throw errors.createGtkInvalidArgumentError(`${name} must be a finite number.`);
2008
2022
  }
2009
2023
  };
2024
+ const int32Min = -2147483648;
2025
+ const int32Max = 2147483647;
2026
+ const assertInt32 = (name, value) => {
2027
+ if (!Number.isInteger(value) || value < int32Min || value > int32Max) {
2028
+ throw errors.createGtkInvalidArgumentError(`${name} must be a 32-bit integer.`);
2029
+ }
2030
+ };
2031
+ const assertPositiveInt32 = (name, value) => {
2032
+ assertInt32(name, value);
2033
+ if (value <= 0) {
2034
+ throw errors.createGtkInvalidArgumentError(`${name} must be greater than zero.`);
2035
+ }
2036
+ };
2010
2037
  const normalizeRoleName = (roleName) => roleName.trim().toLowerCase().replace(/[_-]+/g, " ").replace(/\s+/g, " ");
2011
2038
  const hasInterface = (info, name) => info.interfaces.some(
2012
2039
  (interfaceName) => interfaceName.toLowerCase() === name.toLowerCase()
@@ -2399,6 +2426,26 @@ const createImageInfoOperation = (handle) => async () => {
2399
2426
  };
2400
2427
  };
2401
2428
  const createBoundsOperation = (handle) => async () => native.nativeBounds(handle);
2429
+ const createMoveToOperation = (handle) => async (x, y) => {
2430
+ assertInt32("x", x);
2431
+ assertInt32("y", y);
2432
+ return native.nativeMoveWindow(handle, x, y);
2433
+ };
2434
+ const createResizeToOperation = (handle) => async (width, height) => {
2435
+ assertPositiveInt32("width", width);
2436
+ assertPositiveInt32("height", height);
2437
+ return native.nativeResizeWindow(handle, width, height);
2438
+ };
2439
+ const createSetBoundsOperation = (handle) => async (bounds) => {
2440
+ if (typeof bounds !== "object" || bounds === null) {
2441
+ throw errors.createGtkInvalidArgumentError("bounds must be an object.");
2442
+ }
2443
+ assertInt32("bounds.x", bounds.x);
2444
+ assertInt32("bounds.y", bounds.y);
2445
+ assertPositiveInt32("bounds.width", bounds.width);
2446
+ assertPositiveInt32("bounds.height", bounds.height);
2447
+ return native.nativeSetWindowBounds(handle, bounds);
2448
+ };
2402
2449
  const createResizeHintsOperation = (handle) => async () => native.nativeResizeHints(handle);
2403
2450
  const createX11InfoOperation = (handle) => async () => native.nativeX11Info(handle);
2404
2451
  const createValueOperation = (handle) => async () => native.nativeValueInfo(handle).value;
@@ -2573,7 +2620,10 @@ const createGtkElement = (handle) => {
2573
2620
  ...common,
2574
2621
  kind: "window",
2575
2622
  bounds: createBoundsOperation(handle),
2623
+ moveTo: createMoveToOperation(handle),
2576
2624
  ...createChildContainerOperations(handle, void 0),
2625
+ resizeTo: createResizeToOperation(handle),
2626
+ setBounds: createSetBoundsOperation(handle),
2577
2627
  resizeHints: createResizeHintsOperation(handle),
2578
2628
  x11Info: createX11InfoOperation(handle)
2579
2629
  };
@@ -3181,4 +3231,4 @@ const createGtkAppLauncher = (options) => createDriverBackedGtkAppLauncher(optio
3181
3231
  exports.createGtkAppEnvironment = createGtkAppEnvironment;
3182
3232
  exports.createGtkAppLauncher = createGtkAppLauncher;
3183
3233
  exports.launchGtkApp = launchGtkApp;
3184
- //# sourceMappingURL=launchGtkApp-CzYcrc9f.cjs.map
3234
+ //# sourceMappingURL=launchGtkApp-OggUtTTC.cjs.map