@vnejs/plugins.scenario.fastforward 0.1.5 → 0.1.7
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 +2 -0
- package/dist/index.js +2 -0
- package/dist/modules/fastforward.d.ts +0 -2
- package/dist/modules/fastforward.js +0 -2
- package/dist/modules/visits.d.ts +3 -2
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/modules/fastforward.ts +1 -3
- package/src/modules/visits.ts +3 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "@vnejs/plugins.core.components.contract";
|
|
2
|
+
import "@vnejs/plugins.core.media.contract";
|
|
1
3
|
import "@vnejs/plugins.scenario.fastforward.contract";
|
|
2
4
|
import { regPlugin } from "@vnejs/shared";
|
|
3
5
|
import { CONSTANTS, PARAMS, PLUGIN_NAME, SETTINGS_KEYS, SUBSCRIBE_EVENTS } from "@vnejs/plugins.scenario.fastforward.contract";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "@vnejs/plugins.core.components.contract";
|
|
2
|
-
import "@vnejs/plugins.core.media.contract";
|
|
3
1
|
import { Module } from "@vnejs/module";
|
|
4
2
|
import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
|
|
5
3
|
export declare class Fastforward extends Module<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams> {
|
package/dist/modules/visits.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import "@vnejs/plugins.core.scenario.contract";
|
|
2
2
|
import "@vnejs/plugins.text.contract";
|
|
3
3
|
import { Module, type ModuleGlobalStateRegistry } from "@vnejs/module";
|
|
4
|
-
import type {
|
|
4
|
+
import type { TextEmitPayload } from "@vnejs/plugins.text.contract";
|
|
5
|
+
import type { ModuleGlobalStateFastforwardVisits } from "@vnejs/plugins.scenario.fastforward.contract";
|
|
5
6
|
import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
|
|
6
7
|
export declare class FastforwardVisits extends Module<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams, ModuleGlobalStateFastforwardVisits> {
|
|
7
8
|
name: string;
|
|
8
9
|
visits: Record<string, number>;
|
|
9
10
|
subscribe: () => void;
|
|
10
11
|
init: () => Promise<void>;
|
|
11
|
-
onText: ({ text, speaker }?:
|
|
12
|
+
onText: ({ text, speaker }?: TextEmitPayload) => Promise<void>;
|
|
12
13
|
onVisitCheck: () => Promise<{
|
|
13
14
|
isAllowed: boolean;
|
|
14
15
|
source: string;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import "@vnejs/plugins.core.components.contract";
|
|
2
|
-
import "@vnejs/plugins.core.media.contract";
|
|
3
|
-
|
|
4
1
|
import { Module } from "@vnejs/module";
|
|
2
|
+
|
|
5
3
|
import type { FastforwardChangedPayload, FastforwardCheckResult } from "@vnejs/plugins.scenario.fastforward.contract";
|
|
6
4
|
|
|
7
5
|
import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
|
package/src/modules/visits.ts
CHANGED
|
@@ -2,7 +2,8 @@ import "@vnejs/plugins.core.scenario.contract";
|
|
|
2
2
|
import "@vnejs/plugins.text.contract";
|
|
3
3
|
|
|
4
4
|
import { Module, type ModuleGlobalStateRegistry } from "@vnejs/module";
|
|
5
|
-
import type {
|
|
5
|
+
import type { TextEmitPayload } from "@vnejs/plugins.text.contract";
|
|
6
|
+
import type { FastforwardCheckResult, ModuleGlobalStateFastforwardVisits } from "@vnejs/plugins.scenario.fastforward.contract";
|
|
6
7
|
|
|
7
8
|
import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
|
|
8
9
|
|
|
@@ -31,7 +32,7 @@ export class FastforwardVisits extends Module<
|
|
|
31
32
|
this.visits = (await this.emitOne(this.EVENTS.STORAGE.GET_ALL, { module: this.name })) as Record<string, number>;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
onText = async ({ text = "", speaker = "" }:
|
|
35
|
+
onText = async ({ text = "", speaker = "" }: TextEmitPayload = {}) => {
|
|
35
36
|
const key = (await this.emitOne(this.EVENTS.VENDORS.HASH, this.state)) as string;
|
|
36
37
|
|
|
37
38
|
this.visits[key] = 1;
|