@vnejs/compatibility.platform.metric-with-save 0.1.4
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 +11 -0
- package/dist/index.js +14 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.js +1 -0
- package/package.json +41 -0
- package/src/index.ts +22 -0
- package/src/types.ts +13 -0
- package/tsconfig.json +9 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "@vnejs/contracts.platform.metric";
|
|
2
|
+
import "@vnejs/contracts.save";
|
|
3
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
4
|
+
import type { SaveKeyPayload } from "@vnejs/contracts.save";
|
|
5
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
6
|
+
export declare class CompatibilityMetricSave extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
7
|
+
name: string;
|
|
8
|
+
subscribe: () => void;
|
|
9
|
+
onSave: ({ key }?: SaveKeyPayload) => Promise<unknown[]> | undefined;
|
|
10
|
+
onLoad: ({ key }?: SaveKeyPayload) => Promise<unknown[]> | undefined;
|
|
11
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "@vnejs/contracts.platform.metric";
|
|
2
|
+
import "@vnejs/contracts.save";
|
|
3
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
4
|
+
import { regModule } from "@vnejs/shared";
|
|
5
|
+
export class CompatibilityMetricSave extends ModuleCore {
|
|
6
|
+
name = "compatibility.platform.metric-with-save";
|
|
7
|
+
subscribe = () => {
|
|
8
|
+
this.on(this.EVENTS.SAVE.CREATE, this.onSave);
|
|
9
|
+
this.on(this.EVENTS.SAVE.LOAD, this.onLoad);
|
|
10
|
+
};
|
|
11
|
+
onSave = ({ key } = {}) => this.emit(this.EVENTS.METRIC.PARAMS, { VNE_SAVE: { key } });
|
|
12
|
+
onLoad = ({ key } = {}) => this.emit(this.EVENTS.METRIC.PARAMS, { VNE_LOAD: { key } });
|
|
13
|
+
}
|
|
14
|
+
regModule(CompatibilityMetricSave);
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as MetricPluginName, SubscribeEvents as MetricSubscribeEvents } from "@vnejs/contracts.platform.metric";
|
|
3
|
+
import type { PluginName as SavePluginName, SubscribeEvents as SaveSubscribeEvents } from "@vnejs/contracts.save";
|
|
4
|
+
export type PluginEvents = ModuleCoreEvents & Record<MetricPluginName, MetricSubscribeEvents> & Record<SavePluginName, SaveSubscribeEvents>;
|
|
5
|
+
export type PluginConstants = ModuleCoreConstants;
|
|
6
|
+
export type PluginSettings = ModuleCoreSettings;
|
|
7
|
+
export type PluginParams = ModuleCoreParams;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/compatibility.platform.metric-with-save",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "",
|
|
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
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
22
|
+
"build": "npx @vnejs/monorepo package",
|
|
23
|
+
"publish:major:plugin": "npm run publish:major",
|
|
24
|
+
"publish:minor:plugin": "npm run publish:minor",
|
|
25
|
+
"publish:patch:plugin": "npm run publish:patch",
|
|
26
|
+
"publish:major": "npx @vnejs/monorepo publish major --access public",
|
|
27
|
+
"publish:minor": "npx @vnejs/monorepo publish minor --access public",
|
|
28
|
+
"publish:patch": "npx @vnejs/monorepo publish patch --access public"
|
|
29
|
+
},
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@vnejs/module.core": "~0.1.0",
|
|
34
|
+
"@vnejs/contracts.platform.metric": "~0.1.0",
|
|
35
|
+
"@vnejs/contracts.save": "~0.1.0",
|
|
36
|
+
"@vnejs/shared": "~0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@vnejs/configs.ts-common": "~0.1.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "@vnejs/contracts.platform.metric";
|
|
2
|
+
import "@vnejs/contracts.save";
|
|
3
|
+
|
|
4
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
5
|
+
import type { SaveKeyPayload } from "@vnejs/contracts.save";
|
|
6
|
+
import { regModule } from "@vnejs/shared";
|
|
7
|
+
|
|
8
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
9
|
+
|
|
10
|
+
export class CompatibilityMetricSave extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
11
|
+
name = "compatibility.platform.metric-with-save";
|
|
12
|
+
|
|
13
|
+
subscribe = () => {
|
|
14
|
+
this.on(this.EVENTS.SAVE.CREATE, this.onSave);
|
|
15
|
+
this.on(this.EVENTS.SAVE.LOAD, this.onLoad);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
onSave = ({ key }: SaveKeyPayload = {}) => this.emit(this.EVENTS.METRIC.PARAMS, { VNE_SAVE: { key } });
|
|
19
|
+
onLoad = ({ key }: SaveKeyPayload = {}) => this.emit(this.EVENTS.METRIC.PARAMS, { VNE_LOAD: { key } });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
regModule(CompatibilityMetricSave);
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as MetricPluginName, SubscribeEvents as MetricSubscribeEvents } from "@vnejs/contracts.platform.metric";
|
|
3
|
+
import type { PluginName as SavePluginName, SubscribeEvents as SaveSubscribeEvents } from "@vnejs/contracts.save";
|
|
4
|
+
|
|
5
|
+
export type PluginEvents = ModuleCoreEvents &
|
|
6
|
+
Record<MetricPluginName, MetricSubscribeEvents> &
|
|
7
|
+
Record<SavePluginName, SaveSubscribeEvents>;
|
|
8
|
+
|
|
9
|
+
export type PluginConstants = ModuleCoreConstants;
|
|
10
|
+
|
|
11
|
+
export type PluginSettings = ModuleCoreSettings;
|
|
12
|
+
|
|
13
|
+
export type PluginParams = ModuleCoreParams;
|