@skrillex1224/playwright-toolkit 2.1.93 → 2.1.95

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
@@ -362,9 +362,19 @@ export interface SseInterceptOptions {
362
362
  overallTimeout?: number;
363
363
  }
364
364
 
365
+ /** SSE 拦截取消函数 */
366
+ export type SseCancelFunction = () => Promise<void>;
367
+
368
+ /** SSE 拦截返回结果:[Promise, 取消函数] */
369
+ export type SseInterceptResult = [Promise<any>, SseCancelFunction];
370
+
365
371
  export interface SseModule {
366
372
  parseSseStream(sseText: string): any[];
367
- intercept(page: Page, urlPattern: string | RegExp, options?: SseInterceptOptions): Promise<any>;
373
+ /**
374
+ * 拦截 SSE 流
375
+ * @returns [promise, cancel] - promise 为流数据的 Promise,cancel 为取消监听的函数
376
+ */
377
+ intercept(page: Page, urlPattern: string | RegExp, options?: SseInterceptOptions): SseInterceptResult;
368
378
  }
369
379
 
370
380
  // =============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrillex1224/playwright-toolkit",
3
- "version": "2.1.93",
3
+ "version": "2.1.95",
4
4
  "description": "一个在 Apify/Crawlee Actor 中启用实时截图视图的实用工具库。",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",