diff --git a/src/api-docs-entry.ts b/src/api-docs-entry.ts index 63d87aff081dc..2fb85cef92c89 100644 --- a/src/api-docs-entry.ts +++ b/src/api-docs-entry.ts @@ -40,6 +40,7 @@ export * from './common/Accessibility.js'; export * from './common/Browser.js'; export * from './node/BrowserFetcher.js'; export * from './node/Puppeteer.js'; +export * from './common/Coverage.js'; export * from './common/Connection.js'; export * from './common/ConsoleMessage.js'; export * from './common/Coverage.js'; @@ -51,6 +52,7 @@ export * from './common/ExecutionContext.js'; export * from './common/EventEmitter.js'; export * from './common/FileChooser.js'; export * from './common/FrameManager.js'; +export * from './common/PuppeteerViewport.js'; export * from './common/Input.js'; export * from './common/Page.js'; export * from './common/Product.js'; diff --git a/src/common/Page.ts b/src/common/Page.ts index ee8fd853b0206..e325cdee088d0 100644 --- a/src/common/Page.ts +++ b/src/common/Page.ts @@ -150,7 +150,7 @@ export interface ScreenshotClip { */ export interface ScreenshotOptions { /** - * @default 'png' + * @defaultValue 'png' */ type?: 'png' | 'jpeg'; /** @@ -162,7 +162,7 @@ export interface ScreenshotOptions { path?: string; /** * When true, takes a screenshot of the full page. - * @default false + * @defaultValue false */ fullPage?: boolean; /** @@ -175,12 +175,12 @@ export interface ScreenshotOptions { quality?: number; /** * Hides default white background and allows capturing screenshots with transparency. - * @default false + * @defaultValue false */ omitBackground?: boolean; /** * Encoding of the image. - * @default 'binary' + * @defaultValue 'binary' */ encoding?: 'base64' | 'binary'; } diff --git a/src/common/PuppeteerViewport.ts b/src/common/PuppeteerViewport.ts index f626ce8d2bcf4..48a0823b52085 100644 --- a/src/common/PuppeteerViewport.ts +++ b/src/common/PuppeteerViewport.ts @@ -13,11 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/** + * + * Sets the viewport of the page. + * @public + */ export interface Viewport { + /** + * The page width in pixels. + */ width: number; + /** + * The page height in pixels. + */ height: number; + /** + * Specify device scale factor. + * See {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio | devicePixelRatio} for more info. + * @defaultValue 1 + */ deviceScaleFactor?: number; + /** + * Whether the `meta viewport` tag is taken into account. + * @defaultValue false + */ isMobile?: boolean; + /** + * Specifies if the viewport is in landscape mode. + * @defaultValue false + */ isLandscape?: boolean; + /** + * Specify if the viewport supports touch events. + * @defaultValue false + */ hasTouch?: boolean; }