-
Notifications
You must be signed in to change notification settings - Fork 188
/
Copy pathtypings.d.ts
97 lines (86 loc) · 1.97 KB
/
typings.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
declare module '*.css' {
const styles: Record<string, string>;
export default styles;
}
declare module '*.svg' {
const source: string;
export default source;
}
declare module '*.md' {
const source: string;
export default source;
}
declare module '*.txt' {
const source: string;
export default source;
}
declare module 'simply-uuid' {
export function generate(): string;
}
declare module 'highlight.js/lib/core.js' {
import hljs from 'highlight.js';
export default hljs;
}
declare module 'combokeys/test/lib/key-event' {
export function simulate(
charCode: number,
keyCode: number,
modifiers?: ('shift' | 'ctrl' | 'alt' | 'meta')[],
element?: Element,
repeat?: number
): void;
}
declare module 'scrollbar-width' {
export default function getScrollbarWidth(
recalculate?: boolean
): number | null;
}
declare module 'sniffr' {
enum Browser {
FIREFOX = 'firefox',
CHROME = 'chrome',
IE = 'ie',
SAFARI = 'safari',
EDGE = 'edge',
ANDROID = 'com.android.browser',
OPERA = 'opera',
OPERA_MINI = 'opera.mini',
BLACKBERRY = 'blackberry',
ICEWEASEL = 'iceweasel',
}
enum OS {
LINUX = 'linux',
MACOS = 'macos',
WINDOWS = 'windows',
IOS = 'ios',
OPENBSD = 'openbsd',
ANDROID = 'android',
FIREFOXOS = 'firefoxos',
WINDOWS_PHONE = 'windows.phone',
WINDOWS_MOBILE = 'windows.mobile',
BLACKBERRYOS = 'blackberryos',
}
enum Device {
IPAD = 'ipad',
IPHONE = 'iphone',
LUMIA = 'lumia',
HTC = 'htc',
NEXUS = 'nexus',
GALAXY_NEXUS = 'galaxy.nexus',
NOKIA = 'nokia',
GALAXY = 'galaxy',
XBOX = 'xbox',
BLACKBERRY = 'blackberry',
}
export interface SnifferProperty<T extends string> {
name: T | 'Unknown'
version: number[]
versionString: string
}
export default class Sniffer {
os: SnifferProperty<OS>;
device: SnifferProperty<Device>;
browser: SnifferProperty<Browser>;
sniff(userAgentString?: string): this
}
}