@vnejs/compatibility.text-with-scenario.autoread 0.2.1 → 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
@@ -3,10 +3,10 @@ import "@vnejs/contracts.text";
3
3
  import { ModuleCore } from "@vnejs/module.core";
4
4
  import type { AutoreadSourcePayload } from "@vnejs/contracts.scenario.autoread";
5
5
  import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
6
- export declare class CompatibilityTextAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
6
+ export declare class CompatibilityTextWithScenarioAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
7
7
  name: string;
8
8
  sourceArg: AutoreadSourcePayload;
9
9
  subscribe: () => void;
10
- onTextEmit: () => Promise<unknown[]> | undefined;
11
- onTextEmitEnd: () => Promise<unknown[]> | undefined;
10
+ onTextEmit: () => Promise<import("@vnejs/shared").EmitResults<"vne:autoread:push">> | undefined;
11
+ onTextEmitEnd: () => Promise<import("@vnejs/shared").EmitResults<"vne:autoread:pop">> | undefined;
12
12
  }
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import "@vnejs/contracts.scenario.autoread";
2
2
  import "@vnejs/contracts.text";
3
3
  import { ModuleCore } from "@vnejs/module.core";
4
4
  import { regModule } from "@vnejs/shared";
5
- export class CompatibilityTextAutoread extends ModuleCore {
5
+ export class CompatibilityTextWithScenarioAutoread extends ModuleCore {
6
6
  name = "compatibility.text-with-scenario.autoread";
7
7
  sourceArg = { source: this.CONST.TEXT.SOURCE };
8
8
  subscribe = () => {
@@ -12,4 +12,4 @@ export class CompatibilityTextAutoread extends ModuleCore {
12
12
  onTextEmit = () => this.emit(this.EVENTS.AUTOREAD.PUSH, this.sourceArg);
13
13
  onTextEmitEnd = () => this.emit(this.EVENTS.AUTOREAD.POP, this.sourceArg);
14
14
  }
15
- regModule(CompatibilityTextAutoread);
15
+ regModule(CompatibilityTextWithScenarioAutoread);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/compatibility.text-with-scenario.autoread",
3
- "version": "0.2.1",
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
@@ -7,7 +7,7 @@ import { regModule } from "@vnejs/shared";
7
7
 
8
8
  import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
9
9
 
10
- export class CompatibilityTextAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
10
+ export class CompatibilityTextWithScenarioAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
11
11
  name = "compatibility.text-with-scenario.autoread";
12
12
 
13
13
  sourceArg: AutoreadSourcePayload = { source: this.CONST.TEXT.SOURCE };
@@ -18,7 +18,8 @@ export class CompatibilityTextAutoread extends ModuleCore<PluginEvents, PluginCo
18
18
  };
19
19
 
20
20
  onTextEmit = () => this.emit(this.EVENTS.AUTOREAD.PUSH, this.sourceArg);
21
+
21
22
  onTextEmitEnd = () => this.emit(this.EVENTS.AUTOREAD.POP, this.sourceArg);
22
23
  }
23
24
 
24
- regModule(CompatibilityTextAutoread);
25
+ regModule(CompatibilityTextWithScenarioAutoread);
@@ -2,16 +2,16 @@ import { beforeEach, describe, expect, it } from "vitest";
2
2
 
3
3
  import { spyEvent } from "@vnejs/test-utils";
4
4
 
5
- import { CompatibilityTextAutoread } from "../index.js";
5
+ import { CompatibilityTextWithScenarioAutoread } from "../index.js";
6
6
  import { AUTOREAD_EVENTS, createCompatibilityTestModule, registerCompatibilityVne, TEXT_CONST, TEXT_EVENTS } from "./setup.js";
7
7
 
8
- describe("CompatibilityTextAutoread", () => {
8
+ describe("CompatibilityTextWithScenarioAutoread", () => {
9
9
  beforeEach(() => {
10
10
  registerCompatibilityVne();
11
11
  });
12
12
 
13
13
  it("TEXT.EMIT emits AUTOREAD.PUSH with text source", async () => {
14
- const { observer } = createCompatibilityTestModule(CompatibilityTextAutoread);
14
+ const { observer } = createCompatibilityTestModule(CompatibilityTextWithScenarioAutoread);
15
15
  const push = spyEvent(observer, AUTOREAD_EVENTS.PUSH);
16
16
 
17
17
  await observer.emit(TEXT_EVENTS.EMIT);
@@ -21,7 +21,7 @@ describe("CompatibilityTextAutoread", () => {
21
21
  });
22
22
 
23
23
  it("TEXT.EMIT_END emits AUTOREAD.POP with text source", async () => {
24
- const { observer } = createCompatibilityTestModule(CompatibilityTextAutoread);
24
+ const { observer } = createCompatibilityTestModule(CompatibilityTextWithScenarioAutoread);
25
25
  const pop = spyEvent(observer, AUTOREAD_EVENTS.POP);
26
26
 
27
27
  await observer.emit(TEXT_EVENTS.EMIT_END);