native-fn 1.0.71 → 1.0.72
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/native.cjs +2 -507
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +2 -507
- package/dist/native.umd.js +2 -507
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +435 -423
- package/dist/plugin/app/index.d.ts +8 -33
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +435 -423
- package/dist/plugin/app/index.umd.js +435 -423
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/app/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/app/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/app/src/plugin/platform/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/platform/types/index.d.ts +5 -1
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/app/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/app/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/appearance/index.cjs +30 -16
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +30 -16
- package/dist/plugin/appearance/index.umd.js +30 -16
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/appearance/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/appearance/src/plugin/platform/index.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/platform/types/index.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +18 -0
- package/dist/plugin/appearance/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/appearance/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/appearance/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/camera/index.cjs +118 -109
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +118 -109
- package/dist/plugin/camera/index.umd.js +118 -109
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/camera/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/camera/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/camera/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/camera/src/plugin/platform/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/platform/types/index.d.ts +5 -1
- package/dist/plugin/camera/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/camera/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/camera/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/camera/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/clipboard/index.cjs +226 -212
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +226 -212
- package/dist/plugin/clipboard/index.umd.js +226 -212
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/clipboard/src/plugin/platform/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/platform/types/index.d.ts +5 -1
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/clipboard/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/clipboard/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/fullscreen/index.cjs +34 -20
- package/dist/plugin/fullscreen/index.d.ts +4 -13
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +34 -20
- package/dist/plugin/fullscreen/index.umd.js +34 -20
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/fullscreen/src/plugin/platform/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/platform/types/index.d.ts +5 -1
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/fullscreen/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/fullscreen/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/platform/index.cjs +355 -109
- package/dist/plugin/platform/index.d.ts +15 -20
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +355 -109
- package/dist/plugin/platform/index.umd.js +355 -109
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/platform/src/plugin/app/cores/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/app/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/app/types/app.d.ts +11 -2
- package/dist/plugin/platform/src/plugin/app/types/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +12 -0
- package/dist/plugin/platform/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/camera/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +5 -5
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/platform/src/plugin/platform/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +5 -1
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/platform/src/plugin/theme/constants/index.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -21
- package/dist/plugin/platform/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/plugin/theme/index.cjs +63 -906
- package/dist/plugin/theme/index.d.ts +4 -87
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +63 -906
- package/dist/plugin/theme/index.umd.js +63 -906
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/theme/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/theme/src/plugin/platform/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +5 -1
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/theme/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/theme/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/src/plugin/app/types/app.d.ts +1 -1
- package/dist/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/src/plugin/platform/index.d.ts +2 -2
- package/dist/src/plugin/platform/types/index.d.ts +5 -1
- package/dist/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/src/plugin/theme/index.d.ts +1 -13
- package/dist/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/src/plugin/theme/types/theme.d.ts +2 -22
- package/package.json +1 -1
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import type { NativePlugin } from "../../types";
|
|
2
2
|
import type { ThemeInstance } from "./types";
|
|
3
|
-
import { Appearances } from "./constants";
|
|
4
|
-
import { EasingError, UnsupportedEasingFunctionError, StepSyntaxError, LinearSyntaxError, CubicBezierSyntaxError } from "./errors/easing-error";
|
|
5
|
-
import { UnsupportedColorError } from "./errors/unsupported-color-error";
|
|
6
3
|
export * from "./types";
|
|
7
|
-
declare const NativeThemePlugin: NativePlugin<'Theme', ThemeInstance, {
|
|
8
|
-
Appearances: typeof Appearances;
|
|
9
|
-
}, {
|
|
10
|
-
EasingError: typeof EasingError;
|
|
11
|
-
UnsupportedEasingFunctionError: typeof UnsupportedEasingFunctionError;
|
|
12
|
-
StepSyntaxError: typeof StepSyntaxError;
|
|
13
|
-
LinearSyntaxError: typeof LinearSyntaxError;
|
|
14
|
-
CubicBezierSyntaxError: typeof CubicBezierSyntaxError;
|
|
15
|
-
UnsupportedColorError: typeof UnsupportedColorError;
|
|
16
|
-
}>;
|
|
4
|
+
declare const NativeThemePlugin: NativePlugin<'Theme', ThemeInstance, {}, {}>;
|
|
17
5
|
export default NativeThemePlugin;
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
export * from "./color";
|
|
2
|
-
export * from "./easing-syntax";
|
|
3
1
|
export * from "./theme";
|
|
4
2
|
import type { ThemeInstance } from "./theme";
|
|
5
|
-
import { Appearances } from "../constants";
|
|
6
|
-
import { UnsupportedColorError } from "../errors/unsupported-color-error";
|
|
7
|
-
import { CubicBezierSyntaxError, EasingError, LinearSyntaxError, StepSyntaxError, UnsupportedEasingFunctionError } from "../errors/easing-error";
|
|
8
3
|
declare module 'native-fn' {
|
|
9
4
|
interface NativePlugins {
|
|
10
5
|
Theme: ThemeInstance;
|
|
11
6
|
}
|
|
12
7
|
interface NativeConstants {
|
|
13
|
-
Appearances: typeof Appearances;
|
|
14
8
|
}
|
|
15
9
|
interface NativeErrors {
|
|
16
|
-
EasingError: typeof EasingError;
|
|
17
|
-
UnsupportedEasingFunctionError: typeof UnsupportedEasingFunctionError;
|
|
18
|
-
StepSyntaxError: typeof StepSyntaxError;
|
|
19
|
-
LinearSyntaxError: typeof LinearSyntaxError;
|
|
20
|
-
CubicBezierSyntaxError: typeof CubicBezierSyntaxError;
|
|
21
|
-
UnsupportedColorError: typeof UnsupportedColorError;
|
|
22
10
|
}
|
|
23
11
|
}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import { Appearances } from "../constants";
|
|
2
|
-
import type { EasingKeyword, EasingSyntax, Color } from "../types";
|
|
3
|
-
export declare interface ListenerEntry {
|
|
4
|
-
fn: (appearance: Appearances) => any;
|
|
5
|
-
capture: boolean;
|
|
6
|
-
once: boolean;
|
|
7
|
-
signal?: AbortSignal;
|
|
8
|
-
}
|
|
9
|
-
export declare type ThemeColorMetaAppearanceKeys = 'default' | 'dark' | 'light';
|
|
10
|
-
export declare type ThemeColorMetaGroup = Partial<Record<ThemeColorMetaAppearanceKeys, HTMLMetaElement>>;
|
|
11
|
-
export declare interface SetThemeColorOptions {
|
|
12
|
-
appearance?: ThemeColorMetaAppearanceKeys;
|
|
13
|
-
duration?: number;
|
|
14
|
-
easingFunction?: EasingSyntax | EasingKeyword;
|
|
15
|
-
defaultColor?: string;
|
|
16
|
-
}
|
|
17
1
|
export declare interface ThemeInstance {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
removeThemeColor(appearance?: ThemeColorMetaAppearanceKeys): void;
|
|
21
|
-
getAppearance(): Promise<Appearances>;
|
|
22
|
-
setAppearance(appearances?: Exclude<Appearances, Appearances.Unknown>): void;
|
|
23
|
-
onAppearanceChange(listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions): () => void;
|
|
2
|
+
get value(): string | undefined;
|
|
3
|
+
set value(color: string | undefined);
|
|
24
4
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var USER_AGENT = navigator.userAgent;
|
|
4
|
-
|
|
5
3
|
var OS;
|
|
6
4
|
(function (OS) {
|
|
7
5
|
OS["Unknown"] = "Unknown";
|
|
@@ -41,42 +39,55 @@ var Browsers;
|
|
|
41
39
|
Browsers["IE"] = "IE";
|
|
42
40
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
43
41
|
})(Browsers || (Browsers = {}));
|
|
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
|
-
if (typeof resolver === 'string')
|
|
75
|
-
return resolver;
|
|
76
|
-
if (string === undefined)
|
|
77
|
-
return '';
|
|
78
|
-
return string;
|
|
42
|
+
var CrossPlatformFramework;
|
|
43
|
+
(function (CrossPlatformFramework) {
|
|
44
|
+
CrossPlatformFramework["NotACrossPlatformFramework"] = "NotACrossPlatformFramework";
|
|
45
|
+
CrossPlatformFramework["ReactNative"] = "ReactNative";
|
|
46
|
+
CrossPlatformFramework["Electron"] = "Electron";
|
|
47
|
+
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
48
|
+
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
49
|
+
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
50
|
+
|
|
51
|
+
function compareVersion(lhs, rhs) {
|
|
52
|
+
var pa = lhs.split('.');
|
|
53
|
+
var pb = rhs.split('.');
|
|
54
|
+
var length = Math.max(pa.length, pb.length);
|
|
55
|
+
for (var i = 0; i < length; i++) {
|
|
56
|
+
var a = void 0;
|
|
57
|
+
var b = void 0;
|
|
58
|
+
if (i < pa.length)
|
|
59
|
+
a = parseInt(pa[i], 10);
|
|
60
|
+
else
|
|
61
|
+
a = 0;
|
|
62
|
+
if (i < pb.length)
|
|
63
|
+
b = parseInt(pb[i], 10);
|
|
64
|
+
else
|
|
65
|
+
b = 0;
|
|
66
|
+
if (a > b)
|
|
67
|
+
return 1;
|
|
68
|
+
if (a < b)
|
|
69
|
+
return -1;
|
|
70
|
+
}
|
|
71
|
+
return 0;
|
|
79
72
|
}
|
|
73
|
+
|
|
74
|
+
var Platform = {
|
|
75
|
+
device: Devices.Unknown,
|
|
76
|
+
os: OS.Unknown,
|
|
77
|
+
engine: Engines.Unknown,
|
|
78
|
+
browser: Browsers.Unknown,
|
|
79
|
+
crossPlatformFramework: CrossPlatformFramework.NotACrossPlatformFramework,
|
|
80
|
+
osVersion: '',
|
|
81
|
+
engineVersion: '',
|
|
82
|
+
browserVersion: '',
|
|
83
|
+
renderer: getRenderer(),
|
|
84
|
+
userAgent: USER_AGENT,
|
|
85
|
+
isNode: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
86
|
+
isMobile: false,
|
|
87
|
+
isDesktop: false,
|
|
88
|
+
isStandalone: false,
|
|
89
|
+
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(USER_AGENT),
|
|
90
|
+
};
|
|
80
91
|
var OS_RESOLVER_MAP = [
|
|
81
92
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
82
93
|
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -135,38 +146,247 @@ var BROWSER_RESOLVER_MAP = [
|
|
|
135
146
|
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
136
147
|
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
137
148
|
];
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
var
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
149
|
+
function resolveWindowsVersion(string) {
|
|
150
|
+
if (string === undefined)
|
|
151
|
+
return '';
|
|
152
|
+
var mapped = {
|
|
153
|
+
'4.90': 'ME',
|
|
154
|
+
'NT3.51': 'NT 3.11',
|
|
155
|
+
'NT4.0': 'NT 4.0',
|
|
156
|
+
'NT 5.0': '2000',
|
|
157
|
+
'NT 5.1': 'XP',
|
|
158
|
+
'NT 5.2': 'XP',
|
|
159
|
+
'NT 6.0': 'Vista',
|
|
160
|
+
'NT 6.1': '7',
|
|
161
|
+
'NT 6.2': '8',
|
|
162
|
+
'NT 6.3': '8.1',
|
|
163
|
+
'NT 6.4': '10',
|
|
164
|
+
'NT 10.0': '10',
|
|
165
|
+
'ARM': 'RT'
|
|
166
|
+
}[string];
|
|
167
|
+
if (mapped !== undefined)
|
|
168
|
+
return mapped;
|
|
169
|
+
return string;
|
|
170
|
+
}
|
|
171
|
+
function resolveUnderscoreVersion(string) {
|
|
172
|
+
if (string === undefined)
|
|
173
|
+
return '';
|
|
174
|
+
return string.replace(/_/g, '.');
|
|
175
|
+
}
|
|
176
|
+
function resolveSemanticWindowsVersion(version, defaultValue) {
|
|
177
|
+
if (version.major === 10 && version.minor === 0 && version.build >= 22000)
|
|
178
|
+
return '11';
|
|
179
|
+
if (version.major === 10 && version.minor === 0 && version.build < 22000)
|
|
180
|
+
return '10';
|
|
181
|
+
if (version.major === 6 && version.minor === 3)
|
|
182
|
+
return '8.1';
|
|
183
|
+
if (version.major === 6 && version.minor === 2)
|
|
184
|
+
return '8';
|
|
185
|
+
if (version.major === 6 && version.minor === 1)
|
|
186
|
+
return '7';
|
|
187
|
+
if (version.major === 6 && version.minor === 0)
|
|
188
|
+
return 'Vista';
|
|
189
|
+
if (version.major === 5 && version.minor === 1)
|
|
190
|
+
return 'XP';
|
|
191
|
+
if (version.major === 5 && version.minor === 2)
|
|
192
|
+
return 'XP';
|
|
193
|
+
if (version.major === 5 && version.minor === 0)
|
|
194
|
+
return '2000';
|
|
195
|
+
if (version.major === 4 && version.minor === 90)
|
|
196
|
+
return 'ME';
|
|
197
|
+
if (version.major === 4 && version.minor === 0)
|
|
198
|
+
return 'NT 4.0';
|
|
199
|
+
if (version.major === 3 && version.minor === 51)
|
|
200
|
+
return 'NT 3.11';
|
|
201
|
+
return defaultValue;
|
|
202
|
+
}
|
|
203
|
+
function resolveSemanticDarwinVersion(version, defaultValue) {
|
|
204
|
+
if (version.major >= 24)
|
|
205
|
+
return '' + (version.major - 9) + '.' + version.minor + '.' + version.build;
|
|
206
|
+
if (version.major === 23)
|
|
207
|
+
return '14.' + version.minor + '.' + version.build;
|
|
208
|
+
if (version.major === 22)
|
|
209
|
+
return '13.' + version.minor + '.' + version.build;
|
|
210
|
+
if (version.major === 21)
|
|
211
|
+
return '12.' + version.minor + '.' + version.build;
|
|
212
|
+
if (version.major === 20)
|
|
213
|
+
return '11.' + version.minor + '.' + version.build;
|
|
214
|
+
if (version.major === 19)
|
|
215
|
+
return '10.15.' + version.minor;
|
|
216
|
+
if (version.major === 18)
|
|
217
|
+
return '10.14.' + version.minor;
|
|
218
|
+
if (version.major === 17)
|
|
219
|
+
return '10.13.' + version.minor;
|
|
220
|
+
if (version.major === 16)
|
|
221
|
+
return '10.12.' + version.minor;
|
|
222
|
+
if (version.major === 15)
|
|
223
|
+
return '10.11.' + version.minor;
|
|
224
|
+
if (version.major === 14)
|
|
225
|
+
return '10.10.' + version.minor;
|
|
226
|
+
if (version.major === 13)
|
|
227
|
+
return '10.9.' + version.minor;
|
|
228
|
+
if (version.major >= 5 && version.major <= 12)
|
|
229
|
+
return '10.' + (version.major - 4) + '.' + version.minor;
|
|
230
|
+
return defaultValue;
|
|
231
|
+
}
|
|
232
|
+
function resolveSemanticAndroidVersion(version, defaultValue) {
|
|
233
|
+
if (version.major >= 36)
|
|
234
|
+
return '16';
|
|
235
|
+
if (version.major === 35)
|
|
236
|
+
return '15';
|
|
237
|
+
if (version.major === 34)
|
|
238
|
+
return '14';
|
|
239
|
+
if (version.major === 33)
|
|
240
|
+
return '13';
|
|
241
|
+
if (version.major === 32)
|
|
242
|
+
return '12.1';
|
|
243
|
+
if (version.major === 31)
|
|
244
|
+
return '12';
|
|
245
|
+
if (version.major === 30)
|
|
246
|
+
return '11';
|
|
247
|
+
if (version.major === 29)
|
|
248
|
+
return '10';
|
|
249
|
+
if (version.major === 28)
|
|
250
|
+
return '9';
|
|
251
|
+
if (version.major === 27)
|
|
252
|
+
return '8.1';
|
|
253
|
+
if (version.major === 26)
|
|
254
|
+
return '8.0';
|
|
255
|
+
if (version.major === 25)
|
|
256
|
+
return '7.1';
|
|
257
|
+
if (version.major === 24)
|
|
258
|
+
return '7.0';
|
|
259
|
+
if (version.major === 23)
|
|
260
|
+
return '6.0';
|
|
261
|
+
if (version.major === 22)
|
|
262
|
+
return '5.1';
|
|
263
|
+
if (version.major === 21)
|
|
264
|
+
return '5.0';
|
|
265
|
+
if (version.major === 20)
|
|
266
|
+
return '4.4';
|
|
267
|
+
if (version.major === 19)
|
|
268
|
+
return '4.4';
|
|
269
|
+
if (version.major === 18)
|
|
270
|
+
return '4.3';
|
|
271
|
+
if (version.major === 17)
|
|
272
|
+
return '4.2';
|
|
273
|
+
if (version.major === 16)
|
|
274
|
+
return '4.1';
|
|
275
|
+
if (version.major === 15)
|
|
276
|
+
return '4.0.3';
|
|
277
|
+
if (version.major === 14)
|
|
278
|
+
return '4.0';
|
|
279
|
+
if (version.major === 13)
|
|
280
|
+
return '3.2';
|
|
281
|
+
if (version.major === 12)
|
|
282
|
+
return '3.1';
|
|
283
|
+
if (version.major === 11)
|
|
284
|
+
return '3.0';
|
|
285
|
+
if (version.major === 10)
|
|
286
|
+
return '2.3.3';
|
|
287
|
+
if (version.major === 9)
|
|
288
|
+
return '2.3';
|
|
289
|
+
if (version.major === 8)
|
|
290
|
+
return '2.2';
|
|
291
|
+
if (version.major === 7)
|
|
292
|
+
return '2.1';
|
|
293
|
+
if (version.major === 6)
|
|
294
|
+
return '2.0.1';
|
|
295
|
+
if (version.major === 5)
|
|
296
|
+
return '2.0';
|
|
297
|
+
if (version.major === 4)
|
|
298
|
+
return '1.6';
|
|
299
|
+
if (version.major === 3)
|
|
300
|
+
return '1.5';
|
|
301
|
+
if (version.major === 2)
|
|
302
|
+
return '1.1';
|
|
303
|
+
if (version.major === 1)
|
|
304
|
+
return '1.0';
|
|
305
|
+
return defaultValue;
|
|
306
|
+
}
|
|
307
|
+
function resolveVersion(string, resolver) {
|
|
308
|
+
if (typeof resolver === 'function')
|
|
309
|
+
return resolver(string);
|
|
310
|
+
if (typeof resolver === 'string')
|
|
311
|
+
return resolver;
|
|
312
|
+
if (string === undefined)
|
|
313
|
+
return '';
|
|
314
|
+
return string;
|
|
315
|
+
}
|
|
316
|
+
function normalizeBrand(entry) {
|
|
317
|
+
if (entry === null || entry === undefined)
|
|
318
|
+
return { brand: '', version: '' };
|
|
319
|
+
if (typeof entry === 'string')
|
|
320
|
+
return { brand: entry, version: '' };
|
|
321
|
+
return { brand: entry.brand, version: entry.version };
|
|
322
|
+
}
|
|
323
|
+
function getRenderer() {
|
|
324
|
+
if (typeof globalThis.document === 'undefined')
|
|
325
|
+
return '';
|
|
326
|
+
var canvas = globalThis.document.createElement('canvas');
|
|
327
|
+
if (typeof canvas.getContext !== 'function')
|
|
328
|
+
return '';
|
|
329
|
+
var context = canvas.getContext('webgl2') || canvas.getContext('experimental-webgl') || canvas.getContext('webgl');
|
|
330
|
+
if (context === null)
|
|
331
|
+
return '';
|
|
332
|
+
if (context instanceof WebGLRenderingContext || 'getParameter' in context && typeof context.getParameter === 'function') {
|
|
333
|
+
var extension = context.getExtension('WEBGL_debug_renderer_info');
|
|
334
|
+
if (extension === null)
|
|
335
|
+
return context.getParameter(context.RENDERER);
|
|
336
|
+
else
|
|
337
|
+
return context.getParameter(extension.UNMASKED_RENDERER_WEBGL);
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
return '';
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function getIsStandalone(os) {
|
|
344
|
+
if (!('matchMedia' in globalThis))
|
|
345
|
+
return false;
|
|
346
|
+
if (os === OS.iOS)
|
|
347
|
+
return 'standalone' in navigator && !!navigator.standalone;
|
|
348
|
+
return globalThis.matchMedia('(display-mode: standalone)').matches;
|
|
349
|
+
}
|
|
350
|
+
function getSemanticVersion(string) {
|
|
351
|
+
var parts = string.split('.');
|
|
352
|
+
return {
|
|
353
|
+
major: parseInt(parts[0] || '0'),
|
|
354
|
+
minor: parseInt(parts[1] || '0'),
|
|
355
|
+
build: parseInt(parts[2] || '0')
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT))) {
|
|
359
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
360
|
+
}
|
|
361
|
+
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative') {
|
|
362
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
363
|
+
}
|
|
145
364
|
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
146
365
|
var map = OS_RESOLVER_MAP[i];
|
|
147
366
|
var regexp = map[0];
|
|
148
367
|
var os = map[1];
|
|
149
368
|
var resolver = map[2];
|
|
150
|
-
var matched =
|
|
369
|
+
var matched = Platform.userAgent.match(regexp);
|
|
151
370
|
if (matched !== null) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (os === OS.iOS || os === OS.Android)
|
|
155
|
-
DEVICE_NAME = Devices.Mobile;
|
|
156
|
-
else if (os === OS.Windows || os === OS.MacOS)
|
|
157
|
-
DEVICE_NAME = Devices.Desktop;
|
|
371
|
+
Platform.os = os;
|
|
372
|
+
Platform.osVersion = resolveVersion(matched[1], resolver);
|
|
158
373
|
break;
|
|
159
374
|
}
|
|
160
375
|
}
|
|
376
|
+
if (Platform.os === OS.iOS && compareVersion(Platform.osVersion, '18.6') === 0) {
|
|
377
|
+
var version = /\) Version\/([\d.]+)/.exec(Platform.userAgent);
|
|
378
|
+
if (version !== null && parseInt(version[1].substring(0, 2), 10) >= 26)
|
|
379
|
+
Platform.osVersion = version[1];
|
|
380
|
+
}
|
|
161
381
|
for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
|
|
162
382
|
var map = ENGINE_RESOLVER_MAP[i];
|
|
163
383
|
var regexp = map[0];
|
|
164
384
|
var engine = map[1];
|
|
165
385
|
var resolver = map[2];
|
|
166
|
-
var matched =
|
|
386
|
+
var matched = Platform.userAgent.match(regexp);
|
|
167
387
|
if (matched !== null) {
|
|
168
|
-
|
|
169
|
-
|
|
388
|
+
Platform.engine = engine;
|
|
389
|
+
Platform.engineVersion = resolveVersion(matched[1], resolver);
|
|
170
390
|
break;
|
|
171
391
|
}
|
|
172
392
|
}
|
|
@@ -175,68 +395,90 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
|
175
395
|
var regexp = map[0];
|
|
176
396
|
var browser = map[1];
|
|
177
397
|
var resolver = map[2];
|
|
178
|
-
var matched =
|
|
398
|
+
var matched = Platform.userAgent.match(regexp);
|
|
179
399
|
if (matched !== null) {
|
|
180
|
-
|
|
181
|
-
|
|
400
|
+
Platform.browser = browser;
|
|
401
|
+
Platform.browserVersion = resolveVersion(matched[1], resolver);
|
|
182
402
|
break;
|
|
183
403
|
}
|
|
184
404
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
405
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
406
|
+
try {
|
|
407
|
+
var reactNative = require('react-native');
|
|
408
|
+
var platform = reactNative.Platform;
|
|
409
|
+
var os = platform.OS;
|
|
410
|
+
var release = '' + platform.Version;
|
|
411
|
+
var version = getSemanticVersion(release);
|
|
412
|
+
switch (os) {
|
|
413
|
+
case 'android':
|
|
414
|
+
Platform.os = OS.Android;
|
|
415
|
+
Platform.osVersion = resolveSemanticAndroidVersion(version, release);
|
|
416
|
+
break;
|
|
417
|
+
case 'ios':
|
|
418
|
+
Platform.os = OS.iOS;
|
|
419
|
+
Platform.osVersion = release;
|
|
420
|
+
break;
|
|
421
|
+
case 'windows':
|
|
422
|
+
Platform.os = OS.Windows;
|
|
423
|
+
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
424
|
+
break;
|
|
425
|
+
case 'macos':
|
|
426
|
+
Platform.os = OS.MacOS;
|
|
427
|
+
Platform.osVersion = release;
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
200
430
|
}
|
|
201
|
-
|
|
202
|
-
return '';
|
|
431
|
+
catch (_) {
|
|
203
432
|
}
|
|
204
|
-
})();
|
|
205
|
-
var IS_WEBVIEW = /; ?wv|applewebkit(?!.*safari)/i.test(USER_AGENT);
|
|
206
|
-
var IS_MOBILE = DEVICE_NAME === Devices.Mobile;
|
|
207
|
-
var IS_DESKTOP = DEVICE_NAME === Devices.Desktop;
|
|
208
|
-
var IS_STANDALONE = (function () {
|
|
209
|
-
if (!('matchMedia' in globalThis))
|
|
210
|
-
return false;
|
|
211
|
-
if (OS_NAME === OS.iOS)
|
|
212
|
-
return 'standalone' in navigator && !!navigator.standalone;
|
|
213
|
-
return globalThis.matchMedia('(display-mode: standalone)').matches;
|
|
214
|
-
})();
|
|
215
|
-
|
|
216
|
-
var Platform = {
|
|
217
|
-
os: OS_NAME,
|
|
218
|
-
device: DEVICE_NAME,
|
|
219
|
-
engine: ENGINE_NAME,
|
|
220
|
-
browser: BROWSER_NAME,
|
|
221
|
-
osVersion: OS_VERSION,
|
|
222
|
-
engineVersion: ENGINE_VERSION,
|
|
223
|
-
browserVersion: BROWSER_VERSION,
|
|
224
|
-
renderer: RENDERER,
|
|
225
|
-
isWebview: IS_WEBVIEW,
|
|
226
|
-
isMobile: IS_MOBILE,
|
|
227
|
-
isDesktop: IS_DESKTOP,
|
|
228
|
-
isStandalone: IS_STANDALONE,
|
|
229
|
-
};
|
|
230
|
-
function normalizeBrand(entry) {
|
|
231
|
-
if (entry === null || entry === undefined)
|
|
232
|
-
return { brand: '', version: '' };
|
|
233
|
-
if (typeof entry === 'string')
|
|
234
|
-
return { brand: entry, version: '' };
|
|
235
|
-
return { brand: entry.brand, version: entry.version };
|
|
236
433
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
434
|
+
if (Platform.isNode) {
|
|
435
|
+
try {
|
|
436
|
+
var os = require('os');
|
|
437
|
+
var platform = os.platform();
|
|
438
|
+
var release = os.release();
|
|
439
|
+
var version = getSemanticVersion(release);
|
|
440
|
+
switch (platform) {
|
|
441
|
+
case 'win32':
|
|
442
|
+
Platform.os = OS.Windows;
|
|
443
|
+
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
444
|
+
break;
|
|
445
|
+
case 'darwin':
|
|
446
|
+
Platform.os = OS.MacOS;
|
|
447
|
+
Platform.osVersion = resolveSemanticDarwinVersion(version, release);
|
|
448
|
+
break;
|
|
449
|
+
case 'android':
|
|
450
|
+
Platform.os = OS.Android;
|
|
451
|
+
Platform.osVersion = release;
|
|
452
|
+
break;
|
|
453
|
+
case 'linux':
|
|
454
|
+
if (/android/i.test(release)) {
|
|
455
|
+
Platform.os = OS.Android;
|
|
456
|
+
Platform.osVersion = release;
|
|
457
|
+
}
|
|
458
|
+
break;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
catch (_) {
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
if (typeof globalThis.document !== 'undefined') {
|
|
465
|
+
globalThis.document.addEventListener("deviceready", function () {
|
|
466
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Cordova;
|
|
467
|
+
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
468
|
+
switch (globalThis.device.platform) {
|
|
469
|
+
case 'Android':
|
|
470
|
+
Platform.os = OS.Android;
|
|
471
|
+
break;
|
|
472
|
+
case 'iOS':
|
|
473
|
+
Platform.os = OS.iOS;
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
Platform.osVersion = globalThis.device.version;
|
|
477
|
+
}
|
|
478
|
+
}, false);
|
|
479
|
+
}
|
|
480
|
+
if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
|
|
481
|
+
navigator
|
|
240
482
|
.userAgentData
|
|
241
483
|
.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
242
484
|
.then(function (result) {
|
|
@@ -259,6 +501,10 @@ if (navigatorWithUserAgentData.userAgentData !== undefined && navigatorWithUserA
|
|
|
259
501
|
}
|
|
260
502
|
});
|
|
261
503
|
}
|
|
504
|
+
Platform.device = Platform.os === OS.iOS || Platform.os === OS.Android ? Devices.Mobile : Platform.os === OS.Windows || Platform.os === OS.MacOS ? Devices.Desktop : Devices.Unknown;
|
|
505
|
+
Platform.isMobile = Platform.device === Devices.Mobile;
|
|
506
|
+
Platform.isDesktop = Platform.device === Devices.Desktop;
|
|
507
|
+
Platform.isStandalone = getIsStandalone(Platform.os);
|
|
262
508
|
|
|
263
509
|
var NativePlatformPlugin = {
|
|
264
510
|
installed: false,
|
|
@@ -6,24 +6,6 @@ declare interface NativePlugin<Key extends string, Module, Constants extends Rec
|
|
|
6
6
|
Errors: Errors;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
declare global {
|
|
10
|
-
interface Navigator {
|
|
11
|
-
userAgentData?: UserAgentData;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
interface ModernUserAgentDataBrand {
|
|
15
|
-
brand: string;
|
|
16
|
-
version: string;
|
|
17
|
-
}
|
|
18
|
-
type UserAgentDataBrand = ModernUserAgentDataBrand | string | null | undefined;
|
|
19
|
-
interface UserAgentDataValues {
|
|
20
|
-
brands?: UserAgentDataBrand[];
|
|
21
|
-
fullVersionList?: UserAgentDataBrand[];
|
|
22
|
-
platformVersion?: string | null | undefined;
|
|
23
|
-
}
|
|
24
|
-
interface UserAgentData {
|
|
25
|
-
getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
|
|
26
|
-
}
|
|
27
9
|
declare enum OS {
|
|
28
10
|
Unknown = "Unknown",
|
|
29
11
|
Android = "Android",
|
|
@@ -59,25 +41,38 @@ declare enum Browsers {
|
|
|
59
41
|
IE = "IE",
|
|
60
42
|
SamsungInternet = "SamsungInternet"
|
|
61
43
|
}
|
|
44
|
+
declare enum CrossPlatformFramework {
|
|
45
|
+
NotACrossPlatformFramework = "NotACrossPlatformFramework",
|
|
46
|
+
ReactNative = "ReactNative",
|
|
47
|
+
Electron = "Electron",
|
|
48
|
+
Cordova = "Cordova"
|
|
49
|
+
}
|
|
62
50
|
|
|
63
51
|
declare interface PlatformInstance {
|
|
64
52
|
os: OS;
|
|
65
53
|
device: Devices;
|
|
66
54
|
engine: Engines;
|
|
67
55
|
browser: Browsers;
|
|
56
|
+
crossPlatformFramework: CrossPlatformFramework;
|
|
68
57
|
osVersion: string;
|
|
69
58
|
engineVersion: string;
|
|
70
59
|
browserVersion: string;
|
|
71
60
|
renderer: string;
|
|
72
|
-
|
|
61
|
+
userAgent: string;
|
|
62
|
+
isNode: boolean;
|
|
73
63
|
isStandalone: boolean;
|
|
74
64
|
isMobile: boolean;
|
|
75
65
|
isDesktop: boolean;
|
|
66
|
+
isWebview: boolean;
|
|
76
67
|
}
|
|
77
68
|
|
|
78
69
|
declare module 'native-fn' {
|
|
79
70
|
interface NativePlugins {
|
|
80
|
-
|
|
71
|
+
Theme: PlatformInstance;
|
|
72
|
+
}
|
|
73
|
+
interface NativeConstants {
|
|
74
|
+
}
|
|
75
|
+
interface NativeErrors {
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
78
|
|