-
Notifications
You must be signed in to change notification settings - Fork 16
/
which-browser.d.ts
84 lines (79 loc) · 2.5 KB
/
which-browser.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
declare module "which-browser" {
export interface WhichBrowserDetails {
toString(): string;
getName(): string;
getVersion(): string;
name: string;
version: WhichBrowserVersion;
}
export interface WhichBrowserVersion {
value: string | number;
alias: string;
details: number;
toString(): string;
is(version: string | number): string;
is(comparison: string, version: string | number): string;
}
export interface WhichBrowserFamily {
name: string;
version: string;
getName(): string;
getVersion(): string;
toString(): string;
}
export interface WhichBrowserUsing {
name: string;
version: string;
getName(): string;
getVersion(): string;
toString(): string;
}
export interface WhichBrowserBrowser extends WhichBrowserDetails {
alias: string;
stock: boolean;
channel: string;
mode?: string;
hidden?: boolean;
family: WhichBrowserFamily;
using: WhichBrowserUsing;
isFamily(name: string): boolean;
isUsing(name: string): boolean;
}
export interface WhichBrowserOS extends WhichBrowserDetails {
family: WhichBrowserFamily;
isFamily(name: string): boolean;
}
export type WhichBrowserDeviceType = "desktop" | "mobile" | "tablet" | "gaming" | "headset" | "ereader" | "media" | "emulator" | "television" | "monitor" | "camera" | "signage" | "whiteboard" | "car" | "pos" | "bot";
export type WhichBrowserDeviceSubType = "feature" | "smart" | "console" | "portable";
export interface WhichBrowserDevice {
type: WhichBrowserDeviceType;
subtype: WhichBrowserDeviceSubType;
identified: boolean;
manufacturer: string;
model: string;
getManufacturer(): string;
getModel(): string;
toString(): string;
}
export interface WhichBrowserOptions {
detectBots?: boolean;
cache?: any;
cacheExpires?: number;
cacheCheckInterval?: number;
}
export default class WhichBrowser {
constructor(userAgentString: string | any, options?: WhichBrowserOptions);
browser: WhichBrowserBrowser;
engine: WhichBrowserDetails;
os: WhichBrowserOS;
device: WhichBrowserDevice;
toString(): string;
isType(...args: string[]): boolean;
isBrowser(name: string, comparison?: string, version?: string | number): boolean;
isOs(name: string, comparison?: string, version?: string | number): boolean;
isEngine(name: string, comparison?: string, version?: string | number): boolean;
getType(): string;
isMobile(): boolean;
isDetected(): boolean;
}
}