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.
Files changed (154) hide show
  1. package/dist/native.cjs +1 -1
  2. package/dist/native.min.cjs +1 -1
  3. package/dist/native.min.mjs +1 -1
  4. package/dist/native.mjs +1 -1
  5. package/dist/native.umd.js +1 -1
  6. package/dist/native.umd.min.js +1 -1
  7. package/dist/plugin/app/index.cjs +124 -6
  8. package/dist/plugin/app/index.min.cjs +1 -1
  9. package/dist/plugin/app/index.min.mjs +1 -1
  10. package/dist/plugin/app/index.mjs +124 -6
  11. package/dist/plugin/app/index.umd.js +124 -6
  12. package/dist/plugin/app/index.umd.min.js +1 -1
  13. package/dist/plugin/app/src/plugin/appearance/types/appearance.d.ts +1 -1
  14. package/dist/plugin/app/src/plugin/clipboard/types/appearance.d.ts +13 -0
  15. package/dist/plugin/app/src/plugin/dimension/cores/index.d.ts +3 -0
  16. package/dist/plugin/app/src/plugin/dimension/index.d.ts +4 -0
  17. package/dist/plugin/app/src/plugin/dimension/types/dimension.d.ts +8 -0
  18. package/dist/plugin/app/src/plugin/dimension/types/index.d.ts +13 -0
  19. package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +5 -0
  20. package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +7 -2
  21. package/dist/plugin/appearance/index.cjs +147 -51
  22. package/dist/plugin/appearance/index.d.ts +1 -1
  23. package/dist/plugin/appearance/index.min.cjs +1 -1
  24. package/dist/plugin/appearance/index.min.mjs +1 -1
  25. package/dist/plugin/appearance/index.mjs +147 -51
  26. package/dist/plugin/appearance/index.umd.js +147 -51
  27. package/dist/plugin/appearance/index.umd.min.js +1 -1
  28. package/dist/plugin/appearance/src/plugin/appearance/types/appearance.d.ts +1 -1
  29. package/dist/plugin/appearance/src/plugin/clipboard/types/appearance.d.ts +13 -0
  30. package/dist/plugin/appearance/src/plugin/dimension/cores/index.d.ts +3 -0
  31. package/dist/plugin/appearance/src/plugin/dimension/index.d.ts +4 -0
  32. package/dist/plugin/appearance/src/plugin/dimension/types/dimension.d.ts +8 -0
  33. package/dist/plugin/appearance/src/plugin/dimension/types/index.d.ts +13 -0
  34. package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +5 -0
  35. package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +7 -2
  36. package/dist/plugin/clipboard/index.cjs +124 -6
  37. package/dist/plugin/clipboard/index.min.cjs +1 -1
  38. package/dist/plugin/clipboard/index.min.mjs +1 -1
  39. package/dist/plugin/clipboard/index.mjs +124 -6
  40. package/dist/plugin/clipboard/index.umd.js +124 -6
  41. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  42. package/dist/plugin/clipboard/src/plugin/appearance/types/appearance.d.ts +1 -1
  43. package/dist/plugin/clipboard/src/plugin/clipboard/types/appearance.d.ts +13 -0
  44. package/dist/plugin/clipboard/src/plugin/dimension/cores/index.d.ts +3 -0
  45. package/dist/plugin/clipboard/src/plugin/dimension/index.d.ts +4 -0
  46. package/dist/plugin/clipboard/src/plugin/dimension/types/dimension.d.ts +8 -0
  47. package/dist/plugin/clipboard/src/plugin/dimension/types/index.d.ts +13 -0
  48. package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +5 -0
  49. package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +7 -2
  50. package/dist/plugin/dimension/index.cjs +13 -0
  51. package/dist/plugin/dimension/index.d.ts +27 -0
  52. package/dist/plugin/dimension/index.min.cjs +1 -0
  53. package/dist/plugin/dimension/index.min.mjs +1 -0
  54. package/dist/plugin/dimension/index.mjs +11 -0
  55. package/dist/plugin/dimension/index.umd.js +19 -0
  56. package/dist/plugin/dimension/index.umd.min.js +1 -0
  57. package/dist/plugin/dimension/src/errors/plugin-not-extended-error.d.ts +2 -0
  58. package/dist/plugin/dimension/src/plugin/app/constants/index.d.ts +12 -0
  59. package/dist/plugin/dimension/src/plugin/app/cores/index.d.ts +13 -0
  60. package/dist/plugin/dimension/src/plugin/app/errors/url-open-error.d.ts +2 -0
  61. package/dist/plugin/dimension/src/plugin/app/index.d.ts +12 -0
  62. package/dist/plugin/dimension/src/plugin/app/types/app.d.ts +54 -0
  63. package/dist/plugin/dimension/src/plugin/app/types/index.d.ts +16 -0
  64. package/dist/plugin/dimension/src/plugin/appearance/constants/index.d.ts +11 -0
  65. package/dist/plugin/dimension/src/plugin/appearance/cores/index.d.ts +3 -0
  66. package/dist/plugin/dimension/src/plugin/appearance/index.d.ts +8 -0
  67. package/dist/plugin/dimension/src/plugin/appearance/types/appearance.d.ts +12 -0
  68. package/dist/plugin/dimension/src/plugin/appearance/types/index.d.ts +13 -0
  69. package/dist/plugin/dimension/src/plugin/clipboard/cores/index.d.ts +3 -0
  70. package/dist/plugin/dimension/src/plugin/clipboard/index.d.ts +5 -0
  71. package/dist/plugin/dimension/src/plugin/clipboard/types/appearance.d.ts +13 -0
  72. package/dist/plugin/dimension/src/plugin/clipboard/types/clipboard.d.ts +4 -0
  73. package/dist/plugin/dimension/src/plugin/clipboard/types/index.d.ts +11 -0
  74. package/dist/plugin/dimension/src/plugin/dimension/cores/index.d.ts +3 -0
  75. package/dist/plugin/dimension/src/plugin/dimension/index.d.ts +4 -0
  76. package/dist/plugin/dimension/src/plugin/dimension/types/dimension.d.ts +8 -0
  77. package/dist/plugin/dimension/src/plugin/dimension/types/index.d.ts +13 -0
  78. package/dist/plugin/dimension/src/plugin/fullscreen/cores/index.d.ts +35 -0
  79. package/dist/plugin/dimension/src/plugin/fullscreen/index.d.ts +5 -0
  80. package/dist/plugin/dimension/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
  81. package/dist/plugin/dimension/src/plugin/fullscreen/types/index.d.ts +11 -0
  82. package/dist/plugin/dimension/src/plugin/platform/constants/index.d.ts +42 -0
  83. package/dist/plugin/dimension/src/plugin/platform/cores/index.d.ts +45 -0
  84. package/dist/plugin/dimension/src/plugin/platform/index.d.ts +12 -0
  85. package/dist/plugin/dimension/src/plugin/platform/types/index.d.ts +11 -0
  86. package/dist/plugin/dimension/src/plugin/platform/types/platform.d.ts +43 -0
  87. package/dist/plugin/dimension/src/plugin/theme/constants/index.d.ts +2 -0
  88. package/dist/plugin/dimension/src/plugin/theme/cores/index.d.ts +3 -0
  89. package/dist/plugin/dimension/src/plugin/theme/index.d.ts +5 -0
  90. package/dist/plugin/dimension/src/plugin/theme/types/index.d.ts +11 -0
  91. package/dist/plugin/dimension/src/plugin/theme/types/theme.d.ts +4 -0
  92. package/dist/plugin/dimension/src/types/event-listener-util.d.ts +11 -0
  93. package/dist/plugin/dimension/src/types/index.d.ts +1 -0
  94. package/dist/plugin/dimension/src/types/native.d.ts +27 -0
  95. package/dist/plugin/dimension/src/utils/assign.d.ts +1 -0
  96. package/dist/plugin/dimension/src/utils/compare-version.d.ts +1 -0
  97. package/dist/plugin/dimension/src/utils/create-custom-error.d.ts +6 -0
  98. package/dist/plugin/dimension/src/utils/create-hidden-element.d.ts +1 -0
  99. package/dist/plugin/dimension/src/utils/dispatch-click-event.d.ts +1 -0
  100. package/dist/plugin/dimension/src/utils/event-listener-utils.d.ts +3 -0
  101. package/dist/plugin/dimension/src/utils/get-topmost-window.d.ts +1 -0
  102. package/dist/plugin/dimension/src/utils/is-secure-context.d.ts +1 -0
  103. package/dist/plugin/fullscreen/index.cjs +140 -19
  104. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  105. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  106. package/dist/plugin/fullscreen/index.mjs +140 -19
  107. package/dist/plugin/fullscreen/index.umd.js +140 -19
  108. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  109. package/dist/plugin/fullscreen/src/plugin/appearance/types/appearance.d.ts +1 -1
  110. package/dist/plugin/fullscreen/src/plugin/clipboard/types/appearance.d.ts +13 -0
  111. package/dist/plugin/fullscreen/src/plugin/dimension/cores/index.d.ts +3 -0
  112. package/dist/plugin/fullscreen/src/plugin/dimension/index.d.ts +4 -0
  113. package/dist/plugin/fullscreen/src/plugin/dimension/types/dimension.d.ts +8 -0
  114. package/dist/plugin/fullscreen/src/plugin/dimension/types/index.d.ts +13 -0
  115. package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +5 -0
  116. package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +7 -2
  117. package/dist/plugin/platform/index.cjs +124 -6
  118. package/dist/plugin/platform/index.d.ts +8 -3
  119. package/dist/plugin/platform/index.min.cjs +1 -1
  120. package/dist/plugin/platform/index.min.mjs +1 -1
  121. package/dist/plugin/platform/index.mjs +124 -6
  122. package/dist/plugin/platform/index.umd.js +124 -6
  123. package/dist/plugin/platform/index.umd.min.js +1 -1
  124. package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +1 -1
  125. package/dist/plugin/platform/src/plugin/clipboard/types/appearance.d.ts +13 -0
  126. package/dist/plugin/platform/src/plugin/dimension/cores/index.d.ts +3 -0
  127. package/dist/plugin/platform/src/plugin/dimension/index.d.ts +4 -0
  128. package/dist/plugin/platform/src/plugin/dimension/types/dimension.d.ts +8 -0
  129. package/dist/plugin/platform/src/plugin/dimension/types/index.d.ts +13 -0
  130. package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +5 -0
  131. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +7 -2
  132. package/dist/plugin/theme/index.cjs +124 -6
  133. package/dist/plugin/theme/index.min.cjs +1 -1
  134. package/dist/plugin/theme/index.min.mjs +1 -1
  135. package/dist/plugin/theme/index.mjs +124 -6
  136. package/dist/plugin/theme/index.umd.js +124 -6
  137. package/dist/plugin/theme/index.umd.min.js +1 -1
  138. package/dist/plugin/theme/src/plugin/appearance/types/appearance.d.ts +1 -1
  139. package/dist/plugin/theme/src/plugin/clipboard/types/appearance.d.ts +13 -0
  140. package/dist/plugin/theme/src/plugin/dimension/cores/index.d.ts +3 -0
  141. package/dist/plugin/theme/src/plugin/dimension/index.d.ts +4 -0
  142. package/dist/plugin/theme/src/plugin/dimension/types/dimension.d.ts +8 -0
  143. package/dist/plugin/theme/src/plugin/dimension/types/index.d.ts +13 -0
  144. package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +5 -0
  145. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +7 -2
  146. package/dist/src/plugin/appearance/types/appearance.d.ts +1 -1
  147. package/dist/src/plugin/clipboard/types/appearance.d.ts +13 -0
  148. package/dist/src/plugin/dimension/cores/index.d.ts +3 -0
  149. package/dist/src/plugin/dimension/index.d.ts +4 -0
  150. package/dist/src/plugin/dimension/types/dimension.d.ts +8 -0
  151. package/dist/src/plugin/dimension/types/index.d.ts +13 -0
  152. package/dist/src/plugin/platform/cores/index.d.ts +5 -0
  153. package/dist/src/plugin/platform/types/platform.d.ts +7 -2
  154. 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,3 @@
1
+ import { ClipboardInstance } from "../types";
2
+ declare const Clipboard: ClipboardInstance;
3
+ export default Clipboard;
@@ -0,0 +1,5 @@
1
+ import type { NativePlugin } from "../../types";
2
+ import type { ClipboardInstance } from "./types";
3
+ export * from "./types";
4
+ declare const NativeClipboardPlugin: NativePlugin<'Clipboard', ClipboardInstance, {}, {}>;
5
+ export default NativeClipboardPlugin;
@@ -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,4 @@
1
+ export declare interface ClipboardInstance {
2
+ copy(item: any): Promise<boolean>;
3
+ paste(): Promise<string>;
4
+ }
@@ -0,0 +1,11 @@
1
+ export * from "./clipboard";
2
+ import type { ClipboardInstance } from "./clipboard";
3
+ declare module 'native-fn' {
4
+ interface NativePlugins {
5
+ Clipboard: ClipboardInstance;
6
+ }
7
+ interface NativeConstants {
8
+ }
9
+ interface NativeErrors {
10
+ }
11
+ }
@@ -0,0 +1,3 @@
1
+ import { DimensionInstance } from "../types";
2
+ declare const Dimension: DimensionInstance;
3
+ export default Dimension;
@@ -0,0 +1,4 @@
1
+ import { NativePlugin } from "../../types";
2
+ import { DimensionInstance } from "./types";
3
+ declare const NativeDimensionPlugin: NativePlugin<'Dimension', DimensionInstance, {}, {}>;
4
+ export default NativeDimensionPlugin;
@@ -0,0 +1,8 @@
1
+ export declare interface ListenerEntry {
2
+ fn: () => any;
3
+ capture: boolean;
4
+ once: boolean;
5
+ signal?: AbortSignal;
6
+ }
7
+ export declare interface DimensionInstance {
8
+ }
@@ -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,5 @@
1
+ import type { NativePlugin } from "../../types";
2
+ import type { FullscreenInstance } from "./types";
3
+ export * from "./types";
4
+ declare const NativeFullscreenPlugin: NativePlugin<'Fullscreen', FullscreenInstance, {}, {}>;
5
+ export default NativeFullscreenPlugin;
@@ -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,11 @@
1
+ export * from "./fullscreen";
2
+ import type { FullscreenInstance } from "./fullscreen";
3
+ declare module 'native-fn' {
4
+ interface NativePlugins {
5
+ Fullscreen: FullscreenInstance;
6
+ }
7
+ interface NativeConstants {
8
+ }
9
+ interface NativeErrors {
10
+ }
11
+ }
@@ -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,11 @@
1
+ export * from "./platform";
2
+ import type { PlatformInstance } from "./platform";
3
+ declare module 'native-fn' {
4
+ interface NativePlugins {
5
+ Platform: PlatformInstance;
6
+ }
7
+ interface NativeConstants {
8
+ }
9
+ interface NativeErrors {
10
+ }
11
+ }
@@ -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,2 @@
1
+ export declare const IS_IE_MOBILE: boolean;
2
+ export declare const IS_WINDOWS_PHONE: boolean;
@@ -0,0 +1,3 @@
1
+ import type { ThemeInstance } from "../types";
2
+ declare const Theme: ThemeInstance;
3
+ export default Theme;
@@ -0,0 +1,5 @@
1
+ import type { NativePlugin } from "../../types";
2
+ import type { ThemeInstance } from "./types";
3
+ export * from "./types";
4
+ declare const NativeThemePlugin: NativePlugin<'Theme', ThemeInstance, {}, {}>;
5
+ export default NativeThemePlugin;
@@ -0,0 +1,11 @@
1
+ export * from "./theme";
2
+ import type { ThemeInstance } from "./theme";
3
+ declare module 'native-fn' {
4
+ interface NativePlugins {
5
+ Theme: ThemeInstance;
6
+ }
7
+ interface NativeConstants {
8
+ }
9
+ interface NativeErrors {
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ export declare interface ThemeInstance {
2
+ get value(): string | undefined;
3
+ set value(color: string | undefined);
4
+ }
@@ -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,6 @@
1
+ declare global {
2
+ interface ErrorConstructor {
3
+ captureStackTrace?: (targetObject: object, constructorOpt?: Function) => void;
4
+ }
5
+ }
6
+ export default function createCustomError(name: string, Base?: ErrorConstructor): ErrorConstructor;
@@ -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,3 @@
1
+ import type { EventListenerUtil } from "../types/event-listener-util";
2
+ declare const EventListenerUtils: EventListenerUtil;
3
+ export default EventListenerUtils;
@@ -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 focusedWindow = electron.BrowserWindow.getFocusedWindow();
876
- if (focusedWindow !== null)
877
- return focusedWindow;
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 allWindows[0];
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.fullScreenable = lastElectronBrowserWindowOptions.fullScreenable;
894
- lastElectronBrowserWindow.autoHideMenuBar = lastElectronBrowserWindowOptions.autoHideMenuBar;
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 allWindows = electron.BrowserWindow.getAllWindows();
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 electron.BrowserWindow.on === 'function') {
939
- electron.BrowserWindow.on('browser-window-created', function (_, currentWindow) {
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
- return typeof electron.BrowserWindow.prototype.setFullScreen === 'function';
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 allWindows = electron.BrowserWindow.getAllWindows();
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()))