@vnejs/shared 0.0.4 → 0.0.6

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 (3) hide show
  1. package/index.d.ts +14 -0
  2. package/index.js +8 -16
  3. package/package.json +2 -5
package/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ declare interface CONST {}
2
+ declare interface EVENTS {}
3
+ declare interface PARAMS {}
4
+ declare interface SETTINGS {}
5
+ declare interface MODULE_EXTENSIONS {}
6
+
7
+ declare module "@vnejs/shared" {
8
+ export const VNE: {
9
+ CONST: CONST;
10
+ EVENTS: EVENTS;
11
+ PARAMS: PARAMS;
12
+ SETTINGS: SETTINGS;
13
+ };
14
+ }
package/index.js CHANGED
@@ -1,24 +1,16 @@
1
- export const VNE_CONST = {};
2
- export const VNE_EVENTS = {};
3
- export const VNE_SETTINGS = {};
4
-
5
1
  export const VNE_MODULES = [];
6
- export const VNE_MODULE_EXTENSIONS = {};
7
2
 
8
- const regModule = (Module) => Module && VNE_MODULES.push(Module);
3
+ export const VNE = { CONST: {}, EVENTS: {}, SETTINGS: {}, PARAMS: {} };
4
+
5
+ export const regModule = (Module) => Module && VNE_MODULES.push(Module);
9
6
 
10
- export const regPlugin = (namespace = "", { constants = {}, events = {}, settings = {} } = {}, modules = []) => {
7
+ export const regPlugin = (namespace = "", { constants = {}, events = {}, settings = {}, params = {} } = {}, modules = []) => {
11
8
  if (!namespace) return;
12
9
 
13
- VNE_CONST[namespace] = constants;
14
- VNE_EVENTS[namespace] = events;
15
- VNE_SETTINGS[namespace] = settings;
10
+ VNE.EVENTS[namespace] = events;
11
+ VNE.PARAMS[namespace] = params;
12
+ VNE.CONST[namespace] = constants;
13
+ VNE.SETTINGS[namespace] = settings;
16
14
 
17
15
  modules.forEach(regModule);
18
16
  };
19
-
20
- export const regModuleExtension = (name, func) => {
21
- if (!name || typeof func !== "function") return;
22
-
23
- VNE_MODULE_EXTENSIONS[name] = func;
24
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/shared",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -11,8 +11,5 @@
11
11
  },
12
12
  "author": "",
13
13
  "license": "ISC",
14
- "description": "",
15
- "devDependencies": {
16
- "typescript": "^5.8.3"
17
- }
14
+ "description": ""
18
15
  }