@bctrl/sdk 1.0.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.
Files changed (260) hide show
  1. package/README.md +75 -0
  2. package/dist/agents/browser-use/index.d.ts +1 -0
  3. package/dist/agents/browser-use/index.js +9 -0
  4. package/dist/agents/browser-use/namespace.d.ts +39 -0
  5. package/dist/agents/browser-use/namespace.js +93 -0
  6. package/dist/agents/index.d.ts +2 -0
  7. package/dist/agents/index.js +17 -0
  8. package/dist/agents/stagehand/core.d.ts +93 -0
  9. package/dist/agents/stagehand/core.js +144 -0
  10. package/dist/agents/stagehand/index.d.ts +3 -0
  11. package/dist/agents/stagehand/index.js +24 -0
  12. package/dist/agents/stagehand/namespace.d.ts +51 -0
  13. package/dist/agents/stagehand/namespace.js +65 -0
  14. package/dist/ai-credentials/client.d.ts +12 -0
  15. package/dist/ai-credentials/client.js +70 -0
  16. package/dist/ai-credentials/index.d.ts +1 -0
  17. package/dist/ai-credentials/index.js +1 -0
  18. package/dist/base/event-binding.d.ts +7 -0
  19. package/dist/base/event-binding.js +23 -0
  20. package/dist/base/types.d.ts +109 -0
  21. package/dist/base/types.js +4 -0
  22. package/dist/bctrl.d.ts +37 -0
  23. package/dist/bctrl.js +77 -0
  24. package/dist/browser-extensions/client.d.ts +15 -0
  25. package/dist/browser-extensions/client.js +72 -0
  26. package/dist/browser-extensions/index.d.ts +2 -0
  27. package/dist/browser-extensions/index.js +1 -0
  28. package/dist/browser-profiles/client.d.ts +11 -0
  29. package/dist/browser-profiles/client.js +63 -0
  30. package/dist/browser-profiles/index.d.ts +1 -0
  31. package/dist/browser-profiles/index.js +1 -0
  32. package/dist/captcha/index.d.ts +1 -0
  33. package/dist/captcha/index.js +1 -0
  34. package/dist/captcha/namespace.d.ts +34 -0
  35. package/dist/captcha/namespace.js +41 -0
  36. package/dist/client/index.d.ts +1 -0
  37. package/dist/client/index.js +1 -0
  38. package/dist/client/rpc.d.ts +83 -0
  39. package/dist/client/rpc.js +354 -0
  40. package/dist/config.d.ts +5 -0
  41. package/dist/config.js +28 -0
  42. package/dist/constants/browser.d.ts +2 -0
  43. package/dist/constants/browser.js +1 -0
  44. package/dist/contracts/agent-tools.d.ts +45 -0
  45. package/dist/contracts/agent-tools.js +31 -0
  46. package/dist/contracts/automation.d.ts +265 -0
  47. package/dist/contracts/automation.js +109 -0
  48. package/dist/contracts/browser-management.d.ts +179 -0
  49. package/dist/contracts/browser-management.js +95 -0
  50. package/dist/contracts/browser-use.d.ts +136 -0
  51. package/dist/contracts/browser-use.js +93 -0
  52. package/dist/contracts/captcha.d.ts +114 -0
  53. package/dist/contracts/captcha.js +40 -0
  54. package/dist/contracts/desktop.d.ts +223 -0
  55. package/dist/contracts/desktop.js +121 -0
  56. package/dist/contracts/drivers/playwright.d.ts +2008 -0
  57. package/dist/contracts/drivers/playwright.js +2033 -0
  58. package/dist/contracts/drivers/puppeteer.d.ts +1221 -0
  59. package/dist/contracts/drivers/puppeteer.js +941 -0
  60. package/dist/contracts/drivers/selenium.d.ts +156 -0
  61. package/dist/contracts/drivers/selenium.js +61 -0
  62. package/dist/contracts/drivers/stagehand.d.ts +155 -0
  63. package/dist/contracts/drivers/stagehand.js +7 -0
  64. package/dist/contracts/extensions.d.ts +13 -0
  65. package/dist/contracts/extensions.js +9 -0
  66. package/dist/contracts/index.d.ts +13 -0
  67. package/dist/contracts/index.js +13 -0
  68. package/dist/contracts/public-api.d.ts +360 -0
  69. package/dist/contracts/public-api.js +17 -0
  70. package/dist/contracts/runtime.d.ts +81 -0
  71. package/dist/contracts/runtime.js +16 -0
  72. package/dist/contracts/stagehand.d.ts +253 -0
  73. package/dist/contracts/stagehand.js +145 -0
  74. package/dist/contracts/storage.d.ts +51 -0
  75. package/dist/contracts/storage.js +56 -0
  76. package/dist/contracts/vault.d.ts +119 -0
  77. package/dist/contracts/vault.js +112 -0
  78. package/dist/contracts/version.d.ts +3 -0
  79. package/dist/contracts/version.js +16 -0
  80. package/dist/desktop.d.ts +2 -0
  81. package/dist/desktop.js +3 -0
  82. package/dist/drivers/desktop/index.d.ts +65 -0
  83. package/dist/drivers/desktop/index.js +68 -0
  84. package/dist/drivers/desktop/session.d.ts +313 -0
  85. package/dist/drivers/desktop/session.js +432 -0
  86. package/dist/drivers/playwright/event-emitter.d.ts +160 -0
  87. package/dist/drivers/playwright/event-emitter.js +297 -0
  88. package/dist/drivers/playwright/generated/api-request-context.d.ts +137 -0
  89. package/dist/drivers/playwright/generated/api-request-context.js +154 -0
  90. package/dist/drivers/playwright/generated/api-response.d.ts +119 -0
  91. package/dist/drivers/playwright/generated/api-response.js +123 -0
  92. package/dist/drivers/playwright/generated/browser-context.d.ts +284 -0
  93. package/dist/drivers/playwright/generated/browser-context.js +458 -0
  94. package/dist/drivers/playwright/generated/browser.d.ts +120 -0
  95. package/dist/drivers/playwright/generated/browser.js +151 -0
  96. package/dist/drivers/playwright/generated/clock.d.ts +80 -0
  97. package/dist/drivers/playwright/generated/clock.js +94 -0
  98. package/dist/drivers/playwright/generated/console-message.d.ts +94 -0
  99. package/dist/drivers/playwright/generated/console-message.js +89 -0
  100. package/dist/drivers/playwright/generated/coverage.d.ts +57 -0
  101. package/dist/drivers/playwright/generated/coverage.js +66 -0
  102. package/dist/drivers/playwright/generated/dialog.d.ts +79 -0
  103. package/dist/drivers/playwright/generated/dialog.js +80 -0
  104. package/dist/drivers/playwright/generated/element-handle.d.ts +399 -0
  105. package/dist/drivers/playwright/generated/element-handle.js +501 -0
  106. package/dist/drivers/playwright/generated/frame-locator.d.ts +34 -0
  107. package/dist/drivers/playwright/generated/frame-locator.js +63 -0
  108. package/dist/drivers/playwright/generated/frame.d.ts +557 -0
  109. package/dist/drivers/playwright/generated/frame.js +634 -0
  110. package/dist/drivers/playwright/generated/js-handle.d.ts +72 -0
  111. package/dist/drivers/playwright/generated/js-handle.js +92 -0
  112. package/dist/drivers/playwright/generated/keyboard.d.ts +103 -0
  113. package/dist/drivers/playwright/generated/keyboard.js +113 -0
  114. package/dist/drivers/playwright/generated/locator.d.ts +795 -0
  115. package/dist/drivers/playwright/generated/locator.js +974 -0
  116. package/dist/drivers/playwright/generated/mouse.d.ts +97 -0
  117. package/dist/drivers/playwright/generated/mouse.js +109 -0
  118. package/dist/drivers/playwright/generated/page.d.ts +762 -0
  119. package/dist/drivers/playwright/generated/page.js +988 -0
  120. package/dist/drivers/playwright/generated/touchscreen.d.ts +34 -0
  121. package/dist/drivers/playwright/generated/touchscreen.js +37 -0
  122. package/dist/drivers/playwright/generated/tracing.d.ts +78 -0
  123. package/dist/drivers/playwright/generated/tracing.js +80 -0
  124. package/dist/drivers/playwright/generated/worker.d.ts +53 -0
  125. package/dist/drivers/playwright/generated/worker.js +59 -0
  126. package/dist/drivers/playwright/index.d.ts +19 -0
  127. package/dist/drivers/playwright/index.js +20 -0
  128. package/dist/drivers/playwright/remote-base.d.ts +62 -0
  129. package/dist/drivers/playwright/remote-base.js +86 -0
  130. package/dist/drivers/playwright/types.d.ts +148 -0
  131. package/dist/drivers/playwright/types.js +8 -0
  132. package/dist/drivers/puppeteer/errors.d.ts +50 -0
  133. package/dist/drivers/puppeteer/errors.js +71 -0
  134. package/dist/drivers/puppeteer/event-emitter.d.ts +145 -0
  135. package/dist/drivers/puppeteer/event-emitter.js +259 -0
  136. package/dist/drivers/puppeteer/generated/accessibility.d.ts +77 -0
  137. package/dist/drivers/puppeteer/generated/accessibility.js +74 -0
  138. package/dist/drivers/puppeteer/generated/browser-context.d.ts +116 -0
  139. package/dist/drivers/puppeteer/generated/browser-context.js +168 -0
  140. package/dist/drivers/puppeteer/generated/browser.d.ts +169 -0
  141. package/dist/drivers/puppeteer/generated/browser.js +246 -0
  142. package/dist/drivers/puppeteer/generated/console-message.d.ts +54 -0
  143. package/dist/drivers/puppeteer/generated/console-message.js +69 -0
  144. package/dist/drivers/puppeteer/generated/coverage.d.ts +49 -0
  145. package/dist/drivers/puppeteer/generated/coverage.js +57 -0
  146. package/dist/drivers/puppeteer/generated/dialog.d.ts +46 -0
  147. package/dist/drivers/puppeteer/generated/dialog.js +60 -0
  148. package/dist/drivers/puppeteer/generated/element-handle.d.ts +261 -0
  149. package/dist/drivers/puppeteer/generated/element-handle.js +341 -0
  150. package/dist/drivers/puppeteer/generated/file-chooser.d.ts +34 -0
  151. package/dist/drivers/puppeteer/generated/file-chooser.js +43 -0
  152. package/dist/drivers/puppeteer/generated/frame.d.ts +221 -0
  153. package/dist/drivers/puppeteer/generated/frame.js +302 -0
  154. package/dist/drivers/puppeteer/generated/http-request.d.ts +195 -0
  155. package/dist/drivers/puppeteer/generated/http-request.js +243 -0
  156. package/dist/drivers/puppeteer/generated/http-response.d.ts +142 -0
  157. package/dist/drivers/puppeteer/generated/http-response.js +169 -0
  158. package/dist/drivers/puppeteer/generated/js-handle.d.ts +104 -0
  159. package/dist/drivers/puppeteer/generated/js-handle.js +125 -0
  160. package/dist/drivers/puppeteer/generated/keyboard.d.ts +79 -0
  161. package/dist/drivers/puppeteer/generated/keyboard.js +89 -0
  162. package/dist/drivers/puppeteer/generated/locator.d.ts +141 -0
  163. package/dist/drivers/puppeteer/generated/locator.js +164 -0
  164. package/dist/drivers/puppeteer/generated/mouse.d.ts +74 -0
  165. package/dist/drivers/puppeteer/generated/mouse.js +94 -0
  166. package/dist/drivers/puppeteer/generated/page.d.ts +604 -0
  167. package/dist/drivers/puppeteer/generated/page.js +776 -0
  168. package/dist/drivers/puppeteer/generated/target.d.ts +105 -0
  169. package/dist/drivers/puppeteer/generated/target.js +123 -0
  170. package/dist/drivers/puppeteer/generated/touchscreen.d.ts +87 -0
  171. package/dist/drivers/puppeteer/generated/touchscreen.js +103 -0
  172. package/dist/drivers/puppeteer/generated/tracing.d.ts +38 -0
  173. package/dist/drivers/puppeteer/generated/tracing.js +43 -0
  174. package/dist/drivers/puppeteer/generated/web-worker.d.ts +63 -0
  175. package/dist/drivers/puppeteer/generated/web-worker.js +73 -0
  176. package/dist/drivers/puppeteer/index.d.ts +21 -0
  177. package/dist/drivers/puppeteer/index.js +23 -0
  178. package/dist/drivers/puppeteer/remote-base.d.ts +57 -0
  179. package/dist/drivers/puppeteer/remote-base.js +79 -0
  180. package/dist/drivers/puppeteer/types.d.ts +178 -0
  181. package/dist/drivers/puppeteer/types.js +8 -0
  182. package/dist/drivers/selenium/driver.d.ts +28 -0
  183. package/dist/drivers/selenium/driver.js +169 -0
  184. package/dist/drivers/selenium/element.d.ts +34 -0
  185. package/dist/drivers/selenium/element.js +73 -0
  186. package/dist/drivers/selenium/index.d.ts +3 -0
  187. package/dist/drivers/selenium/index.js +5 -0
  188. package/dist/drivers/selenium/types.d.ts +2 -0
  189. package/dist/drivers/selenium/types.js +12 -0
  190. package/dist/drivers/stagehand/generated/context.d.ts +127 -0
  191. package/dist/drivers/stagehand/generated/context.js +153 -0
  192. package/dist/drivers/stagehand/generated/locator.d.ts +324 -0
  193. package/dist/drivers/stagehand/generated/locator.js +368 -0
  194. package/dist/drivers/stagehand/generated/page.d.ts +377 -0
  195. package/dist/drivers/stagehand/generated/page.js +439 -0
  196. package/dist/drivers/stagehand/generated/response.d.ts +197 -0
  197. package/dist/drivers/stagehand/generated/response.js +232 -0
  198. package/dist/drivers/stagehand/index.d.ts +5 -0
  199. package/dist/drivers/stagehand/index.js +8 -0
  200. package/dist/drivers/stagehand/types.d.ts +1 -0
  201. package/dist/drivers/stagehand/types.js +7 -0
  202. package/dist/errors.d.ts +47 -0
  203. package/dist/errors.js +157 -0
  204. package/dist/extensions/client.d.ts +47 -0
  205. package/dist/extensions/client.js +154 -0
  206. package/dist/extensions/index.d.ts +1 -0
  207. package/dist/extensions/index.js +1 -0
  208. package/dist/index.d.ts +12 -0
  209. package/dist/index.js +23 -0
  210. package/dist/internal/dev-client.d.ts +5 -0
  211. package/dist/internal/dev-client.js +9 -0
  212. package/dist/internal/rpc-targets.d.ts +17 -0
  213. package/dist/internal/rpc-targets.js +58 -0
  214. package/dist/internal/serialization.d.ts +32 -0
  215. package/dist/internal/serialization.js +42 -0
  216. package/dist/internal/transport.d.ts +24 -0
  217. package/dist/internal/transport.js +29 -0
  218. package/dist/playwright.d.ts +1 -0
  219. package/dist/playwright.js +2 -0
  220. package/dist/puppeteer.d.ts +1 -0
  221. package/dist/puppeteer.js +2 -0
  222. package/dist/selenium.d.ts +1 -0
  223. package/dist/selenium.js +2 -0
  224. package/dist/stagehand.d.ts +1 -0
  225. package/dist/stagehand.js +2 -0
  226. package/dist/storage/client.d.ts +151 -0
  227. package/dist/storage/client.js +329 -0
  228. package/dist/storage/index.d.ts +2 -0
  229. package/dist/storage/index.js +4 -0
  230. package/dist/telemetry.d.ts +18 -0
  231. package/dist/telemetry.js +93 -0
  232. package/dist/updates/client.d.ts +8 -0
  233. package/dist/updates/client.js +128 -0
  234. package/dist/updates/index.d.ts +1 -0
  235. package/dist/updates/index.js +1 -0
  236. package/dist/utils/http.d.ts +39 -0
  237. package/dist/utils/http.js +88 -0
  238. package/dist/utils/index.d.ts +4 -0
  239. package/dist/utils/index.js +4 -0
  240. package/dist/utils/logger.d.ts +27 -0
  241. package/dist/utils/logger.js +74 -0
  242. package/dist/utils/schema.d.ts +17 -0
  243. package/dist/utils/schema.js +31 -0
  244. package/dist/utils/url.d.ts +5 -0
  245. package/dist/utils/url.js +7 -0
  246. package/dist/vault/client.d.ts +43 -0
  247. package/dist/vault/client.js +123 -0
  248. package/dist/vault/index.d.ts +1 -0
  249. package/dist/vault/index.js +1 -0
  250. package/dist/version.d.ts +1 -0
  251. package/dist/version.js +4 -0
  252. package/dist/workspaces/browser-runtime.d.ts +251 -0
  253. package/dist/workspaces/browser-runtime.js +1025 -0
  254. package/dist/workspaces/client.d.ts +48 -0
  255. package/dist/workspaces/client.js +222 -0
  256. package/dist/workspaces/index.d.ts +2 -0
  257. package/dist/workspaces/index.js +2 -0
  258. package/dist/workspaces/runtime-event-pump.d.ts +65 -0
  259. package/dist/workspaces/runtime-event-pump.js +716 -0
  260. package/package.json +56 -0
@@ -0,0 +1,72 @@
1
+ /**
2
+ * AUTO-GENERATED FILE - DO NOT EDIT
3
+ *
4
+ * Generated from: packages/automation-spec/src/drivers/playwright/methods/
5
+ * Run `pnpm generate:playwright` to regenerate.
6
+ */
7
+ import type { SimpleRpcSender } from '../../../internal/transport.js';
8
+ import { RemoteBase } from '../remote-base.js';
9
+ /**
10
+ * RemotePlaywrightJSHandle - Remote Playwright JSHandle API over RPC.
11
+ *
12
+ * @see https://playwright.dev/docs/api/class-jshandle
13
+ */
14
+ export declare class RemotePlaywrightJSHandle extends RemoteBase {
15
+ /** Factory to create JSHandle instances */
16
+ private readonly _jsHandleFactory;
17
+ constructor(id: string, sendRpc: SimpleRpcSender, jsHandleFactory: (id: string) => RemotePlaywrightJSHandle);
18
+ protected get jsHandleFactory(): (id: string) => RemotePlaywrightJSHandle;
19
+ /**
20
+ * Evaluates the given function with this handle as the first argument.
21
+ * @param pageFunction - Function to be evaluated in the page context.
22
+ * @param arg - Optional argument to pass to the function.
23
+ *
24
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-evaluate
25
+ */
26
+ evaluate<R = unknown>(pageFunction: Function | string, arg?: unknown): Promise<R>;
27
+ /**
28
+ * Evaluates the given function with this handle as the first argument and returns a JSHandle.
29
+ * @param pageFunction - Function to be evaluated in the page context.
30
+ * @param arg - Optional argument to pass to the function.
31
+ *
32
+ * @remarks
33
+ * Note: Returns serialized handle reference. Full JSHandle support not yet available.
34
+ *
35
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-evaluate-handle
36
+ */
37
+ evaluateHandle<R = unknown>(pageFunction: Function | string, arg?: unknown): Promise<unknown>;
38
+ /**
39
+ * Returns a map of property names to JSHandle instances for own properties of the object.
40
+ *
41
+ * @remarks
42
+ * Note: Returns serialized handle references. Full JSHandle support not yet available.
43
+ *
44
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-get-properties
45
+ */
46
+ getProperties(): Promise<Map<string, unknown>>;
47
+ /**
48
+ * Returns a JSHandle for the property with the given name.
49
+ * @param propertyName - Property name to get.
50
+ *
51
+ * @remarks
52
+ * Note: Returns serialized handle reference. Full JSHandle support not yet available.
53
+ *
54
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-get-property
55
+ */
56
+ getProperty(propertyName: string): Promise<unknown>;
57
+ /**
58
+ * Returns a JSON representation of the object.
59
+ *
60
+ * @remarks
61
+ * If the object has a toJSON function, it will not be called.
62
+ *
63
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-json-value
64
+ */
65
+ jsonValue<T = unknown>(): Promise<T>;
66
+ /**
67
+ * Releases the handle. After calling dispose, the handle is no longer valid.
68
+ *
69
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-dispose
70
+ */
71
+ dispose(): Promise<void>;
72
+ }
@@ -0,0 +1,92 @@
1
+ /**
2
+ * AUTO-GENERATED FILE - DO NOT EDIT
3
+ *
4
+ * Generated from: packages/automation-spec/src/drivers/playwright/methods/
5
+ * Run `pnpm generate:playwright` to regenerate.
6
+ */
7
+ import { RemoteBase } from '../remote-base.js';
8
+ import { serializeFunctionSource } from '../../../internal/transport.js';
9
+ /**
10
+ * RemotePlaywrightJSHandle - Remote Playwright JSHandle API over RPC.
11
+ *
12
+ * @see https://playwright.dev/docs/api/class-jshandle
13
+ */
14
+ export class RemotePlaywrightJSHandle extends RemoteBase {
15
+ /** Factory to create JSHandle instances */
16
+ _jsHandleFactory;
17
+ constructor(id, sendRpc, jsHandleFactory) {
18
+ super(id, sendRpc);
19
+ this._jsHandleFactory = jsHandleFactory;
20
+ }
21
+ get jsHandleFactory() {
22
+ return this._jsHandleFactory;
23
+ }
24
+ /**
25
+ * Evaluates the given function with this handle as the first argument.
26
+ * @param pageFunction - Function to be evaluated in the page context.
27
+ * @param arg - Optional argument to pass to the function.
28
+ *
29
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-evaluate
30
+ */
31
+ async evaluate(pageFunction, arg) {
32
+ const _pageFunction = serializeFunctionSource(pageFunction);
33
+ return this.rpc('evaluate', [_pageFunction, arg]);
34
+ }
35
+ /**
36
+ * Evaluates the given function with this handle as the first argument and returns a JSHandle.
37
+ * @param pageFunction - Function to be evaluated in the page context.
38
+ * @param arg - Optional argument to pass to the function.
39
+ *
40
+ * @remarks
41
+ * Note: Returns serialized handle reference. Full JSHandle support not yet available.
42
+ *
43
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-evaluate-handle
44
+ */
45
+ async evaluateHandle(pageFunction, arg) {
46
+ const _pageFunction = serializeFunctionSource(pageFunction);
47
+ return this.rpc('evaluateHandle', [_pageFunction, arg]);
48
+ }
49
+ /**
50
+ * Returns a map of property names to JSHandle instances for own properties of the object.
51
+ *
52
+ * @remarks
53
+ * Note: Returns serialized handle references. Full JSHandle support not yet available.
54
+ *
55
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-get-properties
56
+ */
57
+ async getProperties() {
58
+ return this.rpc('getProperties', []);
59
+ }
60
+ /**
61
+ * Returns a JSHandle for the property with the given name.
62
+ * @param propertyName - Property name to get.
63
+ *
64
+ * @remarks
65
+ * Note: Returns serialized handle reference. Full JSHandle support not yet available.
66
+ *
67
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-get-property
68
+ */
69
+ async getProperty(propertyName) {
70
+ return this.rpc('getProperty', [propertyName]);
71
+ }
72
+ /**
73
+ * Returns a JSON representation of the object.
74
+ *
75
+ * @remarks
76
+ * If the object has a toJSON function, it will not be called.
77
+ *
78
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-json-value
79
+ */
80
+ async jsonValue() {
81
+ return this.rpc('jsonValue', []);
82
+ }
83
+ /**
84
+ * Releases the handle. After calling dispose, the handle is no longer valid.
85
+ *
86
+ * @see https://playwright.dev/docs/api/class-jshandle#js-handle-dispose
87
+ */
88
+ async dispose() {
89
+ await this.rpc('dispose', []);
90
+ this.markClosed();
91
+ }
92
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * AUTO-GENERATED FILE - DO NOT EDIT
3
+ *
4
+ * Generated from: packages/automation-spec/src/drivers/playwright/methods/
5
+ * Run `pnpm generate:playwright` to regenerate.
6
+ */
7
+ import type { SimpleRpcSender } from '../../../internal/transport.js';
8
+ import { RemoteComponentBase } from '../remote-base.js';
9
+ import type { PlaywrightKeyboardPressOptions, PlaywrightKeyboardTypeOptions } from '../types.js';
10
+ /**
11
+ * RemotePlaywrightKeyboard - Remote Playwright Keyboard API over RPC.
12
+ *
13
+ * @see https://playwright.dev/docs/api/class-keyboard
14
+ */
15
+ export declare class RemotePlaywrightKeyboard extends RemoteComponentBase {
16
+ constructor(sendRpc: SimpleRpcSender);
17
+ /**
18
+ * Dispatches a keydown event.
19
+ * @param key - Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
20
+ *
21
+ * @remarks
22
+ * If key is a single character and no modifier keys besides Shift are being held down,
23
+ * a keypress/input event will also be generated. The text option can be specified to force an input event to be generated.
24
+ *
25
+ * Modifier keys DO affect keyboard.down. Holding down Shift will type the text in upper case.
26
+ *
27
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-down
28
+ */
29
+ down(key: string): Promise<void>;
30
+ /**
31
+ * Dispatches a keyup event.
32
+ * @param key - Name of the key to release or a character.
33
+ *
34
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-up
35
+ */
36
+ up(key: string): Promise<void>;
37
+ /**
38
+ * Shortcut for keyboard.down() and keyboard.up().
39
+ * @param key - Key to press. Can be a character or a special key name (e.g., `ArrowLeft`, `Shift+A`, `ControlOrMeta+A`).
40
+ * @param options - Options for the key press event.
41
+ *
42
+ * @remarks
43
+ * Dispatches a keydown, keypress/input, and keyup event for the specified key.
44
+ *
45
+ * If key is a single character and no modifier keys besides Shift are being held down,
46
+ * a keypress/input event will also be generated.
47
+ *
48
+ * Modifier keys DO affect keyboard.press. Holding down Shift will type the text in upper case.
49
+ *
50
+ * Shortcut such as "ControlOrMeta+A" are supported. "ControlOrMeta" resolves to "Control" on Windows/Linux and to "Meta" on macOS.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * await page.keyboard.press('Enter');
55
+ * await page.keyboard.press('Shift+A');
56
+ * await page.keyboard.press('ControlOrMeta+A');
57
+ * ```
58
+ *
59
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-press
60
+ */
61
+ press(key: string, options?: PlaywrightKeyboardPressOptions): Promise<void>;
62
+ /**
63
+ * Sends a keydown, keypress/input, and keyup event for each character in the text.
64
+ * @param text - Text to type.
65
+ * @param options - Options for typing.
66
+ *
67
+ * @remarks
68
+ * Use this method when you need to simulate typing character by character,
69
+ * for example, if the page has custom keyboard event listeners.
70
+ *
71
+ * Modifier keys DO NOT affect keyboard.type. Holding down Shift will not type the text in upper case.
72
+ *
73
+ * For characters not present on a standard US keyboard layout, only an input event will be dispatched.
74
+ *
75
+ * For simple text input, locator.fill() is generally preferred.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * await page.keyboard.type('Hello'); // Types instantly
80
+ * await page.keyboard.type('World', { delay: 100 }); // Types slower, like a user
81
+ * ```
82
+ *
83
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-type
84
+ */
85
+ type(text: string, options?: PlaywrightKeyboardTypeOptions): Promise<void>;
86
+ /**
87
+ * Dispatches only an input event, does not emit keydown, keyup, or keypress events.
88
+ * @param text - Text to insert.
89
+ *
90
+ * @remarks
91
+ * This method is useful for directly inserting text without simulating physical key presses.
92
+ *
93
+ * Modifier keys DO NOT affect keyboard.insertText. Holding down Shift will not type the text in upper case.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * await page.keyboard.insertText('Hello');
98
+ * ```
99
+ *
100
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-insert-text
101
+ */
102
+ insertText(text: string): Promise<void>;
103
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * AUTO-GENERATED FILE - DO NOT EDIT
3
+ *
4
+ * Generated from: packages/automation-spec/src/drivers/playwright/methods/
5
+ * Run `pnpm generate:playwright` to regenerate.
6
+ */
7
+ import { RemoteComponentBase } from '../remote-base.js';
8
+ /**
9
+ * RemotePlaywrightKeyboard - Remote Playwright Keyboard API over RPC.
10
+ *
11
+ * @see https://playwright.dev/docs/api/class-keyboard
12
+ */
13
+ export class RemotePlaywrightKeyboard extends RemoteComponentBase {
14
+ constructor(sendRpc) {
15
+ super(sendRpc);
16
+ }
17
+ /**
18
+ * Dispatches a keydown event.
19
+ * @param key - Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
20
+ *
21
+ * @remarks
22
+ * If key is a single character and no modifier keys besides Shift are being held down,
23
+ * a keypress/input event will also be generated. The text option can be specified to force an input event to be generated.
24
+ *
25
+ * Modifier keys DO affect keyboard.down. Holding down Shift will type the text in upper case.
26
+ *
27
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-down
28
+ */
29
+ async down(key) {
30
+ await this.rpc('keyboard.down', [key]);
31
+ }
32
+ /**
33
+ * Dispatches a keyup event.
34
+ * @param key - Name of the key to release or a character.
35
+ *
36
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-up
37
+ */
38
+ async up(key) {
39
+ await this.rpc('keyboard.up', [key]);
40
+ }
41
+ /**
42
+ * Shortcut for keyboard.down() and keyboard.up().
43
+ * @param key - Key to press. Can be a character or a special key name (e.g., `ArrowLeft`, `Shift+A`, `ControlOrMeta+A`).
44
+ * @param options - Options for the key press event.
45
+ *
46
+ * @remarks
47
+ * Dispatches a keydown, keypress/input, and keyup event for the specified key.
48
+ *
49
+ * If key is a single character and no modifier keys besides Shift are being held down,
50
+ * a keypress/input event will also be generated.
51
+ *
52
+ * Modifier keys DO affect keyboard.press. Holding down Shift will type the text in upper case.
53
+ *
54
+ * Shortcut such as "ControlOrMeta+A" are supported. "ControlOrMeta" resolves to "Control" on Windows/Linux and to "Meta" on macOS.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * await page.keyboard.press('Enter');
59
+ * await page.keyboard.press('Shift+A');
60
+ * await page.keyboard.press('ControlOrMeta+A');
61
+ * ```
62
+ *
63
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-press
64
+ */
65
+ async press(key, options) {
66
+ await this.rpc('keyboard.press', [key, options]);
67
+ }
68
+ /**
69
+ * Sends a keydown, keypress/input, and keyup event for each character in the text.
70
+ * @param text - Text to type.
71
+ * @param options - Options for typing.
72
+ *
73
+ * @remarks
74
+ * Use this method when you need to simulate typing character by character,
75
+ * for example, if the page has custom keyboard event listeners.
76
+ *
77
+ * Modifier keys DO NOT affect keyboard.type. Holding down Shift will not type the text in upper case.
78
+ *
79
+ * For characters not present on a standard US keyboard layout, only an input event will be dispatched.
80
+ *
81
+ * For simple text input, locator.fill() is generally preferred.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * await page.keyboard.type('Hello'); // Types instantly
86
+ * await page.keyboard.type('World', { delay: 100 }); // Types slower, like a user
87
+ * ```
88
+ *
89
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-type
90
+ */
91
+ async type(text, options) {
92
+ await this.rpc('keyboard.type', [text, options]);
93
+ }
94
+ /**
95
+ * Dispatches only an input event, does not emit keydown, keyup, or keypress events.
96
+ * @param text - Text to insert.
97
+ *
98
+ * @remarks
99
+ * This method is useful for directly inserting text without simulating physical key presses.
100
+ *
101
+ * Modifier keys DO NOT affect keyboard.insertText. Holding down Shift will not type the text in upper case.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * await page.keyboard.insertText('Hello');
106
+ * ```
107
+ *
108
+ * @see https://playwright.dev/docs/api/class-keyboard#keyboard-insert-text
109
+ */
110
+ async insertText(text) {
111
+ await this.rpc('keyboard.insertText', [text]);
112
+ }
113
+ }