native-fn 1.0.36 → 1.0.38

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 (35) hide show
  1. package/dist/index.d.ts +17 -22
  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.d.ts +13 -10
  9. package/dist/plugin/app/src/plugin/app/index.d.ts +8 -1
  10. package/dist/plugin/app/src/plugin/app/types/index.d.ts +2 -2
  11. package/dist/plugin/app/src/plugin/platform/index.d.ts +1 -1
  12. package/dist/plugin/app/src/plugin/theme/index.d.ts +13 -1
  13. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +1 -1
  14. package/dist/plugin/app/src/types/native.d.ts +15 -15
  15. package/dist/plugin/platform/index.d.ts +6 -8
  16. package/dist/plugin/platform/src/plugin/app/index.d.ts +8 -1
  17. package/dist/plugin/platform/src/plugin/app/types/index.d.ts +2 -2
  18. package/dist/plugin/platform/src/plugin/platform/index.d.ts +1 -1
  19. package/dist/plugin/platform/src/plugin/theme/index.d.ts +13 -1
  20. package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +1 -1
  21. package/dist/plugin/platform/src/types/native.d.ts +15 -15
  22. package/dist/plugin/theme/index.d.ts +16 -9
  23. package/dist/plugin/theme/src/plugin/app/index.d.ts +8 -1
  24. package/dist/plugin/theme/src/plugin/app/types/index.d.ts +2 -2
  25. package/dist/plugin/theme/src/plugin/platform/index.d.ts +1 -1
  26. package/dist/plugin/theme/src/plugin/theme/index.d.ts +13 -1
  27. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +1 -1
  28. package/dist/plugin/theme/src/types/native.d.ts +15 -15
  29. package/dist/src/plugin/app/index.d.ts +8 -1
  30. package/dist/src/plugin/app/types/index.d.ts +2 -2
  31. package/dist/src/plugin/platform/index.d.ts +1 -1
  32. package/dist/src/plugin/theme/index.d.ts +13 -1
  33. package/dist/src/plugin/theme/types/index.d.ts +1 -1
  34. package/dist/src/types/native.d.ts +15 -15
  35. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,32 +1,27 @@
1
1
  interface NativePlugins {
2
2
  }
3
- interface NativeConstants {
3
+ interface NativeConstants extends Record<string, any> {
4
4
  }
5
- interface NativeErrors {
5
+ interface NativeErrors extends Record<string, ErrorConstructor> {
6
6
  }
7
- declare interface ModuleBase {
8
- }
9
- declare interface NativePlugin<T> extends ModuleBase {
7
+ declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
10
8
  installed: boolean;
11
- name: string;
12
- module: T;
13
- Constants: Record<string, any>;
14
- Errors: Record<string, ErrorConstructor>;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
15
13
  }
16
- declare interface NativeBase extends ModuleBase {
14
+ type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
17
15
  Version: string;
18
- Constants: NativeConstants;
19
- Errors: NativeErrors;
20
- extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
21
- }
22
- type NativeInstance = NativeBase & NativePlugins;
16
+ Constants: AssignedConstants;
17
+ Errors: AssignedErrors;
18
+ 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 & {
19
+ [Plugin in Key]: Module;
20
+ }, AssignedConstants & Constants, AssignedErrors & Errors>;
21
+ } & NativePlugins;
22
+ type NativeInstance = NativeBase<NativePlugins, NativeConstants, NativeErrors>;
23
23
 
24
- declare const Native: {
25
- Version: string;
26
- Constants: {};
27
- Errors: {};
28
- extends<T>(plugin: NativePlugin<T>): NativeInstance;
29
- };
24
+ declare const Native: NativeInstance;
30
25
 
31
26
  export { Native as default };
32
- export type { ModuleBase, NativeBase, NativeConstants, NativeErrors, NativeInstance, NativePlugin, NativePlugins };
27
+ export type { NativeBase, NativeConstants, NativeErrors, NativeInstance, NativePlugin, NativePlugins };
package/dist/native.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.0.36";
3
+ var version = "1.0.38";
4
4
  var packageJSON = {
5
5
  version: version};
6
6
 
@@ -1 +1 @@
1
- "use strict";var t="1.0.36";function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=Object(t[0]),o=1;o<t.length;o++){var n=t[o];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(r[a]=n[a])}return r}var r=function(t,e){function r(o){if(!(this instanceof r))return new r(o);var n=new e(o||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(n,r.prototype):n.__proto__=r.prototype,n.name=t,void 0!==o&&(n.message=o),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(n,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(n,r);else if(e.captureStackTrace&&"function"==typeof e.captureStackTrace)e.captureStackTrace(n,r);else try{var a=new e;a.stack&&(n.stack=a.stack)}catch(t){}return n}void 0===e&&(e=Error),r.prototype=Object.create(e.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(e){try{r.prototype.name=t}catch(t){}}try{Object.defineProperty(r,"name",{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}return r}("PluginNotExtendedError"),o=new Proxy({Version:t,Constants:{},Errors:{},extends:function(t){return t.installed||(this.Constants=e(this.Constants,t.Constants),this.Errors=e(this.Errors,t.Errors),this[t.name]=t.module,t.installed=!0),this}},{get:function(t,e,o){if(e in t)return Reflect.get(t,e,o);throw new r(e.toString()+" is not extended yet. Call Native.extends(plugin) first.")}});module.exports=o;
1
+ "use strict";var t="1.0.38";function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=Object(t[0]),o=1;o<t.length;o++){var n=t[o];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(r[a]=n[a])}return r}var r=function(t,e){function r(o){if(!(this instanceof r))return new r(o);var n=new e(o||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(n,r.prototype):n.__proto__=r.prototype,n.name=t,void 0!==o&&(n.message=o),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(n,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(n,r);else if(e.captureStackTrace&&"function"==typeof e.captureStackTrace)e.captureStackTrace(n,r);else try{var a=new e;a.stack&&(n.stack=a.stack)}catch(t){}return n}void 0===e&&(e=Error),r.prototype=Object.create(e.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(e){try{r.prototype.name=t}catch(t){}}try{Object.defineProperty(r,"name",{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}return r}("PluginNotExtendedError"),o=new Proxy({Version:t,Constants:{},Errors:{},extends:function(t){return t.installed||(this.Constants=e(this.Constants,t.Constants),this.Errors=e(this.Errors,t.Errors),this[t.name]=t.module,t.installed=!0),this}},{get:function(t,e,o){if(e in t)return Reflect.get(t,e,o);throw new r(e.toString()+" is not extended yet. Call Native.extends(plugin) first.")}});module.exports=o;
@@ -1 +1 @@
1
- var t="1.0.36";function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=Object(t[0]),o=1;o<t.length;o++){var n=t[o];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(r[a]=n[a])}return r}var r=function(t,e){function r(o){if(!(this instanceof r))return new r(o);var n=new e(o||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(n,r.prototype):n.__proto__=r.prototype,n.name=t,void 0!==o&&(n.message=o),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(n,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(n,r);else if(e.captureStackTrace&&"function"==typeof e.captureStackTrace)e.captureStackTrace(n,r);else try{var a=new e;a.stack&&(n.stack=a.stack)}catch(t){}return n}void 0===e&&(e=Error),r.prototype=Object.create(e.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(e){try{r.prototype.name=t}catch(t){}}try{Object.defineProperty(r,"name",{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}return r}("PluginNotExtendedError"),o=new Proxy({Version:t,Constants:{},Errors:{},extends:function(t){return t.installed||(this.Constants=e(this.Constants,t.Constants),this.Errors=e(this.Errors,t.Errors),this[t.name]=t.module,t.installed=!0),this}},{get:function(t,e,o){if(e in t)return Reflect.get(t,e,o);throw new r(e.toString()+" is not extended yet. Call Native.extends(plugin) first.")}});export{o as default};
1
+ var t="1.0.38";function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=Object(t[0]),o=1;o<t.length;o++){var n=t[o];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(r[a]=n[a])}return r}var r=function(t,e){function r(o){if(!(this instanceof r))return new r(o);var n=new e(o||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(n,r.prototype):n.__proto__=r.prototype,n.name=t,void 0!==o&&(n.message=o),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(n,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(n,r);else if(e.captureStackTrace&&"function"==typeof e.captureStackTrace)e.captureStackTrace(n,r);else try{var a=new e;a.stack&&(n.stack=a.stack)}catch(t){}return n}void 0===e&&(e=Error),r.prototype=Object.create(e.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(e){try{r.prototype.name=t}catch(t){}}try{Object.defineProperty(r,"name",{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}return r}("PluginNotExtendedError"),o=new Proxy({Version:t,Constants:{},Errors:{},extends:function(t){return t.installed||(this.Constants=e(this.Constants,t.Constants),this.Errors=e(this.Errors,t.Errors),this[t.name]=t.module,t.installed=!0),this}},{get:function(t,e,o){if(e in t)return Reflect.get(t,e,o);throw new r(e.toString()+" is not extended yet. Call Native.extends(plugin) first.")}});export{o as default};
package/dist/native.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var version = "1.0.36";
1
+ var version = "1.0.38";
2
2
  var packageJSON = {
3
3
  version: version};
4
4
 
@@ -4,7 +4,7 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Native = factory());
5
5
  })(this, (function () { 'use strict';
6
6
 
7
- var version = "1.0.36";
7
+ var version = "1.0.38";
8
8
  var packageJSON = {
9
9
  version: version};
10
10
 
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Native=e()}(this,(function(){"use strict";var t="1.0.36";function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=Object(t[0]),o=1;o<t.length;o++){var n=t[o];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(r[a]=n[a])}return r}var r=function(t,e){function r(o){if(!(this instanceof r))return new r(o);var n=new e(o||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(n,r.prototype):n.__proto__=r.prototype,n.name=t,void 0!==o&&(n.message=o),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(n,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(n,r);else if(e.captureStackTrace&&"function"==typeof e.captureStackTrace)e.captureStackTrace(n,r);else try{var a=new e;a.stack&&(n.stack=a.stack)}catch(t){}return n}void 0===e&&(e=Error),r.prototype=Object.create(e.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(e){try{r.prototype.name=t}catch(t){}}try{Object.defineProperty(r,"name",{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}return r}("PluginNotExtendedError");return new Proxy({Version:t,Constants:{},Errors:{},extends:function(t){return t.installed||(this.Constants=e(this.Constants,t.Constants),this.Errors=e(this.Errors,t.Errors),this[t.name]=t.module,t.installed=!0),this}},{get:function(t,e,o){if(e in t)return Reflect.get(t,e,o);throw new r(e.toString()+" is not extended yet. Call Native.extends(plugin) first.")}})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Native=e()}(this,(function(){"use strict";var t="1.0.38";function e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=Object(t[0]),o=1;o<t.length;o++){var n=t[o];if(null!=n)for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(r[a]=n[a])}return r}var r=function(t,e){function r(o){if(!(this instanceof r))return new r(o);var n=new e(o||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(n,r.prototype):n.__proto__=r.prototype,n.name=t,void 0!==o&&(n.message=o),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(n,Symbol.toStringTag,{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(n,r);else if(e.captureStackTrace&&"function"==typeof e.captureStackTrace)e.captureStackTrace(n,r);else try{var a=new e;a.stack&&(n.stack=a.stack)}catch(t){}return n}void 0===e&&(e=Error),r.prototype=Object.create(e.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(e){try{r.prototype.name=t}catch(t){}}try{Object.defineProperty(r,"name",{value:t,writable:!1,enumerable:!1,configurable:!0})}catch(t){}return r}("PluginNotExtendedError");return new Proxy({Version:t,Constants:{},Errors:{},extends:function(t){return t.installed||(this.Constants=e(this.Constants,t.Constants),this.Errors=e(this.Errors,t.Errors),this[t.name]=t.module,t.installed=!0),this}},{get:function(t,e,o){if(e in t)return Reflect.get(t,e,o);throw new r(e.toString()+" is not extended yet. Call Native.extends(plugin) first.")}})}));
@@ -1,11 +1,9 @@
1
- declare interface ModuleBase {
2
- }
3
- declare interface NativePlugin<T> extends ModuleBase {
1
+ declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
4
2
  installed: boolean;
5
- name: string;
6
- module: T;
7
- Constants: Record<string, any>;
8
- Errors: Record<string, ErrorConstructor>;
3
+ name: Key;
4
+ module: Module;
5
+ Constants: Constants;
6
+ Errors: Errors;
9
7
  }
10
8
 
11
9
  declare enum OS {
@@ -89,15 +87,20 @@ declare module 'native-fn' {
89
87
  App: AppInstance;
90
88
  }
91
89
  interface NativeConstants {
92
- AppOpenState: AppOpenState;
93
- Messengers: Messengers;
90
+ AppOpenState: typeof AppOpenState;
91
+ Messengers: typeof Messengers;
94
92
  }
95
93
  interface NativeErrors {
96
94
  URLOpenError: typeof URLOpenError;
97
95
  }
98
96
  }
99
97
 
100
- declare const NativeAppPlugin: NativePlugin<AppInstance>;
98
+ declare const NativeAppPlugin: NativePlugin<'App', AppInstance, {
99
+ AppOpenState: typeof AppOpenState;
100
+ Messengers: typeof Messengers;
101
+ }, {
102
+ URLOpenError: typeof URLOpenError;
103
+ }>;
101
104
 
102
105
  export { NativeAppPlugin as default };
103
106
  export type { AndroidAppInfo, AppInfo, AppInstance, AppOpenOptions, EventListenerOptions, EventListenerUtil, IOSAppInfo, MacOSAppInfo, Messenger, MessengerOpenOptions, Stringifiable, StringifiableSequence, URLCandidate, WindowsAppInfo };
@@ -1,5 +1,12 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { AppInstance } from "./types";
3
+ import { AppOpenState, Messengers } from './constants/app';
4
+ import { URLOpenError } from './errors/url-open-error';
3
5
  export * from './types';
4
- declare const NativeAppPlugin: NativePlugin<AppInstance>;
6
+ declare const NativeAppPlugin: NativePlugin<'App', AppInstance, {
7
+ AppOpenState: typeof AppOpenState;
8
+ Messengers: typeof Messengers;
9
+ }, {
10
+ URLOpenError: typeof URLOpenError;
11
+ }>;
5
12
  export default NativeAppPlugin;
@@ -7,8 +7,8 @@ declare module 'native-fn' {
7
7
  App: AppInstance;
8
8
  }
9
9
  interface NativeConstants {
10
- AppOpenState: AppOpenState;
11
- Messengers: Messengers;
10
+ AppOpenState: typeof AppOpenState;
11
+ Messengers: typeof Messengers;
12
12
  }
13
13
  interface NativeErrors {
14
14
  URLOpenError: typeof URLOpenError;
@@ -1,5 +1,5 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { PlatformInstance } from "./types";
3
3
  export * from './types';
4
- declare const NativePlatformPlugin: NativePlugin<PlatformInstance>;
4
+ declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {}, {}>;
5
5
  export default NativePlatformPlugin;
@@ -1,5 +1,17 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { ThemeInstance } from "./types";
3
+ import { Appearances } from './constants/theme';
4
+ import { EasingError, UnsupportedEasingFunctionError, StepSyntaxError, LinearSyntaxError, CubicBezierSyntaxError } from './errors/easing-error';
5
+ import { UnsupportedColorError } from './errors/unsupported-color-error';
3
6
  export * from './types';
4
- declare const NativeThemePlugin: NativePlugin<ThemeInstance>;
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
+ }>;
5
17
  export default NativeThemePlugin;
@@ -10,7 +10,7 @@ declare module 'native-fn' {
10
10
  Theme: ThemeInstance;
11
11
  }
12
12
  interface NativeConstants {
13
- Appearances: Appearances;
13
+ Appearances: typeof Appearances;
14
14
  }
15
15
  interface NativeErrors {
16
16
  EasingError: typeof EasingError;
@@ -1,22 +1,22 @@
1
1
  export interface NativePlugins {
2
2
  }
3
- export interface NativeConstants {
3
+ export interface NativeConstants extends Record<string, any> {
4
4
  }
5
- export interface NativeErrors {
5
+ export interface NativeErrors extends Record<string, ErrorConstructor> {
6
6
  }
7
- export declare interface ModuleBase {
8
- }
9
- export declare interface NativePlugin<T> extends ModuleBase {
7
+ 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
8
  installed: boolean;
11
- name: string;
12
- module: T;
13
- Constants: Record<string, any>;
14
- Errors: Record<string, ErrorConstructor>;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
15
13
  }
16
- export declare interface NativeBase extends ModuleBase {
14
+ export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
17
15
  Version: string;
18
- Constants: NativeConstants;
19
- Errors: NativeErrors;
20
- extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
21
- }
22
- export type NativeInstance = NativeBase & NativePlugins;
16
+ Constants: AssignedConstants;
17
+ Errors: AssignedErrors;
18
+ 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 & {
19
+ [Plugin in Key]: Module;
20
+ }, AssignedConstants & Constants, AssignedErrors & Errors>;
21
+ } & NativePlugins;
22
+ export type NativeInstance = NativeBase<NativePlugins, NativeConstants, NativeErrors>;
@@ -1,11 +1,9 @@
1
- declare interface ModuleBase {
2
- }
3
- declare interface NativePlugin<T> extends ModuleBase {
1
+ declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
4
2
  installed: boolean;
5
- name: string;
6
- module: T;
7
- Constants: Record<string, any>;
8
- Errors: Record<string, ErrorConstructor>;
3
+ name: Key;
4
+ module: Module;
5
+ Constants: Constants;
6
+ Errors: Errors;
9
7
  }
10
8
 
11
9
  declare enum OS {
@@ -53,7 +51,7 @@ declare module 'native-fn' {
53
51
  }
54
52
  }
55
53
 
56
- declare const NativePlatformPlugin: NativePlugin<PlatformInstance>;
54
+ declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {}, {}>;
57
55
 
58
56
  export { NativePlatformPlugin as default };
59
57
  export type { PlatformInstance };
@@ -1,5 +1,12 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { AppInstance } from "./types";
3
+ import { AppOpenState, Messengers } from './constants/app';
4
+ import { URLOpenError } from './errors/url-open-error';
3
5
  export * from './types';
4
- declare const NativeAppPlugin: NativePlugin<AppInstance>;
6
+ declare const NativeAppPlugin: NativePlugin<'App', AppInstance, {
7
+ AppOpenState: typeof AppOpenState;
8
+ Messengers: typeof Messengers;
9
+ }, {
10
+ URLOpenError: typeof URLOpenError;
11
+ }>;
5
12
  export default NativeAppPlugin;
@@ -7,8 +7,8 @@ declare module 'native-fn' {
7
7
  App: AppInstance;
8
8
  }
9
9
  interface NativeConstants {
10
- AppOpenState: AppOpenState;
11
- Messengers: Messengers;
10
+ AppOpenState: typeof AppOpenState;
11
+ Messengers: typeof Messengers;
12
12
  }
13
13
  interface NativeErrors {
14
14
  URLOpenError: typeof URLOpenError;
@@ -1,5 +1,5 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { PlatformInstance } from "./types";
3
3
  export * from './types';
4
- declare const NativePlatformPlugin: NativePlugin<PlatformInstance>;
4
+ declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {}, {}>;
5
5
  export default NativePlatformPlugin;
@@ -1,5 +1,17 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { ThemeInstance } from "./types";
3
+ import { Appearances } from './constants/theme';
4
+ import { EasingError, UnsupportedEasingFunctionError, StepSyntaxError, LinearSyntaxError, CubicBezierSyntaxError } from './errors/easing-error';
5
+ import { UnsupportedColorError } from './errors/unsupported-color-error';
3
6
  export * from './types';
4
- declare const NativeThemePlugin: NativePlugin<ThemeInstance>;
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
+ }>;
5
17
  export default NativeThemePlugin;
@@ -10,7 +10,7 @@ declare module 'native-fn' {
10
10
  Theme: ThemeInstance;
11
11
  }
12
12
  interface NativeConstants {
13
- Appearances: Appearances;
13
+ Appearances: typeof Appearances;
14
14
  }
15
15
  interface NativeErrors {
16
16
  EasingError: typeof EasingError;
@@ -1,22 +1,22 @@
1
1
  export interface NativePlugins {
2
2
  }
3
- export interface NativeConstants {
3
+ export interface NativeConstants extends Record<string, any> {
4
4
  }
5
- export interface NativeErrors {
5
+ export interface NativeErrors extends Record<string, ErrorConstructor> {
6
6
  }
7
- export declare interface ModuleBase {
8
- }
9
- export declare interface NativePlugin<T> extends ModuleBase {
7
+ 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
8
  installed: boolean;
11
- name: string;
12
- module: T;
13
- Constants: Record<string, any>;
14
- Errors: Record<string, ErrorConstructor>;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
15
13
  }
16
- export declare interface NativeBase extends ModuleBase {
14
+ export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
17
15
  Version: string;
18
- Constants: NativeConstants;
19
- Errors: NativeErrors;
20
- extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
21
- }
22
- export type NativeInstance = NativeBase & NativePlugins;
16
+ Constants: AssignedConstants;
17
+ Errors: AssignedErrors;
18
+ 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 & {
19
+ [Plugin in Key]: Module;
20
+ }, AssignedConstants & Constants, AssignedErrors & Errors>;
21
+ } & NativePlugins;
22
+ export type NativeInstance = NativeBase<NativePlugins, NativeConstants, NativeErrors>;
@@ -1,11 +1,9 @@
1
- declare interface ModuleBase {
2
- }
3
- declare interface NativePlugin<T> extends ModuleBase {
1
+ declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
4
2
  installed: boolean;
5
- name: string;
6
- module: T;
7
- Constants: Record<string, any>;
8
- Errors: Record<string, ErrorConstructor>;
3
+ name: Key;
4
+ module: Module;
5
+ Constants: Constants;
6
+ Errors: Errors;
9
7
  }
10
8
 
11
9
  type SystemColor = 'ActiveBorder' | 'ActiveCaption' | 'AppWorkspace' | 'Background' | 'ButtonHighlight' | 'ButtonShadow' | 'CaptionText' | 'InactiveBorder' | 'InactiveCaption' | 'InactiveCaptionText' | 'InfoBackground' | 'InfoText' | 'Menu' | 'MenuText' | 'Scrollbar' | 'ThreeDDarkShadow' | 'ThreeDFace' | 'ThreeDHighlight' | 'ThreeDLightShadow' | 'ThreeDShadow' | 'Window' | 'WindowFrame' | 'WindowText';
@@ -84,7 +82,7 @@ declare module 'native-fn' {
84
82
  Theme: ThemeInstance;
85
83
  }
86
84
  interface NativeConstants {
87
- Appearances: Appearances;
85
+ Appearances: typeof Appearances;
88
86
  }
89
87
  interface NativeErrors {
90
88
  EasingError: typeof EasingError;
@@ -96,7 +94,16 @@ declare module 'native-fn' {
96
94
  }
97
95
  }
98
96
 
99
- declare const NativeThemePlugin: NativePlugin<ThemeInstance>;
97
+ declare const NativeThemePlugin: NativePlugin<'Theme', ThemeInstance, {
98
+ Appearances: typeof Appearances;
99
+ }, {
100
+ EasingError: typeof EasingError;
101
+ UnsupportedEasingFunctionError: typeof UnsupportedEasingFunctionError;
102
+ StepSyntaxError: typeof StepSyntaxError;
103
+ LinearSyntaxError: typeof LinearSyntaxError;
104
+ CubicBezierSyntaxError: typeof CubicBezierSyntaxError;
105
+ UnsupportedColorError: typeof UnsupportedColorError;
106
+ }>;
100
107
 
101
108
  export { NativeThemePlugin as default };
102
109
  export type { Color, CubicBezierParams, CubicBezierSyntax, DeprecatedSystemColor, EasingFunction, EasingKeyword, EasingSyntax, HEXColor, HSLAColor, HSLColor, LinearPoint, LinearSyntax, ListenerEntry, NamedColor, RGB, RGBA, RGBAColor, RGBColor, SetThemeColorOptions, StepSyntax, SystemColor, ThemeColorMetaAppearanceKeys, ThemeColorMetaGroup, ThemeInstance };
@@ -1,5 +1,12 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { AppInstance } from "./types";
3
+ import { AppOpenState, Messengers } from './constants/app';
4
+ import { URLOpenError } from './errors/url-open-error';
3
5
  export * from './types';
4
- declare const NativeAppPlugin: NativePlugin<AppInstance>;
6
+ declare const NativeAppPlugin: NativePlugin<'App', AppInstance, {
7
+ AppOpenState: typeof AppOpenState;
8
+ Messengers: typeof Messengers;
9
+ }, {
10
+ URLOpenError: typeof URLOpenError;
11
+ }>;
5
12
  export default NativeAppPlugin;
@@ -7,8 +7,8 @@ declare module 'native-fn' {
7
7
  App: AppInstance;
8
8
  }
9
9
  interface NativeConstants {
10
- AppOpenState: AppOpenState;
11
- Messengers: Messengers;
10
+ AppOpenState: typeof AppOpenState;
11
+ Messengers: typeof Messengers;
12
12
  }
13
13
  interface NativeErrors {
14
14
  URLOpenError: typeof URLOpenError;
@@ -1,5 +1,5 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { PlatformInstance } from "./types";
3
3
  export * from './types';
4
- declare const NativePlatformPlugin: NativePlugin<PlatformInstance>;
4
+ declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {}, {}>;
5
5
  export default NativePlatformPlugin;
@@ -1,5 +1,17 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { ThemeInstance } from "./types";
3
+ import { Appearances } from './constants/theme';
4
+ import { EasingError, UnsupportedEasingFunctionError, StepSyntaxError, LinearSyntaxError, CubicBezierSyntaxError } from './errors/easing-error';
5
+ import { UnsupportedColorError } from './errors/unsupported-color-error';
3
6
  export * from './types';
4
- declare const NativeThemePlugin: NativePlugin<ThemeInstance>;
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
+ }>;
5
17
  export default NativeThemePlugin;
@@ -10,7 +10,7 @@ declare module 'native-fn' {
10
10
  Theme: ThemeInstance;
11
11
  }
12
12
  interface NativeConstants {
13
- Appearances: Appearances;
13
+ Appearances: typeof Appearances;
14
14
  }
15
15
  interface NativeErrors {
16
16
  EasingError: typeof EasingError;
@@ -1,22 +1,22 @@
1
1
  export interface NativePlugins {
2
2
  }
3
- export interface NativeConstants {
3
+ export interface NativeConstants extends Record<string, any> {
4
4
  }
5
- export interface NativeErrors {
5
+ export interface NativeErrors extends Record<string, ErrorConstructor> {
6
6
  }
7
- export declare interface ModuleBase {
8
- }
9
- export declare interface NativePlugin<T> extends ModuleBase {
7
+ 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
8
  installed: boolean;
11
- name: string;
12
- module: T;
13
- Constants: Record<string, any>;
14
- Errors: Record<string, ErrorConstructor>;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
15
13
  }
16
- export declare interface NativeBase extends ModuleBase {
14
+ export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
17
15
  Version: string;
18
- Constants: NativeConstants;
19
- Errors: NativeErrors;
20
- extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
21
- }
22
- export type NativeInstance = NativeBase & NativePlugins;
16
+ Constants: AssignedConstants;
17
+ Errors: AssignedErrors;
18
+ 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 & {
19
+ [Plugin in Key]: Module;
20
+ }, AssignedConstants & Constants, AssignedErrors & Errors>;
21
+ } & NativePlugins;
22
+ export type NativeInstance = NativeBase<NativePlugins, NativeConstants, NativeErrors>;
@@ -1,5 +1,12 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { AppInstance } from "./types";
3
+ import { AppOpenState, Messengers } from './constants/app';
4
+ import { URLOpenError } from './errors/url-open-error';
3
5
  export * from './types';
4
- declare const NativeAppPlugin: NativePlugin<AppInstance>;
6
+ declare const NativeAppPlugin: NativePlugin<'App', AppInstance, {
7
+ AppOpenState: typeof AppOpenState;
8
+ Messengers: typeof Messengers;
9
+ }, {
10
+ URLOpenError: typeof URLOpenError;
11
+ }>;
5
12
  export default NativeAppPlugin;
@@ -7,8 +7,8 @@ declare module 'native-fn' {
7
7
  App: AppInstance;
8
8
  }
9
9
  interface NativeConstants {
10
- AppOpenState: AppOpenState;
11
- Messengers: Messengers;
10
+ AppOpenState: typeof AppOpenState;
11
+ Messengers: typeof Messengers;
12
12
  }
13
13
  interface NativeErrors {
14
14
  URLOpenError: typeof URLOpenError;
@@ -1,5 +1,5 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { PlatformInstance } from "./types";
3
3
  export * from './types';
4
- declare const NativePlatformPlugin: NativePlugin<PlatformInstance>;
4
+ declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {}, {}>;
5
5
  export default NativePlatformPlugin;
@@ -1,5 +1,17 @@
1
1
  import type { NativePlugin } from '../../types';
2
2
  import type { ThemeInstance } from "./types";
3
+ import { Appearances } from './constants/theme';
4
+ import { EasingError, UnsupportedEasingFunctionError, StepSyntaxError, LinearSyntaxError, CubicBezierSyntaxError } from './errors/easing-error';
5
+ import { UnsupportedColorError } from './errors/unsupported-color-error';
3
6
  export * from './types';
4
- declare const NativeThemePlugin: NativePlugin<ThemeInstance>;
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
+ }>;
5
17
  export default NativeThemePlugin;
@@ -10,7 +10,7 @@ declare module 'native-fn' {
10
10
  Theme: ThemeInstance;
11
11
  }
12
12
  interface NativeConstants {
13
- Appearances: Appearances;
13
+ Appearances: typeof Appearances;
14
14
  }
15
15
  interface NativeErrors {
16
16
  EasingError: typeof EasingError;
@@ -1,22 +1,22 @@
1
1
  export interface NativePlugins {
2
2
  }
3
- export interface NativeConstants {
3
+ export interface NativeConstants extends Record<string, any> {
4
4
  }
5
- export interface NativeErrors {
5
+ export interface NativeErrors extends Record<string, ErrorConstructor> {
6
6
  }
7
- export declare interface ModuleBase {
8
- }
9
- export declare interface NativePlugin<T> extends ModuleBase {
7
+ 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
8
  installed: boolean;
11
- name: string;
12
- module: T;
13
- Constants: Record<string, any>;
14
- Errors: Record<string, ErrorConstructor>;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
15
13
  }
16
- export declare interface NativeBase extends ModuleBase {
14
+ export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
17
15
  Version: string;
18
- Constants: NativeConstants;
19
- Errors: NativeErrors;
20
- extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
21
- }
22
- export type NativeInstance = NativeBase & NativePlugins;
16
+ Constants: AssignedConstants;
17
+ Errors: AssignedErrors;
18
+ 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 & {
19
+ [Plugin in Key]: Module;
20
+ }, AssignedConstants & Constants, AssignedErrors & Errors>;
21
+ } & NativePlugins;
22
+ export type NativeInstance = NativeBase<NativePlugins, NativeConstants, NativeErrors>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-fn",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": " ",
5
5
  "type": "module",
6
6