@vnejs/plugins.views.achievement 0.1.7 → 0.1.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.
@@ -1,21 +1,13 @@
1
1
  import { Module } from "@vnejs/module";
2
2
  import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
3
- type LineExecPayload = {
4
- keywords?: string[];
5
- line?: string;
6
- };
7
- type LineLoadPayload = {
8
- line?: string;
9
- priority?: number;
10
- };
3
+ import type { LineExecHandlerArg, LineLoadHandlerArg } from "@vnejs/plugins.core.scenario.contract";
11
4
  export declare class AchievementExec extends Module<AchievementPluginEvents, AchievementPluginConstants, AchievementPluginSettings, AchievementPluginParams> {
12
5
  name: string;
13
6
  init: () => Promise<[unknown[] | undefined, unknown[] | undefined]>;
14
- onLineExec: ({ keywords, line }?: LineExecPayload) => Promise<void>;
15
- onLineLoad: ({ line, priority }?: LineLoadPayload) => Promise<unknown> | undefined;
7
+ onLineExec: ({ keywords, line }?: LineExecHandlerArg) => Promise<void>;
8
+ onLineLoad: ({ line, priority }?: LineLoadHandlerArg) => Promise<unknown> | undefined;
16
9
  emitActionExec: (action?: string, tokens?: string[], keywords?: string[]) => Promise<unknown> | undefined;
17
10
  emitUnlockExec: (id?: string, isSkipIfPossible?: boolean) => Promise<unknown> | undefined;
18
11
  emitActionLoad: (action?: string, tokens?: string[], priority?: number) => Promise<unknown> | undefined;
19
12
  emitUnlockLoad: (id?: string, priority?: number) => Promise<unknown> | undefined;
20
13
  }
21
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.views.achievement",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,16 +2,7 @@ import { Module } from "@vnejs/module";
2
2
  import { tokenizeExecLine } from "@vnejs/helpers";
3
3
 
4
4
  import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
5
-
6
- type LineExecPayload = {
7
- keywords?: string[];
8
- line?: string;
9
- };
10
-
11
- type LineLoadPayload = {
12
- line?: string;
13
- priority?: number;
14
- };
5
+ import type { LineExecHandlerArg, LineLoadHandlerArg } from "@vnejs/plugins.core.scenario.contract";
15
6
 
16
7
  export class AchievementExec extends Module<AchievementPluginEvents, AchievementPluginConstants, AchievementPluginSettings, AchievementPluginParams> {
17
8
  name = "achievement.exec";
@@ -22,7 +13,7 @@ export class AchievementExec extends Module<AchievementPluginEvents, Achievement
22
13
  this.emit(this.EVENTS.SCENARIO.LINE_LOAD_REG, { module: "achievement", handler: this.onLineLoad }),
23
14
  ]);
24
15
 
25
- onLineExec = async ({ keywords = [], line = "" }: LineExecPayload = {}) => {
16
+ onLineExec = async ({ keywords = [], line = "" }: LineExecHandlerArg = {}) => {
26
17
  const [action = "", ...tokens] = tokenizeExecLine(line).map(String);
27
18
 
28
19
  await this.emitActionExec(action, tokens, keywords);
@@ -30,7 +21,7 @@ export class AchievementExec extends Module<AchievementPluginEvents, Achievement
30
21
  this.emit(this.EVENTS.SCENARIO.NEXT, { module: this.name });
31
22
  };
32
23
 
33
- onLineLoad = ({ line = "", priority = this.CONST.MEDIA.PRIORITIES.BACKGROUND }: LineLoadPayload = {}) => {
24
+ onLineLoad = ({ line = "", priority = this.CONST.MEDIA.PRIORITIES.BACKGROUND }: LineLoadHandlerArg = {}) => {
34
25
  const [action = "", ...tokens] = tokenizeExecLine(line).map(String);
35
26
 
36
27
  return this.emitActionLoad(action, tokens, priority);