mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #47822 [puppeteer] Add page.waitForTimeout by @okko
This commit is contained in:
parent
00954267f7
commit
b7dafdedb6
6
types/puppeteer/v2/index.d.ts
vendored
6
types/puppeteer/v2/index.d.ts
vendored
@ -1275,6 +1275,12 @@ export interface FrameBase extends Evalable, JSEvalable {
|
||||
xpath: string,
|
||||
options?: WaitForSelectorOptions,
|
||||
): Promise<ElementHandle>;
|
||||
|
||||
/**
|
||||
* Waits for a certain amount of time before resolving.
|
||||
* @param duration The time to wait for.
|
||||
*/
|
||||
waitForTimeout(duration: number): Promise<void>;
|
||||
}
|
||||
|
||||
export interface Frame extends FrameBase {
|
||||
|
||||
@ -512,6 +512,13 @@ puppeteer.launch().then(async browser => {
|
||||
}, 'asd');
|
||||
})();
|
||||
|
||||
// Test waitForTimeout
|
||||
(async () => {
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.waitForTimeout(1000); // $ExpectType void
|
||||
})();
|
||||
|
||||
// Permission tests
|
||||
(async () => {
|
||||
const browser = await puppeteer.launch();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user