From ed4afe81a51a5969654c60c33f30eee984dde3af Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Fri, 8 Apr 2022 11:58:55 +0200 Subject: [PATCH] docs: typos and minor documentation issues (#8211) --- README.md | 3 +-- docs/api.md | 2 +- src/common/PDFOptions.ts | 54 ++++++++++++++++++++++------------------ 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index bb0596a139044..a9ad80a972ef6 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/docs/api.md b/docs/api.md index 727a26f3d8244..f1606dd1d3efb 100644 --- a/docs/api.md +++ b/docs/api.md @@ -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) diff --git a/src/common/PDFOptions.ts b/src/common/PDFOptions.ts index f05b040ab0f00..d609316048737 100644 --- a/src/common/PDFOptions.ts +++ b/src/common/PDFOptions.ts @@ -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. * @@ -55,17 +68,9 @@ export interface PDFMargin { * @public */ export type PaperFormat = - | 'letter' - | 'legal' - | 'tabloid' - | 'ledger' - | 'a0' - | 'a1' - | 'a2' - | 'a3' - | 'a4' - | 'a5' - | 'a6'; + | Uppercase + | Capitalize + | LowerCasePaperFormat; /** * Valid options to configure PDF generation via {@link Page.pdf}. @@ -174,16 +179,17 @@ export interface PaperFormatDimensions { /** * @internal */ -export const paperFormats: Record = { - 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 = + { + 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;