@vnejs/module.core 0.1.4 → 0.2.0

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Module, type ModuleGlobalStateRegistry } from "@vnejs/module";
2
+ import type { InteractPushPopPayload } from "@vnejs/contracts.core.interact";
2
3
  import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "./types.js";
3
- export type { ModuleGlobalStateRegistry, ModuleInitResult, ModuleInject, ModuleMedia, ModuleShared, } from "@vnejs/module";
4
+ export type { ModuleGlobalStateRegistry, ModuleInitResult, ModuleInject, ModuleMedia, ModuleShared } from "@vnejs/module";
4
5
  export type { LineExecHandlerArg, LineLoadHandlerArg } from "@vnejs/contracts.core.scenario";
5
6
  export type { SettingsChangedResult } from "@vnejs/contracts.core.settings";
6
7
  export type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "./types.js";
@@ -9,5 +10,6 @@ export declare abstract class ModuleCore<TEvents extends ModuleCoreEvents = Modu
9
10
  emitLog: (value: unknown) => Promise<unknown[]> | undefined;
10
11
  emitClone: <T>(value: unknown) => Promise<T>;
11
12
  emitNext: () => undefined;
13
+ emitInteractPushPop: ({ key, skipHandler, handler }: InteractPushPopPayload) => Promise<unknown[]> | undefined;
12
14
  onSetStateClone: (payload: ModuleGlobalStateRegistry) => Promise<void>;
13
15
  }
package/dist/index.js CHANGED
@@ -3,5 +3,6 @@ export class ModuleCore extends Module {
3
3
  emitLog = (value) => this.emit(this.EVENTS.LOGS.EMIT, { module: this.name, value });
4
4
  emitClone = (value) => this.emitOne(this.EVENTS.VENDORS.CLONE, value);
5
5
  emitNext = () => void this.emit(this.EVENTS.SCENARIO.NEXT, { module: this.name });
6
+ emitInteractPushPop = ({ key, skipHandler, handler }) => this.emit(this.EVENTS.INTERACT.PUSH_POP, { key, skipHandler, handler });
6
7
  onSetStateClone = async (payload) => this.setState(await this.emitClone(this.getStateSlice(payload)));
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/module.core",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,25 +27,25 @@
27
27
  "author": "",
28
28
  "license": "ISC",
29
29
  "peerDependencies": {
30
- "@vnejs/module": "~0.1.0",
31
- "@vnejs/contracts.core.components": "~0.1.0",
32
- "@vnejs/contracts.core.interact": "~0.1.0",
33
- "@vnejs/contracts.core.logs": "~0.1.0",
34
- "@vnejs/contracts.core.media": "~0.1.0",
35
- "@vnejs/contracts.core.memory": "~0.1.0",
36
- "@vnejs/contracts.core.platforms": "~0.1.0",
37
- "@vnejs/contracts.core.scenario": "~0.1.0",
38
- "@vnejs/contracts.core.settings": "~0.1.0",
39
- "@vnejs/contracts.core.stack": "~0.1.0",
40
- "@vnejs/contracts.core.state": "~0.1.0",
41
- "@vnejs/contracts.core.storage": "~0.1.0",
42
- "@vnejs/contracts.core.system": "~0.1.0",
43
- "@vnejs/contracts.core.vendors": "~0.1.0",
44
- "@vnejs/shared": "~0.1.0"
30
+ "@vnejs/module": "~0.2.0",
31
+ "@vnejs/contracts.core.components": "~0.2.0",
32
+ "@vnejs/contracts.core.interact": "~0.2.0",
33
+ "@vnejs/contracts.core.logs": "~0.2.0",
34
+ "@vnejs/contracts.core.media": "~0.2.0",
35
+ "@vnejs/contracts.core.memory": "~0.2.0",
36
+ "@vnejs/contracts.core.platforms": "~0.2.0",
37
+ "@vnejs/contracts.core.scenario": "~0.2.0",
38
+ "@vnejs/contracts.core.settings": "~0.2.0",
39
+ "@vnejs/contracts.core.stack": "~0.2.0",
40
+ "@vnejs/contracts.core.state": "~0.2.0",
41
+ "@vnejs/contracts.core.storage": "~0.2.0",
42
+ "@vnejs/contracts.core.system": "~0.2.0",
43
+ "@vnejs/contracts.core.vendors": "~0.2.0",
44
+ "@vnejs/shared": "~0.2.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@vnejs/configs.ts-common": "~0.1.0",
48
- "@vnejs/module": "~0.1.0",
49
- "@vnejs/shared": "~0.1.0"
47
+ "@vnejs/configs.ts-common": "~0.2.0",
48
+ "@vnejs/module": "~0.2.0",
49
+ "@vnejs/shared": "~0.2.0"
50
50
  }
51
51
  }
package/src/index.ts CHANGED
@@ -1,14 +1,10 @@
1
1
  import { Module, type ModuleGlobalStateRegistry } from "@vnejs/module";
2
2
 
3
+ import type { InteractPushPopPayload } from "@vnejs/contracts.core.interact";
4
+
3
5
  import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "./types.js";
4
6
 
5
- export type {
6
- ModuleGlobalStateRegistry,
7
- ModuleInitResult,
8
- ModuleInject,
9
- ModuleMedia,
10
- ModuleShared,
11
- } from "@vnejs/module";
7
+ export type { ModuleGlobalStateRegistry, ModuleInitResult, ModuleInject, ModuleMedia, ModuleShared } from "@vnejs/module";
12
8
  export type { LineExecHandlerArg, LineLoadHandlerArg } from "@vnejs/contracts.core.scenario";
13
9
  export type { SettingsChangedResult } from "@vnejs/contracts.core.settings";
14
10
  export type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "./types.js";
@@ -26,5 +22,7 @@ export abstract class ModuleCore<
26
22
  emitClone = <T>(value: unknown) => this.emitOne(this.EVENTS.VENDORS.CLONE, value) as Promise<T>;
27
23
  emitNext = () => void this.emit(this.EVENTS.SCENARIO.NEXT, { module: this.name });
28
24
 
25
+ emitInteractPushPop = ({ key, skipHandler, handler }: InteractPushPopPayload) => this.emit(this.EVENTS.INTERACT.PUSH_POP, { key, skipHandler, handler });
26
+
29
27
  onSetStateClone = async (payload: ModuleGlobalStateRegistry) => this.setState(await this.emitClone<TState>(this.getStateSlice(payload)));
30
28
  }