Skip to content

Commit

Permalink
docs: typos and minor documentation issues (#8211)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Apr 8, 2022
1 parent 04e5c88 commit ed4afe8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 27 deletions.
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -51,8 +51,7 @@ npm i 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
browser you intend to connect to.
`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.

See [puppeteer vs puppeteer-core](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#puppeteer-vs-puppeteer-core).

Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Expand Up @@ -2316,7 +2316,7 @@ This setting will change the default maximum time for the following methods and
- `enabled` <[boolean]>
- 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)

Expand Down
54 changes: 30 additions & 24 deletions src/common/PDFOptions.ts
Expand Up @@ -24,6 +24,19 @@ export interface PDFMargin {
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.
*
Expand Down Expand Up @@ -55,17 +68,9 @@ export interface PDFMargin {
* @public
*/
export type PaperFormat =
| 'letter'
| 'legal'
| 'tabloid'
| 'ledger'
| 'a0'
| 'a1'
| 'a2'
| 'a3'
| 'a4'
| 'a5'
| 'a6';
| Uppercase<LowerCasePaperFormat>
| Capitalize<LowerCasePaperFormat>
| LowerCasePaperFormat;

/**
* Valid options to configure PDF generation via {@link Page.pdf}.
Expand Down Expand Up @@ -174,16 +179,17 @@ export interface PaperFormatDimensions {
/**
* @internal
*/
export const paperFormats: Record<PaperFormat, PaperFormatDimensions> = {
letter: { width: 8.5, height: 11 },
legal: { width: 8.5, height: 14 },
tabloid: { width: 11, height: 17 },
ledger: { width: 17, height: 11 },
a0: { width: 33.1, height: 46.8 },
a1: { width: 23.4, height: 33.1 },
a2: { width: 16.54, height: 23.4 },
a3: { width: 11.7, height: 16.54 },
a4: { width: 8.27, height: 11.7 },
a5: { width: 5.83, height: 8.27 },
a6: { width: 4.13, height: 5.83 },
} as const;
export const paperFormats: Record<LowerCasePaperFormat, PaperFormatDimensions> =
{
letter: { width: 8.5, height: 11 },
legal: { width: 8.5, height: 14 },
tabloid: { width: 11, height: 17 },
ledger: { width: 17, height: 11 },
a0: { width: 33.1, height: 46.8 },
a1: { width: 23.4, height: 33.1 },
a2: { width: 16.54, height: 23.4 },
a3: { width: 11.7, height: 16.54 },
a4: { width: 8.27, height: 11.7 },
a5: { width: 5.83, height: 8.27 },
a6: { width: 4.13, height: 5.83 },
} as const;

0 comments on commit ed4afe8

Please sign in to comment.