docs: Document options (#10035)

Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
This commit is contained in:
Marcus Otterström 2023-04-19 10:19:50 +02:00 committed by GitHub
parent 502458979d
commit 28154eff6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 10 deletions

View File

@ -21,10 +21,10 @@ class ElementHandle {
## Parameters ## Parameters
| Parameter | Type | Description | | Parameter | Type | Description |
| --------- | ------------------------------------------------------------ | ------------ | | --------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | | | this | [ElementHandle](./puppeteer.elementhandle.md)&lt;Element&gt; | |
| options | { threshold?: number; } | _(Optional)_ | | options | { threshold?: number; } | _(Optional)_ Threshold for the intersection between 0 (no intersection) and 1 (full intersection). Defaults to 1. |
**Returns:** **Returns:**

View File

@ -23,10 +23,10 @@ class ElementHandle {
## Parameters ## Parameters
| Parameter | Type | Description | | Parameter | Type | Description |
| --------- | ------------------ | ------------ | | --------- | ------------------ | -------------------------------------------------- |
| text | string | | | text | string | |
| options | { delay: number; } | _(Optional)_ | | options | { delay: number; } | _(Optional)_ Delay in milliseconds. Defaults to 0. |
**Returns:** **Returns:**

View File

@ -201,8 +201,10 @@ To deliver to a different location, use the "deliver" option:
## Writing documentation ## Writing documentation
Documentation is generated via `npm run docs`. It is automatically published to Documentation is generated from TSDoc comments via `npm run docs`. It is automatically
our documentation site on merge and gets versioned on release. published to our documentation site on merge and gets versioned on release.
This means that you should not change the markdown in files `docs/api` manually.
## Writing TSDoc comments ## Writing TSDoc comments

View File

@ -769,6 +769,8 @@ export class ElementHandle<
* await elementHandle.type('some text'); * await elementHandle.type('some text');
* await elementHandle.press('Enter'); * await elementHandle.press('Enter');
* ``` * ```
*
* @param options - Delay in milliseconds. Defaults to 0.
*/ */
async type(text: string, options?: {delay: number}): Promise<void>; async type(text: string, options?: {delay: number}): Promise<void>;
async type(): Promise<void> { async type(): Promise<void> {
@ -852,6 +854,9 @@ export class ElementHandle<
* Resolves to true if the element is visible in the current viewport. If an * Resolves to true if the element is visible in the current viewport. If an
* element is an SVG, we check if the svg owner element is in the viewport * element is an SVG, we check if the svg owner element is in the viewport
* instead. See https://crbug.com/963246. * instead. See https://crbug.com/963246.
*
* @param options - Threshold for the intersection between 0 (no intersection) and 1
* (full intersection). Defaults to 1.
*/ */
async isIntersectingViewport( async isIntersectingViewport(
this: ElementHandle<Element>, this: ElementHandle<Element>,