@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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/index.d.ts +11 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
// =============================================================================
|