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,12 +12,7 @@ Navigates the frame to the given `url`.
class Frame {
abstract goto(
url: string,
options?: {
referer?: string;
referrerPolicy?: string;
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
}
options?: GoToOptions
): Promise<HTTPResponse | null>;
}
```
@ -25,9 +20,9 @@ class Frame {
## Parameters
| Parameter | Type | Description |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| --------- | ----------------------------------------- | --------------------------------------------------------------------------------------- |
| 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:**

View File

@ -10,22 +10,16 @@ Set the content of the frame.
```typescript
class Frame {
abstract setContent(
html: string,
options?: {
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
}
): Promise<void>;
abstract setContent(html: string, options?: WaitForOptions): Promise<void>;
}
```
## Parameters
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| --------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| 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:**

View File

@ -339,12 +339,7 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
*/
abstract goto(
url: string,
options?: {
referer?: string;
referrerPolicy?: string;
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
}
options?: GoToOptions
): 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
* what point to consider the content setting successful.
*/
abstract setContent(
html: string,
options?: {
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
}
): Promise<void>;
abstract setContent(html: string, options?: WaitForOptions): Promise<void>;
/**
* @internal