mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-19 08:50:34 +03:00
BREAKING CHANGE: AR/VR devices moved to new device type: xr
This commit is contained in:
3
src/main/ua-parser.d.ts
vendored
3
src/main/ua-parser.d.ts
vendored
@@ -23,7 +23,7 @@ declare namespace UAParser {
|
||||
}
|
||||
|
||||
interface IDevice extends IData<IDevice> {
|
||||
type?: 'mobile' | 'tablet' | 'console' | 'smarttv' | 'wearable';
|
||||
type?: 'mobile' | 'tablet' | 'console' | 'smarttv' | 'wearable' | 'xr' | 'embedded';
|
||||
vendor?: string;
|
||||
model?: string;
|
||||
}
|
||||
@@ -76,6 +76,7 @@ declare namespace UAParser {
|
||||
SMARTTV: 'smarttv';
|
||||
TABLET: 'tablet';
|
||||
WEARABLE: 'wearable';
|
||||
XR: 'xr';
|
||||
EMBEDDED: 'embedded';
|
||||
};
|
||||
static readonly ENGINE: {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
TABLET = 'tablet',
|
||||
SMARTTV = 'smarttv',
|
||||
WEARABLE = 'wearable',
|
||||
XR = 'xr',
|
||||
EMBEDDED = 'embedded',
|
||||
USER_AGENT = 'user-agent',
|
||||
UA_MAX_LENGTH = 500,
|
||||
@@ -274,7 +275,8 @@
|
||||
'mobile' : 'Mobile',
|
||||
'tablet' : ['Tablet', 'EInk'],
|
||||
'smarttv' : 'TV',
|
||||
'wearable' : ['VR', 'XR', 'Watch'],
|
||||
'wearable' : 'Watch',
|
||||
'xr' : ['VR', 'XR'],
|
||||
'?' : ['Desktop', 'Unknown'],
|
||||
'*' : undefined
|
||||
};
|
||||
@@ -711,12 +713,17 @@
|
||||
], [VENDOR, MODEL, [TYPE, WEARABLE]], [
|
||||
/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i // Apple Watch
|
||||
], [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], [
|
||||
/droid.+; (glass) \d/i // Google Glass
|
||||
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [
|
||||
/droid.+; (wt63?0{2,3})\)/i
|
||||
], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [
|
||||
|
||||
///////////////////
|
||||
// XR
|
||||
///////////////////
|
||||
|
||||
/droid.+; (glass) \d/i // Google Glass
|
||||
], [MODEL, [VENDOR, GOOGLE], [TYPE, XR]], [
|
||||
/(quest( \d| pro)?)/i // Oculus Quest
|
||||
], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [
|
||||
], [MODEL, [VENDOR, FACEBOOK], [TYPE, XR]], [
|
||||
|
||||
///////////////////
|
||||
// EMBEDDED
|
||||
|
||||
Reference in New Issue
Block a user