@vnejs/plugins.scenario.autoread 0.1.3 → 0.1.4

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.
@@ -1,7 +1,7 @@
1
1
  import { Module } from "@vnejs/module";
2
2
  import type { AutoreadSourcePayload } from "@vnejs/plugins.scenario.autoread.contract";
3
3
  import type { AutoreadPluginConstants, AutoreadPluginEvents, AutoreadPluginParams, AutoreadPluginSettings } from "../types.js";
4
- import type { SettingsChangedPayload } from "../utils/autoread.js";
4
+ import type { SettingsChangedResult } from "@vnejs/plugins.core.settings.contract";
5
5
  export declare class Autoread extends Module<AutoreadPluginEvents, AutoreadPluginConstants, AutoreadPluginSettings, AutoreadPluginParams> {
6
6
  name: string;
7
7
  disableSources: string[];
@@ -11,7 +11,7 @@ export declare class Autoread extends Module<AutoreadPluginEvents, AutoreadPlugi
11
11
  onTry: () => Promise<void | unknown[]>;
12
12
  onPush: ({ source }?: AutoreadSourcePayload) => void;
13
13
  onPop: ({ source }?: AutoreadSourcePayload) => void;
14
- onSettingsChanged: ({ name, value }?: SettingsChangedPayload) => false | Promise<unknown[]> | undefined;
14
+ onSettingsChanged: ({ name, value }: SettingsChangedResult) => false | Promise<unknown[]> | undefined;
15
15
  onStateSet: () => void;
16
16
  createTimeout: () => void;
17
17
  clearTimeout: () => void;
@@ -38,7 +38,7 @@ export class Autoread extends Module {
38
38
  if (!this.disableSources.length)
39
39
  this.createTimeout();
40
40
  };
41
- onSettingsChanged = ({ name, value } = {}) => name === this.SETTINGS.AUTOREAD.ENABLED && this.emit(value ? this.EVENTS.AUTOREAD.POP : this.EVENTS.AUTOREAD.PUSH, { source: this.name });
41
+ onSettingsChanged = ({ name, value }) => name === this.SETTINGS.AUTOREAD.ENABLED && this.emit(value ? this.EVENTS.AUTOREAD.POP : this.EVENTS.AUTOREAD.PUSH, { source: this.name });
42
42
  onStateSet = () => {
43
43
  this.disableSources = [];
44
44
  this.clearTimeout();
@@ -1,6 +1,2 @@
1
1
  import type { AutoreadSourcePayload } from "@vnejs/plugins.scenario.autoread.contract";
2
- export type SettingsChangedPayload = {
3
- name?: string;
4
- value?: unknown;
5
- };
6
2
  export type { AutoreadSourcePayload };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.scenario.autoread",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,7 +2,7 @@ import { Module } from "@vnejs/module";
2
2
  import type { AutoreadSourcePayload } from "@vnejs/plugins.scenario.autoread.contract";
3
3
 
4
4
  import type { AutoreadPluginConstants, AutoreadPluginEvents, AutoreadPluginParams, AutoreadPluginSettings } from "../types.js";
5
- import type { SettingsChangedPayload } from "../utils/autoread.js";
5
+ import type { SettingsChangedResult } from "@vnejs/plugins.core.settings.contract";
6
6
 
7
7
  export class Autoread extends Module<AutoreadPluginEvents, AutoreadPluginConstants, AutoreadPluginSettings, AutoreadPluginParams> {
8
8
  name = "autoread";
@@ -55,7 +55,7 @@ export class Autoread extends Module<AutoreadPluginEvents, AutoreadPluginConstan
55
55
  if (!this.disableSources.length) this.createTimeout();
56
56
  };
57
57
 
58
- onSettingsChanged = ({ name, value }: SettingsChangedPayload = {}) =>
58
+ onSettingsChanged = ({ name, value }: SettingsChangedResult) =>
59
59
  name === this.SETTINGS.AUTOREAD.ENABLED && this.emit(value ? this.EVENTS.AUTOREAD.POP : this.EVENTS.AUTOREAD.PUSH, { source: this.name });
60
60
 
61
61
  onStateSet = () => {
@@ -1,8 +1,3 @@
1
1
  import type { AutoreadSourcePayload } from "@vnejs/plugins.scenario.autoread.contract";
2
2
 
3
- export type SettingsChangedPayload = {
4
- name?: string;
5
- value?: unknown;
6
- };
7
-
8
3
  export type { AutoreadSourcePayload };