@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 +3 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +3 -2
- package/src/tests/scenario.autoread.test.ts +4 -4
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
|
|
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<
|
|
11
|
-
onTextEmitEnd: () => Promise<
|
|
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
|
|
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(
|
|
15
|
+
regModule(CompatibilityTextWithScenarioAutoread);
|
package/package.json
CHANGED
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
|
|
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(
|
|
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 {
|
|
5
|
+
import { CompatibilityTextWithScenarioAutoread } from "../index.js";
|
|
6
6
|
import { AUTOREAD_EVENTS, createCompatibilityTestModule, registerCompatibilityVne, TEXT_CONST, TEXT_EVENTS } from "./setup.js";
|
|
7
7
|
|
|
8
|
-
describe("
|
|
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(
|
|
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(
|
|
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);
|