@vnejs/plugins.scenario.fastforward 0.2.6 → 0.2.8
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.js +1 -1
- package/dist/modules/fastforward.d.ts +5 -5
- package/dist/modules/fastforward.js +4 -4
- package/dist/modules/storage.d.ts +2 -2
- package/dist/modules/visits.d.ts +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/modules/fastforward.ts +8 -5
- package/src/modules/visits.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@vnejs/contracts.scenario.fastforward";
|
|
2
|
-
import { regPlugin } from "@vnejs/
|
|
2
|
+
import { regPlugin } from "@vnejs/registry";
|
|
3
3
|
import { CONSTANTS, PARAMS, PLUGIN_NAME, SETTINGS_KEYS, SUBSCRIBE_EVENTS } from "@vnejs/contracts.scenario.fastforward";
|
|
4
4
|
import { FastforwardEmit } from "./modules/emit.js";
|
|
5
5
|
import { Fastforward } from "./modules/fastforward.js";
|
|
@@ -2,16 +2,16 @@ import { ModuleCore } from "@vnejs/module.core";
|
|
|
2
2
|
import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
|
|
3
3
|
export declare class Fastforward extends ModuleCore<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams> {
|
|
4
4
|
name: string;
|
|
5
|
-
emitStop: () => Promise<import("@vnejs/shared").EmitResults<"vne:fastforward:stop">> | undefined;
|
|
6
5
|
subscribe: () => void;
|
|
7
|
-
setup: () => Promise<[import("@vnejs/
|
|
6
|
+
setup: () => Promise<[import("@vnejs/registry").EmitResults<"vne:settings:init"> | undefined, import("@vnejs/registry").EmitResults<"vne:settings:init"> | undefined]>;
|
|
8
7
|
init: () => void;
|
|
9
|
-
|
|
8
|
+
onStop: () => void;
|
|
9
|
+
onStart: () => void;
|
|
10
10
|
onCheck: () => {
|
|
11
11
|
isAllowed: boolean;
|
|
12
12
|
source: string;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
onToggle: () => void;
|
|
15
|
+
emitStop: () => Promise<import("@vnejs/registry").EmitResults<"vne:fastforward:stop">> | undefined;
|
|
16
16
|
setValue: (value: boolean) => void;
|
|
17
17
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
export class Fastforward extends ModuleCore {
|
|
3
3
|
name = "fastforward";
|
|
4
|
-
emitStop = () => this.emit(this.EVENTS.FASTFORWARD.STOP);
|
|
5
4
|
subscribe = () => {
|
|
6
5
|
this.on(this.EVENTS.FASTFORWARD.STOP, this.onStop);
|
|
7
6
|
this.on(this.EVENTS.FASTFORWARD.START, this.onStart);
|
|
@@ -16,10 +15,11 @@ export class Fastforward extends ModuleCore {
|
|
|
16
15
|
init = () => {
|
|
17
16
|
this.setValue(false);
|
|
18
17
|
};
|
|
19
|
-
onToggle = () => this.setValue(!this.shared.isFastforwardOn);
|
|
20
|
-
onCheck = () => ({ isAllowed: this.shared.settings[this.SETTINGS.FASTFORWARD.ENABLED], source: this.name });
|
|
21
|
-
onStart = () => this.setValue(true);
|
|
22
18
|
onStop = () => this.setValue(false);
|
|
19
|
+
onStart = () => this.setValue(true);
|
|
20
|
+
onCheck = () => ({ isAllowed: this.shared.settings[this.SETTINGS.FASTFORWARD.ENABLED], source: this.name });
|
|
21
|
+
onToggle = () => this.setValue(!this.shared.isFastforwardOn);
|
|
22
|
+
emitStop = () => this.emit(this.EVENTS.FASTFORWARD.STOP);
|
|
23
23
|
setValue = (value) => {
|
|
24
24
|
this.shared.isFastforwardOn = value;
|
|
25
25
|
this.shared.mediaNoTimeoutSources.set(this.name, value);
|
|
@@ -5,6 +5,6 @@ export declare class FastforwardStorage extends ModuleCore<FastforwardPluginEven
|
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
|
7
7
|
init: () => Promise<void>;
|
|
8
|
-
onVisitAdd: ({ key, group }?: FastforwardVisitAddPayload) => Promise<import("@vnejs/
|
|
9
|
-
onClear: () => Promise<import("@vnejs/
|
|
8
|
+
onVisitAdd: ({ key, group }?: FastforwardVisitAddPayload) => Promise<import("@vnejs/registry").EmitResults<"vne:storage:set">> | undefined;
|
|
9
|
+
onClear: () => Promise<import("@vnejs/registry").EmitResults<"vne:storage:rm_all">> | undefined;
|
|
10
10
|
}
|
package/dist/modules/visits.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPl
|
|
|
4
4
|
export declare class FastforwardVisits extends ModuleCore<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams, ModuleGlobalStateFastforwardVisits> {
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
|
7
|
-
setup: () => Promise<import("@vnejs/
|
|
7
|
+
setup: () => Promise<import("@vnejs/registry").EmitResults<"vne:settings:init">> | undefined;
|
|
8
8
|
onVisitCheck: () => Promise<{
|
|
9
9
|
isAllowed: boolean;
|
|
10
10
|
source: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/plugins.scenario.fastforward",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@vnejs/module.core": "~0.2.0",
|
|
38
|
-
"@vnejs/
|
|
38
|
+
"@vnejs/registry": "~0.2.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@vnejs/configs.ts-common": "~0.2.0",
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@vnejs/contracts.scenario.fastforward";
|
|
2
2
|
|
|
3
|
-
import { regPlugin } from "@vnejs/
|
|
3
|
+
import { regPlugin } from "@vnejs/registry";
|
|
4
4
|
import { CONSTANTS, PARAMS, PLUGIN_NAME, SETTINGS_KEYS, SUBSCRIBE_EVENTS } from "@vnejs/contracts.scenario.fastforward";
|
|
5
5
|
|
|
6
6
|
import { FastforwardEmit } from "./modules/emit.js";
|
|
@@ -7,8 +7,6 @@ import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPl
|
|
|
7
7
|
export class Fastforward extends ModuleCore<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams> {
|
|
8
8
|
name = "fastforward";
|
|
9
9
|
|
|
10
|
-
emitStop = () => this.emit(this.EVENTS.FASTFORWARD.STOP);
|
|
11
|
-
|
|
12
10
|
subscribe = () => {
|
|
13
11
|
this.on(this.EVENTS.FASTFORWARD.STOP, this.onStop);
|
|
14
12
|
this.on(this.EVENTS.FASTFORWARD.START, this.onStart);
|
|
@@ -28,11 +26,16 @@ export class Fastforward extends ModuleCore<FastforwardPluginEvents, Fastforward
|
|
|
28
26
|
this.setValue(false);
|
|
29
27
|
};
|
|
30
28
|
|
|
31
|
-
onToggle = () => this.setValue(!this.shared.isFastforwardOn);
|
|
32
|
-
onCheck = () => ({ isAllowed: this.shared.settings[this.SETTINGS.FASTFORWARD.ENABLED], source: this.name }) satisfies FastforwardCheckResult;
|
|
33
|
-
onStart = () => this.setValue(true);
|
|
34
29
|
onStop = () => this.setValue(false);
|
|
35
30
|
|
|
31
|
+
onStart = () => this.setValue(true);
|
|
32
|
+
|
|
33
|
+
onCheck = () => ({ isAllowed: this.shared.settings[this.SETTINGS.FASTFORWARD.ENABLED], source: this.name }) satisfies FastforwardCheckResult;
|
|
34
|
+
|
|
35
|
+
onToggle = () => this.setValue(!this.shared.isFastforwardOn);
|
|
36
|
+
|
|
37
|
+
emitStop = () => this.emit(this.EVENTS.FASTFORWARD.STOP);
|
|
38
|
+
|
|
36
39
|
setValue = (value: boolean) => {
|
|
37
40
|
this.shared.isFastforwardOn = value;
|
|
38
41
|
|
package/src/modules/visits.ts
CHANGED
|
@@ -29,6 +29,7 @@ export class FastforwardVisits extends ModuleCore<
|
|
|
29
29
|
|
|
30
30
|
return { isAllowed, source: this.name } satisfies FastforwardCheckResult;
|
|
31
31
|
};
|
|
32
|
+
|
|
32
33
|
onVisitAdd = ({ key = "", module, block, line, args = {}, keywords = [] }: FastforwardVisitAddPayload = {}) => {
|
|
33
34
|
this.shared.fastforwardStorage.add(key);
|
|
34
35
|
|