@vnejs/plugins.save.contract 0.0.2
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/const.d.ts +27 -0
- package/dist/const.js +16 -0
- package/dist/events.d.ts +11 -0
- package/dist/events.js +10 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +9 -0
- package/dist/module-global-state.d.ts +3 -0
- package/dist/module-global-state.js +1 -0
- package/dist/params.d.ts +5 -0
- package/dist/params.js +4 -0
- package/package.json +36 -0
- package/src/const.ts +20 -0
- package/src/events.ts +15 -0
- package/src/index.ts +54 -0
- package/src/module-global-state.ts +3 -0
- package/src/params.ts +7 -0
- package/tsconfig.json +9 -0
package/dist/const.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const EXEC_ACTIONS: {
|
|
2
|
+
readonly KEY: "key";
|
|
3
|
+
};
|
|
4
|
+
export declare const LOGS_ACTIONS: {
|
|
5
|
+
readonly GET: "GET";
|
|
6
|
+
readonly SAVE: "save";
|
|
7
|
+
readonly LOAD: "load";
|
|
8
|
+
readonly DELETE: "delete";
|
|
9
|
+
readonly PRELOAD: "preload";
|
|
10
|
+
readonly CLEAR: "clear";
|
|
11
|
+
readonly KEY: "key";
|
|
12
|
+
};
|
|
13
|
+
export declare const CONSTANTS: {
|
|
14
|
+
readonly EXEC_ACTIONS: {
|
|
15
|
+
readonly KEY: "key";
|
|
16
|
+
};
|
|
17
|
+
readonly LOGS_ACTIONS: {
|
|
18
|
+
readonly GET: "GET";
|
|
19
|
+
readonly SAVE: "save";
|
|
20
|
+
readonly LOAD: "load";
|
|
21
|
+
readonly DELETE: "delete";
|
|
22
|
+
readonly PRELOAD: "preload";
|
|
23
|
+
readonly CLEAR: "clear";
|
|
24
|
+
readonly KEY: "key";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type Constants = typeof CONSTANTS;
|
package/dist/const.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const EXEC_ACTIONS = {
|
|
2
|
+
KEY: "key",
|
|
3
|
+
};
|
|
4
|
+
export const LOGS_ACTIONS = {
|
|
5
|
+
GET: "GET",
|
|
6
|
+
SAVE: "save",
|
|
7
|
+
LOAD: "load",
|
|
8
|
+
DELETE: "delete",
|
|
9
|
+
PRELOAD: "preload",
|
|
10
|
+
CLEAR: "clear",
|
|
11
|
+
KEY: "key",
|
|
12
|
+
};
|
|
13
|
+
export const CONSTANTS = {
|
|
14
|
+
EXEC_ACTIONS,
|
|
15
|
+
LOGS_ACTIONS,
|
|
16
|
+
};
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const SUBSCRIBE_EVENTS: {
|
|
2
|
+
readonly GET: "vne:save:get";
|
|
3
|
+
readonly CLEAR: "vne:save:clear";
|
|
4
|
+
readonly DELETE: "vne:save:delete";
|
|
5
|
+
readonly CREATE: "vne:save:create";
|
|
6
|
+
readonly KEY: "vne:save:key";
|
|
7
|
+
readonly SCREENSHOT: "vne:save:screenshot";
|
|
8
|
+
readonly LOAD: "vne:save:load";
|
|
9
|
+
readonly PRELOAD: "vne:save:preload";
|
|
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:save:get",
|
|
3
|
+
CLEAR: "vne:save:clear",
|
|
4
|
+
DELETE: "vne:save:delete",
|
|
5
|
+
CREATE: "vne:save:create",
|
|
6
|
+
KEY: "vne:save:key",
|
|
7
|
+
SCREENSHOT: "vne:save:screenshot",
|
|
8
|
+
LOAD: "vne:save:load",
|
|
9
|
+
PRELOAD: "vne:save:preload",
|
|
10
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ModuleGlobalState } from "@vnejs/module";
|
|
2
|
+
import { CONSTANTS as StateConstants } from "@vnejs/plugins.core.state.contract";
|
|
3
|
+
import "@vnejs/module";
|
|
4
|
+
import "@vnejs/shared";
|
|
5
|
+
import { CONSTANTS } from "./const.js";
|
|
6
|
+
import { SUBSCRIBE_EVENTS } from "./events.js";
|
|
7
|
+
import type { ModuleGlobalStateSaveKey } from "./module-global-state.js";
|
|
8
|
+
import { PARAMS } from "./params.js";
|
|
9
|
+
export declare const PLUGIN_NAME: "SAVE";
|
|
10
|
+
export type PluginName = typeof PLUGIN_NAME;
|
|
11
|
+
export type { ModuleGlobalStateSaveKey } from "./module-global-state.js";
|
|
12
|
+
export { CONSTANTS };
|
|
13
|
+
export type { Constants } from "./const.js";
|
|
14
|
+
export { SUBSCRIBE_EVENTS };
|
|
15
|
+
export type { SubscribeEvents } from "./events.js";
|
|
16
|
+
export { PARAMS };
|
|
17
|
+
export type { Params } from "./params.js";
|
|
18
|
+
export type SaveMigrateStatus = (typeof StateConstants.MIGRATE_STATUS)[keyof typeof StateConstants.MIGRATE_STATUS];
|
|
19
|
+
export type SaveRecord = {
|
|
20
|
+
state: ModuleGlobalState;
|
|
21
|
+
ts: number;
|
|
22
|
+
key?: string;
|
|
23
|
+
screen?: string;
|
|
24
|
+
migrateStatus?: SaveMigrateStatus;
|
|
25
|
+
};
|
|
26
|
+
export type SaveKeyPayload = {
|
|
27
|
+
key?: string;
|
|
28
|
+
};
|
|
29
|
+
export type SaveCreatePayload = {
|
|
30
|
+
key?: string;
|
|
31
|
+
withScreenshot?: boolean;
|
|
32
|
+
};
|
|
33
|
+
declare module "@vnejs/module" {
|
|
34
|
+
interface ModuleGlobalState {
|
|
35
|
+
"save.key": ModuleGlobalStateSaveKey;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
declare module "@vnejs/shared" {
|
|
39
|
+
interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {
|
|
40
|
+
}
|
|
41
|
+
interface VnePluginConstantsMap extends Record<typeof PLUGIN_NAME, typeof CONSTANTS> {
|
|
42
|
+
}
|
|
43
|
+
interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "@vnejs/module";
|
|
2
|
+
import "@vnejs/shared";
|
|
3
|
+
import { CONSTANTS } from "./const.js";
|
|
4
|
+
import { SUBSCRIBE_EVENTS } from "./events.js";
|
|
5
|
+
import { PARAMS } from "./params.js";
|
|
6
|
+
export const PLUGIN_NAME = "SAVE";
|
|
7
|
+
export { CONSTANTS };
|
|
8
|
+
export { SUBSCRIBE_EVENTS };
|
|
9
|
+
export { PARAMS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/params.d.ts
ADDED
package/dist/params.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/plugins.save.contract",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Contracts for @vnejs/plugins.save",
|
|
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.0.1",
|
|
30
|
+
"@vnejs/plugins.core.state.contract": "~0.0.1",
|
|
31
|
+
"@vnejs/shared": "~0.0.9"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@vnejs/configs.ts-common": "~0.0.1"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/const.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const EXEC_ACTIONS = {
|
|
2
|
+
KEY: "key",
|
|
3
|
+
} as const;
|
|
4
|
+
|
|
5
|
+
export const LOGS_ACTIONS = {
|
|
6
|
+
GET: "GET",
|
|
7
|
+
SAVE: "save",
|
|
8
|
+
LOAD: "load",
|
|
9
|
+
DELETE: "delete",
|
|
10
|
+
PRELOAD: "preload",
|
|
11
|
+
CLEAR: "clear",
|
|
12
|
+
KEY: "key",
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
export const CONSTANTS = {
|
|
16
|
+
EXEC_ACTIONS,
|
|
17
|
+
LOGS_ACTIONS,
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
export type Constants = typeof CONSTANTS;
|
package/src/events.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const SUBSCRIBE_EVENTS = {
|
|
2
|
+
GET: "vne:save:get",
|
|
3
|
+
CLEAR: "vne:save:clear",
|
|
4
|
+
DELETE: "vne:save:delete",
|
|
5
|
+
CREATE: "vne:save:create",
|
|
6
|
+
|
|
7
|
+
KEY: "vne:save:key",
|
|
8
|
+
|
|
9
|
+
SCREENSHOT: "vne:save:screenshot",
|
|
10
|
+
|
|
11
|
+
LOAD: "vne:save:load",
|
|
12
|
+
PRELOAD: "vne:save:preload",
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ModuleGlobalState } from "@vnejs/module";
|
|
2
|
+
import { CONSTANTS as StateConstants } from "@vnejs/plugins.core.state.contract";
|
|
3
|
+
|
|
4
|
+
import "@vnejs/module";
|
|
5
|
+
import "@vnejs/shared";
|
|
6
|
+
|
|
7
|
+
import { CONSTANTS } from "./const.js";
|
|
8
|
+
import { SUBSCRIBE_EVENTS } from "./events.js";
|
|
9
|
+
import type { ModuleGlobalStateSaveKey } from "./module-global-state.js";
|
|
10
|
+
import { PARAMS } from "./params.js";
|
|
11
|
+
|
|
12
|
+
export const PLUGIN_NAME = "SAVE" as const;
|
|
13
|
+
export type PluginName = typeof PLUGIN_NAME;
|
|
14
|
+
|
|
15
|
+
export type { ModuleGlobalStateSaveKey } from "./module-global-state.js";
|
|
16
|
+
export { CONSTANTS };
|
|
17
|
+
export type { Constants } from "./const.js";
|
|
18
|
+
export { SUBSCRIBE_EVENTS };
|
|
19
|
+
export type { SubscribeEvents } from "./events.js";
|
|
20
|
+
export { PARAMS };
|
|
21
|
+
export type { Params } from "./params.js";
|
|
22
|
+
|
|
23
|
+
export type SaveMigrateStatus = (typeof StateConstants.MIGRATE_STATUS)[keyof typeof StateConstants.MIGRATE_STATUS];
|
|
24
|
+
|
|
25
|
+
export type SaveRecord = {
|
|
26
|
+
state: ModuleGlobalState;
|
|
27
|
+
ts: number;
|
|
28
|
+
key?: string;
|
|
29
|
+
screen?: string;
|
|
30
|
+
migrateStatus?: SaveMigrateStatus;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type SaveKeyPayload = {
|
|
34
|
+
key?: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type SaveCreatePayload = {
|
|
38
|
+
key?: string;
|
|
39
|
+
withScreenshot?: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
declare module "@vnejs/module" {
|
|
43
|
+
interface ModuleGlobalState {
|
|
44
|
+
"save.key": ModuleGlobalStateSaveKey;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare module "@vnejs/shared" {
|
|
49
|
+
interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {}
|
|
50
|
+
|
|
51
|
+
interface VnePluginConstantsMap extends Record<typeof PLUGIN_NAME, typeof CONSTANTS> {}
|
|
52
|
+
|
|
53
|
+
interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {}
|
|
54
|
+
}
|
package/src/params.ts
ADDED