@vnejs/compatibility.text-with-audio.voice 0.2.2 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -10,8 +10,8 @@ type CompatState = {
10
10
  export declare class CompatibilityTextWithAudioVoice extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams, CompatState> {
11
11
  name: string;
12
12
  subscribe: () => void;
13
- init: () => Promise<[unknown[] | undefined, unknown[] | undefined]>;
14
- onLineLoad: ({ args, priority }?: LineLoadHandlerArg) => Promise<unknown[]> | undefined;
13
+ init: () => Promise<import("@vnejs/shared").EmitResults<"vne:scenario:line_load_reg">> | undefined;
14
+ onLineLoad: ({ args, priority }?: LineLoadHandlerArg) => Promise<import("@vnejs/shared").EmitResults<"vne:audio:media_load">> | undefined;
15
15
  onTextEmitBefore: () => Promise<void>;
16
16
  onTextEmit: (payload?: TextEmitPayload) => Promise<void>;
17
17
  onInteractStarted: () => Promise<void>;
package/dist/index.js CHANGED
@@ -12,11 +12,9 @@ export class CompatibilityTextWithAudioVoice extends ModuleCore {
12
12
  this.on(this.EVENTS.INTERACT.STARTED, this.onInteractStarted);
13
13
  this.on(this.EVENTS.SETTINGS.CHANGED, this.onSettingsChanged);
14
14
  this.on(this.EVENTS.STATE.CLEAR, this.onStateClear);
15
+ this.on(this.EVENTS.TEXT.EMIT, this.onTextEmitBefore, { priority: this.CONST.TEXT.EMIT_PRIORITY.BEFORE });
15
16
  };
16
- init = () => Promise.all([
17
- this.emit(this.EVENTS.SCENARIO.LINE_LOAD_REG, { module: this.CONST.SCENARIO.OTHER_MODULE, handler: this.onLineLoad }),
18
- this.emit(this.EVENTS.TEXT.EMIT_BEFORE_REG, { handler: this.onTextEmitBefore }),
19
- ]);
17
+ init = () => this.emit(this.EVENTS.SCENARIO.LINE_LOAD_REG, { module: this.CONST.SCENARIO.OTHER_MODULE, handler: this.onLineLoad });
20
18
  onLineLoad = ({ args = {}, priority = this.CONST.MEDIA.PRIORITIES.BACKGROUND } = {}) => {
21
19
  const voice = this.getVoiceArg(args);
22
20
  if (!voice || this.shared.voiceDisableSources.isNotEmpty())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/compatibility.text-with-audio.voice",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -22,13 +22,10 @@ export class CompatibilityTextWithAudioVoice extends ModuleCore<PluginEvents, Pl
22
22
  this.on(this.EVENTS.INTERACT.STARTED, this.onInteractStarted);
23
23
  this.on(this.EVENTS.SETTINGS.CHANGED, this.onSettingsChanged);
24
24
  this.on(this.EVENTS.STATE.CLEAR, this.onStateClear);
25
+ this.on(this.EVENTS.TEXT.EMIT, this.onTextEmitBefore, { priority: this.CONST.TEXT.EMIT_PRIORITY.BEFORE });
25
26
  };
26
27
 
27
- init = () =>
28
- Promise.all([
29
- this.emit(this.EVENTS.SCENARIO.LINE_LOAD_REG, { module: this.CONST.SCENARIO.OTHER_MODULE, handler: this.onLineLoad }),
30
- this.emit(this.EVENTS.TEXT.EMIT_BEFORE_REG, { handler: this.onTextEmitBefore }),
31
- ]);
28
+ init = () => this.emit(this.EVENTS.SCENARIO.LINE_LOAD_REG, { module: this.CONST.SCENARIO.OTHER_MODULE, handler: this.onLineLoad });
32
29
 
33
30
  onLineLoad = ({ args = {}, priority = this.CONST.MEDIA.PRIORITIES.BACKGROUND }: LineLoadHandlerArg = {}) => {
34
31
  const voice = this.getVoiceArg(args);