-
Notifications
You must be signed in to change notification settings - Fork 22
/
client-hints.d.ts
59 lines (50 loc) · 1.16 KB
/
client-hints.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
export default class ClientHints {
static getHeaderClientHints(): JSONObject;
static isSupport(headers: JSONObject): boolean;
parse(hints: JSONObject, meta: JSONObject): ResultClientHints;
}
export interface ResultMetaClientHints {
width?: string;
height?: string;
gpu?: string;
gamut?: string;
ram?: string;
colorDepth?: string;
cpuCores?: number;
}
export interface ResultPrefersClientHints {
colorScheme: string;
}
export interface ResultClientPropClientHints {
brands: string[];
version: string;
}
export interface ResultOsPropClientHints {
name: string;
platform: string;
bitness: string;
version: string;
}
export interface ResultDevicePropClientHints {
model: string;
}
export interface ResultClientHints {
upgradeHeader: boolean;
formFactors?: string[];
meta?: ResultMetaClientHints;
prefers?: ResultPrefersClientHints;
os: ResultOsPropClientHints;
client: ResultClientPropClientHints;
device: ResultDevicePropClientHints;
}
export type JSONValue =
| string
| number
| boolean
| JSONObject
| JSONArray
| null;
export interface JSONObject {
[k: string]: JSONValue;
}
export type JSONArray = Array<JSONValue>;