native-fn 1.0.33 → 1.0.35

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 (47) hide show
  1. package/dist/index.d.ts +13 -5
  2. package/dist/native.cjs +89 -3
  3. package/dist/native.min.cjs +1 -1
  4. package/dist/native.min.mjs +1 -1
  5. package/dist/native.mjs +89 -3
  6. package/dist/native.umd.js +89 -3
  7. package/dist/native.umd.min.js +1 -1
  8. package/dist/plugin/app/index.d.ts +14 -5
  9. package/dist/plugin/app/src/errors/url-open-error.d.ts +2 -0
  10. package/dist/plugin/app/src/plugin/app/types/app.d.ts +2 -2
  11. package/dist/plugin/app/src/plugin/app/types/index.d.ts +10 -1
  12. package/dist/plugin/app/src/plugin/platform/types/index.d.ts +1 -1
  13. package/dist/plugin/app/src/plugin/theme/types/index.d.ts +15 -1
  14. package/dist/plugin/app/src/types/native.d.ts +12 -4
  15. package/dist/plugin/platform/index.d.ts +3 -3
  16. package/dist/plugin/platform/src/errors/url-open-error.d.ts +2 -0
  17. package/dist/plugin/platform/src/plugin/app/types/app.d.ts +2 -2
  18. package/dist/plugin/platform/src/plugin/app/types/index.d.ts +10 -1
  19. package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +1 -1
  20. package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +15 -1
  21. package/dist/plugin/platform/src/types/native.d.ts +12 -4
  22. package/dist/plugin/theme/index.d.ts +22 -3
  23. package/dist/plugin/theme/src/errors/url-open-error.d.ts +2 -0
  24. package/dist/plugin/theme/src/plugin/app/types/app.d.ts +2 -2
  25. package/dist/plugin/theme/src/plugin/app/types/index.d.ts +10 -1
  26. package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +1 -1
  27. package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +15 -1
  28. package/dist/plugin/theme/src/types/native.d.ts +12 -4
  29. package/dist/src/errors/url-open-error.d.ts +2 -0
  30. package/dist/src/plugin/app/types/app.d.ts +2 -2
  31. package/dist/src/plugin/app/types/index.d.ts +10 -1
  32. package/dist/src/plugin/platform/types/index.d.ts +1 -1
  33. package/dist/src/plugin/theme/types/index.d.ts +15 -1
  34. package/dist/src/types/native.d.ts +12 -4
  35. package/package.json +1 -1
  36. package/dist/plugin/app/src/plugin/app/types/appModule.d.ts +0 -54
  37. package/dist/plugin/app/src/plugin/platform/types/platformModule.d.ts +0 -13
  38. package/dist/plugin/app/src/plugin/theme/types/themeModule.d.ts +0 -24
  39. package/dist/plugin/platform/src/plugin/app/types/appModule.d.ts +0 -54
  40. package/dist/plugin/platform/src/plugin/platform/types/platformModule.d.ts +0 -13
  41. package/dist/plugin/platform/src/plugin/theme/types/themeModule.d.ts +0 -24
  42. package/dist/plugin/theme/src/plugin/app/types/appModule.d.ts +0 -54
  43. package/dist/plugin/theme/src/plugin/platform/types/platformModule.d.ts +0 -13
  44. package/dist/plugin/theme/src/plugin/theme/types/themeModule.d.ts +0 -24
  45. package/dist/src/plugin/app/types/appModule.d.ts +0 -54
  46. package/dist/src/plugin/platform/types/platformModule.d.ts +0 -13
  47. package/dist/src/plugin/theme/types/themeModule.d.ts +0 -24
package/dist/index.d.ts CHANGED
@@ -1,21 +1,29 @@
1
+ interface NativePlugins {
2
+ }
3
+ interface NativeConstants {
4
+ [key: string]: any;
5
+ }
6
+ interface NativeErrors {
7
+ [key: string]: ErrorConstructor;
8
+ }
1
9
  declare interface ModuleBase {
2
- Constants: Record<string, any>;
3
- Errors: Record<string, ErrorConstructor>;
4
10
  }
5
11
  declare interface NativePlugin<T> extends ModuleBase {
6
12
  installed: boolean;
7
13
  name: string;
8
14
  module: T;
15
+ Constants: Record<string, any>;
16
+ Errors: Record<string, ErrorConstructor>;
9
17
  }
10
18
  declare interface NativeBase extends ModuleBase {
11
19
  Version: string;
20
+ Constants: NativeConstants;
21
+ Errors: NativeErrors;
12
22
  extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
13
23
  }
14
- interface NativePlugins {
15
- }
16
24
  type NativeInstance = NativeBase & NativePlugins;
17
25
 
18
26
  declare const Native: NativeInstance;
19
27
 
20
28
  export { Native as default };
21
- export type { ModuleBase, NativeBase, NativeInstance, NativePlugin, NativePlugins };
29
+ export type { ModuleBase, 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.33";
3
+ var version = "1.0.35";
4
4
  var packageJSON = {
5
5
  version: version};
6
6
 
@@ -23,7 +23,87 @@ function assign() {
23
23
  return to;
24
24
  }
25
25
 
26
- var Native = {
26
+ function createCustomError(name, Base) {
27
+ if (Base === void 0) { Base = Error; }
28
+ function CustomError(message) {
29
+ if (!(this instanceof CustomError))
30
+ return new CustomError(message);
31
+ var error = new Base(message || '');
32
+ if (typeof Object.setPrototypeOf === 'function')
33
+ Object.setPrototypeOf(error, CustomError.prototype);
34
+ else
35
+ error.__proto__ = CustomError.prototype;
36
+ error.name = name;
37
+ if (message !== undefined)
38
+ error.message = message;
39
+ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
40
+ try {
41
+ Object.defineProperty(error, Symbol.toStringTag, {
42
+ value: name,
43
+ writable: false,
44
+ enumerable: false,
45
+ configurable: true
46
+ });
47
+ }
48
+ catch (_) {
49
+ }
50
+ }
51
+ if (typeof Error.captureStackTrace === 'function') {
52
+ Error.captureStackTrace(error, CustomError);
53
+ }
54
+ else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
55
+ Base.captureStackTrace(error, CustomError);
56
+ }
57
+ else {
58
+ try {
59
+ var tempError = new Base();
60
+ if (tempError.stack)
61
+ error.stack = tempError.stack;
62
+ }
63
+ catch (_) {
64
+ }
65
+ }
66
+ return error;
67
+ }
68
+ CustomError.prototype = Object.create(Base.prototype, {
69
+ constructor: {
70
+ value: CustomError,
71
+ writable: true,
72
+ enumerable: false,
73
+ configurable: true
74
+ }
75
+ });
76
+ try {
77
+ Object.defineProperty(CustomError.prototype, 'name', {
78
+ value: name,
79
+ writable: true,
80
+ enumerable: false,
81
+ configurable: true
82
+ });
83
+ }
84
+ catch (_) {
85
+ try {
86
+ CustomError.prototype.name = name;
87
+ }
88
+ catch (_) {
89
+ }
90
+ }
91
+ try {
92
+ Object.defineProperty(CustomError, 'name', {
93
+ value: name,
94
+ writable: false,
95
+ enumerable: false,
96
+ configurable: true
97
+ });
98
+ }
99
+ catch (_) {
100
+ }
101
+ return CustomError;
102
+ }
103
+
104
+ var PluginNotExtendedError = createCustomError('PluginNotExtendedError');
105
+
106
+ var Native = new Proxy({
27
107
  Version: packageJSON.version,
28
108
  Constants: {},
29
109
  Errors: {},
@@ -36,6 +116,12 @@ var Native = {
36
116
  plugin.installed = true;
37
117
  return this;
38
118
  }
39
- };
119
+ }, {
120
+ get: function (target, prop, receiver) {
121
+ if (prop in target)
122
+ return Reflect.get(target, prop, receiver);
123
+ throw new PluginNotExtendedError(prop.toString() + ' is not extended yet. Call Native.extends(plugin) first.');
124
+ }
125
+ });
40
126
 
41
127
  module.exports = Native;
@@ -1 +1 @@
1
- "use strict";function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var s=Object(t[0]),o=1;o<t.length;o++){var n=t[o];if(null!=n)for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(s[e]=n[e])}return s}var r={Version:"1.0.33",Constants:{},Errors:{},extends:function(r){return r.installed||(this.Constants=t(this.Constants,r.Constants),this.Errors=t(this.Errors,r.Errors),this[r.name]=r.module,r.installed=!0),this}};module.exports=r;
1
+ "use strict";var t="1.0.35";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
- function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=Object(t[0]),o=1;o<t.length;o++){var s=t[o];if(null!=s)for(var e in s)Object.prototype.hasOwnProperty.call(s,e)&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(n[e]=s[e])}return n}var r={Version:"1.0.33",Constants:{},Errors:{},extends:function(r){return r.installed||(this.Constants=t(this.Constants,r.Constants),this.Errors=t(this.Errors,r.Errors),this[r.name]=r.module,r.installed=!0),this}};export{r as default};
1
+ var t="1.0.35";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.33";
1
+ var version = "1.0.35";
2
2
  var packageJSON = {
3
3
  version: version};
4
4
 
@@ -21,7 +21,87 @@ function assign() {
21
21
  return to;
22
22
  }
23
23
 
24
- var Native = {
24
+ function createCustomError(name, Base) {
25
+ if (Base === void 0) { Base = Error; }
26
+ function CustomError(message) {
27
+ if (!(this instanceof CustomError))
28
+ return new CustomError(message);
29
+ var error = new Base(message || '');
30
+ if (typeof Object.setPrototypeOf === 'function')
31
+ Object.setPrototypeOf(error, CustomError.prototype);
32
+ else
33
+ error.__proto__ = CustomError.prototype;
34
+ error.name = name;
35
+ if (message !== undefined)
36
+ error.message = message;
37
+ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
38
+ try {
39
+ Object.defineProperty(error, Symbol.toStringTag, {
40
+ value: name,
41
+ writable: false,
42
+ enumerable: false,
43
+ configurable: true
44
+ });
45
+ }
46
+ catch (_) {
47
+ }
48
+ }
49
+ if (typeof Error.captureStackTrace === 'function') {
50
+ Error.captureStackTrace(error, CustomError);
51
+ }
52
+ else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
53
+ Base.captureStackTrace(error, CustomError);
54
+ }
55
+ else {
56
+ try {
57
+ var tempError = new Base();
58
+ if (tempError.stack)
59
+ error.stack = tempError.stack;
60
+ }
61
+ catch (_) {
62
+ }
63
+ }
64
+ return error;
65
+ }
66
+ CustomError.prototype = Object.create(Base.prototype, {
67
+ constructor: {
68
+ value: CustomError,
69
+ writable: true,
70
+ enumerable: false,
71
+ configurable: true
72
+ }
73
+ });
74
+ try {
75
+ Object.defineProperty(CustomError.prototype, 'name', {
76
+ value: name,
77
+ writable: true,
78
+ enumerable: false,
79
+ configurable: true
80
+ });
81
+ }
82
+ catch (_) {
83
+ try {
84
+ CustomError.prototype.name = name;
85
+ }
86
+ catch (_) {
87
+ }
88
+ }
89
+ try {
90
+ Object.defineProperty(CustomError, 'name', {
91
+ value: name,
92
+ writable: false,
93
+ enumerable: false,
94
+ configurable: true
95
+ });
96
+ }
97
+ catch (_) {
98
+ }
99
+ return CustomError;
100
+ }
101
+
102
+ var PluginNotExtendedError = createCustomError('PluginNotExtendedError');
103
+
104
+ var Native = new Proxy({
25
105
  Version: packageJSON.version,
26
106
  Constants: {},
27
107
  Errors: {},
@@ -34,6 +114,12 @@ var Native = {
34
114
  plugin.installed = true;
35
115
  return this;
36
116
  }
37
- };
117
+ }, {
118
+ get: function (target, prop, receiver) {
119
+ if (prop in target)
120
+ return Reflect.get(target, prop, receiver);
121
+ throw new PluginNotExtendedError(prop.toString() + ' is not extended yet. Call Native.extends(plugin) first.');
122
+ }
123
+ });
38
124
 
39
125
  export { Native as default };
@@ -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.33";
7
+ var version = "1.0.35";
8
8
  var packageJSON = {
9
9
  version: version};
10
10
 
@@ -27,7 +27,87 @@
27
27
  return to;
28
28
  }
29
29
 
30
- var Native = {
30
+ function createCustomError(name, Base) {
31
+ if (Base === void 0) { Base = Error; }
32
+ function CustomError(message) {
33
+ if (!(this instanceof CustomError))
34
+ return new CustomError(message);
35
+ var error = new Base(message || '');
36
+ if (typeof Object.setPrototypeOf === 'function')
37
+ Object.setPrototypeOf(error, CustomError.prototype);
38
+ else
39
+ error.__proto__ = CustomError.prototype;
40
+ error.name = name;
41
+ if (message !== undefined)
42
+ error.message = message;
43
+ if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
44
+ try {
45
+ Object.defineProperty(error, Symbol.toStringTag, {
46
+ value: name,
47
+ writable: false,
48
+ enumerable: false,
49
+ configurable: true
50
+ });
51
+ }
52
+ catch (_) {
53
+ }
54
+ }
55
+ if (typeof Error.captureStackTrace === 'function') {
56
+ Error.captureStackTrace(error, CustomError);
57
+ }
58
+ else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
59
+ Base.captureStackTrace(error, CustomError);
60
+ }
61
+ else {
62
+ try {
63
+ var tempError = new Base();
64
+ if (tempError.stack)
65
+ error.stack = tempError.stack;
66
+ }
67
+ catch (_) {
68
+ }
69
+ }
70
+ return error;
71
+ }
72
+ CustomError.prototype = Object.create(Base.prototype, {
73
+ constructor: {
74
+ value: CustomError,
75
+ writable: true,
76
+ enumerable: false,
77
+ configurable: true
78
+ }
79
+ });
80
+ try {
81
+ Object.defineProperty(CustomError.prototype, 'name', {
82
+ value: name,
83
+ writable: true,
84
+ enumerable: false,
85
+ configurable: true
86
+ });
87
+ }
88
+ catch (_) {
89
+ try {
90
+ CustomError.prototype.name = name;
91
+ }
92
+ catch (_) {
93
+ }
94
+ }
95
+ try {
96
+ Object.defineProperty(CustomError, 'name', {
97
+ value: name,
98
+ writable: false,
99
+ enumerable: false,
100
+ configurable: true
101
+ });
102
+ }
103
+ catch (_) {
104
+ }
105
+ return CustomError;
106
+ }
107
+
108
+ var PluginNotExtendedError = createCustomError('PluginNotExtendedError');
109
+
110
+ var Native = new Proxy({
31
111
  Version: packageJSON.version,
32
112
  Constants: {},
33
113
  Errors: {},
@@ -40,7 +120,13 @@
40
120
  plugin.installed = true;
41
121
  return this;
42
122
  }
43
- };
123
+ }, {
124
+ get: function (target, prop, receiver) {
125
+ if (prop in target)
126
+ return Reflect.get(target, prop, receiver);
127
+ throw new PluginNotExtendedError(prop.toString() + ' is not extended yet. Call Native.extends(plugin) first.');
128
+ }
129
+ });
44
130
 
45
131
  return Native;
46
132
 
@@ -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";function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=Object(t[0]),o=1;o<t.length;o++){var r=t[o];if(null!=r)for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&"__proto__"!==s&&"constructor"!==s&&"prototype"!==s&&(n[s]=r[s])}return n}return{Version:"1.0.33",Constants:{},Errors:{},extends:function(e){return e.installed||(this.Constants=t(this.Constants,e.Constants),this.Errors=t(this.Errors,e.Errors),this[e.name]=e.module,e.installed=!0),this}}}));
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.35";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,11 @@
1
1
  declare interface ModuleBase {
2
- Constants: Record<string, any>;
3
- Errors: Record<string, ErrorConstructor>;
4
2
  }
5
3
  declare interface NativePlugin<T> extends ModuleBase {
6
4
  installed: boolean;
7
5
  name: string;
8
6
  module: T;
7
+ Constants: Record<string, any>;
8
+ Errors: Record<string, ErrorConstructor>;
9
9
  }
10
10
 
11
11
  declare enum OS {
@@ -76,16 +76,25 @@ declare type MessengerOpenOptions = {
76
76
  subject?: Stringifiable;
77
77
  body?: Stringifiable;
78
78
  } | HTMLFormElement | FormData;
79
- declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
79
+ declare type Messenger = Record<Messengers, (options: MessengerOpenOptions) => Promise<void>>;
80
80
  declare interface AppInstance {
81
- open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
81
+ open: (options: AppOpenOptions) => Promise<AppOpenState>;
82
82
  messenger: Messenger;
83
83
  }
84
84
 
85
- declare module '../../../types/native' {
85
+ declare const URLOpenError: ErrorConstructor;
86
+
87
+ declare module 'native-fn' {
86
88
  interface NativePlugins {
87
89
  App: AppInstance;
88
90
  }
91
+ interface NativeConstants {
92
+ AppOpenState: AppOpenState;
93
+ Messengers: Messengers;
94
+ }
95
+ interface NativeErrors {
96
+ URLOpenError: typeof URLOpenError;
97
+ }
89
98
  }
90
99
 
91
100
  declare const NativeAppPlugin: NativePlugin<AppInstance>;
@@ -0,0 +1,2 @@
1
+ declare const PluginNotExtendedError: ErrorConstructor;
2
+ export { PluginNotExtendedError, };
@@ -47,8 +47,8 @@ export declare type MessengerOpenOptions = {
47
47
  subject?: Stringifiable;
48
48
  body?: Stringifiable;
49
49
  } | HTMLFormElement | FormData;
50
- export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
50
+ export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions) => Promise<void>>;
51
51
  export declare interface AppInstance {
52
- open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
52
+ open: (options: AppOpenOptions) => Promise<AppOpenState>;
53
53
  messenger: Messenger;
54
54
  }
@@ -1,7 +1,16 @@
1
1
  export * from './app';
2
2
  import type { AppInstance } from './app';
3
- declare module '../../../types/native' {
3
+ import { AppOpenState, Messengers } from "../constants/app";
4
+ import { URLOpenError } from "../errors/url-open-error";
5
+ declare module 'native-fn' {
4
6
  interface NativePlugins {
5
7
  App: AppInstance;
6
8
  }
9
+ interface NativeConstants {
10
+ AppOpenState: AppOpenState;
11
+ Messengers: Messengers;
12
+ }
13
+ interface NativeErrors {
14
+ URLOpenError: typeof URLOpenError;
15
+ }
7
16
  }
@@ -1,6 +1,6 @@
1
1
  export * from './platform';
2
2
  import type { PlatformInstance } from './platform';
3
- declare module '../../../types/native' {
3
+ declare module 'native-fn' {
4
4
  interface NativePlugins {
5
5
  Platform: PlatformInstance;
6
6
  }
@@ -2,8 +2,22 @@ export * from './color';
2
2
  export * from './easing-syntax';
3
3
  export * from './theme';
4
4
  import type { ThemeInstance } from './theme';
5
- declare module '../../../types/native' {
5
+ import { Appearances } from "../constants/theme";
6
+ import { UnsupportedColorError } from "../errors/unsupported-color-error";
7
+ import { CubicBezierSyntaxError, EasingError, LinearSyntaxError, StepSyntaxError, UnsupportedEasingFunctionError } from "../errors/easing-error";
8
+ declare module 'native-fn' {
6
9
  interface NativePlugins {
7
10
  Theme: ThemeInstance;
8
11
  }
12
+ interface NativeConstants {
13
+ Appearances: Appearances;
14
+ }
15
+ interface NativeErrors {
16
+ EasingError: typeof EasingError;
17
+ UnsupportedEasingFunctionError: typeof UnsupportedEasingFunctionError;
18
+ StepSyntaxError: typeof StepSyntaxError;
19
+ LinearSyntaxError: typeof LinearSyntaxError;
20
+ CubicBezierSyntaxError: typeof CubicBezierSyntaxError;
21
+ UnsupportedColorError: typeof UnsupportedColorError;
22
+ }
9
23
  }
@@ -1,16 +1,24 @@
1
+ export interface NativePlugins {
2
+ }
3
+ export interface NativeConstants {
4
+ [key: string]: any;
5
+ }
6
+ export interface NativeErrors {
7
+ [key: string]: ErrorConstructor;
8
+ }
1
9
  export declare interface ModuleBase {
2
- Constants: Record<string, any>;
3
- Errors: Record<string, ErrorConstructor>;
4
10
  }
5
11
  export declare interface NativePlugin<T> extends ModuleBase {
6
12
  installed: boolean;
7
13
  name: string;
8
14
  module: T;
15
+ Constants: Record<string, any>;
16
+ Errors: Record<string, ErrorConstructor>;
9
17
  }
10
18
  export declare interface NativeBase extends ModuleBase {
11
19
  Version: string;
20
+ Constants: NativeConstants;
21
+ Errors: NativeErrors;
12
22
  extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
13
23
  }
14
- export interface NativePlugins {
15
- }
16
24
  export type NativeInstance = NativeBase & NativePlugins;
@@ -1,11 +1,11 @@
1
1
  declare interface ModuleBase {
2
- Constants: Record<string, any>;
3
- Errors: Record<string, ErrorConstructor>;
4
2
  }
5
3
  declare interface NativePlugin<T> extends ModuleBase {
6
4
  installed: boolean;
7
5
  name: string;
8
6
  module: T;
7
+ Constants: Record<string, any>;
8
+ Errors: Record<string, ErrorConstructor>;
9
9
  }
10
10
 
11
11
  declare enum OS {
@@ -47,7 +47,7 @@ declare interface PlatformInstance {
47
47
  isDesktop: boolean;
48
48
  }
49
49
 
50
- declare module '../../../types/native' {
50
+ declare module 'native-fn' {
51
51
  interface NativePlugins {
52
52
  Platform: PlatformInstance;
53
53
  }
@@ -0,0 +1,2 @@
1
+ declare const PluginNotExtendedError: ErrorConstructor;
2
+ export { PluginNotExtendedError, };
@@ -47,8 +47,8 @@ export declare type MessengerOpenOptions = {
47
47
  subject?: Stringifiable;
48
48
  body?: Stringifiable;
49
49
  } | HTMLFormElement | FormData;
50
- export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions, self?: WindowProxy) => Promise<void>>;
50
+ export declare type Messenger = Record<Messengers, (options: MessengerOpenOptions) => Promise<void>>;
51
51
  export declare interface AppInstance {
52
- open: (options: AppOpenOptions, target?: WindowProxy) => Promise<AppOpenState>;
52
+ open: (options: AppOpenOptions) => Promise<AppOpenState>;
53
53
  messenger: Messenger;
54
54
  }
@@ -1,7 +1,16 @@
1
1
  export * from './app';
2
2
  import type { AppInstance } from './app';
3
- declare module '../../../types/native' {
3
+ import { AppOpenState, Messengers } from "../constants/app";
4
+ import { URLOpenError } from "../errors/url-open-error";
5
+ declare module 'native-fn' {
4
6
  interface NativePlugins {
5
7
  App: AppInstance;
6
8
  }
9
+ interface NativeConstants {
10
+ AppOpenState: AppOpenState;
11
+ Messengers: Messengers;
12
+ }
13
+ interface NativeErrors {
14
+ URLOpenError: typeof URLOpenError;
15
+ }
7
16
  }
@@ -1,6 +1,6 @@
1
1
  export * from './platform';
2
2
  import type { PlatformInstance } from './platform';
3
- declare module '../../../types/native' {
3
+ declare module 'native-fn' {
4
4
  interface NativePlugins {
5
5
  Platform: PlatformInstance;
6
6
  }
@@ -2,8 +2,22 @@ export * from './color';
2
2
  export * from './easing-syntax';
3
3
  export * from './theme';
4
4
  import type { ThemeInstance } from './theme';
5
- declare module '../../../types/native' {
5
+ import { Appearances } from "../constants/theme";
6
+ import { UnsupportedColorError } from "../errors/unsupported-color-error";
7
+ import { CubicBezierSyntaxError, EasingError, LinearSyntaxError, StepSyntaxError, UnsupportedEasingFunctionError } from "../errors/easing-error";
8
+ declare module 'native-fn' {
6
9
  interface NativePlugins {
7
10
  Theme: ThemeInstance;
8
11
  }
12
+ interface NativeConstants {
13
+ Appearances: Appearances;
14
+ }
15
+ interface NativeErrors {
16
+ EasingError: typeof EasingError;
17
+ UnsupportedEasingFunctionError: typeof UnsupportedEasingFunctionError;
18
+ StepSyntaxError: typeof StepSyntaxError;
19
+ LinearSyntaxError: typeof LinearSyntaxError;
20
+ CubicBezierSyntaxError: typeof CubicBezierSyntaxError;
21
+ UnsupportedColorError: typeof UnsupportedColorError;
22
+ }
9
23
  }
@@ -1,16 +1,24 @@
1
+ export interface NativePlugins {
2
+ }
3
+ export interface NativeConstants {
4
+ [key: string]: any;
5
+ }
6
+ export interface NativeErrors {
7
+ [key: string]: ErrorConstructor;
8
+ }
1
9
  export declare interface ModuleBase {
2
- Constants: Record<string, any>;
3
- Errors: Record<string, ErrorConstructor>;
4
10
  }
5
11
  export declare interface NativePlugin<T> extends ModuleBase {
6
12
  installed: boolean;
7
13
  name: string;
8
14
  module: T;
15
+ Constants: Record<string, any>;
16
+ Errors: Record<string, ErrorConstructor>;
9
17
  }
10
18
  export declare interface NativeBase extends ModuleBase {
11
19
  Version: string;
20
+ Constants: NativeConstants;
21
+ Errors: NativeErrors;
12
22
  extends: <T>(plugin: NativePlugin<T>) => NativeInstance;
13
23
  }
14
- export interface NativePlugins {
15
- }
16
24
  export type NativeInstance = NativeBase & NativePlugins;