mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: internal lazy params (#8982)
This commit is contained in:
parent
7d6927209e
commit
d5045976a6
@ -8,7 +8,7 @@ sidebar_label: InnerParams
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
export declare type InnerParams<T extends unknown[]> = {
|
export declare type InnerParams<T extends unknown[]> = {
|
||||||
[K in keyof T]: FlattenHandle<FlattenLazyArg<FlattenHandle<T[K]>>>;
|
[K in keyof T]: FlattenHandle<T[K]>;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import {JSHandle} from './JSHandle.js';
|
|||||||
import {LazyArg} from './LazyArg.js';
|
import {LazyArg} from './LazyArg.js';
|
||||||
import {LifecycleWatcher, PuppeteerLifeCycleEvent} from './LifecycleWatcher.js';
|
import {LifecycleWatcher, PuppeteerLifeCycleEvent} from './LifecycleWatcher.js';
|
||||||
import {TimeoutSettings} from './TimeoutSettings.js';
|
import {TimeoutSettings} from './TimeoutSettings.js';
|
||||||
import {EvaluateFunc, HandleFor, NodeFor} from './types.js';
|
import {EvaluateFunc, HandleFor, InnerLazyParams, NodeFor} from './types.js';
|
||||||
import {createJSHandle, debugError, pageBindingInitString} from './util.js';
|
import {createJSHandle, debugError, pageBindingInitString} from './util.js';
|
||||||
import {TaskManager, WaitTask} from './WaitTask.js';
|
import {TaskManager, WaitTask} from './WaitTask.js';
|
||||||
|
|
||||||
@ -559,7 +559,9 @@ export class IsolatedWorld {
|
|||||||
|
|
||||||
waitForFunction<
|
waitForFunction<
|
||||||
Params extends unknown[],
|
Params extends unknown[],
|
||||||
Func extends EvaluateFunc<Params> = EvaluateFunc<Params>
|
Func extends EvaluateFunc<InnerLazyParams<Params>> = EvaluateFunc<
|
||||||
|
InnerLazyParams<Params>
|
||||||
|
>
|
||||||
>(
|
>(
|
||||||
pageFunction: Func | string,
|
pageFunction: Func | string,
|
||||||
options: {
|
options: {
|
||||||
|
@ -43,11 +43,18 @@ export type FlattenHandle<T> = T extends HandleOr<infer U> ? U : never;
|
|||||||
*/
|
*/
|
||||||
export type FlattenLazyArg<T> = T extends LazyArg<infer U> ? U : T;
|
export type FlattenLazyArg<T> = T extends LazyArg<infer U> ? U : T;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
export type InnerLazyParams<T extends unknown[]> = {
|
||||||
|
[K in keyof T]: FlattenLazyArg<T[K]>;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
export type InnerParams<T extends unknown[]> = {
|
export type InnerParams<T extends unknown[]> = {
|
||||||
[K in keyof T]: FlattenHandle<FlattenLazyArg<FlattenHandle<T[K]>>>;
|
[K in keyof T]: FlattenHandle<T[K]>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user