@vnejs/plugins.text.smooth 0.2.2 → 0.2.3

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.
@@ -6,7 +6,7 @@ export declare class TextSmoothCycle extends ModuleCore<TextSmoothPluginEvents,
6
6
  name: string;
7
7
  textUpdateRaf: number | null;
8
8
  subscribe: () => void;
9
- init: () => Promise<unknown[]> | undefined;
9
+ setup: () => Promise<unknown[]> | undefined;
10
10
  getSmoothState: () => import("@vnejs/contracts.text.smooth").ModuleGlobalStateTextSmooth;
11
11
  onSmooth: ({ tokensVisible }?: TextSmoothPayload) => Promise<void>;
12
12
  setUpdateTextRaf: (tokens?: TextSmoothPayload["tokens"]) => void;
@@ -8,7 +8,7 @@ export class TextSmoothCycle extends ModuleCore {
8
8
  this.on(this.EVENTS.TEXT.EMIT_END, this.cancelRaf);
9
9
  this.on(this.EVENTS.STATE.CLEAR, this.cancelRaf);
10
10
  };
11
- init = () => this.emit(this.EVENTS.SETTINGS.INIT, {
11
+ setup = () => this.emit(this.EVENTS.SETTINGS.INIT, {
12
12
  name: this.SETTINGS.TEXT_SMOOTH.TOKEN_RENDER_SPEED,
13
13
  value: this.PARAMS.TEXT_SMOOTH.DEFAULT_TOKEN_RENDER_SPEED,
14
14
  });
@@ -2,5 +2,5 @@ import { ModuleCore } from "@vnejs/module.core";
2
2
  import type { TextSmoothPluginConstants, TextSmoothPluginEvents, TextSmoothPluginParams, TextSmoothPluginSettings } from "../types.js";
3
3
  export declare class TextSmoothInit extends ModuleCore<TextSmoothPluginEvents, TextSmoothPluginConstants, TextSmoothPluginSettings, TextSmoothPluginParams> {
4
4
  name: string;
5
- init: () => void;
5
+ postinject: () => void;
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { ModuleCore } from "@vnejs/module.core";
2
2
  export class TextSmoothInit extends ModuleCore {
3
3
  name = "text.smooth.init";
4
- init = () => {
4
+ postinject = () => {
5
5
  this.shared.isTextSmoothInProcess = false;
6
6
  };
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.text.smooth",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@ export class TextSmoothCycle extends ModuleCore<
24
24
  this.on(this.EVENTS.STATE.CLEAR, this.cancelRaf);
25
25
  };
26
26
 
27
- init = () =>
27
+ setup = () =>
28
28
  this.emit(this.EVENTS.SETTINGS.INIT, {
29
29
  name: this.SETTINGS.TEXT_SMOOTH.TOKEN_RENDER_SPEED,
30
30
  value: this.PARAMS.TEXT_SMOOTH.DEFAULT_TOKEN_RENDER_SPEED,
@@ -5,7 +5,7 @@ import type { TextSmoothPluginConstants, TextSmoothPluginEvents, TextSmoothPlugi
5
5
  export class TextSmoothInit extends ModuleCore<TextSmoothPluginEvents, TextSmoothPluginConstants, TextSmoothPluginSettings, TextSmoothPluginParams> {
6
6
  name = "text.smooth.init";
7
7
 
8
- init = () => {
8
+ postinject = () => {
9
9
  this.shared.isTextSmoothInProcess = false;
10
10
  };
11
11
  }
@@ -9,12 +9,12 @@ describe("TextSmoothInit", () => {
9
9
  registerTextSmoothPluginVne();
10
10
  });
11
11
 
12
- it("init resets isTextSmoothInProcess flag", async () => {
12
+ it("postinject resets isTextSmoothInProcess flag", () => {
13
13
  const { module, shared } = createTextSmoothTestModule(TextSmoothInit, { subscribe: false });
14
14
 
15
15
  shared.isTextSmoothInProcess = true;
16
16
 
17
- await (module as TextSmoothInit).init();
17
+ (module as TextSmoothInit).postinject!();
18
18
 
19
19
  expect(shared.isTextSmoothInProcess).toBe(false);
20
20
  });