@skrillex1224/playwright-toolkit 2.1.262 → 2.1.265

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -285,6 +285,38 @@ export interface DeviceInputModule {
285
285
  drag(page: Page, sourceLocator: Locator, targetLocator: Locator, options?: DeviceInputOptions): Promise<boolean>;
286
286
  }
287
287
 
288
+ export interface DeviceViewDescriptor {
289
+ userAgent?: string;
290
+ viewport?: { width: number; height: number };
291
+ screen?: { width: number; height: number };
292
+ deviceScaleFactor?: number;
293
+ isMobile?: boolean;
294
+ hasTouch?: boolean;
295
+ }
296
+
297
+ export interface DeviceViewOptions {
298
+ runtimeState?: RuntimeEnvState | Record<string, any> | null;
299
+ device: RuntimeDevice;
300
+ descriptor?: string | DeviceViewDescriptor;
301
+ platform?: string;
302
+ maxTouchPoints?: number;
303
+ }
304
+
305
+ export interface DeviceViewContext {
306
+ page: Page;
307
+ device: RuntimeDevice;
308
+ descriptor: DeviceViewDescriptor | null;
309
+ runtimeState: RuntimeEnvState | Record<string, any>;
310
+ }
311
+
312
+ export interface DeviceViewModule {
313
+ withPageDevice<T>(
314
+ page: Page,
315
+ options: DeviceViewOptions,
316
+ callback: (context: DeviceViewContext) => T | Promise<T>
317
+ ): Promise<Awaited<T>>;
318
+ }
319
+
288
320
  export interface HumanizeModule {
289
321
  initializeCursor(page: Page): Promise<void>;
290
322
  jitterMs(base: number, jitterPercent?: number): number;
@@ -788,6 +820,7 @@ export interface PlaywrightToolKit {
788
820
  ApifyKit: ApifyKitModule;
789
821
  AntiCheat: AntiDetectModule;
790
822
  DeviceInput: DeviceInputModule;
823
+ DeviceView: DeviceViewModule;
791
824
  Humanize: HumanizeModule;
792
825
  Launch: LaunchModule;
793
826
  LiveView: LiveViewModule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrillex1224/playwright-toolkit",
3
- "version": "2.1.262",
3
+ "version": "2.1.265",
4
4
  "description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",