native-fn 1.0.73 → 1.0.75

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 (80) hide show
  1. package/dist/index.d.ts +5 -5
  2. package/dist/native.cjs +1 -1
  3. package/dist/native.min.cjs +1 -1
  4. package/dist/native.min.mjs +1 -1
  5. package/dist/native.mjs +1 -1
  6. package/dist/native.umd.js +1 -1
  7. package/dist/native.umd.min.js +1 -1
  8. package/dist/plugin/app/index.cjs +357 -178
  9. package/dist/plugin/app/index.min.cjs +1 -1
  10. package/dist/plugin/app/index.min.mjs +1 -1
  11. package/dist/plugin/app/index.mjs +357 -178
  12. package/dist/plugin/app/index.umd.js +357 -178
  13. package/dist/plugin/app/index.umd.min.js +1 -1
  14. package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +1 -1
  15. package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +12 -0
  16. package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +16 -6
  17. package/dist/plugin/app/src/types/native.d.ts +5 -5
  18. package/dist/plugin/appearance/index.cjs +346 -167
  19. package/dist/plugin/appearance/index.min.cjs +1 -1
  20. package/dist/plugin/appearance/index.min.mjs +1 -1
  21. package/dist/plugin/appearance/index.mjs +346 -167
  22. package/dist/plugin/appearance/index.umd.js +346 -167
  23. package/dist/plugin/appearance/index.umd.min.js +1 -1
  24. package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +1 -1
  25. package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +12 -0
  26. package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +16 -6
  27. package/dist/plugin/appearance/src/types/native.d.ts +5 -5
  28. package/dist/plugin/camera/index.cjs +2 -2
  29. package/dist/plugin/camera/index.min.cjs +1 -1
  30. package/dist/plugin/camera/index.min.mjs +1 -1
  31. package/dist/plugin/camera/index.mjs +2 -2
  32. package/dist/plugin/camera/index.umd.js +2 -2
  33. package/dist/plugin/camera/index.umd.min.js +1 -1
  34. package/dist/plugin/camera/src/plugin/platform/constants/index.d.ts +1 -1
  35. package/dist/plugin/clipboard/index.cjs +341 -162
  36. package/dist/plugin/clipboard/index.min.cjs +1 -1
  37. package/dist/plugin/clipboard/index.min.mjs +1 -1
  38. package/dist/plugin/clipboard/index.mjs +341 -162
  39. package/dist/plugin/clipboard/index.umd.js +341 -162
  40. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  41. package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +1 -1
  42. package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +12 -0
  43. package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +16 -6
  44. package/dist/plugin/clipboard/src/types/native.d.ts +5 -5
  45. package/dist/plugin/fullscreen/index.cjs +350 -171
  46. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  47. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  48. package/dist/plugin/fullscreen/index.mjs +350 -171
  49. package/dist/plugin/fullscreen/index.umd.js +350 -171
  50. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  51. package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +1 -1
  52. package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +12 -0
  53. package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +16 -6
  54. package/dist/plugin/fullscreen/src/types/native.d.ts +5 -5
  55. package/dist/plugin/platform/index.cjs +341 -162
  56. package/dist/plugin/platform/index.d.ts +18 -8
  57. package/dist/plugin/platform/index.min.cjs +1 -1
  58. package/dist/plugin/platform/index.min.mjs +1 -1
  59. package/dist/plugin/platform/index.mjs +341 -162
  60. package/dist/plugin/platform/index.umd.js +341 -162
  61. package/dist/plugin/platform/index.umd.min.js +1 -1
  62. package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +1 -1
  63. package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +12 -0
  64. package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +16 -6
  65. package/dist/plugin/platform/src/types/native.d.ts +5 -5
  66. package/dist/plugin/theme/index.cjs +341 -162
  67. package/dist/plugin/theme/index.min.cjs +1 -1
  68. package/dist/plugin/theme/index.min.mjs +1 -1
  69. package/dist/plugin/theme/index.mjs +341 -162
  70. package/dist/plugin/theme/index.umd.js +341 -162
  71. package/dist/plugin/theme/index.umd.min.js +1 -1
  72. package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +1 -1
  73. package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +12 -0
  74. package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +16 -6
  75. package/dist/plugin/theme/src/types/native.d.ts +5 -5
  76. package/dist/src/plugin/platform/constants/index.d.ts +1 -1
  77. package/dist/src/plugin/platform/cores/index.d.ts +12 -0
  78. package/dist/src/plugin/platform/types/platform.d.ts +16 -6
  79. package/dist/src/types/native.d.ts +5 -5
  80. package/package.json +1 -1
@@ -5,8 +5,18 @@ declare global {
5
5
  interface Navigator {
6
6
  userAgent?: string;
7
7
  userAgentData?: UserAgentData;
8
+ connection?: NavigatorConnection;
9
+ mozConnection?: NavigatorConnection;
10
+ webkitConnection?: NavigatorConnection;
8
11
  }
9
12
  }
13
+ interface NavigatorConnection {
14
+ effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
15
+ type?: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other';
16
+ downlink?: number;
17
+ rtt?: number;
18
+ saveData?: boolean;
19
+ }
10
20
  interface CordovaDevice {
11
21
  platform: string;
12
22
  version: string;
@@ -20,6 +30,8 @@ interface UserAgentDataValues {
20
30
  brands?: UserAgentDataBrand[];
21
31
  fullVersionList?: UserAgentDataBrand[];
22
32
  platformVersion?: string | null | undefined;
33
+ platform?: string | null | undefined;
34
+ mobile?: boolean;
23
35
  }
24
36
  interface UserAgentData {
25
37
  getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
@@ -1,13 +1,11 @@
1
1
  import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "../constants";
2
2
  export declare interface PlatformInstance {
3
- os: OS;
3
+ os: NameVersionPair<OS>;
4
+ engine: NameVersionPair<Engines>;
5
+ browser: NameVersionPair<Browsers>;
4
6
  device: Devices;
5
- engine: Engines;
6
- browser: Browsers;
7
7
  crossPlatformFramework: CrossPlatformFramework;
8
- osVersion: string;
9
- engineVersion: string;
10
- browserVersion: string;
8
+ network: Network;
11
9
  renderer: string;
12
10
  userAgent: string;
13
11
  isNode: boolean;
@@ -16,3 +14,15 @@ export declare interface PlatformInstance {
16
14
  isDesktop: boolean;
17
15
  isWebview: boolean;
18
16
  }
17
+ export declare interface NameVersionPair<T> {
18
+ name: T;
19
+ version: string;
20
+ }
21
+ export declare interface Network {
22
+ isOnline: boolean | null;
23
+ effectiveType: 'slow-2g' | '2g' | '3g' | '4g' | null;
24
+ type: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | null;
25
+ downlink: number | null;
26
+ rtt: number | null;
27
+ saveData: boolean | null;
28
+ }
@@ -1,9 +1,9 @@
1
1
  import { PluginNotExtendedError } from "../errors/plugin-not-extended-error";
2
- export interface NativePlugins {
2
+ export declare interface NativePlugins {
3
3
  }
4
- export interface NativeConstants extends Record<string, any> {
4
+ export declare interface NativeConstants extends Record<string, any> {
5
5
  }
6
- export interface NativeErrors extends Record<string, ErrorConstructor> {
6
+ export declare interface NativeErrors extends Record<string, ErrorConstructor> {
7
7
  PluginNotExtendedError: typeof PluginNotExtendedError;
8
8
  }
9
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>> {
@@ -13,10 +13,10 @@ export declare interface NativePlugin<Key extends string, Module, Constants exte
13
13
  Constants: Constants;
14
14
  Errors: Errors;
15
15
  }
16
- export type ExtendedNativeBase<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = NativeBase<NativePlugins & {
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
17
  [Plugin in Key]: Module;
18
18
  }, NativeConstants & Constants, NativeErrors & Errors>;
19
- export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
19
+ export declare type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
20
20
  Version: string;
21
21
  Constants: AssignedConstants;
22
22
  Errors: AssignedErrors;
@@ -34,7 +34,7 @@ export declare enum Browsers {
34
34
  SamsungInternet = "SamsungInternet"
35
35
  }
36
36
  export declare enum CrossPlatformFramework {
37
- NotACrossPlatformFramework = "NotACrossPlatformFramework",
37
+ Unknown = "Unknown",
38
38
  ReactNative = "ReactNative",
39
39
  Electron = "Electron",
40
40
  Cordova = "Cordova"
@@ -5,8 +5,18 @@ declare global {
5
5
  interface Navigator {
6
6
  userAgent?: string;
7
7
  userAgentData?: UserAgentData;
8
+ connection?: NavigatorConnection;
9
+ mozConnection?: NavigatorConnection;
10
+ webkitConnection?: NavigatorConnection;
8
11
  }
9
12
  }
13
+ interface NavigatorConnection {
14
+ effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
15
+ type?: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other';
16
+ downlink?: number;
17
+ rtt?: number;
18
+ saveData?: boolean;
19
+ }
10
20
  interface CordovaDevice {
11
21
  platform: string;
12
22
  version: string;
@@ -20,6 +30,8 @@ interface UserAgentDataValues {
20
30
  brands?: UserAgentDataBrand[];
21
31
  fullVersionList?: UserAgentDataBrand[];
22
32
  platformVersion?: string | null | undefined;
33
+ platform?: string | null | undefined;
34
+ mobile?: boolean;
23
35
  }
24
36
  interface UserAgentData {
25
37
  getHighEntropyValues?(hints: string[]): Promise<UserAgentDataValues>;
@@ -1,13 +1,11 @@
1
1
  import { Browsers, CrossPlatformFramework, Devices, Engines, OS } from "../constants";
2
2
  export declare interface PlatformInstance {
3
- os: OS;
3
+ os: NameVersionPair<OS>;
4
+ engine: NameVersionPair<Engines>;
5
+ browser: NameVersionPair<Browsers>;
4
6
  device: Devices;
5
- engine: Engines;
6
- browser: Browsers;
7
7
  crossPlatformFramework: CrossPlatformFramework;
8
- osVersion: string;
9
- engineVersion: string;
10
- browserVersion: string;
8
+ network: Network;
11
9
  renderer: string;
12
10
  userAgent: string;
13
11
  isNode: boolean;
@@ -16,3 +14,15 @@ export declare interface PlatformInstance {
16
14
  isDesktop: boolean;
17
15
  isWebview: boolean;
18
16
  }
17
+ export declare interface NameVersionPair<T> {
18
+ name: T;
19
+ version: string;
20
+ }
21
+ export declare interface Network {
22
+ isOnline: boolean | null;
23
+ effectiveType: 'slow-2g' | '2g' | '3g' | '4g' | null;
24
+ type: 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | null;
25
+ downlink: number | null;
26
+ rtt: number | null;
27
+ saveData: boolean | null;
28
+ }
@@ -1,9 +1,9 @@
1
1
  import { PluginNotExtendedError } from "../errors/plugin-not-extended-error";
2
- export interface NativePlugins {
2
+ export declare interface NativePlugins {
3
3
  }
4
- export interface NativeConstants extends Record<string, any> {
4
+ export declare interface NativeConstants extends Record<string, any> {
5
5
  }
6
- export interface NativeErrors extends Record<string, ErrorConstructor> {
6
+ export declare interface NativeErrors extends Record<string, ErrorConstructor> {
7
7
  PluginNotExtendedError: typeof PluginNotExtendedError;
8
8
  }
9
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>> {
@@ -13,10 +13,10 @@ export declare interface NativePlugin<Key extends string, Module, Constants exte
13
13
  Constants: Constants;
14
14
  Errors: Errors;
15
15
  }
16
- export type ExtendedNativeBase<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = NativeBase<NativePlugins & {
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
17
  [Plugin in Key]: Module;
18
18
  }, NativeConstants & Constants, NativeErrors & Errors>;
19
- export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
19
+ export declare type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
20
20
  Version: string;
21
21
  Constants: AssignedConstants;
22
22
  Errors: AssignedErrors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-fn",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "description": " ",
5
5
  "type": "module",
6
6