@react-native-windows/automation-commands 0.84.0 → 0.85.0-preview.1

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.
@@ -5,4 +5,5 @@
5
5
  * @format
6
6
  */
7
7
  import dumpVisualTree from './dumpVisualTree';
8
- export { dumpVisualTree };
8
+ import createScreenshot from './screenshot';
9
+ export { dumpVisualTree, createScreenshot };
@@ -9,7 +9,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.dumpVisualTree = void 0;
12
+ exports.createScreenshot = exports.dumpVisualTree = void 0;
13
13
  const dumpVisualTree_1 = __importDefault(require("./dumpVisualTree"));
14
14
  exports.dumpVisualTree = dumpVisualTree_1.default;
15
+ const screenshot_1 = __importDefault(require("./screenshot"));
16
+ exports.createScreenshot = screenshot_1.default;
15
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,sEAA8C;AAEtC,yBAFD,wBAAc,CAEC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * @format\n */\n\nimport dumpVisualTree from './dumpVisualTree';\n\nexport {dumpVisualTree};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,sEAA8C;AAGrC,yBAHF,wBAAc,CAGE;AAFvB,8DAA4C;AAEnB,2BAFlB,oBAAgB,CAEkB","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * @format\n */\n\nimport dumpVisualTree from './dumpVisualTree';\nimport createScreenshot from './screenshot';\n\nexport { dumpVisualTree, createScreenshot };\n"]}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ */
7
+ /**
8
+ * Take a screenshot of the app window
9
+ */
10
+ export default function createScreenshot(opts?: {
11
+ accessibilityId: string;
12
+ screenshotsPath?: string;
13
+ location?: {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ };
19
+ }): Promise<void>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Microsoft Corporation.
4
+ * Licensed under the MIT License.
5
+ *
6
+ * @format
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ /**
10
+ * Take a screenshot of the app window
11
+ */
12
+ async function createScreenshot(opts) {
13
+ if (!automationClient) {
14
+ throw new Error('RPC client is not enabled');
15
+ }
16
+ const dumpResponse = await automationClient.invoke('CreateScreenshot', {
17
+ ...opts,
18
+ });
19
+ if (dumpResponse.type === 'error') {
20
+ throw new Error(dumpResponse.message);
21
+ }
22
+ }
23
+ exports.default = createScreenshot;
24
+ //# sourceMappingURL=screenshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../src/screenshot.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH;;GAEG;AACY,KAAK,UAAU,gBAAgB,CAC5C,IAIC;IAED,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;KAC9C;IAED,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,kBAAkB,EAAE;QACrE,GAAG,IAAI;KACR,CAAC,CAAC;IAEH,IAAI,YAAY,CAAC,IAAI,KAAK,OAAO,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;KACvC;AACH,CAAC;AAlBD,mCAkBC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * @format\n */\n\n/**\n * Take a screenshot of the app window\n */\nexport default async function createScreenshot(\n opts?: {\n accessibilityId: string,\n screenshotsPath?: string,\n location?: { x: number, y: number, width: number, height: number };\n },\n): Promise<void> {\n if (!automationClient) {\n throw new Error('RPC client is not enabled');\n }\n\n const dumpResponse = await automationClient.invoke('CreateScreenshot', {\n ...opts,\n });\n\n if (dumpResponse.type === 'error') {\n throw new Error(dumpResponse.message);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-windows/automation-commands",
3
- "version": "0.84.0",
3
+ "version": "0.85.0-preview.1",
4
4
  "description": "Allows controlling your react-native-windows application",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "license": "MIT",
@@ -9,7 +9,6 @@
9
9
  "url": "https://github.com/microsoft/react-native-windows",
10
10
  "directory": "packages/@react-native-windows/automation-commands"
11
11
  },
12
- "private": false,
13
12
  "scripts": {
14
13
  "build": "rnw-scripts build",
15
14
  "clean": "rnw-scripts clean",
@@ -18,9 +17,9 @@
18
17
  "watch": "rnw-scripts watch"
19
18
  },
20
19
  "dependencies": {
21
- "@react-native-windows/automation-channel": "0.84.0",
22
- "@typescript-eslint/eslint-plugin": "^7.1.1",
23
- "@typescript-eslint/parser": "^7.1.1"
20
+ "@react-native-windows/automation-channel": "0.85.0-preview.1",
21
+ "@typescript-eslint/eslint-plugin": "^8.36.0",
22
+ "@typescript-eslint/parser": "^8.36.0"
24
23
  },
25
24
  "devDependencies": {
26
25
  "@jest/types": "^29.2.1",
@@ -38,11 +37,11 @@
38
37
  "README.md"
39
38
  ],
40
39
  "beachball": {
41
- "defaultNpmTag": "latest",
40
+ "defaultNpmTag": "preview",
42
41
  "disallowedChangeTypes": [
43
42
  "major",
44
43
  "minor",
45
- "prerelease",
44
+ "patch",
46
45
  "premajor",
47
46
  "preminor",
48
47
  "prepatch"