@vnejs/plugins.scenario.qte 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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/modules/qte.d.ts +10 -0
- package/dist/modules/qte.js +31 -0
- package/dist/modules/scenario.d.ts +9 -0
- package/dist/modules/scenario.js +17 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.js +1 -0
- package/dist/utils/qte.d.ts +6 -0
- package/dist/utils/qte.js +1 -0
- package/package.json +49 -0
- package/src/index.ts +9 -0
- package/src/modules/qte.ts +42 -0
- package/src/modules/scenario.ts +28 -0
- package/src/tests/qte.test.ts +56 -0
- package/src/tests/scenario.test.ts +41 -0
- package/src/tests/setup.ts +28 -0
- package/src/types.ts +23 -0
- package/src/utils/qte.ts +7 -0
- package/tsconfig.json +9 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@vnejs/contracts.scenario.qte";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "@vnejs/contracts.scenario.qte";
|
|
2
|
+
import { regPlugin } from "@vnejs/shared";
|
|
3
|
+
import { PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.scenario.qte";
|
|
4
|
+
import { Qte } from "./modules/qte.js";
|
|
5
|
+
import { QteScenario } from "./modules/scenario.js";
|
|
6
|
+
regPlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS, params: PARAMS }, [Qte, QteScenario]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import type { QtePluginConstants, QtePluginEvents, QtePluginParams, QtePluginSettings } from "../types.js";
|
|
3
|
+
import type { QteEmitPayload, QteResultPayload } from "../utils/qte.js";
|
|
4
|
+
export declare class Qte extends ModuleCore<QtePluginEvents, QtePluginConstants, QtePluginSettings, QtePluginParams> {
|
|
5
|
+
name: string;
|
|
6
|
+
subscribe: () => void;
|
|
7
|
+
onQteEmit: (payload?: QteEmitPayload) => Promise<void>;
|
|
8
|
+
onQteResult: ({ success }?: QteResultPayload) => Promise<void>;
|
|
9
|
+
applyResult: (success: boolean) => Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
export class Qte extends ModuleCore {
|
|
3
|
+
name = "qte";
|
|
4
|
+
subscribe = () => {
|
|
5
|
+
this.on(this.EVENTS.QTE.EMIT, this.onQteEmit);
|
|
6
|
+
this.on(this.EVENTS.QTE.RESULT, this.onQteResult);
|
|
7
|
+
};
|
|
8
|
+
onQteEmit = async (payload = {}) => {
|
|
9
|
+
this.emitLog({ action: "emit", id: payload.id });
|
|
10
|
+
await this.emit(this.EVENTS.QTE.OPENED, payload);
|
|
11
|
+
};
|
|
12
|
+
onQteResult = async ({ success = false } = {}) => {
|
|
13
|
+
this.emitLog({ action: "result", success });
|
|
14
|
+
await this.emit(this.EVENTS.QTE.CLOSED, { isForce: false });
|
|
15
|
+
await this.applyResult(success);
|
|
16
|
+
this.emitNext();
|
|
17
|
+
};
|
|
18
|
+
applyResult = async (success) => {
|
|
19
|
+
if (success) {
|
|
20
|
+
this.globalState.scenario.curLine += 1;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const { curLine = 0, label } = this.globalState.scenario;
|
|
24
|
+
const lines = (await this.emitOne(this.EVENTS.SCENARIO.LINES_GET, { label }));
|
|
25
|
+
const parentIndent = lines[curLine]?.indent ?? 0;
|
|
26
|
+
let indexShift = 1;
|
|
27
|
+
while (lines[curLine + indexShift] && (lines[curLine + indexShift].indent ?? 0) > parentIndent)
|
|
28
|
+
indexShift++;
|
|
29
|
+
this.globalState.scenario.curLine += indexShift;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import type { LineExecHandlerArg } from "@vnejs/module.core";
|
|
3
|
+
import type { QtePluginConstants, QtePluginEvents, QtePluginParams, QtePluginSettings } from "../types.js";
|
|
4
|
+
export declare class QteScenario extends ModuleCore<QtePluginEvents, QtePluginConstants, QtePluginSettings, QtePluginParams> {
|
|
5
|
+
name: string;
|
|
6
|
+
execName: string;
|
|
7
|
+
init: () => Promise<unknown[]> | undefined;
|
|
8
|
+
onLineExec: ({ line }?: LineExecHandlerArg) => Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import { tokenizeExecLine } from "@vnejs/helpers";
|
|
3
|
+
export class QteScenario extends ModuleCore {
|
|
4
|
+
name = "qte.scenario";
|
|
5
|
+
execName = "qte";
|
|
6
|
+
init = () => this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { block: this.execName, handler: this.onLineExec });
|
|
7
|
+
onLineExec = async ({ line = "" } = {}) => {
|
|
8
|
+
const [id = ""] = tokenizeExecLine(line).map(String);
|
|
9
|
+
const item = this.PARAMS.QTE.ITEMS[id];
|
|
10
|
+
if (!id || !item) {
|
|
11
|
+
this.emitLog({ action: "missing", id });
|
|
12
|
+
await this.emit(this.EVENTS.QTE.RESULT, { success: false });
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
await this.emit(this.EVENTS.QTE.EMIT, { id, item });
|
|
16
|
+
};
|
|
17
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as LogsPluginName, SubscribeEvents as LogsSubscribeEvents } from "@vnejs/contracts.core.logs";
|
|
3
|
+
import type { Constants as ScenarioConstants, PluginName as ScenarioPluginName, SubscribeEvents as ScenarioSubscribeEvents } from "@vnejs/contracts.core.scenario";
|
|
4
|
+
import type { PluginName as VendorsPluginName, SubscribeEvents as VendorsSubscribeEvents } from "@vnejs/contracts.core.vendors";
|
|
5
|
+
import type { PluginName, SubscribeEvents, Params } from "@vnejs/contracts.scenario.qte";
|
|
6
|
+
export type QtePluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents> & Record<ScenarioPluginName, ScenarioSubscribeEvents> & Record<VendorsPluginName, VendorsSubscribeEvents> & Record<LogsPluginName, LogsSubscribeEvents>;
|
|
7
|
+
export type QtePluginConstants = ModuleCoreConstants & Record<ScenarioPluginName, ScenarioConstants>;
|
|
8
|
+
export type QtePluginSettings = ModuleCoreSettings;
|
|
9
|
+
export type QtePluginParams = ModuleCoreParams & Record<PluginName, Params>;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/plugins.scenario.qte",
|
|
3
|
+
"version": "0.1.1",
|
|
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": "npx @vnejs/monorepo test",
|
|
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
|
+
"dependencies": {
|
|
33
|
+
"@vnejs/contracts.scenario.qte": "~0.1.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@vnejs/helpers": "~0.1.0",
|
|
37
|
+
"@vnejs/module.core": "~0.1.0",
|
|
38
|
+
"@vnejs/shared": "~0.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@vnejs/configs.ts-common": "~0.1.0",
|
|
42
|
+
"@vnejs/configs.vitest": "~0.1.0",
|
|
43
|
+
"@vnejs/test-utils": "~0.1.0",
|
|
44
|
+
"@vnejs/contracts.scenario.qte": "~0.1.0",
|
|
45
|
+
"@vnejs/helpers": "~0.1.0",
|
|
46
|
+
"@vnejs/module.core": "~0.1.0",
|
|
47
|
+
"@vnejs/shared": "~0.1.0"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "@vnejs/contracts.scenario.qte";
|
|
2
|
+
|
|
3
|
+
import { regPlugin } from "@vnejs/shared";
|
|
4
|
+
import { PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.scenario.qte";
|
|
5
|
+
|
|
6
|
+
import { Qte } from "./modules/qte.js";
|
|
7
|
+
import { QteScenario } from "./modules/scenario.js";
|
|
8
|
+
|
|
9
|
+
regPlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS, params: PARAMS }, [Qte, QteScenario]);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
|
|
3
|
+
import type { QtePluginConstants, QtePluginEvents, QtePluginParams, QtePluginSettings } from "../types.js";
|
|
4
|
+
import type { QteEmitPayload, QteResultPayload, QteVisibilityPayload, ScenarioLine } from "../utils/qte.js";
|
|
5
|
+
|
|
6
|
+
export class Qte extends ModuleCore<QtePluginEvents, QtePluginConstants, QtePluginSettings, QtePluginParams> {
|
|
7
|
+
name = "qte";
|
|
8
|
+
|
|
9
|
+
subscribe = () => {
|
|
10
|
+
this.on(this.EVENTS.QTE.EMIT, this.onQteEmit);
|
|
11
|
+
this.on(this.EVENTS.QTE.RESULT, this.onQteResult);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
onQteEmit = async (payload: QteEmitPayload = {}) => {
|
|
15
|
+
this.emitLog({ action: "emit", id: payload.id });
|
|
16
|
+
await this.emit(this.EVENTS.QTE.OPENED, payload satisfies QteVisibilityPayload);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
onQteResult = async ({ success = false }: QteResultPayload = {}) => {
|
|
20
|
+
this.emitLog({ action: "result", success });
|
|
21
|
+
await this.emit(this.EVENTS.QTE.CLOSED, { isForce: false } satisfies QteVisibilityPayload);
|
|
22
|
+
await this.applyResult(success);
|
|
23
|
+
this.emitNext();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
applyResult = async (success: boolean) => {
|
|
27
|
+
if (success) {
|
|
28
|
+
this.globalState.scenario.curLine += 1;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const { curLine = 0, label } = this.globalState.scenario;
|
|
33
|
+
const lines = (await this.emitOne(this.EVENTS.SCENARIO.LINES_GET, { label })) as ScenarioLine[];
|
|
34
|
+
const parentIndent = lines[curLine]?.indent ?? 0;
|
|
35
|
+
|
|
36
|
+
let indexShift = 1;
|
|
37
|
+
|
|
38
|
+
while (lines[curLine + indexShift] && (lines[curLine + indexShift].indent ?? 0) > parentIndent) indexShift++;
|
|
39
|
+
|
|
40
|
+
this.globalState.scenario.curLine += indexShift;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import { tokenizeExecLine } from "@vnejs/helpers";
|
|
3
|
+
|
|
4
|
+
import type { LineExecHandlerArg } from "@vnejs/module.core";
|
|
5
|
+
|
|
6
|
+
import type { QtePluginConstants, QtePluginEvents, QtePluginParams, QtePluginSettings } from "../types.js";
|
|
7
|
+
import type { QteEmitPayload } from "../utils/qte.js";
|
|
8
|
+
|
|
9
|
+
export class QteScenario extends ModuleCore<QtePluginEvents, QtePluginConstants, QtePluginSettings, QtePluginParams> {
|
|
10
|
+
name = "qte.scenario";
|
|
11
|
+
|
|
12
|
+
execName = "qte";
|
|
13
|
+
|
|
14
|
+
init = () => this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { block: this.execName, handler: this.onLineExec });
|
|
15
|
+
|
|
16
|
+
onLineExec = async ({ line = "" }: LineExecHandlerArg = {}) => {
|
|
17
|
+
const [id = ""] = tokenizeExecLine(line).map(String);
|
|
18
|
+
const item = this.PARAMS.QTE.ITEMS[id];
|
|
19
|
+
|
|
20
|
+
if (!id || !item) {
|
|
21
|
+
this.emitLog({ action: "missing", id });
|
|
22
|
+
await this.emit(this.EVENTS.QTE.RESULT, { success: false });
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
await this.emit(this.EVENTS.QTE.EMIT, { id, item } satisfies QteEmitPayload);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { spyEvent, stubEvent } from "@vnejs/test-utils";
|
|
4
|
+
import { SUBSCRIBE_EVENTS as SCENARIO_EVENTS } from "@vnejs/contracts.core.scenario";
|
|
5
|
+
|
|
6
|
+
import { Qte } from "../modules/qte.js";
|
|
7
|
+
import { createQteTestModule, registerQtePluginVne, SUBSCRIBE_EVENTS } from "./setup.js";
|
|
8
|
+
|
|
9
|
+
const LINES = [
|
|
10
|
+
{ line: "% qte door_lock", indent: 0 },
|
|
11
|
+
{ line: '"success"', indent: 2 },
|
|
12
|
+
{ line: '"after"', indent: 0 },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
describe("Qte", () => {
|
|
16
|
+
beforeEach(() => registerQtePluginVne());
|
|
17
|
+
|
|
18
|
+
it("EMIT bridges to OPENED", async () => {
|
|
19
|
+
const { observer } = createQteTestModule(Qte);
|
|
20
|
+
const opened = spyEvent(observer, SUBSCRIBE_EVENTS.OPENED);
|
|
21
|
+
const payload = { id: "door_lock", item: { start: 70, size: 20, duration: 1500 } };
|
|
22
|
+
|
|
23
|
+
await observer.emit(SUBSCRIBE_EVENTS.EMIT, payload);
|
|
24
|
+
|
|
25
|
+
expect(opened).toHaveBeenCalledExactlyOnceWith(payload);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("RESULT success enters the block", async () => {
|
|
29
|
+
const { module, observer, state } = createQteTestModule(Qte);
|
|
30
|
+
const closed = spyEvent(observer, SUBSCRIBE_EVENTS.CLOSED);
|
|
31
|
+
const next = spyEvent(observer, SCENARIO_EVENTS.NEXT);
|
|
32
|
+
|
|
33
|
+
stubEvent(observer, SCENARIO_EVENTS.LINES_GET, () => LINES);
|
|
34
|
+
state.scenario.curLine = 0;
|
|
35
|
+
|
|
36
|
+
await observer.emit(SUBSCRIBE_EVENTS.RESULT, { success: true });
|
|
37
|
+
|
|
38
|
+
expect(closed).toHaveBeenCalledOnce();
|
|
39
|
+
expect(state.scenario.curLine).toBe(1);
|
|
40
|
+
expect(next).toHaveBeenCalledOnce();
|
|
41
|
+
expect((module as Qte).name).toBe("qte");
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("RESULT fail skips the block", async () => {
|
|
45
|
+
const { observer, state } = createQteTestModule(Qte);
|
|
46
|
+
const next = spyEvent(observer, SCENARIO_EVENTS.NEXT);
|
|
47
|
+
|
|
48
|
+
stubEvent(observer, SCENARIO_EVENTS.LINES_GET, () => LINES);
|
|
49
|
+
state.scenario.curLine = 0;
|
|
50
|
+
|
|
51
|
+
await observer.emit(SUBSCRIBE_EVENTS.RESULT, { success: false });
|
|
52
|
+
|
|
53
|
+
expect(state.scenario.curLine).toBe(2);
|
|
54
|
+
expect(next).toHaveBeenCalledOnce();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { spyEvent } from "@vnejs/test-utils";
|
|
4
|
+
import { SUBSCRIBE_EVENTS as SCENARIO_EVENTS } from "@vnejs/contracts.core.scenario";
|
|
5
|
+
|
|
6
|
+
import { QteScenario } from "../modules/scenario.js";
|
|
7
|
+
import { createQteTestModule, registerQtePluginVne, SUBSCRIBE_EVENTS } from "./setup.js";
|
|
8
|
+
|
|
9
|
+
describe("QteScenario", () => {
|
|
10
|
+
beforeEach(() => registerQtePluginVne());
|
|
11
|
+
|
|
12
|
+
it("onLineExec emits EMIT with item from PARAMS", async () => {
|
|
13
|
+
const { module, observer } = createQteTestModule(QteScenario, { subscribe: false });
|
|
14
|
+
const emit = spyEvent(observer, SUBSCRIBE_EVENTS.EMIT);
|
|
15
|
+
|
|
16
|
+
await (module as QteScenario).onLineExec({ line: "door_lock" });
|
|
17
|
+
|
|
18
|
+
expect(emit).toHaveBeenCalledExactlyOnceWith({
|
|
19
|
+
id: "door_lock",
|
|
20
|
+
item: { start: 70, size: 20, duration: 1500 },
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("onLineExec emits RESULT fail when item is missing", async () => {
|
|
25
|
+
const { module, observer } = createQteTestModule(QteScenario, { subscribe: false });
|
|
26
|
+
const result = spyEvent(observer, SUBSCRIBE_EVENTS.RESULT);
|
|
27
|
+
|
|
28
|
+
await (module as QteScenario).onLineExec({ line: "unknown" });
|
|
29
|
+
|
|
30
|
+
expect(result).toHaveBeenCalledExactlyOnceWith({ success: false });
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("init registers block handler", async () => {
|
|
34
|
+
const { module, observer } = createQteTestModule(QteScenario, { subscribe: false, init: false });
|
|
35
|
+
const reg = spyEvent(observer, SCENARIO_EVENTS.LINE_EXEC_REG);
|
|
36
|
+
|
|
37
|
+
await (module as QteScenario).init();
|
|
38
|
+
|
|
39
|
+
expect(reg).toHaveBeenCalledExactlyOnceWith({ block: "qte", handler: expect.any(Function) });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.scenario.qte";
|
|
2
|
+
import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin, stubSilentEvent } from "@vnejs/test-utils";
|
|
3
|
+
import { SUBSCRIBE_EVENTS as SCENARIO_EVENTS } from "@vnejs/contracts.core.scenario";
|
|
4
|
+
|
|
5
|
+
export const registerQtePluginVne = () => {
|
|
6
|
+
registerCoreVne();
|
|
7
|
+
registerVnePlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS, params: { ...PARAMS, ITEMS: { door_lock: { start: 70, size: 20, duration: 1500 } } } });
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const createQteTestModule = <T extends Parameters<typeof baseCreateTestModule>[0]>(
|
|
11
|
+
ModuleClass: T,
|
|
12
|
+
options: Parameters<typeof baseCreateTestModule>[1] = {},
|
|
13
|
+
) => {
|
|
14
|
+
const result = baseCreateTestModule(ModuleClass, {
|
|
15
|
+
state: {
|
|
16
|
+
scenario: { curLine: 0, label: "start" },
|
|
17
|
+
...(options.state ?? {}),
|
|
18
|
+
},
|
|
19
|
+
...options,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
stubSilentEvent(result.observer, SCENARIO_EVENTS.NEXT);
|
|
23
|
+
stubSilentEvent(result.observer, SCENARIO_EVENTS.LINE_EXEC_REG);
|
|
24
|
+
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { SUBSCRIBE_EVENTS, PLUGIN_NAME, SCENARIO_EVENTS };
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
|
|
3
|
+
import type { PluginName as LogsPluginName, SubscribeEvents as LogsSubscribeEvents } from "@vnejs/contracts.core.logs";
|
|
4
|
+
import type {
|
|
5
|
+
Constants as ScenarioConstants,
|
|
6
|
+
PluginName as ScenarioPluginName,
|
|
7
|
+
SubscribeEvents as ScenarioSubscribeEvents,
|
|
8
|
+
} from "@vnejs/contracts.core.scenario";
|
|
9
|
+
import type { PluginName as VendorsPluginName, SubscribeEvents as VendorsSubscribeEvents } from "@vnejs/contracts.core.vendors";
|
|
10
|
+
|
|
11
|
+
import type { PluginName, SubscribeEvents, Params } from "@vnejs/contracts.scenario.qte";
|
|
12
|
+
|
|
13
|
+
export type QtePluginEvents = ModuleCoreEvents &
|
|
14
|
+
Record<PluginName, SubscribeEvents> &
|
|
15
|
+
Record<ScenarioPluginName, ScenarioSubscribeEvents> &
|
|
16
|
+
Record<VendorsPluginName, VendorsSubscribeEvents> &
|
|
17
|
+
Record<LogsPluginName, LogsSubscribeEvents>;
|
|
18
|
+
|
|
19
|
+
export type QtePluginConstants = ModuleCoreConstants & Record<ScenarioPluginName, ScenarioConstants>;
|
|
20
|
+
|
|
21
|
+
export type QtePluginSettings = ModuleCoreSettings;
|
|
22
|
+
|
|
23
|
+
export type QtePluginParams = ModuleCoreParams & Record<PluginName, Params>;
|
package/src/utils/qte.ts
ADDED