docs: typos and minor documentation issues (#8211)

This commit is contained in:
Alex Rudenko 2022-04-08 11:58:55 +02:00 committed by GitHub
parent 04e5c88997
commit ed4afe81a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 27 deletions

View File

@ -51,8 +51,7 @@ npm i puppeteer-core
# or "yarn add puppeteer-core" # or "yarn add puppeteer-core"
``` ```
`puppeteer-core` is intended to be a lightweight version of Puppeteer for launching an existing browser installation or for connecting to a remote one. Be sure that the version of puppeteer-core you install is compatible with the `puppeteer-core` is intended to be a lightweight version of Puppeteer for launching an existing browser installation or for connecting to a remote one. Be sure that the version of puppeteer-core you install is compatible with the browser you intend to connect to.
browser you intend to connect to.
See [puppeteer vs puppeteer-core](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#puppeteer-vs-puppeteer-core). See [puppeteer vs puppeteer-core](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#puppeteer-vs-puppeteer-core).

View File

@ -2316,7 +2316,7 @@ This setting will change the default maximum time for the following methods and
- `enabled` <[boolean]> - `enabled` <[boolean]>
- returns: <[Promise]> - returns: <[Promise]>
Enables the Input.drag methods. This provides the capability to cpature drag events emitted on the page, which can then be used to simulate drag-and-drop. Enables the Input.drag methods. This provides the capability to capture drag events emitted on the page, which can then be used to simulate drag-and-drop.
#### page.setExtraHTTPHeaders(headers) #### page.setExtraHTTPHeaders(headers)

View File

@ -24,6 +24,19 @@ export interface PDFMargin {
right?: string | number; right?: string | number;
} }
type LowerCasePaperFormat =
| 'letter'
| 'legal'
| 'tabloid'
| 'ledger'
| 'a0'
| 'a1'
| 'a2'
| 'a3'
| 'a4'
| 'a5'
| 'a6';
/** /**
* All the valid paper format types when printing a PDF. * All the valid paper format types when printing a PDF.
* *
@ -55,17 +68,9 @@ export interface PDFMargin {
* @public * @public
*/ */
export type PaperFormat = export type PaperFormat =
| 'letter' | Uppercase<LowerCasePaperFormat>
| 'legal' | Capitalize<LowerCasePaperFormat>
| 'tabloid' | LowerCasePaperFormat;
| 'ledger'
| 'a0'
| 'a1'
| 'a2'
| 'a3'
| 'a4'
| 'a5'
| 'a6';
/** /**
* Valid options to configure PDF generation via {@link Page.pdf}. * Valid options to configure PDF generation via {@link Page.pdf}.
@ -174,7 +179,8 @@ export interface PaperFormatDimensions {
/** /**
* @internal * @internal
*/ */
export const paperFormats: Record<PaperFormat, PaperFormatDimensions> = { export const paperFormats: Record<LowerCasePaperFormat, PaperFormatDimensions> =
{
letter: { width: 8.5, height: 11 }, letter: { width: 8.5, height: 11 },
legal: { width: 8.5, height: 14 }, legal: { width: 8.5, height: 14 },
tabloid: { width: 11, height: 17 }, tabloid: { width: 11, height: 17 },
@ -186,4 +192,4 @@ export const paperFormats: Record<PaperFormat, PaperFormatDimensions> = {
a4: { width: 8.27, height: 11.7 }, a4: { width: 8.27, height: 11.7 },
a5: { width: 5.83, height: 8.27 }, a5: { width: 5.83, height: 8.27 },
a6: { width: 4.13, height: 5.83 }, a6: { width: 4.13, height: 5.83 },
} as const; } as const;