chore: use existing types (#11851)

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
This commit is contained in:
jrandolf 2024-02-06 17:42:51 +01:00 committed by GitHub
parent 6c5b9ad3b9
commit dfdd1aab38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 34 deletions

View File

@ -12,22 +12,17 @@ Navigates the frame to the given `url`.
class Frame { class Frame {
abstract goto( abstract goto(
url: string, url: string,
options?: { options?: GoToOptions
referer?: string;
referrerPolicy?: string;
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
}
): Promise<HTTPResponse | null>; ): Promise<HTTPResponse | null>;
} }
``` ```
## Parameters ## Parameters
| Parameter | Type | Description | | Parameter | Type | Description |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | --------- | ----------------------------------------- | --------------------------------------------------------------------------------------- |
| url | string | URL to navigate the frame to. The URL should include scheme, e.g. <code>https://</code> | | url | string | URL to navigate the frame to. The URL should include scheme, e.g. <code>https://</code> |
| options | &#123; referer?: string; referrerPolicy?: string; timeout?: number; waitUntil?: [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\]; &#125; | _(Optional)_ Options to configure waiting behavior. | | options | [GoToOptions](./puppeteer.gotooptions.md) | _(Optional)_ Options to configure waiting behavior. |
**Returns:** **Returns:**

View File

@ -10,22 +10,16 @@ Set the content of the frame.
```typescript ```typescript
class Frame { class Frame {
abstract setContent( abstract setContent(html: string, options?: WaitForOptions): Promise<void>;
html: string,
options?: {
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
}
): Promise<void>;
} }
``` ```
## Parameters ## Parameters
| Parameter | Type | Description | | Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | | --------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| html | string | HTML markup to assign to the page. | | html | string | HTML markup to assign to the page. |
| options | &#123; timeout?: number; waitUntil?: [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) \| [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md)\[\]; &#125; | _(Optional)_ Options to configure how long before timing out and at what point to consider the content setting successful. | | options | [WaitForOptions](./puppeteer.waitforoptions.md) | _(Optional)_ Options to configure how long before timing out and at what point to consider the content setting successful. |
**Returns:** **Returns:**

View File

@ -339,12 +339,7 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
*/ */
abstract goto( abstract goto(
url: string, url: string,
options?: { options?: GoToOptions
referer?: string;
referrerPolicy?: string;
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
}
): Promise<HTTPResponse | null>; ): Promise<HTTPResponse | null>;
/** /**
@ -749,13 +744,7 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
* @param options - Options to configure how long before timing out and at * @param options - Options to configure how long before timing out and at
* what point to consider the content setting successful. * what point to consider the content setting successful.
*/ */
abstract setContent( abstract setContent(html: string, options?: WaitForOptions): Promise<void>;
html: string,
options?: {
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
}
): Promise<void>;
/** /**
* @internal * @internal