native-fn 1.0.81 → 1.0.82
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 +1 -1
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +1 -1
- package/dist/native.umd.js +1 -1
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +124 -6
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +124 -6
- package/dist/plugin/app/index.umd.js +124 -6
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/app/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/app/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/app/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/appearance/index.cjs +147 -51
- package/dist/plugin/appearance/index.d.ts +1 -1
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +147 -51
- package/dist/plugin/appearance/index.umd.js +147 -51
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/appearance/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/clipboard/index.cjs +124 -6
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +124 -6
- package/dist/plugin/clipboard/index.umd.js +124 -6
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/dimension/index.cjs +13 -0
- package/dist/plugin/dimension/index.d.ts +27 -0
- package/dist/plugin/dimension/index.min.cjs +1 -0
- package/dist/plugin/dimension/index.min.mjs +1 -0
- package/dist/plugin/dimension/index.mjs +11 -0
- package/dist/plugin/dimension/index.umd.js +19 -0
- package/dist/plugin/dimension/index.umd.min.js +1 -0
- package/dist/plugin/dimension/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/app/cores/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/app/types/app.d.ts +54 -0
- package/dist/plugin/dimension/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/dimension/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/dimension/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +45 -0
- package/dist/plugin/dimension/src/plugin/platform/index.d.ts +12 -0
- package/dist/plugin/dimension/src/plugin/platform/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +43 -0
- package/dist/plugin/dimension/src/plugin/theme/constants/index.d.ts +2 -0
- package/dist/plugin/dimension/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/dimension/src/plugin/theme/index.d.ts +5 -0
- package/dist/plugin/dimension/src/plugin/theme/types/index.d.ts +11 -0
- package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +4 -0
- package/dist/plugin/dimension/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/dimension/src/types/index.d.ts +1 -0
- package/dist/plugin/dimension/src/types/native.d.ts +27 -0
- package/dist/plugin/dimension/src/utils/assign.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/create-custom-error.d.ts +6 -0
- package/dist/plugin/dimension/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/dimension/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/dimension/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +140 -19
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +140 -19
- package/dist/plugin/fullscreen/index.umd.js +140 -19
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/platform/index.cjs +124 -6
- package/dist/plugin/platform/index.d.ts +8 -3
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +124 -6
- package/dist/plugin/platform/index.umd.js +124 -6
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/plugin/theme/index.cjs +124 -6
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +124 -6
- package/dist/plugin/theme/index.umd.js +124 -6
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/dimension/index.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +7 -2
- package/dist/src/plugin/appearance/types/appearance.d.ts +1 -1
- package/dist/src/plugin/clipboard/types/appearance.d.ts +13 -0
- package/dist/src/plugin/dimension/cores/index.d.ts +3 -0
- package/dist/src/plugin/dimension/index.d.ts +4 -0
- package/dist/src/plugin/dimension/types/dimension.d.ts +8 -0
- package/dist/src/plugin/dimension/types/index.d.ts +13 -0
- package/dist/src/plugin/platform/cores/index.d.ts +5 -0
- package/dist/src/plugin/platform/types/platform.d.ts +7 -2
- package/package.json +15 -15
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./appearance";
|
|
2
|
+
import type { AppearanceInstance } from "./appearance";
|
|
3
|
+
import { Appearances } from "../constants";
|
|
4
|
+
declare module 'native-fn' {
|
|
5
|
+
interface NativePlugins {
|
|
6
|
+
Appearance: AppearanceInstance;
|
|
7
|
+
}
|
|
8
|
+
interface NativeConstants {
|
|
9
|
+
Appearances: typeof Appearances;
|
|
10
|
+
}
|
|
11
|
+
interface NativeErrors {
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Appearances } from "../constants";
|
|
2
|
+
import { NativeModule } 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 interface AppearanceInstance extends NativeModule {
|
|
10
|
+
get value(): Appearances;
|
|
11
|
+
set value(appearances: Exclude<Appearances, Appearances.Unknown>);
|
|
12
|
+
onchange(listener: (appearance?: Appearances) => any, options?: boolean | AddEventListenerOptions): () => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DimensionInstance } from "./dimension";
|
|
2
|
+
import Dimension from "../cores";
|
|
3
|
+
export * from "./dimension";
|
|
4
|
+
declare module 'native-fn' {
|
|
5
|
+
interface NativePlugins {
|
|
6
|
+
Dimension: DimensionInstance;
|
|
7
|
+
}
|
|
8
|
+
interface NativeConstants {
|
|
9
|
+
Dimension: typeof Dimension;
|
|
10
|
+
}
|
|
11
|
+
interface NativeErrors {
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FullscreenInstance } from "../types";
|
|
2
|
+
declare const Fullscreen: FullscreenInstance;
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLVideoElement {
|
|
5
|
+
webkitEnterFullscreen?: () => void;
|
|
6
|
+
webkitExitFullscreen?: () => void;
|
|
7
|
+
webkitSupportsFullscreen?: boolean;
|
|
8
|
+
webkitDisplayingFullscreen?: boolean;
|
|
9
|
+
__fsBridged__?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface Document {
|
|
12
|
+
readonly fullscreenEnabled: boolean;
|
|
13
|
+
fullscreenElement?: Element | null;
|
|
14
|
+
exitFullscreen: () => Promise<void>;
|
|
15
|
+
readonly webkitFullscreenEnabled?: boolean;
|
|
16
|
+
webkitFullscreenElement?: Element | null;
|
|
17
|
+
webkitCurrentFullScreenElement?: Element | null;
|
|
18
|
+
webkitExitFullscreen?: () => Promise<void>;
|
|
19
|
+
webkitCancelFullScreen?: () => Promise<void>;
|
|
20
|
+
readonly mozFullScreenEnabled?: boolean;
|
|
21
|
+
mozFullScreenElement?: Element | null;
|
|
22
|
+
mozCancelFullScreen?: () => Promise<void>;
|
|
23
|
+
readonly msFullscreenEnabled?: boolean;
|
|
24
|
+
msFullscreenElement?: Element | null;
|
|
25
|
+
msExitFullscreen?: () => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
interface Element {
|
|
28
|
+
requestFullscreen: (options?: FullscreenOptions) => Promise<void>;
|
|
29
|
+
webkitRequestFullscreen?: (options?: FullscreenOptions) => Promise<void>;
|
|
30
|
+
webkitRequestFullScreen?: (options?: FullscreenOptions) => Promise<void>;
|
|
31
|
+
mozRequestFullScreen?: () => Promise<void>;
|
|
32
|
+
msRequestFullscreen?: () => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export default Fullscreen;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare interface FullscreenInstance {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
element: any;
|
|
4
|
+
isFullscreen: boolean;
|
|
5
|
+
request(target?: any, options?: FullscreenOptions): Promise<void>;
|
|
6
|
+
exit(): Promise<void>;
|
|
7
|
+
toggle(target?: any, options?: FullscreenOptions): Promise<void>;
|
|
8
|
+
onchange(handler: (event: Event) => void): () => void;
|
|
9
|
+
onerror(handler: (event: Event) => void): () => void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare enum OS {
|
|
2
|
+
Unknown = "Unknown",
|
|
3
|
+
Android = "Android",
|
|
4
|
+
iOS = "iOS",
|
|
5
|
+
Windows = "Windows",
|
|
6
|
+
MacOS = "MacOS"
|
|
7
|
+
}
|
|
8
|
+
export declare enum Devices {
|
|
9
|
+
Unknown = "Unknown",
|
|
10
|
+
Mobile = "Mobile",
|
|
11
|
+
Desktop = "Desktop"
|
|
12
|
+
}
|
|
13
|
+
export declare enum Engines {
|
|
14
|
+
Unknown = "Unknown",
|
|
15
|
+
EdgeHTML = "EdgeHTML",
|
|
16
|
+
ArkWeb = "ArkWeb",
|
|
17
|
+
Blink = "Blink",
|
|
18
|
+
Presto = "Presto",
|
|
19
|
+
WebKit = "WebKit",
|
|
20
|
+
Trident = "Trident",
|
|
21
|
+
NetFront = "NetFront",
|
|
22
|
+
KHTML = "KHTML",
|
|
23
|
+
Tasman = "Tasman",
|
|
24
|
+
Gecko = "Gecko"
|
|
25
|
+
}
|
|
26
|
+
export declare enum Browsers {
|
|
27
|
+
Unknown = "Unknown",
|
|
28
|
+
Chrome = "Chrome",
|
|
29
|
+
Safari = "Safari",
|
|
30
|
+
Edge = "Edge",
|
|
31
|
+
Firefox = "Firefox",
|
|
32
|
+
Opera = "Opera",
|
|
33
|
+
IE = "IE",
|
|
34
|
+
SamsungInternet = "SamsungInternet"
|
|
35
|
+
}
|
|
36
|
+
export declare enum CrossPlatformFramework {
|
|
37
|
+
Unknown = "Unknown",
|
|
38
|
+
ReactNative = "ReactNative",
|
|
39
|
+
Electron = "Electron",
|
|
40
|
+
Cordova = "Cordova"
|
|
41
|
+
}
|
|
42
|
+
export declare const USER_AGENT: string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { PlatformInstance } from "../types";
|
|
2
|
+
declare global {
|
|
3
|
+
var cordova: string | undefined;
|
|
4
|
+
var device: CordovaDevice | undefined;
|
|
5
|
+
interface Navigator {
|
|
6
|
+
userAgent?: string;
|
|
7
|
+
userAgentData?: UserAgentData;
|
|
8
|
+
language?: string;
|
|
9
|
+
languages?: readonly string[];
|
|
10
|
+
browserLanguage?: string;
|
|
11
|
+
systemLanguage?: string;
|
|
12
|
+
userLanguage?: string;
|
|
13
|
+
connection?: NavigatorConnection;
|
|
14
|
+
mozConnection?: NavigatorConnection;
|
|
15
|
+
webkitConnection?: NavigatorConnection;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
interface NavigatorConnection {
|
|
19
|
+
effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
|
|
20
|
+
type?: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other';
|
|
21
|
+
downlink?: number;
|
|
22
|
+
rtt?: number;
|
|
23
|
+
saveData?: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface CordovaDevice {
|
|
26
|
+
platform: string;
|
|
27
|
+
version: string;
|
|
28
|
+
}
|
|
29
|
+
interface ModernUserAgentDataBrand {
|
|
30
|
+
brand: string;
|
|
31
|
+
version: string;
|
|
32
|
+
}
|
|
33
|
+
type UserAgentDataBrand = ModernUserAgentDataBrand | string | null | undefined;
|
|
34
|
+
interface UserAgentDataValues {
|
|
35
|
+
brands?: UserAgentDataBrand[];
|
|
36
|
+
fullVersionList?: UserAgentDataBrand[];
|
|
37
|
+
platformVersion?: string | null | undefined;
|
|
38
|
+
platform?: string | null | undefined;
|
|
39
|
+
mobile?: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface UserAgentData {
|
|
42
|
+
getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
|
|
43
|
+
}
|
|
44
|
+
declare const Platform: PlatformInstance;
|
|
45
|
+
export default Platform;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NativePlugin } from "../../types";
|
|
2
|
+
import { PlatformInstance } from "./types";
|
|
3
|
+
import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "./constants";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {
|
|
6
|
+
OS: typeof OS;
|
|
7
|
+
Devices: typeof Devices;
|
|
8
|
+
Engines: typeof Engines;
|
|
9
|
+
Browsers: typeof Browsers;
|
|
10
|
+
CrossPlatformFramework: typeof CrossPlatformFramework;
|
|
11
|
+
}, {}>;
|
|
12
|
+
export default NativePlatformPlugin;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "../constants";
|
|
2
|
+
export declare interface PlatformInstance {
|
|
3
|
+
os: NameVersionPair<OS>;
|
|
4
|
+
engine: NameVersionPair<Engines>;
|
|
5
|
+
browser: NameVersionPair<Browsers>;
|
|
6
|
+
device: Devices;
|
|
7
|
+
crossPlatformFramework: CrossPlatformFramework;
|
|
8
|
+
network: Network;
|
|
9
|
+
locale: Locale;
|
|
10
|
+
dimension: Dimension;
|
|
11
|
+
renderer: string;
|
|
12
|
+
userAgent: string;
|
|
13
|
+
readyState: 'loading' | 'complete';
|
|
14
|
+
isNode: boolean;
|
|
15
|
+
isStandalone: boolean;
|
|
16
|
+
isWebview: boolean;
|
|
17
|
+
onready(callback: (platform: PlatformInstance) => void): void;
|
|
18
|
+
}
|
|
19
|
+
export declare interface NameVersionPair<T> {
|
|
20
|
+
name: T;
|
|
21
|
+
version: string;
|
|
22
|
+
}
|
|
23
|
+
export declare interface Network {
|
|
24
|
+
isOnline: boolean | null;
|
|
25
|
+
effectiveType: 'slow-2g' | '2g' | '3g' | '4g' | null;
|
|
26
|
+
type: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | null;
|
|
27
|
+
downlink: number | null;
|
|
28
|
+
rtt: number | null;
|
|
29
|
+
saveData: boolean | null;
|
|
30
|
+
}
|
|
31
|
+
export declare interface Dimension {
|
|
32
|
+
outerWidth: number;
|
|
33
|
+
outerHeight: number;
|
|
34
|
+
innerWidth: number;
|
|
35
|
+
innerHeight: number;
|
|
36
|
+
scale: number;
|
|
37
|
+
}
|
|
38
|
+
export declare interface Locale {
|
|
39
|
+
language: string;
|
|
40
|
+
languages: string[];
|
|
41
|
+
timezone: string;
|
|
42
|
+
timezoneOffset: number;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare interface EventListenerUtil {
|
|
2
|
+
useStd: boolean;
|
|
3
|
+
add<T extends EventTarget | undefined, E extends Event = Event>(target: T, eventListenerOptions: EventListenerOptions<NonNullable<T>, E>): void;
|
|
4
|
+
remove<T extends EventTarget | undefined, E extends Event = Event>(target: T, eventListenerOptions: EventListenerOptions<NonNullable<T>, E>): void;
|
|
5
|
+
withVender(target: any, type?: string): string;
|
|
6
|
+
}
|
|
7
|
+
export declare interface EventListenerOptions<T extends EventTarget = EventTarget, E extends Event = Event> {
|
|
8
|
+
type?: string | undefined;
|
|
9
|
+
callback: ((this: T, event: E) => void) | EventListenerObject | null;
|
|
10
|
+
options?: AddEventListenerOptions | boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./native";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PluginNotExtendedError } from "../errors/plugin-not-extended-error";
|
|
2
|
+
export declare interface NativePlugins {
|
|
3
|
+
}
|
|
4
|
+
export declare interface NativeConstants extends Record<string, any> {
|
|
5
|
+
}
|
|
6
|
+
export declare interface NativeErrors extends Record<string, ErrorConstructor> {
|
|
7
|
+
PluginNotExtendedError: typeof PluginNotExtendedError;
|
|
8
|
+
}
|
|
9
|
+
export declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
|
|
10
|
+
installed: boolean;
|
|
11
|
+
name: Key;
|
|
12
|
+
module: Module;
|
|
13
|
+
Constants: Constants;
|
|
14
|
+
Errors: Errors;
|
|
15
|
+
}
|
|
16
|
+
export declare type ExtendedNativeBase<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = NativeBase<NativePlugins & {
|
|
17
|
+
[Plugin in Key]: Module;
|
|
18
|
+
}, NativeConstants & Constants, NativeErrors & Errors>;
|
|
19
|
+
export declare type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
|
|
20
|
+
Version: string;
|
|
21
|
+
Constants: AssignedConstants;
|
|
22
|
+
Errors: AssignedErrors;
|
|
23
|
+
extends: <Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(this: NativeBase<Plugins, AssignedConstants, AssignedErrors>, plugin: NativePlugin<Key, Module, Constants, Errors>) => NativeBase<Plugins & {
|
|
24
|
+
[Plugin in Key]: Module;
|
|
25
|
+
}, AssignedConstants & Constants, AssignedErrors & Errors>;
|
|
26
|
+
} & NativePlugins;
|
|
27
|
+
export type NativeInstance = NativeBase<NativePlugins, NativeConstants, NativeErrors>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function assign(...args: any[]): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function compareVersion(lhs: string, rhs: string): -1 | 0 | 1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function createHiddenElement<K extends keyof HTMLElementTagNameMap>(tagName: K, focusable?: boolean): HTMLElementTagNameMap[K] | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function dispatchClickEvent(element: HTMLElement, view?: WindowProxy): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getTopmostWindow(): WindowProxy;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isSecureContext(): boolean;
|
|
@@ -86,6 +86,9 @@ var Platform = {
|
|
|
86
86
|
get network() {
|
|
87
87
|
return getNetwork();
|
|
88
88
|
},
|
|
89
|
+
get locale() {
|
|
90
|
+
return getLocale();
|
|
91
|
+
},
|
|
89
92
|
get dimension() {
|
|
90
93
|
return getDimension();
|
|
91
94
|
},
|
|
@@ -99,12 +102,6 @@ var Platform = {
|
|
|
99
102
|
get renderer() {
|
|
100
103
|
return getRenderer();
|
|
101
104
|
},
|
|
102
|
-
get isMobile() {
|
|
103
|
-
return this.device === Devices.Mobile;
|
|
104
|
-
},
|
|
105
|
-
get isDesktop() {
|
|
106
|
-
return this.device === Devices.Desktop;
|
|
107
|
-
},
|
|
108
105
|
get isWebview() {
|
|
109
106
|
return /; ?wv|applewebkit(?!.*safari)/i.test(this.userAgent);
|
|
110
107
|
},
|
|
@@ -528,6 +525,127 @@ function getNetwork() {
|
|
|
528
525
|
}
|
|
529
526
|
return network;
|
|
530
527
|
}
|
|
528
|
+
function normalizeLocale(locale) {
|
|
529
|
+
if (locale === null || locale === undefined)
|
|
530
|
+
return locale;
|
|
531
|
+
if (locale.length === 0)
|
|
532
|
+
return null;
|
|
533
|
+
locale = locale.replace(/_/g, '-');
|
|
534
|
+
if (locale === 'C' || locale === 'posix' || locale === 'POSIX')
|
|
535
|
+
return 'en-US';
|
|
536
|
+
if (locale.indexOf('.') !== -1)
|
|
537
|
+
return normalizeLocale(locale.split('.')[0]);
|
|
538
|
+
if (locale.indexOf('@') !== -1)
|
|
539
|
+
return normalizeLocale(locale.split('@')[0]);
|
|
540
|
+
var parts = locale.split('-');
|
|
541
|
+
if (parts.length === 0)
|
|
542
|
+
return null;
|
|
543
|
+
parts[0] = parts[0].toLowerCase();
|
|
544
|
+
if (parts.length > 1 && parts[1].length === 2)
|
|
545
|
+
parts[1] = parts[1].toUpperCase();
|
|
546
|
+
if (parts.length > 2 && parts[1].length === 4)
|
|
547
|
+
parts[1] = parts[1].charAt(0).toUpperCase() + parts[1].slice(1).toLowerCase();
|
|
548
|
+
return parts.join('-');
|
|
549
|
+
}
|
|
550
|
+
function getLocale() {
|
|
551
|
+
var locale = {
|
|
552
|
+
language: '',
|
|
553
|
+
languages: [],
|
|
554
|
+
timezone: '',
|
|
555
|
+
timezoneOffset: 0,
|
|
556
|
+
};
|
|
557
|
+
function addLanguages(language) {
|
|
558
|
+
for (var i = 0; i < language.length; i++)
|
|
559
|
+
addLanguage(language[i]);
|
|
560
|
+
}
|
|
561
|
+
function addLanguage(language) {
|
|
562
|
+
language = normalizeLocale(language);
|
|
563
|
+
if (typeof language === "string" && locale.languages.indexOf(language) === -1) {
|
|
564
|
+
if (locale.language.length === 0)
|
|
565
|
+
locale.language = language;
|
|
566
|
+
locale.languages.push(language);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
570
|
+
try {
|
|
571
|
+
var reactNative = require('react-native');
|
|
572
|
+
var nativeModules = reactNative.NativeModules;
|
|
573
|
+
if (typeof nativeModules.SettingsManager !== 'undefined') {
|
|
574
|
+
var settingManager = nativeModules.SettingsManager;
|
|
575
|
+
if (typeof settingManager !== 'undefined') {
|
|
576
|
+
var constant = typeof settingManager.getConstants === 'function'
|
|
577
|
+
? settingManager.getConstants()
|
|
578
|
+
: settingManager;
|
|
579
|
+
if (typeof constant !== 'undefined' && typeof constant.settings !== 'undefined') {
|
|
580
|
+
var settings = constant.settings;
|
|
581
|
+
if (typeof settings.AppleLocale === 'string')
|
|
582
|
+
addLanguage(settings.AppleLocale);
|
|
583
|
+
if (Array.isArray(settings.AppleLanguages) && settings.AppleLanguages.length > 0)
|
|
584
|
+
addLanguages(settings.AppleLanguages);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
if (typeof nativeModules.I18nManager !== 'undefined') {
|
|
589
|
+
var i18nManager = nativeModules.I18nManager;
|
|
590
|
+
if (typeof i18nManager !== 'undefined') {
|
|
591
|
+
var constant = typeof i18nManager.getConstants === 'function'
|
|
592
|
+
? i18nManager.getConstants()
|
|
593
|
+
: i18nManager;
|
|
594
|
+
if (typeof constant !== 'undefined' && typeof constant.localeIdentifier !== 'undefined')
|
|
595
|
+
addLanguage(constant.localeIdentifier);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
catch (_) {
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
603
|
+
try {
|
|
604
|
+
var electron = require('electron');
|
|
605
|
+
var app = electron.app;
|
|
606
|
+
if (typeof app.getLocale !== 'undefined')
|
|
607
|
+
addLanguage(app.getLocale());
|
|
608
|
+
if (typeof app.getSystemLocale !== 'undefined')
|
|
609
|
+
addLanguage(app.getSystemLocale());
|
|
610
|
+
if (typeof app.getPreferredSystemLanguages !== 'undefined')
|
|
611
|
+
addLanguages(app.getPreferredSystemLanguages());
|
|
612
|
+
}
|
|
613
|
+
catch (_) {
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
if (typeof Intl !== 'undefined') {
|
|
617
|
+
try {
|
|
618
|
+
addLanguage(Intl.DateTimeFormat().resolvedOptions().locale);
|
|
619
|
+
}
|
|
620
|
+
catch (_) {
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
if (typeof globalThis.navigator !== 'undefined') {
|
|
624
|
+
if (typeof globalThis.navigator.languages !== 'undefined')
|
|
625
|
+
addLanguages(globalThis.navigator.languages);
|
|
626
|
+
if (typeof globalThis.navigator.language !== 'undefined')
|
|
627
|
+
addLanguage(globalThis.navigator.language);
|
|
628
|
+
if (typeof globalThis.navigator.userLanguage !== 'undefined')
|
|
629
|
+
addLanguage(globalThis.navigator.userLanguage);
|
|
630
|
+
if (typeof globalThis.navigator.browserLanguage !== 'undefined')
|
|
631
|
+
addLanguage(globalThis.navigator.browserLanguage);
|
|
632
|
+
if (typeof globalThis.navigator.systemLanguage !== 'undefined')
|
|
633
|
+
addLanguage(globalThis.navigator.systemLanguage);
|
|
634
|
+
}
|
|
635
|
+
try {
|
|
636
|
+
if (typeof Intl !== 'undefined') {
|
|
637
|
+
locale.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
catch (_) {
|
|
641
|
+
}
|
|
642
|
+
try {
|
|
643
|
+
locale.timezoneOffset = new Date().getTimezoneOffset();
|
|
644
|
+
}
|
|
645
|
+
catch (_) {
|
|
646
|
+
}
|
|
647
|
+
return locale;
|
|
648
|
+
}
|
|
531
649
|
function getDimension() {
|
|
532
650
|
var dimension = {
|
|
533
651
|
innerWidth: -1,
|
|
@@ -872,13 +990,11 @@ function detectApi() {
|
|
|
872
990
|
function getDefaultTarget() {
|
|
873
991
|
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
874
992
|
var electron = require('electron');
|
|
875
|
-
var
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
var allWindows = electron.BrowserWindow.getAllWindows();
|
|
879
|
-
if (allWindows.length === 0)
|
|
993
|
+
var browserWindow = electron.BrowserWindow;
|
|
994
|
+
var focusedWindow = browserWindow.getFocusedWindow() || browserWindow.getAllWindows()[0];
|
|
995
|
+
if (focusedWindow === undefined)
|
|
880
996
|
throw new Error();
|
|
881
|
-
return
|
|
997
|
+
return focusedWindow;
|
|
882
998
|
}
|
|
883
999
|
if (Platform.os.name === OS.iOS) {
|
|
884
1000
|
var video = globalThis.document.querySelector('video');
|
|
@@ -890,8 +1006,10 @@ function getDefaultTarget() {
|
|
|
890
1006
|
}
|
|
891
1007
|
function restoreElectronBrowserWindowOptions() {
|
|
892
1008
|
if (lastElectronBrowserWindowOptions !== null) {
|
|
893
|
-
lastElectronBrowserWindow
|
|
894
|
-
|
|
1009
|
+
if (lastElectronBrowserWindow !== null) {
|
|
1010
|
+
lastElectronBrowserWindow.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
|
|
1011
|
+
lastElectronBrowserWindow.autoHideMenuBar = lastElectronBrowserWindowOptions.autoHideMenuBar;
|
|
1012
|
+
}
|
|
895
1013
|
lastElectronBrowserWindowOptions = null;
|
|
896
1014
|
}
|
|
897
1015
|
lastElectronBrowserWindow = null;
|
|
@@ -920,7 +1038,8 @@ function bridgeEvents() {
|
|
|
920
1038
|
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
921
1039
|
try {
|
|
922
1040
|
var electron = require('electron');
|
|
923
|
-
var
|
|
1041
|
+
var browserWindow = electron.BrowserWindow;
|
|
1042
|
+
var allWindows = browserWindow.getAllWindows();
|
|
924
1043
|
var _loop_1 = function (i) {
|
|
925
1044
|
var currentWindow = allWindows[i];
|
|
926
1045
|
currentWindow.on('enter-full-screen', function () {
|
|
@@ -935,8 +1054,8 @@ function bridgeEvents() {
|
|
|
935
1054
|
for (var i = 0; i < allWindows.length; i++) {
|
|
936
1055
|
_loop_1(i);
|
|
937
1056
|
}
|
|
938
|
-
if (typeof
|
|
939
|
-
|
|
1057
|
+
if (typeof browserWindow.on === 'function') {
|
|
1058
|
+
browserWindow.on('browser-window-created', function (_, currentWindow) {
|
|
940
1059
|
currentWindow.on('enter-full-screen', function () {
|
|
941
1060
|
lastElectronBrowserWindow = currentWindow;
|
|
942
1061
|
emitChange();
|
|
@@ -990,7 +1109,8 @@ function getEnabled() {
|
|
|
990
1109
|
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron) {
|
|
991
1110
|
try {
|
|
992
1111
|
var electron = require('electron');
|
|
993
|
-
|
|
1112
|
+
var browserWindow = electron.BrowserWindow;
|
|
1113
|
+
return typeof browserWindow.prototype.setFullScreen === 'function';
|
|
994
1114
|
}
|
|
995
1115
|
catch (_) {
|
|
996
1116
|
return false;
|
|
@@ -1018,7 +1138,8 @@ function getElement() {
|
|
|
1018
1138
|
return lastElectronBrowserWindow;
|
|
1019
1139
|
try {
|
|
1020
1140
|
var electron = require('electron');
|
|
1021
|
-
var
|
|
1141
|
+
var browserWindow = electron.BrowserWindow;
|
|
1142
|
+
var allWindows = browserWindow.getAllWindows();
|
|
1022
1143
|
for (var i = 0; i < allWindows.length; i++) {
|
|
1023
1144
|
var currentWindow = allWindows[i];
|
|
1024
1145
|
if (currentWindow.isFullScreen() || (Platform.os.name === OS.MacOS && typeof currentWindow.isSimpleFullScreen === 'function' && currentWindow.isSimpleFullScreen()))
|