UNPKG

1.13 kBPlain TextView Raw
1/**
2 * @license
3 * Copyright 2020 Google Inc.
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/**
8 * @public
9 */
10export interface Viewport {
11 /**
12 * The page width in CSS pixels.
13 *
14 * @remarks
15 * Setting this value to `0` will reset this value to the system default.
16 */
17 width: number;
18 /**
19 * The page height in CSS pixels.
20 *
21 * @remarks
22 * Setting this value to `0` will reset this value to the system default.
23 */
24 height: number;
25 /**
26 * Specify device scale factor.
27 * See {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio | devicePixelRatio} for more info.
28 *
29 * @remarks
30 * Setting this value to `0` will reset this value to the system default.
31 *
32 * @defaultValue `1`
33 */
34 deviceScaleFactor?: number;
35 /**
36 * Whether the `meta viewport` tag is taken into account.
37 * @defaultValue `false`
38 */
39 isMobile?: boolean;
40 /**
41 * Specifies if the viewport is in landscape mode.
42 * @defaultValue `false`
43 */
44 isLandscape?: boolean;
45 /**
46 * Specify if the viewport supports touch events.
47 * @defaultValue `false`
48 */
49 hasTouch?: boolean;
50}