Skip to content

Commit

Permalink
chore: generate types, api.json off md rather than html (#4825)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Dec 26, 2020
1 parent 9dd982c commit 15cdfd1
Show file tree
Hide file tree
Showing 31 changed files with 1,295 additions and 1,323 deletions.
276 changes: 137 additions & 139 deletions docs-src/api-body.md

Large diffs are not rendered by default.

57 changes: 9 additions & 48 deletions docs-src/api-params.md
@@ -1,14 +1,12 @@
## navigation-wait-until

- `waitUntil` <"load"|"domcontentloaded"|"networkidle">
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
- `'load'` - consider operation to be finished when the `load` event is fired.
- `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.

When to consider operation succeeded, defaults to `load`. Events can be either:
* `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* `'load'` - consider operation to be finished when the `load` event is fired.
* `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.

## navigation-timeout

- `timeout` <[number]>

Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
Expand All @@ -19,43 +17,37 @@ The default value can be changed by using the
[`method: Page.setDefaultTimeout`]() methods.

## wait-for-timeout

- `timeout` <[number]>

maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default
value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]().

## input-timeout

- `timeout` <[number]>

Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the [`method: BrowserContext.setDefaultTimeout`]() or
[`method: Page.setDefaultTimeout`]() methods.

## input-no-wait-after

- `noWaitAfter` <[boolean]>

Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating
to inaccessible pages. Defaults to `false`.

## input-force

- `force` <[boolean]>

Whether to bypass the [actionability](./actionability.md) checks. Defaults to `false`.

## input-selector

- `selector` <[string]>

A selector to search for element. If there are multiple elements satisfying the selector, the first will be used. See
[working with selectors](#working-with-selectors) for more details.

## input-position

- `position` <[Object]>
- `x` <[number]>
- `y` <[number]>
Expand All @@ -64,57 +56,49 @@ A point to use relative to the top-left corner of element padding box. If not sp
element.

## input-modifiers

- `modifiers` <[Array]<"Alt"|"Control"|"Meta"|"Shift">>

Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
modifiers back. If not specified, currently pressed modifiers are used.

## input-button

- `button` <"left"|"right"|"middle">

Defaults to `left`.

## input-files

- `files` <[string]|[Array]<[string]>|[Object]|[Array]<[Object]>>
- `name` <[string]> [File] name **required**
- `mimeType` <[string]> [File] type **required**
- `buffer` <[Buffer]> File content **required**

## input-down-up-delay

- `delay` <[number]>

Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.

## input-click-count

- `clickCount` <[number]>

defaults to 1. See [UIEvent.detail].

## query-selector

- `selector` <[string]>

A selector to query for. See [working with selectors](#working-with-selectors) for more details.

## wait-for-selector-state

- `state` <"attached"|"detached"|"visible"|"hidden">
- `'attached'` - wait for element to be present in DOM.
- `'detached'` - wait for element to not be present in DOM.
- `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without
any content or with `display:none` has an empty bounding box and is not considered visible.
- `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.
This is opposite to the `'visible'` option.

Defaults to `'visible'`. Can be either:
* `'attached'` - wait for element to be present in DOM.
* `'detached'` - wait for element to not be present in DOM.
* `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without
any content or with `display:none` has an empty bounding box and is not considered visible.
* `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.
This is opposite to the `'visible'` option.

## context-option-storage-state

- `storageState` <[string]|[Object]>
- `cookies` <[Array]<[Object]>> Optional cookies to set for context
- `name` <[string]> **required**
Expand All @@ -136,133 +120,113 @@ Populates context with given storage state. This method can be used to initializ
obtained via [`method: BrowserContext.storageState`](). Either a path to the file with saved storage, or an object with the following fields:

## context-option-acceptdownloads

- `acceptDownloads` <[boolean]>

Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.

## context-option-ignorehttpserrors

- `ignoreHTTPSErrors` <[boolean]>

Whether to ignore HTTPS errors during navigation. Defaults to `false`.

## context-option-bypasscsp

- `bypassCSP` <[boolean]>

Toggles bypassing page's Content-Security-Policy.

## context-option-viewport

- `viewport` <[null]|[Object]>
- `width` <[number]> page width in pixels.
- `height` <[number]> page height in pixels.

Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.

## context-option-useragent

- `userAgent` <[string]>

Specific user agent to use in this context.

## context-option-devicescalefactor

- `deviceScaleFactor` <[number]>

Specify device scale factor (can be thought of as dpr). Defaults to `1`.

## context-option-ismobile

- `isMobile` <[boolean]>

Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported
in Firefox.

## context-option-hastouch

- `hasTouch` <[boolean]>

Specifies if viewport supports touch events. Defaults to false.

## context-option-javascriptenabled

- `javaScriptEnabled` <[boolean]>

Whether or not to enable JavaScript in the context. Defaults to `true`.

## context-option-timezoneid

- `timezoneId` <[string]>

Changes the timezone of the context. See [ICU’s `metaZones.txt`](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)
for a list of supported timezone IDs.

## context-option-geolocation

- `geolocation` <[Object]>
- `latitude` <[number]> Latitude between -90 and 90.
- `longitude` <[number]> Longitude between -180 and 180.
- `accuracy` <[number]> Non-negative accuracy value. Defaults to `0`.

## context-option-locale

- `locale` <[string]>

Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`
request header value as well as number and date formatting rules.

## context-option-permissions

- `permissions` <[Array]<[string]>>

A list of permissions to grant to all pages in this context. See
[`method: BrowserContext.grantPermissions`]() for more details.

## context-option-extrahttpheaders

- `extraHTTPHeaders` <[Object]<[string], [string]>>

An object containing additional HTTP headers to be sent with every request. All header values must be strings.

## context-option-offline

- `offline` <[boolean]>

Whether to emulate network being offline. Defaults to `false`.

## context-option-httpcredentials

- `httpCredentials` <[Object]>
- `username` <[string]>
- `password` <[string]>

Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).

## context-option-colorscheme

- `colorScheme` <"light"|"dark"|"no-preference">

Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
[`method: Page.emulateMedia`]() for more details. Defaults to '`light`'.

## context-option-logger

- `logger` <[Logger]>

Logger sink for Playwright logging.

## context-option-videospath

- `videosPath` <[string]>

**NOTE** Use [`param: recordVideo`]() instead, it takes precedence over `videosPath`. Enables video recording for all pages to
`videosPath` directory. If not specified, videos are not recorded. Make sure to await
[`method: BrowserContext.close`]() for videos to be saved.

## context-option-videosize

- `videoSize` <[Object]>
- `width` <[number]> Video frame width.
- `height` <[number]> Video frame height.
Expand All @@ -273,7 +237,6 @@ recorded video. Can only be used if `videosPath` is set. If not specified the si
down if necessary to fit specified size.

## context-option-recordhar

- `recordHar` <[Object]>
- `omitContent` <[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to
`false`.
Expand All @@ -284,7 +247,6 @@ specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.
saved.

## context-option-recordvideo

- `recordVideo` <[Object]>
- `dir` <[string]> Path to the directory to put videos into.
- `size` <[Object]> Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`.
Expand All @@ -297,7 +259,6 @@ Enables video recording for all pages into `recordVideo.dir` directory. If not s
sure to await [`method: BrowserContext.close`]() for videos to be saved.

## context-option-proxy

- `proxy` <[Object]>
- `server` <[string]> Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example
`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
Expand Down

0 comments on commit 15cdfd1

Please sign in to comment.