ua-browser 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,140 +1,140 @@
1
- export type HashOptions = Record<string, string>
2
-
3
- export type OsVersionType =
4
- | 'Android'
5
- | 'iOS'
6
- | 'Debian'
7
- | 'Windows Phone'
8
- | 'MacOS'
9
- | 'WebOS'
10
- | 'HarmonyOS'
11
- | 'Windows'
12
-
13
- export type EnvWebview = {
14
- isWebview: boolean
15
- }
16
-
17
- export type EnvPart = Record<'version' | 'osVersion' | 'platfrom' | 'languge', string>
18
-
19
- export type EnvOption = EnvPart & EnvWebview & {
20
- engine:
21
- | 'Trident'
22
- | 'Presto'
23
- | 'WebKit'
24
- | 'Gecko'
25
- | 'KHTML'
26
- | 'Blink'
27
- | 'EdgeHTML'
28
- | 'unknown'
29
- browser:
30
- | 'Safari'
31
- | 'Chrome'
32
- | 'IE'
33
- | 'Edge'
34
- | 'Firefox'
35
- | 'Firefox Focus'
36
- | 'Chromium'
37
- | 'Opera'
38
- | 'Vivaldi'
39
- | 'Yandex'
40
- | 'Arora'
41
- | 'Lunascape'
42
- | 'QupZilla'
43
- | 'Coc Coc'
44
- | 'Kindle'
45
- | 'Iceweasel'
46
- | 'Konqueror'
47
- | 'Iceape'
48
- | 'SeaMonkey'
49
- | 'Epiphany'
50
- | '360'
51
- | '360EE'
52
- | '360SE'
53
- | 'UC'
54
- | 'QQBrowser'
55
- | 'QQ'
56
- | 'Baidu'
57
- | 'Maxthon'
58
- | 'Sogou'
59
- | 'Liebao'
60
- | '2345Explorer'
61
- | '115Browser'
62
- | 'TheWorld'
63
- | 'OPPO'
64
- | 'XiaoMi'
65
- | 'Quark'
66
- | 'Qiyu'
67
- | 'Wechat'
68
- | 'WechatWork'
69
- | 'Taobao'
70
- | 'Alipay'
71
- | 'Weibo'
72
- | 'Douban'
73
- | 'Suning'
74
- | 'iQiYi'
75
- | 'DingTalk'
76
- | 'Huawei'
77
- | 'Vivo'
78
- | 'Firefox Nightly'
79
- | 'Wechat Miniapp'
80
- | 'Douyin'
81
- | 'unknown'
82
- os:
83
- | 'Windows'
84
- | 'Linux'
85
- | 'MacOS'
86
- | 'Android'
87
- | 'HarmonyOS'
88
- | 'Ubuntu'
89
- | 'FreeBSD'
90
- | 'Debian'
91
- | 'Windows Phone'
92
- | 'BlackBerry'
93
- | 'MeeGo'
94
- | 'Symbian'
95
- | 'iOS'
96
- | 'Chrome OS'
97
- | 'WebOS'
98
- | 'unknown'
99
- device:
100
- | 'Mobile'
101
- | 'Tablet'
102
- | 'Pc'
103
- }
104
-
105
- declare function uaBrowser(ua?: string): EnvOption
106
-
107
- declare namespace uaBrowser {
108
- /** 检查 `webview` 浏览环境,仅支持 `android` */
109
- function isWebview(ua: string): boolean
110
- /** 检查微信小程序 */
111
- function isWechatMiniapp(): boolean
112
- /** 浏览器语言 */
113
- function getLanguage(): string
114
- /** 当前版本 */
115
- const VERSION: string
116
- }
117
-
118
- export default uaBrowser
119
-
120
- declare global {
121
- const __wxjs_environment: string
122
-
123
- const chrome: {
124
- adblock2345: any
125
- common2345: any
126
- }
127
-
128
- const showModalDialog: any
129
-
130
- const u2f: any
131
-
132
- // Navigator
133
- interface Navigator {
134
- browserLanguage: string
135
- userAgentData: Record<string, any>
136
- connection: Record<string, any>
137
- }
138
- }
139
-
140
- export {}
1
+ export type HashOptions = Record<string, string>
2
+
3
+ export type OsVersionType =
4
+ | 'Android'
5
+ | 'iOS'
6
+ | 'Debian'
7
+ | 'Windows Phone'
8
+ | 'MacOS'
9
+ | 'WebOS'
10
+ | 'HarmonyOS'
11
+ | 'Windows'
12
+
13
+ export type EnvWebview = {
14
+ isWebview: boolean
15
+ }
16
+
17
+ export type EnvPart = Record<'version' | 'osVersion' | 'platfrom' | 'languge', string>
18
+
19
+ export type EnvOption = EnvPart & EnvWebview & {
20
+ engine:
21
+ | 'Trident'
22
+ | 'Presto'
23
+ | 'WebKit'
24
+ | 'Gecko'
25
+ | 'KHTML'
26
+ | 'Blink'
27
+ | 'EdgeHTML'
28
+ | 'unknown'
29
+ browser:
30
+ | 'Safari'
31
+ | 'Chrome'
32
+ | 'IE'
33
+ | 'Edge'
34
+ | 'Firefox'
35
+ | 'Firefox Focus'
36
+ | 'Chromium'
37
+ | 'Opera'
38
+ | 'Vivaldi'
39
+ | 'Yandex'
40
+ | 'Arora'
41
+ | 'Lunascape'
42
+ | 'QupZilla'
43
+ | 'Coc Coc'
44
+ | 'Kindle'
45
+ | 'Iceweasel'
46
+ | 'Konqueror'
47
+ | 'Iceape'
48
+ | 'SeaMonkey'
49
+ | 'Epiphany'
50
+ | '360'
51
+ | '360EE'
52
+ | '360SE'
53
+ | 'UC'
54
+ | 'QQBrowser'
55
+ | 'QQ'
56
+ | 'Baidu'
57
+ | 'Maxthon'
58
+ | 'Sogou'
59
+ | 'Liebao'
60
+ | '2345Explorer'
61
+ | '115Browser'
62
+ | 'TheWorld'
63
+ | 'OPPO'
64
+ | 'XiaoMi'
65
+ | 'Quark'
66
+ | 'Qiyu'
67
+ | 'Wechat'
68
+ | 'WechatWork'
69
+ | 'Taobao'
70
+ | 'Alipay'
71
+ | 'Weibo'
72
+ | 'Douban'
73
+ | 'Suning'
74
+ | 'iQiYi'
75
+ | 'DingTalk'
76
+ | 'Huawei'
77
+ | 'Vivo'
78
+ | 'Firefox Nightly'
79
+ | 'Wechat Miniapp'
80
+ | 'Douyin'
81
+ | 'unknown'
82
+ os:
83
+ | 'Windows'
84
+ | 'Linux'
85
+ | 'MacOS'
86
+ | 'Android'
87
+ | 'HarmonyOS'
88
+ | 'Ubuntu'
89
+ | 'FreeBSD'
90
+ | 'Debian'
91
+ | 'Windows Phone'
92
+ | 'BlackBerry'
93
+ | 'MeeGo'
94
+ | 'Symbian'
95
+ | 'iOS'
96
+ | 'Chrome OS'
97
+ | 'WebOS'
98
+ | 'unknown'
99
+ device:
100
+ | 'Mobile'
101
+ | 'Tablet'
102
+ | 'Pc'
103
+ }
104
+
105
+ declare function uaBrowser(ua?: string): EnvOption
106
+
107
+ declare namespace uaBrowser {
108
+ /** 检查 `webview` 浏览环境,仅支持 `android` */
109
+ function isWebview(ua: string): boolean
110
+ /** 检查微信小程序 */
111
+ function isWechatMiniapp(): boolean
112
+ /** 浏览器语言 */
113
+ function getLanguage(): string
114
+ /** 当前版本 */
115
+ const VERSION: string
116
+ }
117
+
118
+ export default uaBrowser
119
+
120
+ declare global {
121
+ const __wxjs_environment: string
122
+
123
+ const chrome: {
124
+ adblock2345: any
125
+ common2345: any
126
+ }
127
+
128
+ const showModalDialog: any
129
+
130
+ const u2f: any
131
+
132
+ // Navigator
133
+ interface Navigator {
134
+ browserLanguage: string
135
+ userAgentData: Record<string, any>
136
+ connection: Record<string, any>
137
+ }
138
+ }
139
+
140
+ export {}