native-fn 1.0.37 → 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.
package/dist/index.d.ts CHANGED
@@ -1,30 +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 NativePlugin<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
7
+ declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
8
8
  installed: boolean;
9
- name: string;
10
- module: T;
11
- Constants: C;
12
- Errors: E;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
13
13
  }
14
- declare interface NativeBase {
14
+ type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
15
15
  Version: string;
16
- Constants: NativeConstants;
17
- Errors: NativeErrors;
18
- extends: <T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(plugin: NativePlugin<T, C, E>) => NativeInstance;
19
- }
20
- 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>;
21
23
 
22
- declare const Native: {
23
- Version: string;
24
- Constants: {};
25
- Errors: {};
26
- extends<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(plugin: NativePlugin<T, C, E>): NativeInstance;
27
- };
24
+ declare const Native: NativeInstance;
28
25
 
29
26
  export { Native as default };
30
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.37";
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.37";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.37";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.37";
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.37";
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.37";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,9 +1,9 @@
1
- declare interface NativePlugin<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
1
+ declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
2
2
  installed: boolean;
3
- name: string;
4
- module: T;
5
- Constants: C;
6
- Errors: E;
3
+ name: Key;
4
+ module: Module;
5
+ Constants: Constants;
6
+ Errors: Errors;
7
7
  }
8
8
 
9
9
  declare enum OS {
@@ -95,7 +95,12 @@ declare module 'native-fn' {
95
95
  }
96
96
  }
97
97
 
98
- 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
+ }>;
99
104
 
100
105
  export { NativeAppPlugin as default };
101
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;
@@ -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;
@@ -1,20 +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 NativePlugin<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
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>> {
8
8
  installed: boolean;
9
- name: string;
10
- module: T;
11
- Constants: C;
12
- Errors: E;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
13
13
  }
14
- export declare interface NativeBase {
14
+ export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
15
15
  Version: string;
16
- Constants: NativeConstants;
17
- Errors: NativeErrors;
18
- extends: <T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(plugin: NativePlugin<T, C, E>) => NativeInstance;
19
- }
20
- 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,9 +1,9 @@
1
- declare interface NativePlugin<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
1
+ declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
2
2
  installed: boolean;
3
- name: string;
4
- module: T;
5
- Constants: C;
6
- Errors: E;
3
+ name: Key;
4
+ module: Module;
5
+ Constants: Constants;
6
+ Errors: Errors;
7
7
  }
8
8
 
9
9
  declare enum OS {
@@ -51,7 +51,7 @@ declare module 'native-fn' {
51
51
  }
52
52
  }
53
53
 
54
- declare const NativePlatformPlugin: NativePlugin<PlatformInstance>;
54
+ declare const NativePlatformPlugin: NativePlugin<'Platform', PlatformInstance, {}, {}>;
55
55
 
56
56
  export { NativePlatformPlugin as default };
57
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;
@@ -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;
@@ -1,20 +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 NativePlugin<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
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>> {
8
8
  installed: boolean;
9
- name: string;
10
- module: T;
11
- Constants: C;
12
- Errors: E;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
13
13
  }
14
- export declare interface NativeBase {
14
+ export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
15
15
  Version: string;
16
- Constants: NativeConstants;
17
- Errors: NativeErrors;
18
- extends: <T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(plugin: NativePlugin<T, C, E>) => NativeInstance;
19
- }
20
- 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,9 +1,9 @@
1
- declare interface NativePlugin<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
1
+ declare interface NativePlugin<Key extends string, Module, Constants extends Record<string, any> = Record<string, any>, Errors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
2
2
  installed: boolean;
3
- name: string;
4
- module: T;
5
- Constants: C;
6
- Errors: E;
3
+ name: Key;
4
+ module: Module;
5
+ Constants: Constants;
6
+ Errors: Errors;
7
7
  }
8
8
 
9
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';
@@ -94,7 +94,16 @@ declare module 'native-fn' {
94
94
  }
95
95
  }
96
96
 
97
- 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
+ }>;
98
107
 
99
108
  export { NativeThemePlugin as default };
100
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;
@@ -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;
@@ -1,20 +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 NativePlugin<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
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>> {
8
8
  installed: boolean;
9
- name: string;
10
- module: T;
11
- Constants: C;
12
- Errors: E;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
13
13
  }
14
- export declare interface NativeBase {
14
+ export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
15
15
  Version: string;
16
- Constants: NativeConstants;
17
- Errors: NativeErrors;
18
- extends: <T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(plugin: NativePlugin<T, C, E>) => NativeInstance;
19
- }
20
- 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;
@@ -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;
@@ -1,20 +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 NativePlugin<T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> {
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>> {
8
8
  installed: boolean;
9
- name: string;
10
- module: T;
11
- Constants: C;
12
- Errors: E;
9
+ name: Key;
10
+ module: Module;
11
+ Constants: Constants;
12
+ Errors: Errors;
13
13
  }
14
- export declare interface NativeBase {
14
+ export type NativeBase<Plugins, AssignedConstants extends Record<string, any> = Record<string, any>, AssignedErrors extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>> = {
15
15
  Version: string;
16
- Constants: NativeConstants;
17
- Errors: NativeErrors;
18
- extends: <T, C extends Record<string, any> = Record<string, any>, E extends Record<string, ErrorConstructor> = Record<string, ErrorConstructor>>(plugin: NativePlugin<T, C, E>) => NativeInstance;
19
- }
20
- 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.37",
3
+ "version": "1.0.38",
4
4
  "description": " ",
5
5
  "type": "module",
6
6