@ricsam/isolate 0.1.10 → 0.1.11

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 (128) hide show
  1. package/README.md +172 -18
  2. package/dist/cjs/bridge/diagnostics.cjs +37 -2
  3. package/dist/cjs/bridge/diagnostics.cjs.map +3 -3
  4. package/dist/cjs/bridge/runtime-bindings.cjs +203 -51
  5. package/dist/cjs/bridge/runtime-bindings.cjs.map +3 -3
  6. package/dist/cjs/bridge/sandbox-isolate.cjs +365 -0
  7. package/dist/cjs/bridge/sandbox-isolate.cjs.map +10 -0
  8. package/dist/cjs/host/create-isolate-host.cjs +51 -25
  9. package/dist/cjs/host/create-isolate-host.cjs.map +3 -3
  10. package/dist/cjs/host/nested-host-controller.cjs +311 -0
  11. package/dist/cjs/host/nested-host-controller.cjs.map +10 -0
  12. package/dist/cjs/index.cjs.map +1 -1
  13. package/dist/cjs/internal/browser-source.cjs +91 -0
  14. package/dist/cjs/internal/browser-source.cjs.map +10 -0
  15. package/dist/cjs/internal/client/connection.cjs +152 -172
  16. package/dist/cjs/internal/client/connection.cjs.map +3 -3
  17. package/dist/cjs/internal/daemon/callback-fs-handler.cjs +3 -3
  18. package/dist/cjs/internal/daemon/callback-fs-handler.cjs.map +3 -3
  19. package/dist/cjs/internal/daemon/connection.cjs +129 -4
  20. package/dist/cjs/internal/daemon/connection.cjs.map +3 -3
  21. package/dist/cjs/internal/playwright/client.cjs +4 -2
  22. package/dist/cjs/internal/playwright/client.cjs.map +3 -3
  23. package/dist/cjs/internal/playwright/handler.cjs +298 -25
  24. package/dist/cjs/internal/playwright/handler.cjs.map +3 -3
  25. package/dist/cjs/internal/playwright/index.cjs +54 -8
  26. package/dist/cjs/internal/playwright/index.cjs.map +3 -3
  27. package/dist/cjs/internal/playwright/types.cjs +3 -1
  28. package/dist/cjs/internal/playwright/types.cjs.map +3 -3
  29. package/dist/cjs/internal/protocol/codec.cjs +16 -5
  30. package/dist/cjs/internal/protocol/codec.cjs.map +3 -3
  31. package/dist/cjs/internal/protocol/marshalValue.cjs +37 -6
  32. package/dist/cjs/internal/protocol/marshalValue.cjs.map +3 -3
  33. package/dist/cjs/internal/protocol/types.cjs.map +2 -2
  34. package/dist/cjs/internal/runtime/index.cjs +377 -22
  35. package/dist/cjs/internal/runtime/index.cjs.map +3 -3
  36. package/dist/cjs/internal/typecheck/index.cjs +2 -1
  37. package/dist/cjs/internal/typecheck/index.cjs.map +3 -3
  38. package/dist/cjs/internal/typecheck/isolate-types.cjs +186 -13
  39. package/dist/cjs/internal/typecheck/isolate-types.cjs.map +3 -3
  40. package/dist/cjs/internal/typecheck/typecheck.cjs +2 -3
  41. package/dist/cjs/internal/typecheck/typecheck.cjs.map +3 -3
  42. package/dist/cjs/package.json +1 -1
  43. package/dist/cjs/runtime/script-runtime.cjs +14 -12
  44. package/dist/cjs/runtime/script-runtime.cjs.map +3 -3
  45. package/dist/cjs/runtime/test-runtime.cjs +113 -0
  46. package/dist/cjs/runtime/test-runtime.cjs.map +10 -0
  47. package/dist/cjs/server/app-server.cjs +16 -9
  48. package/dist/cjs/server/app-server.cjs.map +3 -3
  49. package/dist/cjs/typecheck/index.cjs +2 -1
  50. package/dist/cjs/typecheck/index.cjs.map +3 -3
  51. package/dist/mjs/bridge/diagnostics.mjs +37 -2
  52. package/dist/mjs/bridge/diagnostics.mjs.map +3 -3
  53. package/dist/mjs/bridge/runtime-bindings.mjs +206 -51
  54. package/dist/mjs/bridge/runtime-bindings.mjs.map +3 -3
  55. package/dist/mjs/bridge/sandbox-isolate.mjs +325 -0
  56. package/dist/mjs/bridge/sandbox-isolate.mjs.map +10 -0
  57. package/dist/mjs/host/create-isolate-host.mjs +53 -25
  58. package/dist/mjs/host/create-isolate-host.mjs.map +3 -3
  59. package/dist/mjs/host/nested-host-controller.mjs +275 -0
  60. package/dist/mjs/host/nested-host-controller.mjs.map +10 -0
  61. package/dist/mjs/index.mjs.map +1 -1
  62. package/dist/mjs/internal/browser-source.mjs +51 -0
  63. package/dist/mjs/internal/browser-source.mjs.map +10 -0
  64. package/dist/mjs/internal/client/connection.mjs +154 -173
  65. package/dist/mjs/internal/client/connection.mjs.map +3 -3
  66. package/dist/mjs/internal/daemon/callback-fs-handler.mjs +3 -3
  67. package/dist/mjs/internal/daemon/callback-fs-handler.mjs.map +3 -3
  68. package/dist/mjs/internal/daemon/connection.mjs +129 -4
  69. package/dist/mjs/internal/daemon/connection.mjs.map +3 -3
  70. package/dist/mjs/internal/playwright/client.mjs +7 -3
  71. package/dist/mjs/internal/playwright/client.mjs.map +3 -3
  72. package/dist/mjs/internal/playwright/handler.mjs +300 -26
  73. package/dist/mjs/internal/playwright/handler.mjs.map +3 -3
  74. package/dist/mjs/internal/playwright/index.mjs +59 -9
  75. package/dist/mjs/internal/playwright/index.mjs.map +3 -3
  76. package/dist/mjs/internal/playwright/types.mjs +3 -1
  77. package/dist/mjs/internal/playwright/types.mjs.map +3 -3
  78. package/dist/mjs/internal/protocol/codec.mjs +16 -5
  79. package/dist/mjs/internal/protocol/codec.mjs.map +3 -3
  80. package/dist/mjs/internal/protocol/marshalValue.mjs +38 -6
  81. package/dist/mjs/internal/protocol/marshalValue.mjs.map +3 -3
  82. package/dist/mjs/internal/protocol/types.mjs.map +2 -2
  83. package/dist/mjs/internal/runtime/index.mjs +377 -22
  84. package/dist/mjs/internal/runtime/index.mjs.map +3 -3
  85. package/dist/mjs/internal/typecheck/index.mjs +3 -1
  86. package/dist/mjs/internal/typecheck/index.mjs.map +3 -3
  87. package/dist/mjs/internal/typecheck/isolate-types.mjs +186 -13
  88. package/dist/mjs/internal/typecheck/isolate-types.mjs.map +3 -3
  89. package/dist/mjs/internal/typecheck/typecheck.mjs +2 -3
  90. package/dist/mjs/internal/typecheck/typecheck.mjs.map +3 -3
  91. package/dist/mjs/package.json +1 -1
  92. package/dist/mjs/runtime/script-runtime.mjs +16 -12
  93. package/dist/mjs/runtime/script-runtime.mjs.map +3 -3
  94. package/dist/mjs/runtime/test-runtime.mjs +78 -0
  95. package/dist/mjs/runtime/test-runtime.mjs.map +10 -0
  96. package/dist/mjs/server/app-server.mjs +23 -11
  97. package/dist/mjs/server/app-server.mjs.map +3 -3
  98. package/dist/mjs/typecheck/index.mjs +2 -1
  99. package/dist/mjs/typecheck/index.mjs.map +3 -3
  100. package/dist/types/bridge/diagnostics.d.ts +6 -1
  101. package/dist/types/bridge/runtime-bindings.d.ts +5 -1
  102. package/dist/types/bridge/sandbox-isolate.d.ts +15 -0
  103. package/dist/types/host/nested-host-controller.d.ts +11 -0
  104. package/dist/types/index.d.ts +1 -1
  105. package/dist/types/internal/browser-source.d.ts +11 -0
  106. package/dist/types/internal/client/types.d.ts +5 -0
  107. package/dist/types/internal/daemon/types.d.ts +0 -2
  108. package/dist/types/internal/playwright/client.d.ts +2 -2
  109. package/dist/types/internal/playwright/handler.d.ts +27 -4
  110. package/dist/types/internal/playwright/index.d.ts +2 -2
  111. package/dist/types/internal/playwright/types.d.ts +33 -1
  112. package/dist/types/internal/protocol/codec.d.ts +12 -2
  113. package/dist/types/internal/protocol/marshalValue.d.ts +3 -2
  114. package/dist/types/internal/protocol/types.d.ts +25 -1
  115. package/dist/types/internal/runtime/index.d.ts +5 -0
  116. package/dist/types/internal/typecheck/index.d.ts +1 -1
  117. package/dist/types/internal/typecheck/isolate-types.d.ts +6 -4
  118. package/dist/types/internal/typecheck/typecheck.d.ts +1 -1
  119. package/dist/types/runtime/script-runtime.d.ts +2 -1
  120. package/dist/types/runtime/test-runtime.d.ts +4 -0
  121. package/dist/types/server/app-server.d.ts +2 -1
  122. package/dist/types/types.d.ts +33 -33
  123. package/package.json +3 -3
  124. package/dist/cjs/browser/browser-runtime.cjs +0 -157
  125. package/dist/cjs/browser/browser-runtime.cjs.map +0 -10
  126. package/dist/mjs/browser/browser-runtime.mjs +0 -93
  127. package/dist/mjs/browser/browser-runtime.mjs.map +0 -10
  128. package/dist/types/browser/browser-runtime.d.ts +0 -3
@@ -55,6 +55,7 @@ export interface IsolateRef {
55
55
  export interface CallbackRef {
56
56
  __type: "CallbackRef";
57
57
  callbackId: number;
58
+ callbackKind?: "asyncGenerator";
58
59
  }
59
60
  /**
60
61
  * Represents a reference to a stream.
@@ -180,12 +181,20 @@ export interface URLRef {
180
181
  __type: "URLRef";
181
182
  href: string;
182
183
  }
184
+ /**
185
+ * Represents a serialized AbortSignal snapshot.
186
+ */
187
+ export interface AbortSignalRef {
188
+ __type: "AbortSignalRef";
189
+ aborted: boolean;
190
+ }
183
191
  /**
184
192
  * Represents a reference to a pending Promise.
185
193
  */
186
194
  export interface PromiseRef {
187
195
  __type: "PromiseRef";
188
196
  promiseId: number;
197
+ __resolveCallbackId?: number;
189
198
  }
190
199
  /**
191
200
  * Represents a reference to an async iterator.
@@ -197,7 +206,7 @@ export interface AsyncIteratorRef {
197
206
  __returnCallbackId?: number;
198
207
  __throwCallbackId?: number;
199
208
  }
200
- export type ExtensionType = IsolateRef | CallbackRef | StreamRef | ErrorRef | BlobRef | DateRef | RegExpRef | UndefinedRef | BigIntRef | RequestRef | ResponseRef | HeadersRef | FileRef | FormDataRef | URLRef | PromiseRef | AsyncIteratorRef;
209
+ export type ExtensionType = IsolateRef | CallbackRef | StreamRef | ErrorRef | BlobRef | DateRef | RegExpRef | UndefinedRef | BigIntRef | RequestRef | ResponseRef | HeadersRef | FileRef | FormDataRef | URLRef | AbortSignalRef | PromiseRef | AsyncIteratorRef;
201
210
  /**
202
211
  * Encode a message to MessagePack bytes.
203
212
  */
@@ -215,7 +224,7 @@ export declare function encodeValue(value: unknown): Uint8Array;
215
224
  */
216
225
  export declare function decodeValue(data: Uint8Array): unknown;
217
226
  export declare function createIsolateRef(isolateId: string): IsolateRef;
218
- export declare function createCallbackRef(callbackId: number): CallbackRef;
227
+ export declare function createCallbackRef(callbackId: number, callbackKind?: "asyncGenerator"): CallbackRef;
219
228
  export declare function createStreamRef(streamId: number, direction: "upload" | "download"): StreamRef;
220
229
  export declare function createErrorRef(name: string, message: string, stack?: string, code?: number): ErrorRef;
221
230
  export declare function createBlobRef(blobId: number, size: number, type: string): BlobRef;
@@ -238,5 +247,6 @@ export declare function createHeadersRef(pairs: [string, string][]): HeadersRef;
238
247
  export declare function createFileRef(name: string, type: string, lastModified: number, data: number[]): FileRef;
239
248
  export declare function createFormDataRef(entries: [string, string | FileRef][]): FormDataRef;
240
249
  export declare function createURLRef(href: string): URLRef;
250
+ export declare function createAbortSignalRef(aborted: boolean): AbortSignalRef;
241
251
  export declare function createPromiseRef(promiseId: number): PromiseRef;
242
252
  export declare function createAsyncIteratorRef(iteratorId: number): AsyncIteratorRef;
@@ -4,6 +4,7 @@
4
4
  * Provides type-preserving serialization for JavaScript types that would
5
5
  * otherwise lose fidelity when JSON stringified.
6
6
  */
7
+ import { type PromiseRef, type AsyncIteratorRef } from "./codec.ts";
7
8
  /**
8
9
  * Error thrown when a value cannot be marshalled.
9
10
  */
@@ -30,9 +31,9 @@ export interface UnmarshalContext {
30
31
  /** Get a callback function by ID */
31
32
  getCallback?: (id: number) => ((...args: unknown[]) => unknown) | undefined;
32
33
  /** Create a proxy Promise for a PromiseRef */
33
- createPromiseProxy?: (promiseId: number) => Promise<unknown>;
34
+ createPromiseProxy?: (promiseId: number, ref?: PromiseRef) => Promise<unknown>;
34
35
  /** Create a proxy AsyncIterator for an AsyncIteratorRef */
35
- createIteratorProxy?: (iteratorId: number) => AsyncIterator<unknown>;
36
+ createIteratorProxy?: (iteratorId: number, ref?: AsyncIteratorRef) => AsyncIterator<unknown>;
36
37
  /** Get a Blob by ID */
37
38
  getBlob?: (blobId: number) => Blob | undefined;
38
39
  }
@@ -105,7 +105,7 @@ export interface CustomFunctionRegistrations {
105
105
  * The client executes this operation on the real Page object.
106
106
  */
107
107
  export interface PlaywrightOperation {
108
- type: "goto" | "reload" | "url" | "title" | "content" | "waitForSelector" | "waitForTimeout" | "waitForLoadState" | "evaluate" | "locatorAction" | "expectLocator" | "expectPage" | "request" | "goBack" | "goForward" | "waitForURL" | "waitForURLPredicate" | "waitForRequestStart" | "waitForRequestFinish" | "waitForRequestPredicateFinish" | "waitForResponseStart" | "waitForResponseFinish" | "waitForResponsePredicateFinish" | "clearCookies" | "screenshot" | "setViewportSize" | "viewportSize" | "emulateMedia" | "setExtraHTTPHeaders" | "bringToFront" | "close" | "isClosed" | "pdf" | "pause" | "frames" | "mainFrame" | "keyboardType" | "keyboardPress" | "keyboardDown" | "keyboardUp" | "keyboardInsertText" | "mouseMove" | "mouseClick" | "mouseDown" | "mouseUp" | "mouseWheel" | "addCookies" | "cookies" | "newContext" | "newPage" | "closeContext";
108
+ type: "goto" | "reload" | "url" | "title" | "content" | "waitForSelector" | "waitForTimeout" | "waitForLoadState" | "evaluate" | "locatorAction" | "expectLocator" | "expectPage" | "request" | "goBack" | "goForward" | "waitForURL" | "waitForURLPredicate" | "waitForRequestStart" | "waitForRequestFinish" | "waitForRequestPredicateFinish" | "waitForResponseStart" | "waitForResponseFinish" | "waitForResponsePredicateFinish" | "clearCookies" | "screenshot" | "setViewportSize" | "viewportSize" | "emulateMedia" | "setExtraHTTPHeaders" | "bringToFront" | "close" | "isClosed" | "pdf" | "pause" | "frames" | "mainFrame" | "keyboardType" | "keyboardPress" | "keyboardDown" | "keyboardUp" | "keyboardInsertText" | "mouseMove" | "mouseClick" | "mouseDown" | "mouseUp" | "mouseWheel" | "addCookies" | "cookies" | "contexts" | "pages" | "newContext" | "newPage" | "closeContext";
109
109
  args: unknown[];
110
110
  /** Target page ID (undefined = default page "page_0") */
111
111
  pageId?: string;
@@ -161,6 +161,8 @@ export interface TestEnvironmentOptionsProtocol {
161
161
  export interface PlaywrightOptionsProtocol {
162
162
  /** Default timeout for Playwright operations in ms */
163
163
  timeout?: number;
164
+ /** Whether the isolate should expose default page/context globals. */
165
+ hasDefaultPage?: boolean;
164
166
  }
165
167
  export interface CreateRuntimeRequest extends BaseMessage {
166
168
  type: typeof MessageType.CREATE_RUNTIME;
@@ -509,6 +511,8 @@ export interface WsClientErrorPayload {
509
511
  */
510
512
  export type PlaywrightEvent = {
511
513
  type: "browserConsoleLog";
514
+ contextId: string;
515
+ pageId: string;
512
516
  level: string;
513
517
  stdout: string;
514
518
  location?: {
@@ -519,12 +523,16 @@ export type PlaywrightEvent = {
519
523
  timestamp: number;
520
524
  } | {
521
525
  type: "pageError";
526
+ contextId: string;
527
+ pageId: string;
522
528
  name: string;
523
529
  message: string;
524
530
  stack?: string;
525
531
  timestamp: number;
526
532
  } | {
527
533
  type: "networkRequest";
534
+ contextId: string;
535
+ pageId: string;
528
536
  requestId: string;
529
537
  url: string;
530
538
  method: string;
@@ -534,6 +542,8 @@ export type PlaywrightEvent = {
534
542
  timestamp: number;
535
543
  } | {
536
544
  type: "networkResponse";
545
+ contextId: string;
546
+ pageId: string;
537
547
  requestId: string;
538
548
  url: string;
539
549
  status: number;
@@ -543,6 +553,8 @@ export type PlaywrightEvent = {
543
553
  timestamp: number;
544
554
  } | {
545
555
  type: "requestFailure";
556
+ contextId: string;
557
+ pageId: string;
546
558
  requestId: string;
547
559
  url: string;
548
560
  method: string;
@@ -801,6 +813,8 @@ export interface PlaywrightFileData {
801
813
  export interface PlaywrightOptions {
802
814
  /** Handler callback for Playwright operations (required when playwright is enabled) */
803
815
  handler: (op: PlaywrightOperation) => Promise<PlaywrightResult>;
816
+ /** Whether the isolate should expose default page/context globals. */
817
+ hasDefaultPage?: boolean;
804
818
  /** Default timeout for operations in ms */
805
819
  timeout?: number;
806
820
  /** If true, browser console logs are routed through console handler (or printed to stdout if no handler) */
@@ -927,6 +941,8 @@ export interface PlaywrightTestResult {
927
941
  export interface CollectedData {
928
942
  /** Browser console logs (from the page, not sandbox) */
929
943
  browserConsoleLogs: {
944
+ contextId: string;
945
+ pageId: string;
930
946
  level: string;
931
947
  stdout: string;
932
948
  location?: {
@@ -937,12 +953,16 @@ export interface CollectedData {
937
953
  timestamp: number;
938
954
  }[];
939
955
  pageErrors: {
956
+ contextId: string;
957
+ pageId: string;
940
958
  name: string;
941
959
  message: string;
942
960
  stack?: string;
943
961
  timestamp: number;
944
962
  }[];
945
963
  networkRequests: {
964
+ contextId: string;
965
+ pageId: string;
946
966
  requestId: string;
947
967
  url: string;
948
968
  method: string;
@@ -952,6 +972,8 @@ export interface CollectedData {
952
972
  timestamp: number;
953
973
  }[];
954
974
  networkResponses: {
975
+ contextId: string;
976
+ pageId: string;
955
977
  requestId: string;
956
978
  url: string;
957
979
  status: number;
@@ -961,6 +983,8 @@ export interface CollectedData {
961
983
  timestamp: number;
962
984
  }[];
963
985
  requestFailures: {
986
+ contextId: string;
987
+ pageId: string;
964
988
  requestId: string;
965
989
  url: string;
966
990
  method: string;
@@ -115,6 +115,11 @@ export interface RuntimeTestEnvironmentHandle {
115
115
  export interface RuntimePlaywrightHandle {
116
116
  /** Get collected browser data (console logs, network requests/responses) */
117
117
  getCollectedData(): CollectedData;
118
+ /** Get tracked browser context/page ids */
119
+ getTrackedResources(): {
120
+ contexts: string[];
121
+ pages: string[];
122
+ };
118
123
  /** Clear collected browser data */
119
124
  clearCollectedData(): void;
120
125
  }
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Type definitions and type-checking utilities for isolated-vm V8 sandbox code.
5
5
  */
6
- export { CORE_TYPES, CONSOLE_TYPES, CRYPTO_TYPES, ENCODING_TYPES, FETCH_TYPES, FS_TYPES, PATH_TYPES, TEST_ENV_TYPES, TIMERS_TYPES, PLAYWRIGHT_TYPES, TYPE_DEFINITIONS, type TypeDefinitionKey, } from "./isolate-types.ts";
6
+ export { CORE_TYPES, CONSOLE_TYPES, CRYPTO_TYPES, ENCODING_TYPES, FETCH_TYPES, FS_TYPES, PATH_TYPES, TEST_ENV_TYPES, TIMERS_TYPES, PLAYWRIGHT_TYPES, SANDBOX_ISOLATE_TYPES, TYPE_DEFINITIONS, type TypeDefinitionKey, } from "./isolate-types.ts";
7
7
  export { typecheckIsolateCode, formatTypecheckErrors, type TypecheckResult, type TypecheckError, type TypecheckOptions, type LibraryTypes, type LibraryTypeFile, } from "./typecheck.ts";
@@ -69,15 +69,17 @@ export declare const TIMERS_TYPES = "/**\n * Global Type Definitions for ../time
69
69
  /**
70
70
  * Playwright types for isolated-vm.
71
71
  *
72
- * These types define the globals injected by setupPlaywright() into an isolated-vm context.
73
- * Playwright brings 3 globals: page, context, and browser.
72
+ * These types define the browser-facing globals and classes injected by
73
+ * setupPlaywright() into an isolated-vm context.
74
74
  */
75
- export declare const PLAYWRIGHT_TYPES = "\n/**\n * Locator represents an element or group of elements in the page.\n */\ndeclare class Locator {\n /** Click the element */\n click(): Promise<void>;\n /** Double-click the element */\n dblclick(): Promise<void>;\n /** Fill an input element with text */\n fill(text: string): Promise<void>;\n /** Type text into an element (key by key) */\n type(text: string): Promise<void>;\n /** Check a checkbox or radio */\n check(): Promise<void>;\n /** Uncheck a checkbox */\n uncheck(): Promise<void>;\n /** Select an option in a dropdown */\n selectOption(value: string | string[]): Promise<void>;\n /** Clear an input element */\n clear(): Promise<void>;\n /** Press a key */\n press(key: string): Promise<void>;\n /** Hover over the element */\n hover(): Promise<void>;\n /** Focus the element */\n focus(): Promise<void>;\n /** Get text content of the element */\n textContent(): Promise<string | null>;\n /** Get the value of an input element */\n inputValue(): Promise<string>;\n /** Check if the element is visible */\n isVisible(): Promise<boolean>;\n /** Check if the element is enabled */\n isEnabled(): Promise<boolean>;\n /** Check if the element is checked */\n isChecked(): Promise<boolean>;\n /** Check if the element is disabled */\n isDisabled(): Promise<boolean>;\n /** Check if the element is hidden */\n isHidden(): Promise<boolean>;\n /** Get the count of matching elements */\n count(): Promise<number>;\n /** Get an attribute value */\n getAttribute(name: string): Promise<string | null>;\n /** Get innerHTML */\n innerHTML(): Promise<string>;\n /** Get innerText */\n innerText(): Promise<string>;\n /** Get all text contents */\n allTextContents(): Promise<string[]>;\n /** Get all inner texts */\n allInnerTexts(): Promise<string[]>;\n /** Wait for the element to match a state */\n waitFor(options?: { state?: \"attached\" | \"detached\" | \"visible\" | \"hidden\"; timeout?: number }): Promise<void>;\n /** Get bounding box */\n boundingBox(): Promise<{ x: number; y: number; width: number; height: number } | null>;\n /** Set input files for a file input */\n setInputFiles(files: string | string[] | { name: string; mimeType: string; buffer: ArrayBuffer | Uint8Array | string }[]): Promise<void>;\n /** Take a screenshot of the element */\n screenshot(options?: { path?: string; type?: \"png\" | \"jpeg\"; quality?: number }): Promise<string>;\n /** Drag to another element */\n dragTo(target: Locator): Promise<void>;\n /** Scroll element into view */\n scrollIntoViewIfNeeded(): Promise<void>;\n /** Highlight the element for debugging */\n highlight(): Promise<void>;\n /** Evaluate a function in the context of the element */\n evaluate<R>(fn: (el: Element, arg?: unknown) => R, arg?: unknown): Promise<R>;\n /** Evaluate a function for all matching elements */\n evaluateAll<R>(fn: (els: Element[], arg?: unknown) => R, arg?: unknown): Promise<R>;\n\n // Chaining methods\n /** Chain with another CSS selector */\n locator(selector: string): Locator;\n /** Chain with getByRole */\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n /** Chain with getByText */\n getByText(text: string | RegExp): Locator;\n /** Chain with getByLabel */\n getByLabel(label: string | RegExp): Locator;\n /** Chain with getByPlaceholder */\n getByPlaceholder(placeholder: string | RegExp): Locator;\n /** Chain with getByTestId */\n getByTestId(testId: string): Locator;\n /** Chain with getByAltText */\n getByAltText(alt: string | RegExp): Locator;\n /** Chain with getByTitle */\n getByTitle(title: string | RegExp): Locator;\n\n // Subset selection\n /** Get all matching locators as an array */\n all(): Promise<Locator[]>;\n /** Get the nth matching element */\n nth(index: number): Locator;\n /** Get the first matching element */\n first(): Locator;\n /** Get the last matching element */\n last(): Locator;\n\n // Filtering\n /** Filter locators by additional criteria */\n filter(options: { hasText?: string | RegExp; hasNotText?: string | RegExp; has?: Locator; hasNot?: Locator }): Locator;\n /** Create a locator matching either this or the other locator */\n or(other: Locator): Locator;\n /** Create a locator matching both this and the other locator */\n and(other: Locator): Locator;\n}\n\n/**\n * FrameLocator for interacting with elements inside iframes.\n */\ninterface FrameLocator {\n locator(selector: string): Locator;\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n getByText(text: string | RegExp): Locator;\n getByLabel(label: string | RegExp): Locator;\n getByPlaceholder(placeholder: string | RegExp): Locator;\n getByTestId(testId: string): Locator;\n getByAltText(alt: string | RegExp): Locator;\n getByTitle(title: string | RegExp): Locator;\n}\n\n/**\n * Keyboard API for simulating keyboard input.\n */\ninterface Keyboard {\n type(text: string, options?: { delay?: number }): Promise<void>;\n press(key: string, options?: { delay?: number }): Promise<void>;\n down(key: string): Promise<void>;\n up(key: string): Promise<void>;\n insertText(text: string): Promise<void>;\n}\n\n/**\n * Mouse API for simulating mouse input.\n */\ninterface Mouse {\n move(x: number, y: number, options?: { steps?: number }): Promise<void>;\n click(x: number, y: number, options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number; delay?: number }): Promise<void>;\n down(options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number }): Promise<void>;\n up(options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number }): Promise<void>;\n wheel(deltaX: number, deltaY: number): Promise<void>;\n}\n\n/**\n * API Response from page.request methods.\n */\ninterface APIResponse {\n status(): number;\n ok(): boolean;\n headers(): Record<string, string>;\n json(): Promise<unknown>;\n text(): Promise<string>;\n body(): Promise<ArrayBuffer>;\n}\n\n/**\n * Request API for making HTTP requests with page cookies.\n */\ninterface APIRequestContext {\n fetch(url: string, options?: { method?: string; data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n get(url: string, options?: { headers?: Record<string, string> }): Promise<APIResponse>;\n post(url: string, options?: { data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n put(url: string, options?: { data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n delete(url: string, options?: { headers?: Record<string, string> }): Promise<APIResponse>;\n}\n\n/**\n * Frame information.\n */\ninterface FrameInfo {\n name: string;\n url: string;\n}\n\n/**\n * Cookie data.\n */\ninterface Cookie {\n name: string;\n value: string;\n domain?: string;\n path?: string;\n expires?: number;\n httpOnly?: boolean;\n secure?: boolean;\n sameSite?: \"Strict\" | \"Lax\" | \"None\";\n}\n\n/**\n * IsolatePage - represents a browser page in the isolate.\n */\ndeclare class IsolatePage {\n /** Navigate to a URL */\n goto(url: string, options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Reload the page */\n reload(): Promise<void>;\n /** Get the current URL */\n url(): Promise<string>;\n /** Get the page title */\n title(): Promise<string>;\n /** Get the page HTML content */\n content(): Promise<string>;\n /** Wait for a selector to appear */\n waitForSelector(selector: string, options?: { state?: \"attached\" | \"detached\" | \"visible\" | \"hidden\"; timeout?: number }): Promise<void>;\n /** Wait for a specified time */\n waitForTimeout(ms: number): Promise<void>;\n /** Wait for a load state */\n waitForLoadState(state?: \"load\" | \"domcontentloaded\" | \"networkidle\"): Promise<void>;\n /** Wait for the URL to match */\n waitForURL(url: string | RegExp, options?: { timeout?: number; waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Evaluate JavaScript in the browser context */\n evaluate<R>(script: string | (() => R) | ((arg: unknown) => R), arg?: unknown): Promise<R>;\n /** Create a locator by CSS selector */\n locator(selector: string): Locator;\n /** Create a locator by ARIA role */\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n /** Create a locator by text content */\n getByText(text: string | RegExp): Locator;\n /** Create a locator by label */\n getByLabel(label: string | RegExp): Locator;\n /** Create a locator by placeholder */\n getByPlaceholder(placeholder: string | RegExp): Locator;\n /** Create a locator by test ID */\n getByTestId(testId: string): Locator;\n /** Create a locator by alt text */\n getByAltText(alt: string | RegExp): Locator;\n /** Create a locator by title */\n getByTitle(title: string | RegExp): Locator;\n /** Create a frame locator */\n frameLocator(selector: string): FrameLocator;\n /** Navigate back */\n goBack(options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Navigate forward */\n goForward(options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Click an element (shorthand) */\n click(selector: string): Promise<void>;\n /** Fill an input (shorthand) */\n fill(selector: string, value: string): Promise<void>;\n /** Take a screenshot */\n screenshot(options?: { path?: string; fullPage?: boolean; type?: \"png\" | \"jpeg\"; quality?: number }): Promise<string>;\n /** Generate a PDF (Chromium only) */\n pdf(options?: { path?: string; format?: string; landscape?: boolean; margin?: { top?: string; bottom?: string; left?: string; right?: string } }): Promise<string>;\n /** Set the viewport size */\n setViewportSize(size: { width: number; height: number }): Promise<void>;\n /** Get the viewport size */\n viewportSize(): Promise<{ width: number; height: number } | null>;\n /** Emulate media type or color scheme */\n emulateMedia(options: { media?: \"screen\" | \"print\" | null; colorScheme?: \"light\" | \"dark\" | \"no-preference\" | null }): Promise<void>;\n /** Set extra HTTP headers */\n setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;\n /** Bring the page to front */\n bringToFront(): Promise<void>;\n /** Close the page */\n close(): Promise<void>;\n /** Check if the page is closed */\n isClosed(): Promise<boolean>;\n /** Pause execution (for debugging) */\n pause(): Promise<void>;\n /** Get all frames */\n frames(): Promise<FrameInfo[]>;\n /** Get the main frame */\n mainFrame(): Promise<FrameInfo>;\n /** Get the browser context for this page */\n context(): IsolateContext;\n /** Keyboard API */\n readonly keyboard: Keyboard;\n /** Mouse API */\n readonly mouse: Mouse;\n /** Request API for making HTTP requests */\n readonly request: APIRequestContext;\n}\n\n/**\n * IsolateContext - represents a browser context in the isolate.\n */\ndeclare class IsolateContext {\n /** Create a new page in this context (requires createPage callback) */\n newPage(): Promise<IsolatePage>;\n /** Close this context and all its pages */\n close(): Promise<void>;\n /** Clear all cookies */\n clearCookies(): Promise<void>;\n /** Add cookies */\n addCookies(cookies: Cookie[]): Promise<void>;\n /** Get cookies */\n cookies(urls?: string | string[]): Promise<Cookie[]>;\n}\n\n/**\n * Browser object for creating new contexts.\n */\ninterface IsolateBrowser {\n /** Create a new browser context (requires createContext callback) */\n newContext(options?: {\n viewport?: { width: number; height: number } | null;\n userAgent?: string;\n locale?: string;\n timezoneId?: string;\n geolocation?: { latitude: number; longitude: number; accuracy?: number };\n permissions?: string[];\n colorScheme?: \"light\" | \"dark\" | \"no-preference\";\n }): Promise<IsolateContext>;\n}\n\n/**\n * The default page object.\n */\ndeclare const page: IsolatePage;\n\n/**\n * The default browser context.\n */\ndeclare const context: IsolateContext;\n\n/**\n * Browser object for creating new contexts.\n */\ndeclare const browser: IsolateBrowser;\n\n// ============================================================================\n// Playwright Expect Matchers (extends test-environment expect)\n// ============================================================================\n\n/**\n * Options for locator assertion timeouts.\n */\ninterface LocatorAssertionOptions {\n timeout?: number;\n}\n\n/**\n * Locator-specific assertion matchers (added to expect when using Playwright).\n * These are available when calling expect(locator).\n */\ninterface PlaywrightLocatorMatchers {\n /** Assert element is visible */\n toBeVisible(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is hidden */\n toBeHidden(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is enabled */\n toBeEnabled(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is disabled */\n toBeDisabled(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is checked */\n toBeChecked(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is focused */\n toBeFocused(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is empty */\n toBeEmpty(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is attached to DOM */\n toBeAttached(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is editable */\n toBeEditable(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is in viewport */\n toBeInViewport(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element contains text */\n toContainText(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has exact text */\n toHaveText(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has value (for inputs) */\n toHaveValue(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has attribute */\n toHaveAttribute(name: string, value?: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element count */\n toHaveCount(count: number, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has class */\n toHaveClass(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element contains class */\n toContainClass(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has id */\n toHaveId(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has CSS property */\n toHaveCSS(name: string, value: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has JavaScript property */\n toHaveJSProperty(name: string, value: unknown, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has accessible name */\n toHaveAccessibleName(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has accessible description */\n toHaveAccessibleDescription(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has ARIA role */\n toHaveRole(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Negated matchers */\n not: PlaywrightLocatorMatchers;\n}\n\n/**\n * Page-specific assertion matchers (added to expect when using Playwright).\n * These are available when calling expect(page).\n */\ninterface PlaywrightPageMatchers {\n /** Assert page has URL */\n toHaveURL(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert page has title */\n toHaveTitle(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Negated matchers */\n not: PlaywrightPageMatchers;\n}\n";
75
+ export declare const PLAYWRIGHT_TYPES = "\n/**\n * Locator represents an element or group of elements in the page.\n */\ndeclare class Locator {\n /** Click the element */\n click(): Promise<void>;\n /** Double-click the element */\n dblclick(): Promise<void>;\n /** Fill an input element with text */\n fill(text: string): Promise<void>;\n /** Type text into an element (key by key) */\n type(text: string): Promise<void>;\n /** Check a checkbox or radio */\n check(): Promise<void>;\n /** Uncheck a checkbox */\n uncheck(): Promise<void>;\n /** Select an option in a dropdown */\n selectOption(value: string | string[]): Promise<void>;\n /** Clear an input element */\n clear(): Promise<void>;\n /** Press a key */\n press(key: string): Promise<void>;\n /** Hover over the element */\n hover(): Promise<void>;\n /** Focus the element */\n focus(): Promise<void>;\n /** Get text content of the element */\n textContent(): Promise<string | null>;\n /** Get the value of an input element */\n inputValue(): Promise<string>;\n /** Check if the element is visible */\n isVisible(): Promise<boolean>;\n /** Check if the element is enabled */\n isEnabled(): Promise<boolean>;\n /** Check if the element is checked */\n isChecked(): Promise<boolean>;\n /** Check if the element is disabled */\n isDisabled(): Promise<boolean>;\n /** Check if the element is hidden */\n isHidden(): Promise<boolean>;\n /** Get the count of matching elements */\n count(): Promise<number>;\n /** Get an attribute value */\n getAttribute(name: string): Promise<string | null>;\n /** Get innerHTML */\n innerHTML(): Promise<string>;\n /** Get innerText */\n innerText(): Promise<string>;\n /** Get all text contents */\n allTextContents(): Promise<string[]>;\n /** Get all inner texts */\n allInnerTexts(): Promise<string[]>;\n /** Wait for the element to match a state */\n waitFor(options?: { state?: \"attached\" | \"detached\" | \"visible\" | \"hidden\"; timeout?: number }): Promise<void>;\n /** Get bounding box */\n boundingBox(): Promise<{ x: number; y: number; width: number; height: number } | null>;\n /** Set input files for a file input */\n setInputFiles(files: string | string[] | { name: string; mimeType: string; buffer: ArrayBuffer | Uint8Array | string }[]): Promise<void>;\n /** Take a screenshot of the element */\n screenshot(options?: { path?: string; type?: \"png\" | \"jpeg\"; quality?: number }): Promise<void>;\n /** Drag to another element */\n dragTo(target: Locator): Promise<void>;\n /** Scroll element into view */\n scrollIntoViewIfNeeded(): Promise<void>;\n /** Highlight the element for debugging */\n highlight(): Promise<void>;\n /** Evaluate a function in the context of the element */\n evaluate<R>(fn: (el: Element, arg?: unknown) => R, arg?: unknown): Promise<R>;\n /** Evaluate a function for all matching elements */\n evaluateAll<R>(fn: (els: Element[], arg?: unknown) => R, arg?: unknown): Promise<R>;\n\n // Chaining methods\n /** Chain with another CSS selector */\n locator(selector: string): Locator;\n /** Chain with getByRole */\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n /** Chain with getByText */\n getByText(text: string | RegExp): Locator;\n /** Chain with getByLabel */\n getByLabel(label: string | RegExp): Locator;\n /** Chain with getByPlaceholder */\n getByPlaceholder(placeholder: string | RegExp): Locator;\n /** Chain with getByTestId */\n getByTestId(testId: string): Locator;\n /** Chain with getByAltText */\n getByAltText(alt: string | RegExp): Locator;\n /** Chain with getByTitle */\n getByTitle(title: string | RegExp): Locator;\n\n // Subset selection\n /** Get all matching locators as an array */\n all(): Promise<Locator[]>;\n /** Get the nth matching element */\n nth(index: number): Locator;\n /** Get the first matching element */\n first(): Locator;\n /** Get the last matching element */\n last(): Locator;\n\n // Filtering\n /** Filter locators by additional criteria */\n filter(options: { hasText?: string | RegExp; hasNotText?: string | RegExp; has?: Locator; hasNot?: Locator }): Locator;\n /** Create a locator matching either this or the other locator */\n or(other: Locator): Locator;\n /** Create a locator matching both this and the other locator */\n and(other: Locator): Locator;\n}\n\n/**\n * FrameLocator for interacting with elements inside iframes.\n */\ninterface FrameLocator {\n locator(selector: string): Locator;\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n getByText(text: string | RegExp): Locator;\n getByLabel(label: string | RegExp): Locator;\n getByPlaceholder(placeholder: string | RegExp): Locator;\n getByTestId(testId: string): Locator;\n getByAltText(alt: string | RegExp): Locator;\n getByTitle(title: string | RegExp): Locator;\n}\n\n/**\n * Keyboard API for simulating keyboard input.\n */\ninterface Keyboard {\n type(text: string, options?: { delay?: number }): Promise<void>;\n press(key: string, options?: { delay?: number }): Promise<void>;\n down(key: string): Promise<void>;\n up(key: string): Promise<void>;\n insertText(text: string): Promise<void>;\n}\n\n/**\n * Mouse API for simulating mouse input.\n */\ninterface Mouse {\n move(x: number, y: number, options?: { steps?: number }): Promise<void>;\n click(x: number, y: number, options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number; delay?: number }): Promise<void>;\n down(options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number }): Promise<void>;\n up(options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number }): Promise<void>;\n wheel(deltaX: number, deltaY: number): Promise<void>;\n}\n\n/**\n * API Response from page.request methods.\n */\ninterface APIResponse {\n status(): number;\n ok(): boolean;\n headers(): Record<string, string>;\n json(): Promise<unknown>;\n text(): Promise<string>;\n body(): Promise<ArrayBuffer>;\n}\n\n/**\n * Request API for making HTTP requests with page cookies.\n */\ninterface APIRequestContext {\n fetch(url: string, options?: { method?: string; data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n get(url: string, options?: { headers?: Record<string, string> }): Promise<APIResponse>;\n post(url: string, options?: { data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n put(url: string, options?: { data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n delete(url: string, options?: { headers?: Record<string, string> }): Promise<APIResponse>;\n}\n\n/**\n * Frame information.\n */\ninterface FrameInfo {\n name: string;\n url: string;\n}\n\n/**\n * Cookie data.\n */\ninterface Cookie {\n name: string;\n value: string;\n domain?: string;\n path?: string;\n expires?: number;\n httpOnly?: boolean;\n secure?: boolean;\n sameSite?: \"Strict\" | \"Lax\" | \"None\";\n}\n\n/**\n * IsolatePage - represents a browser page in the isolate.\n */\ndeclare class IsolatePage {\n /** Navigate to a URL */\n goto(url: string, options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Reload the page */\n reload(): Promise<void>;\n /** Get the current URL */\n url(): Promise<string>;\n /** Get the page title */\n title(): Promise<string>;\n /** Get the page HTML content */\n content(): Promise<string>;\n /** Wait for a selector to appear */\n waitForSelector(selector: string, options?: { state?: \"attached\" | \"detached\" | \"visible\" | \"hidden\"; timeout?: number }): Promise<void>;\n /** Wait for a specified time */\n waitForTimeout(ms: number): Promise<void>;\n /** Wait for a load state */\n waitForLoadState(state?: \"load\" | \"domcontentloaded\" | \"networkidle\"): Promise<void>;\n /** Wait for the URL to match */\n waitForURL(url: string | RegExp, options?: { timeout?: number; waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Evaluate JavaScript in the browser context */\n evaluate<R>(script: string | (() => R) | ((arg: unknown) => R), arg?: unknown): Promise<R>;\n /** Create a locator by CSS selector */\n locator(selector: string): Locator;\n /** Create a locator by ARIA role */\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n /** Create a locator by text content */\n getByText(text: string | RegExp): Locator;\n /** Create a locator by label */\n getByLabel(label: string | RegExp): Locator;\n /** Create a locator by placeholder */\n getByPlaceholder(placeholder: string | RegExp): Locator;\n /** Create a locator by test ID */\n getByTestId(testId: string): Locator;\n /** Create a locator by alt text */\n getByAltText(alt: string | RegExp): Locator;\n /** Create a locator by title */\n getByTitle(title: string | RegExp): Locator;\n /** Create a frame locator */\n frameLocator(selector: string): FrameLocator;\n /** Navigate back */\n goBack(options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Navigate forward */\n goForward(options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Click an element (shorthand) */\n click(selector: string): Promise<void>;\n /** Fill an input (shorthand) */\n fill(selector: string, value: string): Promise<void>;\n /** Take a screenshot */\n screenshot(options?: { path?: string; fullPage?: boolean; type?: \"png\" | \"jpeg\"; quality?: number }): Promise<void>;\n /** Generate a PDF (Chromium only) */\n pdf(options?: { path?: string; format?: string; landscape?: boolean; margin?: { top?: string; bottom?: string; left?: string; right?: string } }): Promise<string>;\n /** Set the viewport size */\n setViewportSize(size: { width: number; height: number }): Promise<void>;\n /** Get the viewport size */\n viewportSize(): Promise<{ width: number; height: number } | null>;\n /** Emulate media type or color scheme */\n emulateMedia(options: { media?: \"screen\" | \"print\" | null; colorScheme?: \"light\" | \"dark\" | \"no-preference\" | null }): Promise<void>;\n /** Set extra HTTP headers */\n setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;\n /** Bring the page to front */\n bringToFront(): Promise<void>;\n /** Close the page */\n close(): Promise<void>;\n /** Check if the page is closed */\n isClosed(): Promise<boolean>;\n /** Pause execution (for debugging) */\n pause(): Promise<void>;\n /** Get all frames */\n frames(): Promise<FrameInfo[]>;\n /** Get the main frame */\n mainFrame(): Promise<FrameInfo>;\n /** Get the browser context for this page */\n context(): IsolateContext;\n /** Keyboard API */\n readonly keyboard: Keyboard;\n /** Mouse API */\n readonly mouse: Mouse;\n /** Request API for making HTTP requests */\n readonly request: APIRequestContext;\n}\n\n/**\n * IsolateContext - represents a browser context in the isolate.\n */\ndeclare class IsolateContext {\n /** Create a new page in this context (requires createPage callback) */\n newPage(): Promise<IsolatePage>;\n /** Get tracked pages for this context */\n pages(): Promise<IsolatePage[]>;\n /** Close this context and all its pages */\n close(): Promise<void>;\n /** Clear all cookies */\n clearCookies(): Promise<void>;\n /** Add cookies */\n addCookies(cookies: Cookie[]): Promise<void>;\n /** Get cookies */\n cookies(urls?: string | string[]): Promise<Cookie[]>;\n}\n\n/**\n * Browser object for creating new contexts.\n */\ninterface IsolateBrowser {\n /** Create a new browser context (requires createContext callback) */\n newContext(options?: {\n viewport?: { width: number; height: number } | null;\n userAgent?: string;\n locale?: string;\n timezoneId?: string;\n geolocation?: { latitude: number; longitude: number; accuracy?: number };\n permissions?: string[];\n colorScheme?: \"light\" | \"dark\" | \"no-preference\";\n }): Promise<IsolateContext>;\n /** Get tracked browser contexts */\n contexts(): Promise<IsolateContext[]>;\n}\n\n/**\n * Browser object for creating new contexts.\n */\ndeclare const browser: IsolateBrowser;\n\n// ============================================================================\n// Playwright Expect Matchers (extends test-environment expect)\n// ============================================================================\n\n/**\n * Options for locator assertion timeouts.\n */\ninterface LocatorAssertionOptions {\n timeout?: number;\n}\n\n/**\n * Locator-specific assertion matchers (added to expect when using Playwright).\n * These are available when calling expect(locator).\n */\ninterface PlaywrightLocatorMatchers {\n /** Assert element is visible */\n toBeVisible(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is hidden */\n toBeHidden(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is enabled */\n toBeEnabled(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is disabled */\n toBeDisabled(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is checked */\n toBeChecked(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is focused */\n toBeFocused(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is empty */\n toBeEmpty(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is attached to DOM */\n toBeAttached(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is editable */\n toBeEditable(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is in viewport */\n toBeInViewport(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element contains text */\n toContainText(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has exact text */\n toHaveText(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has value (for inputs) */\n toHaveValue(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has attribute */\n toHaveAttribute(name: string, value?: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element count */\n toHaveCount(count: number, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has class */\n toHaveClass(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element contains class */\n toContainClass(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has id */\n toHaveId(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has CSS property */\n toHaveCSS(name: string, value: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has JavaScript property */\n toHaveJSProperty(name: string, value: unknown, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has accessible name */\n toHaveAccessibleName(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has accessible description */\n toHaveAccessibleDescription(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has ARIA role */\n toHaveRole(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Negated matchers */\n not: PlaywrightLocatorMatchers;\n}\n\n/**\n * Page-specific assertion matchers (added to expect when using Playwright).\n * These are available when calling expect(page).\n */\ninterface PlaywrightPageMatchers {\n /** Assert page has URL */\n toHaveURL(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert page has title */\n toHaveTitle(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Negated matchers */\n not: PlaywrightPageMatchers;\n}\n";
76
+ export declare const SANDBOX_ISOLATE_TYPES = "\ndeclare module \"@ricsam/isolate\" {\n export interface NestedModuleImporter {\n path: string;\n resolveDir: string;\n }\n\n export interface NestedModuleSource {\n code: string;\n filename: string;\n resolveDir: string;\n static?: boolean;\n }\n\n export type NestedModuleResolveResult =\n | string\n | NestedModuleSource\n | null\n | undefined\n | Promise<string | NestedModuleSource | null | undefined>;\n\n export interface NestedFileBindings {\n readFile?: (path: string) => Promise<ArrayBuffer>;\n writeFile?: (path: string, data: ArrayBuffer) => Promise<void>;\n unlink?: (path: string) => Promise<void>;\n readdir?: (path: string) => Promise<string[]>;\n mkdir?: (path: string, options?: { recursive?: boolean }) => Promise<void>;\n rmdir?: (path: string) => Promise<void>;\n stat?: (\n path: string,\n ) => Promise<{ isFile: boolean; isDirectory: boolean; size: number }>;\n rename?: (from: string, to: string) => Promise<void>;\n }\n\n export interface NestedBrowserBindings {\n createContext?: (options: unknown) => Promise<unknown> | unknown;\n createPage?: (contextHandle: unknown) => Promise<unknown> | unknown;\n }\n\n export interface NestedHostBindings {\n console?: {\n onEntry?: (entry: unknown) => void;\n };\n fetch?: (request: Request) => Response | Promise<Response>;\n files?: NestedFileBindings;\n modules?: {\n resolve(\n specifier: string,\n importer: NestedModuleImporter,\n ): NestedModuleResolveResult;\n };\n tools?: Record<string, (...args: any[]) => unknown>;\n browser?: unknown;\n }\n\n export interface NestedRuntimeDiagnostics {\n activeRequests: number;\n activeResources: number;\n pendingFiles: number;\n pendingFetches: number;\n pendingModules: number;\n pendingTools: number;\n streamCount: number;\n lastError?: string;\n reused?: boolean;\n lifecycleState: \"idle\" | \"active\" | \"reloading\" | \"disposing\";\n }\n\n export interface NestedBrowserDiagnostics {\n contexts: number;\n pages: number;\n browserConsoleLogs: number;\n networkRequests: number;\n networkResponses: number;\n pageErrors: number;\n requestFailures: number;\n collectedData: {\n browserConsoleLogs: unknown[];\n pageErrors: unknown[];\n networkRequests: unknown[];\n networkResponses: unknown[];\n requestFailures: unknown[];\n };\n }\n\n export interface NestedRuntimeResourceDiagnostics {\n runtime: NestedRuntimeDiagnostics;\n browser?: NestedBrowserDiagnostics;\n }\n\n export interface NestedTestDiagnostics {\n enabled: true;\n registeredTests: number;\n lastRun?: unknown;\n }\n\n export interface NestedTestRuntimeDiagnostics extends NestedRuntimeResourceDiagnostics {\n test: NestedTestDiagnostics;\n }\n\n export interface NestedHostDiagnostics {\n runtimes: number;\n servers: number;\n connected: boolean;\n }\n\n export type NestedRequestResult =\n | { type: \"response\"; response: Response }\n | { type: \"websocket\"; upgradeData: Record<string, unknown> };\n\n export interface NestedScriptRuntime {\n eval(\n code: string,\n options?: string | { filename?: string; executionTimeout?: number },\n ): Promise<void>;\n dispose(options?: { hard?: boolean; reason?: string }): Promise<void>;\n diagnostics(): Promise<NestedRuntimeResourceDiagnostics>;\n events: {\n on(event: string, handler: (payload: unknown) => void): () => void;\n emit(event: string, payload: unknown): Promise<void>;\n };\n }\n\n export interface NestedAppServer {\n handle(\n request: Request | string,\n options?: { requestId?: string; metadata?: Record<string, string> },\n ): Promise<NestedRequestResult>;\n ws: {\n open(connectionId: string): Promise<void>;\n message(connectionId: string, data: string | ArrayBuffer): Promise<void>;\n close(connectionId: string, code: number, reason: string): Promise<void>;\n error(connectionId: string, error: Error): Promise<void>;\n };\n reload(reason?: string): Promise<void>;\n dispose(options?: { hard?: boolean; reason?: string }): Promise<void>;\n diagnostics(): Promise<NestedRuntimeResourceDiagnostics>;\n }\n\n export interface NestedTestRuntime {\n run(\n code: string,\n options?: { filename?: string; timeoutMs?: number },\n ): Promise<unknown>;\n diagnostics(): Promise<NestedTestRuntimeDiagnostics>;\n dispose(options?: { hard?: boolean; reason?: string }): Promise<void>;\n }\n\n export interface NestedCreateRuntimeOptions {\n key?: string;\n bindings?: NestedHostBindings;\n cwd?: string;\n executionTimeout?: number;\n memoryLimitMB?: number;\n }\n\n export interface NestedCreateTestRuntimeOptions extends NestedCreateRuntimeOptions {}\n\n export interface NestedCreateAppServerOptions extends NestedCreateRuntimeOptions {\n key: string;\n entry: string;\n entryFilename?: string;\n }\n\n export interface NestedIsolateHost {\n createRuntime(options?: NestedCreateRuntimeOptions): Promise<NestedScriptRuntime>;\n createAppServer(options: NestedCreateAppServerOptions): Promise<NestedAppServer>;\n createTestRuntime(\n options?: NestedCreateTestRuntimeOptions,\n ): Promise<NestedTestRuntime>;\n diagnostics(): Promise<NestedHostDiagnostics>;\n close(): Promise<void>;\n }\n\n export function createIsolateHost(): NestedIsolateHost;\n}\n";
76
77
  /**
77
78
  * Map of package names to their type definitions.
78
79
  */
79
80
  export declare const TYPE_DEFINITIONS: {
80
81
  readonly core: "/**\n * Global Type Definitions for ../core/index.ts\n *\n * These types define the globals injected by setupCore() into an isolated-vm context.\n * Use these types to typecheck user code that will run inside the V8 isolate.\n *\n * @example\n * // In your tsconfig.isolate.json\n * {\n * \"compilerOptions\": {\n * \"lib\": [\"ESNext\", \"DOM\"]\n * }\n * }\n *\n * // Then reference this file or use ts-morph for code strings\n */\n\nexport {};\n\ndeclare global {\n // ============================================\n // Async Context\n // ============================================\n\n interface AsyncContextVariableOptions<T = unknown> {\n defaultValue?: T;\n name?: string;\n }\n\n interface AsyncContextVariable<T = unknown> {\n readonly name: string;\n run<R, A extends unknown[]>(value: T, fn: (...args: A) => R, ...args: A): R;\n get(): T;\n }\n\n interface AsyncContextVariableConstructor {\n new <T = unknown>(options?: AsyncContextVariableOptions<T>): AsyncContextVariable<T>;\n readonly prototype: AsyncContextVariable<unknown>;\n }\n\n interface AsyncContextSnapshot {\n run<R, A extends unknown[]>(fn: (...args: A) => R, ...args: A): R;\n }\n\n interface AsyncContextSnapshotConstructor {\n new (): AsyncContextSnapshot;\n wrap<T extends (...args: any[]) => any>(fn: T): T;\n readonly prototype: AsyncContextSnapshot;\n }\n\n const AsyncContext: {\n Variable: AsyncContextVariableConstructor;\n Snapshot: AsyncContextSnapshotConstructor;\n };\n\n // ============================================\n // Web Streams API\n // ============================================\n\n /**\n * A readable stream of data.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream\n */\n const ReadableStream: typeof globalThis.ReadableStream;\n\n /**\n * A writable stream of data.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WritableStream\n */\n const WritableStream: typeof globalThis.WritableStream;\n\n /**\n * A transform stream that can be used to pipe data through a transformer.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TransformStream\n */\n const TransformStream: typeof globalThis.TransformStream;\n\n /**\n * Default reader for ReadableStream\n * @see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader\n */\n const ReadableStreamDefaultReader: typeof globalThis.ReadableStreamDefaultReader;\n\n /**\n * Default writer for WritableStream\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter\n */\n const WritableStreamDefaultWriter: typeof globalThis.WritableStreamDefaultWriter;\n\n // ============================================\n // Blob and File APIs\n // ============================================\n\n /**\n * A file-like object of immutable, raw data.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Blob\n */\n const Blob: typeof globalThis.Blob;\n\n /**\n * A file object representing a file.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/File\n */\n const File: typeof globalThis.File;\n\n // ============================================\n // URL APIs\n // ============================================\n\n /**\n * Interface for URL manipulation.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/URL\n */\n const URL: typeof globalThis.URL;\n\n /**\n * Utility for working with URL query strings.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams\n */\n const URLSearchParams: typeof globalThis.URLSearchParams;\n\n // ============================================\n // DOM Parsing and Constructors\n // ============================================\n\n /**\n * Parses HTML/XML strings into Document objects.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser\n */\n const DOMParser: typeof globalThis.DOMParser;\n\n /**\n * Base DOM node constructor.\n */\n const Node: typeof globalThis.Node;\n\n /**\n * DOM document constructor.\n */\n const Document: typeof globalThis.Document;\n\n /**\n * DOM document fragment constructor.\n */\n const DocumentFragment: typeof globalThis.DocumentFragment;\n\n /**\n * DOM document type constructor.\n */\n const DocumentType: typeof globalThis.DocumentType;\n\n /**\n * DOM element constructor.\n */\n const Element: typeof globalThis.Element;\n\n /**\n * DOM attribute constructor.\n */\n const Attr: typeof globalThis.Attr;\n\n /**\n * DOM text node constructor.\n */\n const Text: typeof globalThis.Text;\n\n /**\n * DOM comment node constructor.\n */\n const Comment: typeof globalThis.Comment;\n\n /**\n * DOM event constructor.\n */\n const Event: typeof globalThis.Event;\n\n /**\n * Base event target constructor.\n */\n const EventTarget: typeof globalThis.EventTarget;\n\n /**\n * Custom event constructor.\n */\n const CustomEvent: typeof globalThis.CustomEvent;\n\n // ============================================\n // Error Handling\n // ============================================\n\n /**\n * Exception type for DOM operations.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n */\n const DOMException: typeof globalThis.DOMException;\n}\n";
82
+ readonly sandboxIsolate: "\ndeclare module \"@ricsam/isolate\" {\n export interface NestedModuleImporter {\n path: string;\n resolveDir: string;\n }\n\n export interface NestedModuleSource {\n code: string;\n filename: string;\n resolveDir: string;\n static?: boolean;\n }\n\n export type NestedModuleResolveResult =\n | string\n | NestedModuleSource\n | null\n | undefined\n | Promise<string | NestedModuleSource | null | undefined>;\n\n export interface NestedFileBindings {\n readFile?: (path: string) => Promise<ArrayBuffer>;\n writeFile?: (path: string, data: ArrayBuffer) => Promise<void>;\n unlink?: (path: string) => Promise<void>;\n readdir?: (path: string) => Promise<string[]>;\n mkdir?: (path: string, options?: { recursive?: boolean }) => Promise<void>;\n rmdir?: (path: string) => Promise<void>;\n stat?: (\n path: string,\n ) => Promise<{ isFile: boolean; isDirectory: boolean; size: number }>;\n rename?: (from: string, to: string) => Promise<void>;\n }\n\n export interface NestedBrowserBindings {\n createContext?: (options: unknown) => Promise<unknown> | unknown;\n createPage?: (contextHandle: unknown) => Promise<unknown> | unknown;\n }\n\n export interface NestedHostBindings {\n console?: {\n onEntry?: (entry: unknown) => void;\n };\n fetch?: (request: Request) => Response | Promise<Response>;\n files?: NestedFileBindings;\n modules?: {\n resolve(\n specifier: string,\n importer: NestedModuleImporter,\n ): NestedModuleResolveResult;\n };\n tools?: Record<string, (...args: any[]) => unknown>;\n browser?: unknown;\n }\n\n export interface NestedRuntimeDiagnostics {\n activeRequests: number;\n activeResources: number;\n pendingFiles: number;\n pendingFetches: number;\n pendingModules: number;\n pendingTools: number;\n streamCount: number;\n lastError?: string;\n reused?: boolean;\n lifecycleState: \"idle\" | \"active\" | \"reloading\" | \"disposing\";\n }\n\n export interface NestedBrowserDiagnostics {\n contexts: number;\n pages: number;\n browserConsoleLogs: number;\n networkRequests: number;\n networkResponses: number;\n pageErrors: number;\n requestFailures: number;\n collectedData: {\n browserConsoleLogs: unknown[];\n pageErrors: unknown[];\n networkRequests: unknown[];\n networkResponses: unknown[];\n requestFailures: unknown[];\n };\n }\n\n export interface NestedRuntimeResourceDiagnostics {\n runtime: NestedRuntimeDiagnostics;\n browser?: NestedBrowserDiagnostics;\n }\n\n export interface NestedTestDiagnostics {\n enabled: true;\n registeredTests: number;\n lastRun?: unknown;\n }\n\n export interface NestedTestRuntimeDiagnostics extends NestedRuntimeResourceDiagnostics {\n test: NestedTestDiagnostics;\n }\n\n export interface NestedHostDiagnostics {\n runtimes: number;\n servers: number;\n connected: boolean;\n }\n\n export type NestedRequestResult =\n | { type: \"response\"; response: Response }\n | { type: \"websocket\"; upgradeData: Record<string, unknown> };\n\n export interface NestedScriptRuntime {\n eval(\n code: string,\n options?: string | { filename?: string; executionTimeout?: number },\n ): Promise<void>;\n dispose(options?: { hard?: boolean; reason?: string }): Promise<void>;\n diagnostics(): Promise<NestedRuntimeResourceDiagnostics>;\n events: {\n on(event: string, handler: (payload: unknown) => void): () => void;\n emit(event: string, payload: unknown): Promise<void>;\n };\n }\n\n export interface NestedAppServer {\n handle(\n request: Request | string,\n options?: { requestId?: string; metadata?: Record<string, string> },\n ): Promise<NestedRequestResult>;\n ws: {\n open(connectionId: string): Promise<void>;\n message(connectionId: string, data: string | ArrayBuffer): Promise<void>;\n close(connectionId: string, code: number, reason: string): Promise<void>;\n error(connectionId: string, error: Error): Promise<void>;\n };\n reload(reason?: string): Promise<void>;\n dispose(options?: { hard?: boolean; reason?: string }): Promise<void>;\n diagnostics(): Promise<NestedRuntimeResourceDiagnostics>;\n }\n\n export interface NestedTestRuntime {\n run(\n code: string,\n options?: { filename?: string; timeoutMs?: number },\n ): Promise<unknown>;\n diagnostics(): Promise<NestedTestRuntimeDiagnostics>;\n dispose(options?: { hard?: boolean; reason?: string }): Promise<void>;\n }\n\n export interface NestedCreateRuntimeOptions {\n key?: string;\n bindings?: NestedHostBindings;\n cwd?: string;\n executionTimeout?: number;\n memoryLimitMB?: number;\n }\n\n export interface NestedCreateTestRuntimeOptions extends NestedCreateRuntimeOptions {}\n\n export interface NestedCreateAppServerOptions extends NestedCreateRuntimeOptions {\n key: string;\n entry: string;\n entryFilename?: string;\n }\n\n export interface NestedIsolateHost {\n createRuntime(options?: NestedCreateRuntimeOptions): Promise<NestedScriptRuntime>;\n createAppServer(options: NestedCreateAppServerOptions): Promise<NestedAppServer>;\n createTestRuntime(\n options?: NestedCreateTestRuntimeOptions,\n ): Promise<NestedTestRuntime>;\n diagnostics(): Promise<NestedHostDiagnostics>;\n close(): Promise<void>;\n }\n\n export function createIsolateHost(): NestedIsolateHost;\n}\n";
81
83
  readonly console: "/**\n * Global Type Definitions for ../console/index.ts\n *\n * These types define the globals injected by setupConsole() into an isolated-vm context.\n * Use these types to typecheck user code that will run inside the V8 isolate.\n */\n\nexport {};\n\ndeclare global {\n /**\n * Console interface for logging and debugging.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Console\n */\n interface Console {\n /**\n * Log a message to the console.\n * @param data - Values to log\n */\n log(...data: unknown[]): void;\n\n /**\n * Log a warning message.\n * @param data - Values to log\n */\n warn(...data: unknown[]): void;\n\n /**\n * Log an error message.\n * @param data - Values to log\n */\n error(...data: unknown[]): void;\n\n /**\n * Log a debug message.\n * @param data - Values to log\n */\n debug(...data: unknown[]): void;\n\n /**\n * Log an info message.\n * @param data - Values to log\n */\n info(...data: unknown[]): void;\n\n /**\n * Log a stack trace.\n * @param data - Values to log with the trace\n */\n trace(...data: unknown[]): void;\n\n /**\n * Display an object in a formatted way.\n * @param item - Object to display\n * @param options - Display options\n */\n dir(item: unknown, options?: object): void;\n\n /**\n * Display tabular data.\n * @param tabularData - Data to display as a table\n * @param properties - Optional array of property names to include\n */\n table(tabularData: unknown, properties?: string[]): void;\n\n /**\n * Start a timer.\n * @param label - Timer label (default: \"default\")\n */\n time(label?: string): void;\n\n /**\n * End a timer and log the elapsed time.\n * @param label - Timer label (default: \"default\")\n */\n timeEnd(label?: string): void;\n\n /**\n * Log the elapsed time of a timer without ending it.\n * @param label - Timer label (default: \"default\")\n * @param data - Additional values to log\n */\n timeLog(label?: string, ...data: unknown[]): void;\n\n /**\n * Log an error if the assertion is false.\n * @param condition - Condition to test\n * @param data - Values to log if assertion fails\n */\n assert(condition?: boolean, ...data: unknown[]): void;\n\n /**\n * Increment and log a counter.\n * @param label - Counter label (default: \"default\")\n */\n count(label?: string): void;\n\n /**\n * Reset a counter.\n * @param label - Counter label (default: \"default\")\n */\n countReset(label?: string): void;\n\n /**\n * Clear the console.\n */\n clear(): void;\n\n /**\n * Start an inline group.\n * @param data - Group label\n */\n group(...data: unknown[]): void;\n\n /**\n * Start a collapsed inline group.\n * @param data - Group label\n */\n groupCollapsed(...data: unknown[]): void;\n\n /**\n * End the current inline group.\n */\n groupEnd(): void;\n }\n\n /**\n * Console object for logging and debugging.\n */\n const console: Console;\n}\n";
82
84
  readonly crypto: "/**\n * Global Type Definitions for ../crypto/index.ts\n *\n * These types define the globals injected by setupCrypto() into an isolated-vm context.\n * Use these types to typecheck user code that will run inside the V8 isolate.\n *\n * @example\n * // Generate random bytes\n * const arr = new Uint8Array(16);\n * crypto.getRandomValues(arr);\n *\n * // Generate UUID\n * const uuid = crypto.randomUUID();\n *\n * // Use SubtleCrypto\n * const key = await crypto.subtle.generateKey(\n * { name: \"AES-GCM\", length: 256 },\n * true,\n * [\"encrypt\", \"decrypt\"]\n * );\n */\n\nexport {};\n\ndeclare global {\n /**\n * CryptoKey represents a cryptographic key.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey\n */\n interface CryptoKey {\n /**\n * The type of key: \"public\", \"private\", or \"secret\".\n */\n readonly type: \"public\" | \"private\" | \"secret\";\n\n /**\n * Whether the key can be exported.\n */\n readonly extractable: boolean;\n\n /**\n * The algorithm used by this key.\n */\n readonly algorithm: KeyAlgorithm;\n\n /**\n * The usages allowed for this key.\n */\n readonly usages: ReadonlyArray<KeyUsage>;\n }\n\n /**\n * CryptoKey constructor (keys cannot be constructed directly).\n */\n const CryptoKey: {\n prototype: CryptoKey;\n };\n\n /**\n * SubtleCrypto interface for cryptographic operations.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto\n */\n interface SubtleCrypto {\n /**\n * Generate a digest (hash) of the given data.\n *\n * @param algorithm - Hash algorithm (e.g., \"SHA-256\", \"SHA-384\", \"SHA-512\")\n * @param data - Data to hash\n * @returns Promise resolving to the hash as ArrayBuffer\n */\n digest(\n algorithm: AlgorithmIdentifier,\n data: BufferSource\n ): Promise<ArrayBuffer>;\n\n /**\n * Generate a new cryptographic key or key pair.\n *\n * @param algorithm - Key generation algorithm\n * @param extractable - Whether the key can be exported\n * @param keyUsages - Allowed key usages\n * @returns Promise resolving to a CryptoKey or CryptoKeyPair\n */\n generateKey(\n algorithm: RsaHashedKeyGenParams | EcKeyGenParams | AesKeyGenParams | HmacKeyGenParams,\n extractable: boolean,\n keyUsages: KeyUsage[]\n ): Promise<CryptoKey | CryptoKeyPair>;\n\n /**\n * Sign data using a private key.\n *\n * @param algorithm - Signing algorithm\n * @param key - Private key to sign with\n * @param data - Data to sign\n * @returns Promise resolving to the signature as ArrayBuffer\n */\n sign(\n algorithm: AlgorithmIdentifier,\n key: CryptoKey,\n data: BufferSource\n ): Promise<ArrayBuffer>;\n\n /**\n * Verify a signature.\n *\n * @param algorithm - Signing algorithm\n * @param key - Public key to verify with\n * @param signature - Signature to verify\n * @param data - Data that was signed\n * @returns Promise resolving to true if valid, false otherwise\n */\n verify(\n algorithm: AlgorithmIdentifier,\n key: CryptoKey,\n signature: BufferSource,\n data: BufferSource\n ): Promise<boolean>;\n\n /**\n * Encrypt data.\n *\n * @param algorithm - Encryption algorithm\n * @param key - Encryption key\n * @param data - Data to encrypt\n * @returns Promise resolving to encrypted data as ArrayBuffer\n */\n encrypt(\n algorithm: AlgorithmIdentifier,\n key: CryptoKey,\n data: BufferSource\n ): Promise<ArrayBuffer>;\n\n /**\n * Decrypt data.\n *\n * @param algorithm - Decryption algorithm\n * @param key - Decryption key\n * @param data - Data to decrypt\n * @returns Promise resolving to decrypted data as ArrayBuffer\n */\n decrypt(\n algorithm: AlgorithmIdentifier,\n key: CryptoKey,\n data: BufferSource\n ): Promise<ArrayBuffer>;\n\n /**\n * Import a key from external data.\n *\n * @param format - Key format (\"raw\", \"pkcs8\", \"spki\", \"jwk\")\n * @param keyData - Key data\n * @param algorithm - Key algorithm\n * @param extractable - Whether the key can be exported\n * @param keyUsages - Allowed key usages\n * @returns Promise resolving to a CryptoKey\n */\n importKey(\n format: \"raw\" | \"pkcs8\" | \"spki\" | \"jwk\",\n keyData: BufferSource | JsonWebKey,\n algorithm: AlgorithmIdentifier,\n extractable: boolean,\n keyUsages: KeyUsage[]\n ): Promise<CryptoKey>;\n\n /**\n * Export a key.\n *\n * @param format - Export format (\"raw\", \"pkcs8\", \"spki\", \"jwk\")\n * @param key - Key to export\n * @returns Promise resolving to ArrayBuffer or JsonWebKey\n */\n exportKey(\n format: \"raw\" | \"pkcs8\" | \"spki\" | \"jwk\",\n key: CryptoKey\n ): Promise<ArrayBuffer | JsonWebKey>;\n\n /**\n * Derive bits from a key.\n *\n * @param algorithm - Derivation algorithm\n * @param baseKey - Base key for derivation\n * @param length - Number of bits to derive\n * @returns Promise resolving to derived bits as ArrayBuffer\n */\n deriveBits(\n algorithm: AlgorithmIdentifier,\n baseKey: CryptoKey,\n length: number\n ): Promise<ArrayBuffer>;\n\n /**\n * Derive a new key from a base key.\n *\n * @param algorithm - Derivation algorithm\n * @param baseKey - Base key for derivation\n * @param derivedKeyType - Type of key to derive\n * @param extractable - Whether the derived key can be exported\n * @param keyUsages - Allowed usages for derived key\n * @returns Promise resolving to a CryptoKey\n */\n deriveKey(\n algorithm: AlgorithmIdentifier,\n baseKey: CryptoKey,\n derivedKeyType: AlgorithmIdentifier,\n extractable: boolean,\n keyUsages: KeyUsage[]\n ): Promise<CryptoKey>;\n\n /**\n * Wrap a key for secure export.\n *\n * @param format - Key format\n * @param key - Key to wrap\n * @param wrappingKey - Key to wrap with\n * @param wrapAlgorithm - Wrapping algorithm\n * @returns Promise resolving to wrapped key as ArrayBuffer\n */\n wrapKey(\n format: \"raw\" | \"pkcs8\" | \"spki\" | \"jwk\",\n key: CryptoKey,\n wrappingKey: CryptoKey,\n wrapAlgorithm: AlgorithmIdentifier\n ): Promise<ArrayBuffer>;\n\n /**\n * Unwrap a wrapped key.\n *\n * @param format - Key format\n * @param wrappedKey - Wrapped key data\n * @param unwrappingKey - Key to unwrap with\n * @param unwrapAlgorithm - Unwrapping algorithm\n * @param unwrappedKeyAlgorithm - Algorithm for the unwrapped key\n * @param extractable - Whether the unwrapped key can be exported\n * @param keyUsages - Allowed usages for unwrapped key\n * @returns Promise resolving to a CryptoKey\n */\n unwrapKey(\n format: \"raw\" | \"pkcs8\" | \"spki\" | \"jwk\",\n wrappedKey: BufferSource,\n unwrappingKey: CryptoKey,\n unwrapAlgorithm: AlgorithmIdentifier,\n unwrappedKeyAlgorithm: AlgorithmIdentifier,\n extractable: boolean,\n keyUsages: KeyUsage[]\n ): Promise<CryptoKey>;\n }\n\n /**\n * Crypto interface providing cryptographic functionality.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto\n */\n interface Crypto {\n /**\n * SubtleCrypto interface for cryptographic operations.\n */\n readonly subtle: SubtleCrypto;\n\n /**\n * Fill a TypedArray with cryptographically random values.\n *\n * @param array - TypedArray to fill (max 65536 bytes)\n * @returns The same array, filled with random values\n *\n * @example\n * const arr = new Uint8Array(16);\n * crypto.getRandomValues(arr);\n */\n getRandomValues<T extends ArrayBufferView | null>(array: T): T;\n\n /**\n * Generate a random UUID v4.\n *\n * @returns A random UUID string\n *\n * @example\n * const uuid = crypto.randomUUID();\n * // \"550e8400-e29b-41d4-a716-446655440000\"\n */\n randomUUID(): string;\n }\n\n /**\n * Crypto object providing cryptographic functionality.\n */\n const crypto: Crypto;\n}\n";
83
85
  readonly encoding: "/**\n * Global Type Definitions for ../encoding/index.ts\n *\n * These types define the globals injected by setupEncoding() into an isolated-vm context.\n * Use these types to typecheck user code that will run inside the V8 isolate.\n */\n\nexport {};\n\ndeclare global {\n /**\n * Decodes a Base64-encoded string.\n *\n * @param encodedData - The Base64 string to decode\n * @returns The decoded string\n * @throws DOMException if the input is not valid Base64\n *\n * @example\n * atob(\"SGVsbG8=\"); // \"Hello\"\n */\n function atob(encodedData: string): string;\n\n /**\n * Encodes a string to Base64.\n *\n * @param stringToEncode - The string to encode (must contain only Latin1 characters)\n * @returns The Base64 encoded string\n * @throws DOMException if the string contains characters outside Latin1 range (0-255)\n *\n * @example\n * btoa(\"Hello\"); // \"SGVsbG8=\"\n */\n function btoa(stringToEncode: string): string;\n\n // ============================================\n // Buffer\n // ============================================\n\n /**\n * Buffer encoding types supported by the isolate Buffer implementation.\n */\n type BufferEncoding = \"utf8\" | \"utf-8\" | \"base64\" | \"hex\";\n\n /**\n * Buffer class for working with binary data.\n * Extends Uint8Array for compatibility.\n * @see https://nodejs.org/api/buffer.html\n */\n interface Buffer extends Uint8Array {\n /**\n * Convert the buffer to a string.\n *\n * @param encoding - The encoding to use (default: \"utf8\")\n * @returns The string representation\n *\n * @example\n * const buf = Buffer.from(\"hello\");\n * buf.toString(); // \"hello\"\n * buf.toString(\"hex\"); // \"68656c6c6f\"\n * buf.toString(\"base64\"); // \"aGVsbG8=\"\n */\n toString(encoding?: BufferEncoding): string;\n\n /**\n * Returns a new Buffer that references the same memory as the original,\n * but offset and cropped by the start and end indices.\n *\n * @param start - Start index (default: 0)\n * @param end - End index (default: buffer.length)\n * @returns A new Buffer instance\n *\n * @example\n * const buf = Buffer.from(\"hello\");\n * buf.slice(1, 4).toString(); // \"ell\"\n */\n slice(start?: number, end?: number): Buffer;\n\n /**\n * Returns a new Buffer that references the same memory as the original,\n * but offset and cropped by the start and end indices.\n *\n * @param start - Start index (default: 0)\n * @param end - End index (default: buffer.length)\n * @returns A new Buffer instance\n */\n subarray(start?: number, end?: number): Buffer;\n }\n\n /**\n * Buffer constructor interface.\n */\n interface BufferConstructor {\n /**\n * Creates a new Buffer from a string, array, ArrayBuffer, or another Buffer.\n *\n * @param value - The value to create a buffer from\n * @param encodingOrOffset - Encoding for strings, or byte offset for ArrayBuffer\n * @param length - Length for ArrayBuffer (when offset is provided)\n * @returns A new Buffer instance\n *\n * @example\n * Buffer.from(\"hello\"); // UTF-8 encoded\n * Buffer.from(\"aGVsbG8=\", \"base64\"); // base64 decoded\n * Buffer.from(\"68656c6c6f\", \"hex\"); // hex decoded\n * Buffer.from([104, 101, 108, 108, 111]); // from array\n */\n from(value: string, encoding?: BufferEncoding): Buffer;\n from(value: ArrayBuffer, byteOffset?: number, length?: number): Buffer;\n from(value: Uint8Array | ReadonlyArray<number>): Buffer;\n from(value: Iterable<number>): Buffer;\n\n /**\n * Allocates a new Buffer of the specified size, filled with zeros or the specified fill value.\n *\n * @param size - The size of the buffer in bytes\n * @param fill - Value to fill the buffer with (default: 0)\n * @param encoding - Encoding for string fill values\n * @returns A new Buffer instance\n *\n * @example\n * Buffer.alloc(5); // <Buffer 00 00 00 00 00>\n * Buffer.alloc(5, 1); // <Buffer 01 01 01 01 01>\n * Buffer.alloc(5, \"ab\"); // <Buffer 61 62 61 62 61>\n */\n alloc(size: number, fill?: number | string | Buffer, encoding?: BufferEncoding): Buffer;\n\n /**\n * Allocates a new Buffer of the specified size without initializing the memory.\n * The contents are unknown and may contain sensitive data.\n *\n * @param size - The size of the buffer in bytes\n * @returns A new Buffer instance\n */\n allocUnsafe(size: number): Buffer;\n\n /**\n * Concatenates a list of Buffers.\n *\n * @param list - Array of Buffer instances to concatenate\n * @param totalLength - Total length of the buffers (optional)\n * @returns A new Buffer instance\n *\n * @example\n * const buf1 = Buffer.from(\"hel\");\n * const buf2 = Buffer.from(\"lo\");\n * Buffer.concat([buf1, buf2]).toString(); // \"hello\"\n */\n concat(list: ReadonlyArray<Uint8Array>, totalLength?: number): Buffer;\n\n /**\n * Returns true if the given object is a Buffer.\n *\n * @param obj - Object to test\n * @returns true if obj is a Buffer\n *\n * @example\n * Buffer.isBuffer(Buffer.from(\"test\")); // true\n * Buffer.isBuffer(new Uint8Array(5)); // false\n */\n isBuffer(obj: unknown): obj is Buffer;\n\n /**\n * Returns the byte length of a string when encoded.\n *\n * @param string - The string to measure\n * @param encoding - The encoding (default: \"utf8\")\n * @returns The byte length\n *\n * @example\n * Buffer.byteLength(\"hello\"); // 5\n * Buffer.byteLength(\"aGVsbG8=\", \"base64\"); // 5 (decoded length)\n */\n byteLength(string: string, encoding?: BufferEncoding): number;\n byteLength(buffer: ArrayBufferView | ArrayBuffer): number;\n\n /**\n * Returns true if the encoding is a valid buffer encoding.\n *\n * @param encoding - The encoding to check\n * @returns true if the encoding is supported\n */\n isEncoding(encoding: string): encoding is BufferEncoding;\n\n readonly prototype: Buffer;\n }\n\n /**\n * Buffer class for working with binary data.\n * @see https://nodejs.org/api/buffer.html\n */\n const Buffer: BufferConstructor;\n}\n";
@@ -86,7 +88,7 @@ export declare const TYPE_DEFINITIONS: {
86
88
  readonly path: "/**\n * Global Type Definitions for ../path/index.ts\n *\n * These types define the globals injected by setupPath() into an isolated-vm context.\n * Use these types to typecheck user code that will run inside the V8 isolate.\n *\n * @example\n * // Typecheck isolate code with path operations\n * const joined = path.join('/foo', 'bar', 'baz');\n * const resolved = path.resolve('relative/path');\n * const cwd = path.cwd();\n */\n\nexport {};\n\ndeclare global {\n /**\n * Parsed path object returned by path.parse().\n */\n interface ParsedPath {\n /** The root of the path (e.g., \"/\" for absolute paths, \"\" for relative) */\n root: string;\n /** The directory portion of the path */\n dir: string;\n /** The file name including extension */\n base: string;\n /** The file extension (e.g., \".txt\") */\n ext: string;\n /** The file name without extension */\n name: string;\n }\n\n /**\n * Input object for path.format().\n */\n interface FormatInputPathObject {\n root?: string;\n dir?: string;\n base?: string;\n ext?: string;\n name?: string;\n }\n\n /**\n * Path utilities for POSIX paths.\n * @see https://nodejs.org/api/path.html\n */\n namespace path {\n /**\n * Join path segments with the platform-specific separator.\n *\n * @param paths - Path segments to join\n * @returns The joined path, normalized\n *\n * @example\n * path.join('/foo', 'bar', 'baz'); // \"/foo/bar/baz\"\n * path.join('foo', 'bar', '..', 'baz'); // \"foo/baz\"\n */\n function join(...paths: string[]): string;\n\n /**\n * Normalize a path, resolving '..' and '.' segments.\n *\n * @param p - The path to normalize\n * @returns The normalized path\n *\n * @example\n * path.normalize('/foo/bar/../baz'); // \"/foo/baz\"\n * path.normalize('/foo//bar'); // \"/foo/bar\"\n */\n function normalize(p: string): string;\n\n /**\n * Get the last portion of a path (the file name).\n *\n * @param p - The path\n * @param ext - Optional extension to remove from the result\n * @returns The base name of the path\n *\n * @example\n * path.basename('/foo/bar/baz.txt'); // \"baz.txt\"\n * path.basename('/foo/bar/baz.txt', '.txt'); // \"baz\"\n */\n function basename(p: string, ext?: string): string;\n\n /**\n * Get the directory name of a path.\n *\n * @param p - The path\n * @returns The directory portion of the path\n *\n * @example\n * path.dirname('/foo/bar/baz.txt'); // \"/foo/bar\"\n * path.dirname('/foo'); // \"/\"\n */\n function dirname(p: string): string;\n\n /**\n * Get the extension of a path.\n *\n * @param p - The path\n * @returns The extension including the dot, or empty string\n *\n * @example\n * path.extname('file.txt'); // \".txt\"\n * path.extname('file.tar.gz'); // \".gz\"\n * path.extname('.bashrc'); // \"\"\n */\n function extname(p: string): string;\n\n /**\n * Check if a path is absolute.\n *\n * @param p - The path to check\n * @returns True if the path is absolute\n *\n * @example\n * path.isAbsolute('/foo/bar'); // true\n * path.isAbsolute('foo/bar'); // false\n */\n function isAbsolute(p: string): boolean;\n\n /**\n * Parse a path into its components.\n *\n * @param p - The path to parse\n * @returns An object with root, dir, base, ext, and name properties\n *\n * @example\n * path.parse('/foo/bar/baz.txt');\n * // { root: \"/\", dir: \"/foo/bar\", base: \"baz.txt\", ext: \".txt\", name: \"baz\" }\n */\n function parse(p: string): ParsedPath;\n\n /**\n * Build a path from an object.\n *\n * @param pathObject - Object with path components\n * @returns The formatted path string\n *\n * @example\n * path.format({ dir: '/foo/bar', base: 'baz.txt' }); // \"/foo/bar/baz.txt\"\n * path.format({ root: '/', name: 'file', ext: '.txt' }); // \"/file.txt\"\n */\n function format(pathObject: FormatInputPathObject): string;\n\n /**\n * Resolve a sequence of paths to an absolute path.\n * Processes paths from right to left, prepending each until an absolute path is formed.\n * Uses the configured working directory for relative paths.\n *\n * @param paths - Path segments to resolve\n * @returns The resolved absolute path\n *\n * @example\n * // With cwd set to \"/home/user\"\n * path.resolve('foo/bar'); // \"/home/user/foo/bar\"\n * path.resolve('/foo', 'bar'); // \"/foo/bar\"\n * path.resolve('/foo', '/bar', 'baz'); // \"/bar/baz\"\n */\n function resolve(...paths: string[]): string;\n\n /**\n * Compute the relative path from one path to another.\n *\n * @param from - The source path\n * @param to - The destination path\n * @returns The relative path from 'from' to 'to'\n *\n * @example\n * path.relative('/foo/bar', '/foo/baz'); // \"../baz\"\n * path.relative('/foo', '/foo/bar/baz'); // \"bar/baz\"\n */\n function relative(from: string, to: string): string;\n\n /**\n * Get the configured working directory.\n *\n * @returns The current working directory\n *\n * @example\n * path.cwd(); // \"/home/user\" (or whatever was configured)\n */\n function cwd(): string;\n\n /**\n * The platform-specific path segment separator.\n * Always \"/\" for POSIX paths.\n */\n const sep: string;\n\n /**\n * The platform-specific path delimiter.\n * Always \":\" for POSIX paths.\n */\n const delimiter: string;\n }\n}\n";
87
89
  readonly testEnvironment: "/**\n * Global Type Definitions for ../test-environment/index.ts\n *\n * These types define the globals injected by setupTestEnvironment() into an isolated-vm context.\n * Use these types to typecheck user code that will run inside the V8 isolate.\n *\n * @example\n * describe(\"Math operations\", () => {\n * it(\"should add numbers\", () => {\n * expect(1 + 1).toBe(2);\n * });\n * });\n */\n\nexport {};\n\ndeclare global {\n // ============================================\n // Test Structure\n // ============================================\n\n /**\n * Define a test suite.\n *\n * @param name - The name of the test suite\n * @param fn - Function containing tests and nested suites\n *\n * @example\n * describe(\"Calculator\", () => {\n * it(\"adds numbers\", () => {\n * expect(1 + 1).toBe(2);\n * });\n * });\n */\n function describe(name: string, fn: () => void): void;\n\n namespace describe {\n /**\n * Skip this suite and all its tests.\n */\n function skip(name: string, fn: () => void): void;\n\n /**\n * Only run this suite (and other .only suites).\n */\n function only(name: string, fn: () => void): void;\n\n /**\n * Mark suite as todo (skipped with different status).\n */\n function todo(name: string, fn?: () => void): void;\n }\n\n /**\n * Define a test case.\n *\n * @param name - The name of the test\n * @param fn - The test function (can be async)\n *\n * @example\n * it(\"should work\", () => {\n * expect(true).toBe(true);\n * });\n *\n * it(\"should work async\", async () => {\n * const result = await Promise.resolve(42);\n * expect(result).toBe(42);\n * });\n */\n function it(name: string, fn: () => void | Promise<void>): void;\n\n namespace it {\n /**\n * Skip this test.\n */\n function skip(name: string, fn?: () => void | Promise<void>): void;\n\n /**\n * Only run this test (and other .only tests).\n */\n function only(name: string, fn: () => void | Promise<void>): void;\n\n /**\n * Mark test as todo.\n */\n function todo(name: string, fn?: () => void | Promise<void>): void;\n }\n\n /**\n * Alias for it().\n */\n function test(name: string, fn: () => void | Promise<void>): void;\n\n namespace test {\n /**\n * Skip this test.\n */\n function skip(name: string, fn?: () => void | Promise<void>): void;\n\n /**\n * Only run this test (and other .only tests).\n */\n function only(name: string, fn: () => void | Promise<void>): void;\n\n /**\n * Mark test as todo.\n */\n function todo(name: string, fn?: () => void | Promise<void>): void;\n }\n\n // ============================================\n // Lifecycle Hooks\n // ============================================\n\n /**\n * Run once before all tests in the current suite.\n *\n * @param fn - Setup function (can be async)\n */\n function beforeAll(fn: () => void | Promise<void>): void;\n\n /**\n * Run once after all tests in the current suite.\n *\n * @param fn - Teardown function (can be async)\n */\n function afterAll(fn: () => void | Promise<void>): void;\n\n /**\n * Run before each test in the current suite (and nested suites).\n *\n * @param fn - Setup function (can be async)\n */\n function beforeEach(fn: () => void | Promise<void>): void;\n\n /**\n * Run after each test in the current suite (and nested suites).\n *\n * @param fn - Teardown function (can be async)\n */\n function afterEach(fn: () => void | Promise<void>): void;\n\n // ============================================\n // Assertions\n // ============================================\n\n /**\n * Matchers for assertions.\n */\n interface Matchers<T> {\n /**\n * Strict equality (===).\n */\n toBe(expected: T): void;\n\n /**\n * Deep equality.\n */\n toEqual(expected: unknown): void;\n\n /**\n * Deep equality with type checking.\n */\n toStrictEqual(expected: unknown): void;\n\n /**\n * Check if value is truthy.\n */\n toBeTruthy(): void;\n\n /**\n * Check if value is falsy.\n */\n toBeFalsy(): void;\n\n /**\n * Check if value is null.\n */\n toBeNull(): void;\n\n /**\n * Check if value is undefined.\n */\n toBeUndefined(): void;\n\n /**\n * Check if value is defined (not undefined).\n */\n toBeDefined(): void;\n\n /**\n * Check if value is NaN.\n */\n toBeNaN(): void;\n\n /**\n * Check if number is greater than expected.\n */\n toBeGreaterThan(n: number): void;\n\n /**\n * Check if number is greater than or equal to expected.\n */\n toBeGreaterThanOrEqual(n: number): void;\n\n /**\n * Check if number is less than expected.\n */\n toBeLessThan(n: number): void;\n\n /**\n * Check if number is less than or equal to expected.\n */\n toBeLessThanOrEqual(n: number): void;\n\n /**\n * Check if array/string contains item/substring.\n */\n toContain(item: unknown): void;\n\n /**\n * Check length of array/string.\n */\n toHaveLength(length: number): void;\n\n /**\n * Check if object has property (optionally with value).\n */\n toHaveProperty(key: string, value?: unknown): void;\n\n /**\n * Check if function throws.\n */\n toThrow(expected?: string | RegExp | Error): void;\n\n /**\n * Check if string matches pattern.\n */\n toMatch(pattern: string | RegExp): void;\n\n /**\n * Check if object matches subset of properties.\n */\n toMatchObject(object: object): void;\n\n /**\n * Check if value is instance of class.\n */\n toBeInstanceOf(constructor: Function): void;\n\n /**\n * Negate the matcher.\n */\n not: Matchers<T>;\n\n /**\n * Await promise and check resolved value.\n */\n resolves: Matchers<Awaited<T>>;\n\n /**\n * Await promise and check rejection.\n */\n rejects: Matchers<unknown>;\n }\n\n /**\n * Create an expectation for a value.\n *\n * @param actual - The value to test\n * @returns Matchers for the value\n *\n * @example\n * expect(1 + 1).toBe(2);\n * expect({ a: 1 }).toEqual({ a: 1 });\n * expect(() => { throw new Error(); }).toThrow();\n * expect(promise).resolves.toBe(42);\n */\n function expect<T>(actual: T): Matchers<T>;\n}\n";
88
90
  readonly timers: "/**\n * Global Type Definitions for ../timers/index.ts\n *\n * These types define the globals injected by setupTimers() into an isolated-vm context.\n * Use these types to typecheck user code that will run inside the V8 isolate.\n *\n * @example\n * const timeoutId = setTimeout(() => {\n * console.log(\"fired!\");\n * }, 1000);\n *\n * clearTimeout(timeoutId);\n *\n * const intervalId = setInterval(() => {\n * console.log(\"tick\");\n * }, 100);\n *\n * clearInterval(intervalId);\n */\n\nexport {};\n\ndeclare global {\n /**\n * Schedule a callback to execute after a delay.\n *\n * @param callback - The function to call after the delay\n * @param ms - The delay in milliseconds (default: 0)\n * @param args - Additional arguments to pass to the callback\n * @returns A timer ID that can be passed to clearTimeout\n *\n * @example\n * const id = setTimeout(() => console.log(\"done\"), 1000);\n * setTimeout((a, b) => console.log(a, b), 100, \"hello\", \"world\");\n */\n function setTimeout(\n callback: (...args: unknown[]) => void,\n ms?: number,\n ...args: unknown[]\n ): number;\n\n /**\n * Schedule a callback to execute repeatedly at a fixed interval.\n *\n * @param callback - The function to call at each interval\n * @param ms - The interval in milliseconds (minimum: 4ms)\n * @param args - Additional arguments to pass to the callback\n * @returns A timer ID that can be passed to clearInterval\n *\n * @example\n * const id = setInterval(() => console.log(\"tick\"), 1000);\n */\n function setInterval(\n callback: (...args: unknown[]) => void,\n ms?: number,\n ...args: unknown[]\n ): number;\n\n /**\n * Cancel a timeout previously scheduled with setTimeout.\n *\n * @param id - The timer ID returned by setTimeout\n *\n * @example\n * const id = setTimeout(() => {}, 1000);\n * clearTimeout(id);\n */\n function clearTimeout(id: number | undefined): void;\n\n /**\n * Cancel an interval previously scheduled with setInterval.\n *\n * @param id - The timer ID returned by setInterval\n *\n * @example\n * const id = setInterval(() => {}, 1000);\n * clearInterval(id);\n */\n function clearInterval(id: number | undefined): void;\n}\n";
89
- readonly playwright: "\n/**\n * Locator represents an element or group of elements in the page.\n */\ndeclare class Locator {\n /** Click the element */\n click(): Promise<void>;\n /** Double-click the element */\n dblclick(): Promise<void>;\n /** Fill an input element with text */\n fill(text: string): Promise<void>;\n /** Type text into an element (key by key) */\n type(text: string): Promise<void>;\n /** Check a checkbox or radio */\n check(): Promise<void>;\n /** Uncheck a checkbox */\n uncheck(): Promise<void>;\n /** Select an option in a dropdown */\n selectOption(value: string | string[]): Promise<void>;\n /** Clear an input element */\n clear(): Promise<void>;\n /** Press a key */\n press(key: string): Promise<void>;\n /** Hover over the element */\n hover(): Promise<void>;\n /** Focus the element */\n focus(): Promise<void>;\n /** Get text content of the element */\n textContent(): Promise<string | null>;\n /** Get the value of an input element */\n inputValue(): Promise<string>;\n /** Check if the element is visible */\n isVisible(): Promise<boolean>;\n /** Check if the element is enabled */\n isEnabled(): Promise<boolean>;\n /** Check if the element is checked */\n isChecked(): Promise<boolean>;\n /** Check if the element is disabled */\n isDisabled(): Promise<boolean>;\n /** Check if the element is hidden */\n isHidden(): Promise<boolean>;\n /** Get the count of matching elements */\n count(): Promise<number>;\n /** Get an attribute value */\n getAttribute(name: string): Promise<string | null>;\n /** Get innerHTML */\n innerHTML(): Promise<string>;\n /** Get innerText */\n innerText(): Promise<string>;\n /** Get all text contents */\n allTextContents(): Promise<string[]>;\n /** Get all inner texts */\n allInnerTexts(): Promise<string[]>;\n /** Wait for the element to match a state */\n waitFor(options?: { state?: \"attached\" | \"detached\" | \"visible\" | \"hidden\"; timeout?: number }): Promise<void>;\n /** Get bounding box */\n boundingBox(): Promise<{ x: number; y: number; width: number; height: number } | null>;\n /** Set input files for a file input */\n setInputFiles(files: string | string[] | { name: string; mimeType: string; buffer: ArrayBuffer | Uint8Array | string }[]): Promise<void>;\n /** Take a screenshot of the element */\n screenshot(options?: { path?: string; type?: \"png\" | \"jpeg\"; quality?: number }): Promise<string>;\n /** Drag to another element */\n dragTo(target: Locator): Promise<void>;\n /** Scroll element into view */\n scrollIntoViewIfNeeded(): Promise<void>;\n /** Highlight the element for debugging */\n highlight(): Promise<void>;\n /** Evaluate a function in the context of the element */\n evaluate<R>(fn: (el: Element, arg?: unknown) => R, arg?: unknown): Promise<R>;\n /** Evaluate a function for all matching elements */\n evaluateAll<R>(fn: (els: Element[], arg?: unknown) => R, arg?: unknown): Promise<R>;\n\n // Chaining methods\n /** Chain with another CSS selector */\n locator(selector: string): Locator;\n /** Chain with getByRole */\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n /** Chain with getByText */\n getByText(text: string | RegExp): Locator;\n /** Chain with getByLabel */\n getByLabel(label: string | RegExp): Locator;\n /** Chain with getByPlaceholder */\n getByPlaceholder(placeholder: string | RegExp): Locator;\n /** Chain with getByTestId */\n getByTestId(testId: string): Locator;\n /** Chain with getByAltText */\n getByAltText(alt: string | RegExp): Locator;\n /** Chain with getByTitle */\n getByTitle(title: string | RegExp): Locator;\n\n // Subset selection\n /** Get all matching locators as an array */\n all(): Promise<Locator[]>;\n /** Get the nth matching element */\n nth(index: number): Locator;\n /** Get the first matching element */\n first(): Locator;\n /** Get the last matching element */\n last(): Locator;\n\n // Filtering\n /** Filter locators by additional criteria */\n filter(options: { hasText?: string | RegExp; hasNotText?: string | RegExp; has?: Locator; hasNot?: Locator }): Locator;\n /** Create a locator matching either this or the other locator */\n or(other: Locator): Locator;\n /** Create a locator matching both this and the other locator */\n and(other: Locator): Locator;\n}\n\n/**\n * FrameLocator for interacting with elements inside iframes.\n */\ninterface FrameLocator {\n locator(selector: string): Locator;\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n getByText(text: string | RegExp): Locator;\n getByLabel(label: string | RegExp): Locator;\n getByPlaceholder(placeholder: string | RegExp): Locator;\n getByTestId(testId: string): Locator;\n getByAltText(alt: string | RegExp): Locator;\n getByTitle(title: string | RegExp): Locator;\n}\n\n/**\n * Keyboard API for simulating keyboard input.\n */\ninterface Keyboard {\n type(text: string, options?: { delay?: number }): Promise<void>;\n press(key: string, options?: { delay?: number }): Promise<void>;\n down(key: string): Promise<void>;\n up(key: string): Promise<void>;\n insertText(text: string): Promise<void>;\n}\n\n/**\n * Mouse API for simulating mouse input.\n */\ninterface Mouse {\n move(x: number, y: number, options?: { steps?: number }): Promise<void>;\n click(x: number, y: number, options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number; delay?: number }): Promise<void>;\n down(options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number }): Promise<void>;\n up(options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number }): Promise<void>;\n wheel(deltaX: number, deltaY: number): Promise<void>;\n}\n\n/**\n * API Response from page.request methods.\n */\ninterface APIResponse {\n status(): number;\n ok(): boolean;\n headers(): Record<string, string>;\n json(): Promise<unknown>;\n text(): Promise<string>;\n body(): Promise<ArrayBuffer>;\n}\n\n/**\n * Request API for making HTTP requests with page cookies.\n */\ninterface APIRequestContext {\n fetch(url: string, options?: { method?: string; data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n get(url: string, options?: { headers?: Record<string, string> }): Promise<APIResponse>;\n post(url: string, options?: { data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n put(url: string, options?: { data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n delete(url: string, options?: { headers?: Record<string, string> }): Promise<APIResponse>;\n}\n\n/**\n * Frame information.\n */\ninterface FrameInfo {\n name: string;\n url: string;\n}\n\n/**\n * Cookie data.\n */\ninterface Cookie {\n name: string;\n value: string;\n domain?: string;\n path?: string;\n expires?: number;\n httpOnly?: boolean;\n secure?: boolean;\n sameSite?: \"Strict\" | \"Lax\" | \"None\";\n}\n\n/**\n * IsolatePage - represents a browser page in the isolate.\n */\ndeclare class IsolatePage {\n /** Navigate to a URL */\n goto(url: string, options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Reload the page */\n reload(): Promise<void>;\n /** Get the current URL */\n url(): Promise<string>;\n /** Get the page title */\n title(): Promise<string>;\n /** Get the page HTML content */\n content(): Promise<string>;\n /** Wait for a selector to appear */\n waitForSelector(selector: string, options?: { state?: \"attached\" | \"detached\" | \"visible\" | \"hidden\"; timeout?: number }): Promise<void>;\n /** Wait for a specified time */\n waitForTimeout(ms: number): Promise<void>;\n /** Wait for a load state */\n waitForLoadState(state?: \"load\" | \"domcontentloaded\" | \"networkidle\"): Promise<void>;\n /** Wait for the URL to match */\n waitForURL(url: string | RegExp, options?: { timeout?: number; waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Evaluate JavaScript in the browser context */\n evaluate<R>(script: string | (() => R) | ((arg: unknown) => R), arg?: unknown): Promise<R>;\n /** Create a locator by CSS selector */\n locator(selector: string): Locator;\n /** Create a locator by ARIA role */\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n /** Create a locator by text content */\n getByText(text: string | RegExp): Locator;\n /** Create a locator by label */\n getByLabel(label: string | RegExp): Locator;\n /** Create a locator by placeholder */\n getByPlaceholder(placeholder: string | RegExp): Locator;\n /** Create a locator by test ID */\n getByTestId(testId: string): Locator;\n /** Create a locator by alt text */\n getByAltText(alt: string | RegExp): Locator;\n /** Create a locator by title */\n getByTitle(title: string | RegExp): Locator;\n /** Create a frame locator */\n frameLocator(selector: string): FrameLocator;\n /** Navigate back */\n goBack(options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Navigate forward */\n goForward(options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Click an element (shorthand) */\n click(selector: string): Promise<void>;\n /** Fill an input (shorthand) */\n fill(selector: string, value: string): Promise<void>;\n /** Take a screenshot */\n screenshot(options?: { path?: string; fullPage?: boolean; type?: \"png\" | \"jpeg\"; quality?: number }): Promise<string>;\n /** Generate a PDF (Chromium only) */\n pdf(options?: { path?: string; format?: string; landscape?: boolean; margin?: { top?: string; bottom?: string; left?: string; right?: string } }): Promise<string>;\n /** Set the viewport size */\n setViewportSize(size: { width: number; height: number }): Promise<void>;\n /** Get the viewport size */\n viewportSize(): Promise<{ width: number; height: number } | null>;\n /** Emulate media type or color scheme */\n emulateMedia(options: { media?: \"screen\" | \"print\" | null; colorScheme?: \"light\" | \"dark\" | \"no-preference\" | null }): Promise<void>;\n /** Set extra HTTP headers */\n setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;\n /** Bring the page to front */\n bringToFront(): Promise<void>;\n /** Close the page */\n close(): Promise<void>;\n /** Check if the page is closed */\n isClosed(): Promise<boolean>;\n /** Pause execution (for debugging) */\n pause(): Promise<void>;\n /** Get all frames */\n frames(): Promise<FrameInfo[]>;\n /** Get the main frame */\n mainFrame(): Promise<FrameInfo>;\n /** Get the browser context for this page */\n context(): IsolateContext;\n /** Keyboard API */\n readonly keyboard: Keyboard;\n /** Mouse API */\n readonly mouse: Mouse;\n /** Request API for making HTTP requests */\n readonly request: APIRequestContext;\n}\n\n/**\n * IsolateContext - represents a browser context in the isolate.\n */\ndeclare class IsolateContext {\n /** Create a new page in this context (requires createPage callback) */\n newPage(): Promise<IsolatePage>;\n /** Close this context and all its pages */\n close(): Promise<void>;\n /** Clear all cookies */\n clearCookies(): Promise<void>;\n /** Add cookies */\n addCookies(cookies: Cookie[]): Promise<void>;\n /** Get cookies */\n cookies(urls?: string | string[]): Promise<Cookie[]>;\n}\n\n/**\n * Browser object for creating new contexts.\n */\ninterface IsolateBrowser {\n /** Create a new browser context (requires createContext callback) */\n newContext(options?: {\n viewport?: { width: number; height: number } | null;\n userAgent?: string;\n locale?: string;\n timezoneId?: string;\n geolocation?: { latitude: number; longitude: number; accuracy?: number };\n permissions?: string[];\n colorScheme?: \"light\" | \"dark\" | \"no-preference\";\n }): Promise<IsolateContext>;\n}\n\n/**\n * The default page object.\n */\ndeclare const page: IsolatePage;\n\n/**\n * The default browser context.\n */\ndeclare const context: IsolateContext;\n\n/**\n * Browser object for creating new contexts.\n */\ndeclare const browser: IsolateBrowser;\n\n// ============================================================================\n// Playwright Expect Matchers (extends test-environment expect)\n// ============================================================================\n\n/**\n * Options for locator assertion timeouts.\n */\ninterface LocatorAssertionOptions {\n timeout?: number;\n}\n\n/**\n * Locator-specific assertion matchers (added to expect when using Playwright).\n * These are available when calling expect(locator).\n */\ninterface PlaywrightLocatorMatchers {\n /** Assert element is visible */\n toBeVisible(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is hidden */\n toBeHidden(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is enabled */\n toBeEnabled(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is disabled */\n toBeDisabled(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is checked */\n toBeChecked(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is focused */\n toBeFocused(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is empty */\n toBeEmpty(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is attached to DOM */\n toBeAttached(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is editable */\n toBeEditable(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is in viewport */\n toBeInViewport(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element contains text */\n toContainText(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has exact text */\n toHaveText(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has value (for inputs) */\n toHaveValue(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has attribute */\n toHaveAttribute(name: string, value?: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element count */\n toHaveCount(count: number, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has class */\n toHaveClass(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element contains class */\n toContainClass(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has id */\n toHaveId(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has CSS property */\n toHaveCSS(name: string, value: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has JavaScript property */\n toHaveJSProperty(name: string, value: unknown, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has accessible name */\n toHaveAccessibleName(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has accessible description */\n toHaveAccessibleDescription(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has ARIA role */\n toHaveRole(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Negated matchers */\n not: PlaywrightLocatorMatchers;\n}\n\n/**\n * Page-specific assertion matchers (added to expect when using Playwright).\n * These are available when calling expect(page).\n */\ninterface PlaywrightPageMatchers {\n /** Assert page has URL */\n toHaveURL(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert page has title */\n toHaveTitle(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Negated matchers */\n not: PlaywrightPageMatchers;\n}\n";
91
+ readonly playwright: "\n/**\n * Locator represents an element or group of elements in the page.\n */\ndeclare class Locator {\n /** Click the element */\n click(): Promise<void>;\n /** Double-click the element */\n dblclick(): Promise<void>;\n /** Fill an input element with text */\n fill(text: string): Promise<void>;\n /** Type text into an element (key by key) */\n type(text: string): Promise<void>;\n /** Check a checkbox or radio */\n check(): Promise<void>;\n /** Uncheck a checkbox */\n uncheck(): Promise<void>;\n /** Select an option in a dropdown */\n selectOption(value: string | string[]): Promise<void>;\n /** Clear an input element */\n clear(): Promise<void>;\n /** Press a key */\n press(key: string): Promise<void>;\n /** Hover over the element */\n hover(): Promise<void>;\n /** Focus the element */\n focus(): Promise<void>;\n /** Get text content of the element */\n textContent(): Promise<string | null>;\n /** Get the value of an input element */\n inputValue(): Promise<string>;\n /** Check if the element is visible */\n isVisible(): Promise<boolean>;\n /** Check if the element is enabled */\n isEnabled(): Promise<boolean>;\n /** Check if the element is checked */\n isChecked(): Promise<boolean>;\n /** Check if the element is disabled */\n isDisabled(): Promise<boolean>;\n /** Check if the element is hidden */\n isHidden(): Promise<boolean>;\n /** Get the count of matching elements */\n count(): Promise<number>;\n /** Get an attribute value */\n getAttribute(name: string): Promise<string | null>;\n /** Get innerHTML */\n innerHTML(): Promise<string>;\n /** Get innerText */\n innerText(): Promise<string>;\n /** Get all text contents */\n allTextContents(): Promise<string[]>;\n /** Get all inner texts */\n allInnerTexts(): Promise<string[]>;\n /** Wait for the element to match a state */\n waitFor(options?: { state?: \"attached\" | \"detached\" | \"visible\" | \"hidden\"; timeout?: number }): Promise<void>;\n /** Get bounding box */\n boundingBox(): Promise<{ x: number; y: number; width: number; height: number } | null>;\n /** Set input files for a file input */\n setInputFiles(files: string | string[] | { name: string; mimeType: string; buffer: ArrayBuffer | Uint8Array | string }[]): Promise<void>;\n /** Take a screenshot of the element */\n screenshot(options?: { path?: string; type?: \"png\" | \"jpeg\"; quality?: number }): Promise<void>;\n /** Drag to another element */\n dragTo(target: Locator): Promise<void>;\n /** Scroll element into view */\n scrollIntoViewIfNeeded(): Promise<void>;\n /** Highlight the element for debugging */\n highlight(): Promise<void>;\n /** Evaluate a function in the context of the element */\n evaluate<R>(fn: (el: Element, arg?: unknown) => R, arg?: unknown): Promise<R>;\n /** Evaluate a function for all matching elements */\n evaluateAll<R>(fn: (els: Element[], arg?: unknown) => R, arg?: unknown): Promise<R>;\n\n // Chaining methods\n /** Chain with another CSS selector */\n locator(selector: string): Locator;\n /** Chain with getByRole */\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n /** Chain with getByText */\n getByText(text: string | RegExp): Locator;\n /** Chain with getByLabel */\n getByLabel(label: string | RegExp): Locator;\n /** Chain with getByPlaceholder */\n getByPlaceholder(placeholder: string | RegExp): Locator;\n /** Chain with getByTestId */\n getByTestId(testId: string): Locator;\n /** Chain with getByAltText */\n getByAltText(alt: string | RegExp): Locator;\n /** Chain with getByTitle */\n getByTitle(title: string | RegExp): Locator;\n\n // Subset selection\n /** Get all matching locators as an array */\n all(): Promise<Locator[]>;\n /** Get the nth matching element */\n nth(index: number): Locator;\n /** Get the first matching element */\n first(): Locator;\n /** Get the last matching element */\n last(): Locator;\n\n // Filtering\n /** Filter locators by additional criteria */\n filter(options: { hasText?: string | RegExp; hasNotText?: string | RegExp; has?: Locator; hasNot?: Locator }): Locator;\n /** Create a locator matching either this or the other locator */\n or(other: Locator): Locator;\n /** Create a locator matching both this and the other locator */\n and(other: Locator): Locator;\n}\n\n/**\n * FrameLocator for interacting with elements inside iframes.\n */\ninterface FrameLocator {\n locator(selector: string): Locator;\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n getByText(text: string | RegExp): Locator;\n getByLabel(label: string | RegExp): Locator;\n getByPlaceholder(placeholder: string | RegExp): Locator;\n getByTestId(testId: string): Locator;\n getByAltText(alt: string | RegExp): Locator;\n getByTitle(title: string | RegExp): Locator;\n}\n\n/**\n * Keyboard API for simulating keyboard input.\n */\ninterface Keyboard {\n type(text: string, options?: { delay?: number }): Promise<void>;\n press(key: string, options?: { delay?: number }): Promise<void>;\n down(key: string): Promise<void>;\n up(key: string): Promise<void>;\n insertText(text: string): Promise<void>;\n}\n\n/**\n * Mouse API for simulating mouse input.\n */\ninterface Mouse {\n move(x: number, y: number, options?: { steps?: number }): Promise<void>;\n click(x: number, y: number, options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number; delay?: number }): Promise<void>;\n down(options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number }): Promise<void>;\n up(options?: { button?: \"left\" | \"right\" | \"middle\"; clickCount?: number }): Promise<void>;\n wheel(deltaX: number, deltaY: number): Promise<void>;\n}\n\n/**\n * API Response from page.request methods.\n */\ninterface APIResponse {\n status(): number;\n ok(): boolean;\n headers(): Record<string, string>;\n json(): Promise<unknown>;\n text(): Promise<string>;\n body(): Promise<ArrayBuffer>;\n}\n\n/**\n * Request API for making HTTP requests with page cookies.\n */\ninterface APIRequestContext {\n fetch(url: string, options?: { method?: string; data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n get(url: string, options?: { headers?: Record<string, string> }): Promise<APIResponse>;\n post(url: string, options?: { data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n put(url: string, options?: { data?: unknown; headers?: Record<string, string> }): Promise<APIResponse>;\n delete(url: string, options?: { headers?: Record<string, string> }): Promise<APIResponse>;\n}\n\n/**\n * Frame information.\n */\ninterface FrameInfo {\n name: string;\n url: string;\n}\n\n/**\n * Cookie data.\n */\ninterface Cookie {\n name: string;\n value: string;\n domain?: string;\n path?: string;\n expires?: number;\n httpOnly?: boolean;\n secure?: boolean;\n sameSite?: \"Strict\" | \"Lax\" | \"None\";\n}\n\n/**\n * IsolatePage - represents a browser page in the isolate.\n */\ndeclare class IsolatePage {\n /** Navigate to a URL */\n goto(url: string, options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Reload the page */\n reload(): Promise<void>;\n /** Get the current URL */\n url(): Promise<string>;\n /** Get the page title */\n title(): Promise<string>;\n /** Get the page HTML content */\n content(): Promise<string>;\n /** Wait for a selector to appear */\n waitForSelector(selector: string, options?: { state?: \"attached\" | \"detached\" | \"visible\" | \"hidden\"; timeout?: number }): Promise<void>;\n /** Wait for a specified time */\n waitForTimeout(ms: number): Promise<void>;\n /** Wait for a load state */\n waitForLoadState(state?: \"load\" | \"domcontentloaded\" | \"networkidle\"): Promise<void>;\n /** Wait for the URL to match */\n waitForURL(url: string | RegExp, options?: { timeout?: number; waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Evaluate JavaScript in the browser context */\n evaluate<R>(script: string | (() => R) | ((arg: unknown) => R), arg?: unknown): Promise<R>;\n /** Create a locator by CSS selector */\n locator(selector: string): Locator;\n /** Create a locator by ARIA role */\n getByRole(role: string, options?: { name?: string | RegExp; exact?: boolean }): Locator;\n /** Create a locator by text content */\n getByText(text: string | RegExp): Locator;\n /** Create a locator by label */\n getByLabel(label: string | RegExp): Locator;\n /** Create a locator by placeholder */\n getByPlaceholder(placeholder: string | RegExp): Locator;\n /** Create a locator by test ID */\n getByTestId(testId: string): Locator;\n /** Create a locator by alt text */\n getByAltText(alt: string | RegExp): Locator;\n /** Create a locator by title */\n getByTitle(title: string | RegExp): Locator;\n /** Create a frame locator */\n frameLocator(selector: string): FrameLocator;\n /** Navigate back */\n goBack(options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Navigate forward */\n goForward(options?: { waitUntil?: \"load\" | \"domcontentloaded\" | \"networkidle\" }): Promise<void>;\n /** Click an element (shorthand) */\n click(selector: string): Promise<void>;\n /** Fill an input (shorthand) */\n fill(selector: string, value: string): Promise<void>;\n /** Take a screenshot */\n screenshot(options?: { path?: string; fullPage?: boolean; type?: \"png\" | \"jpeg\"; quality?: number }): Promise<void>;\n /** Generate a PDF (Chromium only) */\n pdf(options?: { path?: string; format?: string; landscape?: boolean; margin?: { top?: string; bottom?: string; left?: string; right?: string } }): Promise<string>;\n /** Set the viewport size */\n setViewportSize(size: { width: number; height: number }): Promise<void>;\n /** Get the viewport size */\n viewportSize(): Promise<{ width: number; height: number } | null>;\n /** Emulate media type or color scheme */\n emulateMedia(options: { media?: \"screen\" | \"print\" | null; colorScheme?: \"light\" | \"dark\" | \"no-preference\" | null }): Promise<void>;\n /** Set extra HTTP headers */\n setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;\n /** Bring the page to front */\n bringToFront(): Promise<void>;\n /** Close the page */\n close(): Promise<void>;\n /** Check if the page is closed */\n isClosed(): Promise<boolean>;\n /** Pause execution (for debugging) */\n pause(): Promise<void>;\n /** Get all frames */\n frames(): Promise<FrameInfo[]>;\n /** Get the main frame */\n mainFrame(): Promise<FrameInfo>;\n /** Get the browser context for this page */\n context(): IsolateContext;\n /** Keyboard API */\n readonly keyboard: Keyboard;\n /** Mouse API */\n readonly mouse: Mouse;\n /** Request API for making HTTP requests */\n readonly request: APIRequestContext;\n}\n\n/**\n * IsolateContext - represents a browser context in the isolate.\n */\ndeclare class IsolateContext {\n /** Create a new page in this context (requires createPage callback) */\n newPage(): Promise<IsolatePage>;\n /** Get tracked pages for this context */\n pages(): Promise<IsolatePage[]>;\n /** Close this context and all its pages */\n close(): Promise<void>;\n /** Clear all cookies */\n clearCookies(): Promise<void>;\n /** Add cookies */\n addCookies(cookies: Cookie[]): Promise<void>;\n /** Get cookies */\n cookies(urls?: string | string[]): Promise<Cookie[]>;\n}\n\n/**\n * Browser object for creating new contexts.\n */\ninterface IsolateBrowser {\n /** Create a new browser context (requires createContext callback) */\n newContext(options?: {\n viewport?: { width: number; height: number } | null;\n userAgent?: string;\n locale?: string;\n timezoneId?: string;\n geolocation?: { latitude: number; longitude: number; accuracy?: number };\n permissions?: string[];\n colorScheme?: \"light\" | \"dark\" | \"no-preference\";\n }): Promise<IsolateContext>;\n /** Get tracked browser contexts */\n contexts(): Promise<IsolateContext[]>;\n}\n\n/**\n * Browser object for creating new contexts.\n */\ndeclare const browser: IsolateBrowser;\n\n// ============================================================================\n// Playwright Expect Matchers (extends test-environment expect)\n// ============================================================================\n\n/**\n * Options for locator assertion timeouts.\n */\ninterface LocatorAssertionOptions {\n timeout?: number;\n}\n\n/**\n * Locator-specific assertion matchers (added to expect when using Playwright).\n * These are available when calling expect(locator).\n */\ninterface PlaywrightLocatorMatchers {\n /** Assert element is visible */\n toBeVisible(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is hidden */\n toBeHidden(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is enabled */\n toBeEnabled(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is disabled */\n toBeDisabled(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is checked */\n toBeChecked(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is focused */\n toBeFocused(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is empty */\n toBeEmpty(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is attached to DOM */\n toBeAttached(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is editable */\n toBeEditable(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element is in viewport */\n toBeInViewport(options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element contains text */\n toContainText(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has exact text */\n toHaveText(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has value (for inputs) */\n toHaveValue(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has attribute */\n toHaveAttribute(name: string, value?: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element count */\n toHaveCount(count: number, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has class */\n toHaveClass(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element contains class */\n toContainClass(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has id */\n toHaveId(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has CSS property */\n toHaveCSS(name: string, value: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has JavaScript property */\n toHaveJSProperty(name: string, value: unknown, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has accessible name */\n toHaveAccessibleName(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has accessible description */\n toHaveAccessibleDescription(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert element has ARIA role */\n toHaveRole(expected: string, options?: LocatorAssertionOptions): Promise<void>;\n /** Negated matchers */\n not: PlaywrightLocatorMatchers;\n}\n\n/**\n * Page-specific assertion matchers (added to expect when using Playwright).\n * These are available when calling expect(page).\n */\ninterface PlaywrightPageMatchers {\n /** Assert page has URL */\n toHaveURL(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Assert page has title */\n toHaveTitle(expected: string | RegExp, options?: LocatorAssertionOptions): Promise<void>;\n /** Negated matchers */\n not: PlaywrightPageMatchers;\n}\n";
90
92
  };
91
93
  /**
92
94
  * Type for the keys of TYPE_DEFINITIONS.
@@ -77,7 +77,7 @@ export interface TypecheckOptions {
77
77
  * Which isolate global types to include.
78
78
  * @default ["core", "fetch", "fs"]
79
79
  */
80
- include?: Array<"core" | "fetch" | "fs" | "console" | "encoding" | "timers" | "testEnvironment" | "playwright">;
80
+ include?: Array<"core" | "sandboxIsolate" | "fetch" | "fs" | "console" | "encoding" | "timers" | "testEnvironment" | "playwright">;
81
81
  /**
82
82
  * Library type definitions to inject for import resolution.
83
83
  * These are added to the virtual node_modules/ for module resolution.
@@ -1,6 +1,7 @@
1
- import type { MutableRuntimeDiagnostics } from "../bridge/diagnostics.ts";
1
+ import { type MutableRuntimeDiagnostics } from "../bridge/diagnostics.ts";
2
2
  import { type RemoteRuntime } from "../internal/client/index.ts";
3
3
  import type { ScriptRuntime } from "../types.ts";
4
4
  export declare function createScriptRuntimeAdapter(runtime: RemoteRuntime, diagnostics: MutableRuntimeDiagnostics, options?: {
5
+ hasBrowser?: boolean;
5
6
  onBeforeDispose?: (reason?: string) => void;
6
7
  }): ScriptRuntime;
@@ -0,0 +1,4 @@
1
+ import { type RuntimeBindingsAdapterOptions } from "../bridge/runtime-bindings.ts";
2
+ import type { RemoteRuntime, RuntimeOptions } from "../internal/client/index.ts";
3
+ import type { CreateTestRuntimeOptions, TestRuntime } from "../types.ts";
4
+ export declare function createTestRuntimeAdapter(createRuntime: (options: RuntimeOptions) => Promise<RemoteRuntime>, options: CreateTestRuntimeOptions, adapterOptions?: RuntimeBindingsAdapterOptions): Promise<TestRuntime>;
@@ -1,3 +1,4 @@
1
1
  import type { DaemonConnection } from "../internal/client/index.ts";
2
+ import { type RuntimeBindingsAdapterOptions } from "../bridge/runtime-bindings.ts";
2
3
  import type { AppServer, CreateAppServerOptions } from "../types.ts";
3
- export declare function createAppServerAdapter(getConnection: () => Promise<DaemonConnection>, options: CreateAppServerOptions): Promise<AppServer>;
4
+ export declare function createAppServerAdapter(getConnection: () => Promise<DaemonConnection>, options: CreateAppServerOptions, adapterOptions?: RuntimeBindingsAdapterOptions): Promise<AppServer>;