@skrillex1224/playwright-toolkit 2.1.50 → 2.1.51

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
@@ -143,16 +143,16 @@ export interface LogTemplate {
143
143
  defaultSelected?: boolean;
144
144
  }
145
145
 
146
- export const Logger: LoggerModule;
147
- export const LOG_TEMPLATES: LogTemplate[];
148
- export function stripAnsi(input: string): string;
146
+
149
147
  export interface BrowserModule {
150
148
  Logger: LoggerModule;
151
149
  LOG_TEMPLATES: LogTemplate[];
152
150
  stripAnsi(input: string): string;
151
+ TokenForm: TokenFormModule;
153
152
  }
154
153
 
155
- export const browser: BrowserModule;
154
+ // TokenForm is browser-only now
155
+ // export const browser: BrowserModule;
156
156
 
157
157
  // =============================================================================
158
158
  // ApifyKit
@@ -438,6 +438,30 @@ export interface MutationModule {
438
438
  useMonitor(page: Page, selectors: string | string[], options?: useMonitorOptions): Promise<MutationMonitor>;
439
439
  }
440
440
 
441
+ // TokenAdapter
442
+ // =============================================================================
443
+ export interface PlatformConfig {
444
+ name: string;
445
+ tokenName: string;
446
+ serviceUrl: string;
447
+ tokenFields: string[];
448
+ guide?: string;
449
+
450
+ // Strategy Methods
451
+ parse(token: string): Record<string, string>;
452
+ format(values: Record<string, any>): string;
453
+ }
454
+
455
+ export interface TokenFormInstance {
456
+ getPlatformConfig(actor: string): PlatformConfig;
457
+ parseToken(token: string, config: PlatformConfig): Record<string, string>;
458
+ formatToken(values: Record<string, any>, config: PlatformConfig): string;
459
+ }
460
+
461
+ export interface TokenFormModule {
462
+ useTokenForm(): Promise<TokenFormInstance>;
463
+ }
464
+
441
465
  // =============================================================================
442
466
  // Toolkit Entry Point
443
467
  // =============================================================================
@@ -454,7 +478,12 @@ export interface PlaywrightToolKit {
454
478
  Errors: ErrorsModule;
455
479
  Interception: InterceptionModule;
456
480
  Mutation: MutationModule;
481
+ // TokenForm is browser-only now
457
482
  Logger: LoggerModule;
483
+ $Internals: {
484
+ LOG_TEMPLATES: LogTemplate[];
485
+ stripAnsi(input: string): string;
486
+ };
458
487
  }
459
488
 
460
489
  export declare function usePlaywrightToolKit(): PlaywrightToolKit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrillex1224/playwright-toolkit",
3
- "version": "2.1.50",
3
+ "version": "2.1.51",
4
4
  "description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -9,7 +9,10 @@
9
9
  "exports": {
10
10
  ".": {
11
11
  "types": "./index.d.ts",
12
- "browser": "./dist/browser.js",
12
+ "browser": {
13
+ "types": "./browser.d.ts",
14
+ "default": "./dist/browser.js"
15
+ },
13
16
  "import": "./dist/index.js",
14
17
  "require": "./dist/index.cjs"
15
18
  }
@@ -22,6 +25,7 @@
22
25
  },
23
26
  "files": [
24
27
  "dist/",
28
+ "browser.d.ts",
25
29
  "index.d.ts",
26
30
  "README.md"
27
31
  ],