@vnejs/contracts.vars 0.1.1

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.
@@ -0,0 +1,11 @@
1
+ export declare const SUBSCRIBE_EVENTS: {
2
+ readonly GET: "vne:vars:get";
3
+ readonly SET: "vne:vars:set";
4
+ readonly INJECT: "vne:vars:inject";
5
+ readonly SCENARIO: "vne:vars:scenario";
6
+ readonly DEFAULT_REG: "vne:vars:default_reg";
7
+ readonly GLOBAL_SET: "vne:vars:global_set";
8
+ readonly GLOBAL_GET: "vne:vars:global_get";
9
+ readonly GLOBAL_CLEAR: "vne:vars:global_clear";
10
+ };
11
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/dist/events.js ADDED
@@ -0,0 +1,10 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ GET: "vne:vars:get",
3
+ SET: "vne:vars:set",
4
+ INJECT: "vne:vars:inject",
5
+ SCENARIO: "vne:vars:scenario",
6
+ DEFAULT_REG: "vne:vars:default_reg",
7
+ GLOBAL_SET: "vne:vars:global_set",
8
+ GLOBAL_GET: "vne:vars:global_get",
9
+ GLOBAL_CLEAR: "vne:vars:global_clear",
10
+ };
@@ -0,0 +1,53 @@
1
+ import "@vnejs/module";
2
+ import "@vnejs/shared";
3
+ import { SUBSCRIBE_EVENTS } from "./events.js";
4
+ import type { ModuleGlobalStateVars } from "./module-global-state.js";
5
+ export declare const PLUGIN_NAME: "VARS";
6
+ export type PluginName = typeof PLUGIN_NAME;
7
+ export type { ModuleGlobalStateVars } from "./module-global-state.js";
8
+ export { SUBSCRIBE_EVENTS };
9
+ export type { SubscribeEvents } from "./events.js";
10
+ export type VarValue = string | number | boolean;
11
+ export type VarsGetPayload = {
12
+ name?: string;
13
+ type?: string;
14
+ isGlobal?: boolean;
15
+ state?: {
16
+ vars?: ModuleGlobalStateVars;
17
+ } | null;
18
+ };
19
+ export type VarsSetPayload = {
20
+ name?: string;
21
+ type?: string;
22
+ value?: VarValue;
23
+ isGlobal?: boolean;
24
+ };
25
+ export type VarsDefaultRegPayload = {
26
+ type?: string;
27
+ value?: VarValue;
28
+ };
29
+ export type VarsGlobalGetPayload = {
30
+ name?: string;
31
+ };
32
+ export type VarsGlobalSetPayload = {
33
+ name?: string;
34
+ value?: VarValue;
35
+ };
36
+ export type VarsInjectPayload = {
37
+ text?: string;
38
+ };
39
+ export type VarsScenarioPayload = {
40
+ shouldGoInside?: boolean;
41
+ };
42
+ declare module "@vnejs/module" {
43
+ interface ModuleShared {
44
+ vars: Record<string, VarValue>;
45
+ }
46
+ interface ModuleGlobalState {
47
+ vars: ModuleGlobalStateVars;
48
+ }
49
+ }
50
+ declare module "@vnejs/shared" {
51
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {
52
+ }
53
+ }
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import "@vnejs/module";
2
+ import "@vnejs/shared";
3
+ import { SUBSCRIBE_EVENTS } from "./events.js";
4
+ export const PLUGIN_NAME = "VARS";
5
+ export { SUBSCRIBE_EVENTS };
@@ -0,0 +1 @@
1
+ export type ModuleGlobalStateVars = Record<string, unknown>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@vnejs/contracts.vars",
3
+ "version": "0.1.1",
4
+ "description": "Contracts for @vnejs/plugins.vars",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "src",
18
+ "tsconfig.json"
19
+ ],
20
+ "scripts": {
21
+ "build": "npx @vnejs/monorepo package",
22
+ "publish:major": "npx @vnejs/monorepo publish major --access public",
23
+ "publish:minor": "npx @vnejs/monorepo publish minor --access public",
24
+ "publish:patch": "npx @vnejs/monorepo publish patch --access public"
25
+ },
26
+ "author": "",
27
+ "license": "ISC",
28
+ "peerDependencies": {
29
+ "@vnejs/module": "~0.1.0",
30
+ "@vnejs/shared": "~0.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "@vnejs/configs.ts-common": "~0.1.0"
34
+ }
35
+ }
package/src/events.ts ADDED
@@ -0,0 +1,13 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ GET: "vne:vars:get",
3
+ SET: "vne:vars:set",
4
+ INJECT: "vne:vars:inject",
5
+ SCENARIO: "vne:vars:scenario",
6
+ DEFAULT_REG: "vne:vars:default_reg",
7
+
8
+ GLOBAL_SET: "vne:vars:global_set",
9
+ GLOBAL_GET: "vne:vars:global_get",
10
+ GLOBAL_CLEAR: "vne:vars:global_clear",
11
+ } as const;
12
+
13
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/src/index.ts ADDED
@@ -0,0 +1,64 @@
1
+ import "@vnejs/module";
2
+ import "@vnejs/shared";
3
+
4
+ import { SUBSCRIBE_EVENTS } from "./events.js";
5
+ import type { ModuleGlobalStateVars } from "./module-global-state.js";
6
+
7
+ export const PLUGIN_NAME = "VARS" as const;
8
+ export type PluginName = typeof PLUGIN_NAME;
9
+
10
+ export type { ModuleGlobalStateVars } from "./module-global-state.js";
11
+ export { SUBSCRIBE_EVENTS };
12
+ export type { SubscribeEvents } from "./events.js";
13
+
14
+ export type VarValue = string | number | boolean;
15
+
16
+ export type VarsGetPayload = {
17
+ name?: string;
18
+ type?: string;
19
+ isGlobal?: boolean;
20
+ state?: { vars?: ModuleGlobalStateVars } | null;
21
+ };
22
+
23
+ export type VarsSetPayload = {
24
+ name?: string;
25
+ type?: string;
26
+ value?: VarValue;
27
+ isGlobal?: boolean;
28
+ };
29
+
30
+ export type VarsDefaultRegPayload = {
31
+ type?: string;
32
+ value?: VarValue;
33
+ };
34
+
35
+ export type VarsGlobalGetPayload = {
36
+ name?: string;
37
+ };
38
+
39
+ export type VarsGlobalSetPayload = {
40
+ name?: string;
41
+ value?: VarValue;
42
+ };
43
+
44
+ export type VarsInjectPayload = {
45
+ text?: string;
46
+ };
47
+
48
+ export type VarsScenarioPayload = {
49
+ shouldGoInside?: boolean;
50
+ };
51
+
52
+ declare module "@vnejs/module" {
53
+ interface ModuleShared {
54
+ vars: Record<string, VarValue>;
55
+ }
56
+
57
+ interface ModuleGlobalState {
58
+ vars: ModuleGlobalStateVars;
59
+ }
60
+ }
61
+
62
+ declare module "@vnejs/shared" {
63
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {}
64
+ }
@@ -0,0 +1 @@
1
+ export type ModuleGlobalStateVars = Record<string, unknown>;
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@vnejs/configs.ts-common/tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["dist", "node_modules"]
9
+ }