@vnejs/plugins.scenario.fastforward 0.2.5 → 0.2.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.
@@ -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
6
  setup: () => Promise<[import("@vnejs/shared").EmitResults<"vne:settings:init"> | undefined, import("@vnejs/shared").EmitResults<"vne:settings:init"> | undefined]>;
8
7
  init: () => void;
9
- onToggle: () => void;
8
+ onStop: () => void;
9
+ onStart: () => void;
10
10
  onCheck: () => {
11
11
  isAllowed: boolean;
12
12
  source: string;
13
13
  };
14
- onStart: () => void;
15
- onStop: () => void;
14
+ onToggle: () => void;
15
+ emitStop: () => Promise<import("@vnejs/shared").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,7 +5,7 @@ export class FastforwardVisits extends ModuleCore {
5
5
  subscribe = () => {
6
6
  this.on(this.EVENTS.FASTFORWARD.CHECK, this.onVisitCheck);
7
7
  this.on(this.EVENTS.FASTFORWARD.VISIT_ADD, this.onVisitAdd);
8
- this.on(this.EVENTS.STATE.SET, this.onSetStateClone);
8
+ this.on(this.EVENTS.STATE.SET, this.setClonedState);
9
9
  this.on(this.EVENTS.STATE.CLEAR, this.setDefaultState);
10
10
  };
11
11
  setup = () => this.emit(this.EVENTS.SETTINGS.INIT, { name: this.SETTINGS.FASTFORWARD.CHECK_VISITED, value: this.PARAMS.FASTFORWARD.DEFAULT_CHECK_VISITED });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.scenario.fastforward",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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
 
@@ -17,7 +17,7 @@ export class FastforwardVisits extends ModuleCore<
17
17
  this.on(this.EVENTS.FASTFORWARD.CHECK, this.onVisitCheck);
18
18
  this.on(this.EVENTS.FASTFORWARD.VISIT_ADD, this.onVisitAdd);
19
19
 
20
- this.on(this.EVENTS.STATE.SET, this.onSetStateClone);
20
+ this.on(this.EVENTS.STATE.SET, this.setClonedState);
21
21
  this.on(this.EVENTS.STATE.CLEAR, this.setDefaultState);
22
22
  };
23
23
 
@@ -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