UNPKG

974 BTypeScriptView Raw
1/**
2 * An object containing screen information.
3 */
4export interface ScreenMetrics {
5 /**
6 * Gets the absolute width of the screen in pixels.
7 */
8 widthPixels: number;
9
10 /**
11 * Gets the absolute height of the screen in pixels.
12 */
13 heightPixels: number;
14
15 /**
16 * Gets the absolute width of the screen in density independent pixels.
17 */
18 widthDIPs: number;
19
20 /**
21 * Gets the absolute height of the screen in density independent pixels.
22 */
23 heightDIPs: number;
24
25 /**
26 * The logical density of the display. This is a scaling factor for the Density Independent Pixel unit.
27 */
28 scale: number;
29
30 _updateMetrics(): void;
31}
32
33/**
34 * An object describing general information about a display.
35 */
36export class Screen {
37 /**
38 * Gets information about the main screen of the current device.
39 */
40 static mainScreen: ScreenMetrics;
41}
42
43/**
44 * An object describing general information about a display.
45 *
46 * This retains compatibility with NS6
47 */
48export const screen: Screen;