@vnejs/compatibility.text-with-scenario.autoread 0.1.12
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 +12 -0
- package/dist/index.js +15 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.js +1 -0
- package/package.json +41 -0
- package/src/index.ts +24 -0
- package/src/types.ts +13 -0
- package/tsconfig.json +6 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@vnejs/contracts.scenario.autoread";
|
|
2
|
+
import "@vnejs/contracts.text";
|
|
3
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
4
|
+
import type { AutoreadSourcePayload } from "@vnejs/contracts.scenario.autoread";
|
|
5
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
6
|
+
export declare class CompatibilityTextAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
7
|
+
name: string;
|
|
8
|
+
sourceArg: AutoreadSourcePayload;
|
|
9
|
+
subscribe: () => void;
|
|
10
|
+
onTextEmit: () => Promise<unknown[]> | undefined;
|
|
11
|
+
onTextEmitEnd: () => Promise<unknown[]> | undefined;
|
|
12
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "@vnejs/contracts.scenario.autoread";
|
|
2
|
+
import "@vnejs/contracts.text";
|
|
3
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
4
|
+
import { regModule } from "@vnejs/shared";
|
|
5
|
+
export class CompatibilityTextAutoread extends ModuleCore {
|
|
6
|
+
name = "compatibility.text-with-scenario.autoread";
|
|
7
|
+
sourceArg = { source: this.CONST.TEXT.SOURCE };
|
|
8
|
+
subscribe = () => {
|
|
9
|
+
this.on(this.EVENTS.TEXT.EMIT, this.onTextEmit);
|
|
10
|
+
this.on(this.EVENTS.TEXT.EMIT_END, this.onTextEmitEnd);
|
|
11
|
+
};
|
|
12
|
+
onTextEmit = () => this.emit(this.EVENTS.AUTOREAD.PUSH, this.sourceArg);
|
|
13
|
+
onTextEmitEnd = () => this.emit(this.EVENTS.AUTOREAD.POP, this.sourceArg);
|
|
14
|
+
}
|
|
15
|
+
regModule(CompatibilityTextAutoread);
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as AutoreadPluginName, SubscribeEvents as AutoreadSubscribeEvents } from "@vnejs/contracts.scenario.autoread";
|
|
3
|
+
import type { Constants as TextConstants, PluginName as TextPluginName, SubscribeEvents as TextSubscribeEvents } from "@vnejs/contracts.text";
|
|
4
|
+
export type PluginEvents = ModuleCoreEvents & Record<TextPluginName, TextSubscribeEvents> & Record<AutoreadPluginName, AutoreadSubscribeEvents>;
|
|
5
|
+
export type PluginConstants = ModuleCoreConstants & Record<TextPluginName, TextConstants>;
|
|
6
|
+
export type PluginSettings = ModuleCoreSettings;
|
|
7
|
+
export type PluginParams = ModuleCoreParams;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/compatibility.text-with-scenario.autoread",
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"src",
|
|
18
|
+
"tsconfig.json"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
22
|
+
"build": "npx @vnejs/monorepo package",
|
|
23
|
+
"publish:major:plugin": "npm run publish:major",
|
|
24
|
+
"publish:minor:plugin": "npm run publish:minor",
|
|
25
|
+
"publish:patch:plugin": "npm run publish:patch",
|
|
26
|
+
"publish:major": "npx @vnejs/monorepo publish major --access public",
|
|
27
|
+
"publish:minor": "npx @vnejs/monorepo publish minor --access public",
|
|
28
|
+
"publish:patch": "npx @vnejs/monorepo publish patch --access public"
|
|
29
|
+
},
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@vnejs/module.core": "~0.1.0",
|
|
34
|
+
"@vnejs/contracts.scenario.autoread": "~0.1.0",
|
|
35
|
+
"@vnejs/contracts.text": "~0.1.0",
|
|
36
|
+
"@vnejs/shared": "~0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@vnejs/configs.ts-common": "~0.1.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "@vnejs/contracts.scenario.autoread";
|
|
2
|
+
import "@vnejs/contracts.text";
|
|
3
|
+
|
|
4
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
5
|
+
import type { AutoreadSourcePayload } from "@vnejs/contracts.scenario.autoread";
|
|
6
|
+
import { regModule } from "@vnejs/shared";
|
|
7
|
+
|
|
8
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
9
|
+
|
|
10
|
+
export class CompatibilityTextAutoread extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
11
|
+
name = "compatibility.text-with-scenario.autoread";
|
|
12
|
+
|
|
13
|
+
sourceArg: AutoreadSourcePayload = { source: this.CONST.TEXT.SOURCE };
|
|
14
|
+
|
|
15
|
+
subscribe = () => {
|
|
16
|
+
this.on(this.EVENTS.TEXT.EMIT, this.onTextEmit);
|
|
17
|
+
this.on(this.EVENTS.TEXT.EMIT_END, this.onTextEmitEnd);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
onTextEmit = () => this.emit(this.EVENTS.AUTOREAD.PUSH, this.sourceArg);
|
|
21
|
+
onTextEmitEnd = () => this.emit(this.EVENTS.AUTOREAD.POP, this.sourceArg);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
regModule(CompatibilityTextAutoread);
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as AutoreadPluginName, SubscribeEvents as AutoreadSubscribeEvents } from "@vnejs/contracts.scenario.autoread";
|
|
3
|
+
import type { Constants as TextConstants, PluginName as TextPluginName, SubscribeEvents as TextSubscribeEvents } from "@vnejs/contracts.text";
|
|
4
|
+
|
|
5
|
+
export type PluginEvents = ModuleCoreEvents &
|
|
6
|
+
Record<TextPluginName, TextSubscribeEvents> &
|
|
7
|
+
Record<AutoreadPluginName, AutoreadSubscribeEvents>;
|
|
8
|
+
|
|
9
|
+
export type PluginConstants = ModuleCoreConstants & Record<TextPluginName, TextConstants>;
|
|
10
|
+
|
|
11
|
+
export type PluginSettings = ModuleCoreSettings;
|
|
12
|
+
|
|
13
|
+
export type PluginParams = ModuleCoreParams;
|