narraleaf-react 0.0.5 → 0.1.0

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.
Files changed (62) hide show
  1. package/dist/game/nlcore/action/action.d.ts +3 -3
  2. package/dist/game/nlcore/action/actionTypes.d.ts +22 -6
  3. package/dist/game/nlcore/action/actions/characterAction.d.ts +14 -0
  4. package/dist/game/nlcore/action/actions/conditionAction.d.ts +15 -0
  5. package/dist/game/nlcore/action/actions/controlAction.d.ts +32 -0
  6. package/dist/game/nlcore/action/actions/imageAction.d.ts +22 -0
  7. package/dist/game/nlcore/action/actions/menuAction.d.ts +13 -0
  8. package/dist/game/nlcore/action/actions/sceneAction.d.ts +29 -0
  9. package/dist/game/nlcore/action/actions/scriptAction.d.ts +10 -0
  10. package/dist/game/nlcore/action/actions/soundAction.d.ts +20 -0
  11. package/dist/game/nlcore/action/actions/storyAction.d.ts +8 -0
  12. package/dist/game/nlcore/action/actions/textAction.d.ts +19 -0
  13. package/dist/game/nlcore/action/actions.d.ts +2 -127
  14. package/dist/game/nlcore/action/logicAction.d.ts +19 -7
  15. package/dist/game/nlcore/common/Utils.d.ts +21 -2
  16. package/dist/game/nlcore/common/elements.d.ts +6 -2
  17. package/dist/game/nlcore/common/transition.d.ts +7 -7
  18. package/dist/game/nlcore/elements/character/pause.d.ts +9 -0
  19. package/dist/game/nlcore/elements/character/sentence.d.ts +29 -0
  20. package/dist/game/nlcore/elements/character/word.d.ts +11 -0
  21. package/dist/game/nlcore/elements/character.d.ts +40 -0
  22. package/dist/game/nlcore/elements/condition.d.ts +0 -2
  23. package/dist/game/nlcore/elements/control.d.ts +11 -0
  24. package/dist/game/nlcore/elements/image.d.ts +11 -23
  25. package/dist/game/nlcore/elements/menu.d.ts +4 -8
  26. package/dist/game/nlcore/elements/scene.d.ts +24 -19
  27. package/dist/game/nlcore/elements/sound.d.ts +1 -1
  28. package/dist/game/nlcore/elements/story.d.ts +1 -1
  29. package/dist/game/nlcore/elements/text.d.ts +67 -55
  30. package/dist/game/nlcore/elements/transform/position.d.ts +3 -3
  31. package/dist/game/nlcore/elements/transform/transform.d.ts +8 -53
  32. package/dist/game/nlcore/elements/transform/type.d.ts +7 -8
  33. package/dist/game/nlcore/elements/transition/{base.d.ts → baseTransitions.d.ts} +10 -3
  34. package/dist/game/nlcore/elements/transition/imageTransitions/dissolve.d.ts +25 -0
  35. package/dist/game/nlcore/elements/transition/imageTransitions/fade.d.ts +19 -0
  36. package/dist/game/nlcore/elements/transition/imageTransitions/fadeIn.d.ts +27 -0
  37. package/dist/game/nlcore/elements/transition/textTransitions/fontSizeTransition.d.ts +15 -0
  38. package/dist/game/nlcore/elements/transition/type.d.ts +11 -6
  39. package/dist/game/nlcore/game.d.ts +3 -4
  40. package/dist/game/nlcore/gameTypes.d.ts +34 -9
  41. package/dist/game/nlcore/types.d.ts +22 -1
  42. package/dist/game/player/elements/displayable/Displayable.d.ts +23 -0
  43. package/dist/game/player/elements/displayable/Displayables.d.ts +7 -0
  44. package/dist/game/player/elements/displayable/Text.d.ts +7 -0
  45. package/dist/game/player/elements/displayable/type.d.ts +15 -0
  46. package/dist/game/player/elements/image/Image.d.ts +1 -2
  47. package/dist/game/player/elements/menu/type.d.ts +1 -1
  48. package/dist/game/player/elements/say/Sentence.d.ts +12 -0
  49. package/dist/game/player/elements/say/TypingEffect.d.ts +4 -0
  50. package/dist/game/player/elements/say/type.d.ts +2 -1
  51. package/dist/game/player/gameState.d.ts +26 -3
  52. package/dist/game/player/gameState.type.d.ts +2 -1
  53. package/dist/game/player/lib/Preloaded.d.ts +1 -1
  54. package/dist/game/player/libElements.d.ts +1 -2
  55. package/dist/main.js +2 -2
  56. package/dist/util/data.d.ts +23 -2
  57. package/package.json +3 -4
  58. package/dist/game/nlcore/elements/transition/dissolve.d.ts +0 -34
  59. package/dist/game/nlcore/elements/transition/fade.d.ts +0 -28
  60. package/dist/game/nlcore/elements/transition/fadeIn.d.ts +0 -35
  61. package/dist/game/player/elements/menu/Sentence.d.ts +0 -6
  62. /package/dist/game/nlcore/{elements → action}/srcManager.d.ts +0 -0
@@ -0,0 +1,19 @@
1
+ import { IImageTransition, ImgElementProp } from "../type";
2
+ import { BaseImageTransition } from "../baseTransitions";
3
+ import { ImageColor, ImageSrc } from "../../../types";
4
+ import { TransformDefinitions } from "../../../elements/transform/type";
5
+ export declare class Fade extends BaseImageTransition<ImgElementProp> implements IImageTransition {
6
+ static Frames: [number, number];
7
+ private readonly duration;
8
+ private state;
9
+ private src?;
10
+ private readonly easing;
11
+ /**
12
+ * The current image will fade out, and the next image will fade in
13
+ */
14
+ constructor(duration?: number, ease?: TransformDefinitions.EasingDefinition);
15
+ setSrc(src: ImageSrc | ImageColor | undefined): this;
16
+ start(onComplete?: () => void): void;
17
+ toElementProps(): ImgElementProp[];
18
+ copy(): Fade;
19
+ }
@@ -0,0 +1,27 @@
1
+ import { IImageTransition, ImgElementProp } from "../../../elements/transition/type";
2
+ import { BaseImageTransition } from "../../../elements/transition/baseTransitions";
3
+ import { ImageColor, ImageSrc } from "../../../types";
4
+ import { TransformDefinitions } from "../../../elements/transform/type";
5
+ export declare class FadeIn extends BaseImageTransition<ImgElementProp> implements IImageTransition {
6
+ __stack: string;
7
+ private readonly duration;
8
+ private readonly direction;
9
+ private readonly offset;
10
+ private state;
11
+ private src?;
12
+ private readonly easing;
13
+ /**
14
+ * The next image will fade-in in a direction
15
+ * @param direction The direction the image will move from
16
+ * @param offset The distance the image will move (in pixels)
17
+ * @param duration The duration of the transition
18
+ * @param easing
19
+ */
20
+ constructor(direction: "left" | "right" | "top" | "bottom", offset: number, duration?: number, easing?: TransformDefinitions.EasingDefinition);
21
+ setSrc(src: ImageSrc | ImageColor | undefined): this;
22
+ start(onComplete?: () => void): void;
23
+ toElementProps(): ImgElementProp[];
24
+ copy(): FadeIn;
25
+ private getInitialTransform;
26
+ private getTransform;
27
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseTextTransition } from "../../../elements/transition/baseTransitions";
2
+ import { ITextTransition, SpanElementProp } from "../../../elements/transition/type";
3
+ import { TransformDefinitions } from "../../../elements/transform/type";
4
+ export declare class FontSizeTransition extends BaseTextTransition<SpanElementProp> implements ITextTransition {
5
+ static Frames: [number, number];
6
+ private readonly duration;
7
+ private state;
8
+ private readonly easing;
9
+ private readonly startValue;
10
+ private readonly endValue;
11
+ constructor(start: number, end: number, duration?: number, easing?: TransformDefinitions.EasingDefinition);
12
+ start(onComplete?: () => void): void;
13
+ toElementProps(): SpanElementProp[];
14
+ copy(): FontSizeTransition;
15
+ }
@@ -1,20 +1,25 @@
1
- import type { EventDispatcher } from "../../../../util/data";
2
1
  import React from "react";
3
- import type { DOMKeyframesDefinition, AnimationPlaybackControls } from "framer-motion";
2
+ import type { DOMKeyframesDefinition } from "framer-motion";
3
+ import { ImageColor, ImageSrc } from "../../types";
4
4
  export type ElementProp<T extends Element = Element, U extends React.HTMLAttributes<T> = React.HTMLAttributes<T>> = React.JSX.IntrinsicAttributes & React.ClassAttributes<T> & React.HTMLAttributes<T> & U;
5
5
  export type ImgElementProp = ElementProp<HTMLImageElement, React.ImgHTMLAttributes<HTMLImageElement>>;
6
+ export type SpanElementProp = ElementProp<HTMLSpanElement, React.HTMLAttributes<HTMLSpanElement>>;
6
7
  export type CSSElementProp<T extends React.CSSProperties | DOMKeyframesDefinition> = ElementProp & {
7
8
  style: T;
8
9
  };
9
10
  export type CSSProps = React.CSSProperties;
10
- export interface ITransition<T extends ElementProp = {}> {
11
- events: EventDispatcher<EventTypes<[T[]]>>;
12
- controller: AnimationPlaybackControls | null | undefined;
11
+ export interface ITransition<T extends ElementProp = Record<string, any>> {
13
12
  start(onComplete?: () => void): void;
14
13
  toElementProps(): T[];
15
- setSrc(src: string): void;
16
14
  copy(): ITransition<T>;
17
15
  }
16
+ export interface IImageTransition<T extends ElementProp = ImgElementProp> extends ITransition<T> {
17
+ setSrc(src: ImageSrc | ImageColor): void;
18
+ copy(): IImageTransition<T>;
19
+ }
20
+ export interface ITextTransition<T extends ElementProp = SpanElementProp> extends ITransition<T> {
21
+ copy(): ITextTransition<T>;
22
+ }
18
23
  export type EventTypes<T extends any[]> = {
19
24
  "start": [null];
20
25
  "update": T;
@@ -1,5 +1,5 @@
1
- import type { GameConfig, GameSettings, SavedGame } from "./gameTypes";
2
- import { DeepPartial } from "../../util/data";
1
+ import type { GameConfig, SavedGame } from "./gameTypes";
2
+ import { DeepPartial, MultiLock } from "../../util/data";
3
3
  import { Storable } from "./store/storable";
4
4
  import { LogicAction } from "./action/logicAction";
5
5
  import { GameState } from "../player/gameState";
@@ -8,11 +8,9 @@ declare enum GameSettingsNamespace {
8
8
  game = "game"
9
9
  }
10
10
  export declare class Game {
11
- static defaultSettings: GameSettings;
12
11
  static ComponentTypes: {
13
12
  [K in keyof ComponentsTypes]: K;
14
13
  };
15
- static DefaultConfig: GameConfig;
16
14
  static GameSettingsNamespace: typeof GameSettingsNamespace;
17
15
  /**
18
16
  * Create a new game
@@ -33,6 +31,7 @@ export declare class LiveGame {
33
31
  readonly game: "game";
34
32
  };
35
33
  game: Game;
34
+ gameLock: MultiLock;
36
35
  getStorable(): Storable;
37
36
  /**
38
37
  * Serialize the current game state
@@ -4,6 +4,7 @@ import { ElementStateRaw } from "./elements/story";
4
4
  import { PlayerStateData } from "../player/gameState";
5
5
  import { StorableData } from "./store/type";
6
6
  import { MenuComponent, SayComponent } from "../player/elements/type";
7
+ import React from "react";
7
8
  export interface SavedGame {
8
9
  name: string;
9
10
  meta: {
@@ -42,7 +43,7 @@ export type GameConfig = {
42
43
  *
43
44
  * See [Key_Values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
44
45
  */
45
- skipKey: string[];
46
+ skipKey: React.KeyboardEvent["key"][];
46
47
  /**
47
48
  * The interval in milliseconds between each skip action.
48
49
  * ex: 100ms means the player can skip 10 actions per second.
@@ -57,7 +58,7 @@ export type GameConfig = {
57
58
  *
58
59
  * See [Key_Values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values)
59
60
  */
60
- nextKey: string[];
61
+ nextKey: React.KeyboardEvent["key"][];
61
62
  /**
62
63
  * The speed of the text effect in milliseconds.
63
64
  * higher value means slower text effect.
@@ -72,10 +73,20 @@ export type GameConfig = {
72
73
  */
73
74
  slowLoadWarning: boolean;
74
75
  slowLoadThreshold: number;
76
+ allowSkipTransform: boolean;
77
+ allowSkipTransition: boolean;
75
78
  };
76
79
  menu: {
77
80
  use: MenuComponent;
78
81
  };
82
+ background: {
83
+ allowSkipTransform: boolean;
84
+ allowSkipTransition: boolean;
85
+ };
86
+ text: {
87
+ allowSkipTransform: boolean;
88
+ allowSkipTransition: boolean;
89
+ };
79
90
  };
80
91
  elementStyles: {
81
92
  say: {
@@ -83,15 +94,29 @@ export type GameConfig = {
83
94
  * Custom class for the say container
84
95
  * Ex: "rounded-md shadow-md" for rounded and shadowed container
85
96
  */
86
- container: string;
87
- nameText: string;
88
- textContainer: string;
89
- textSpan: string;
97
+ containerClassName: string;
98
+ nameTextClassName: string;
99
+ textContainerClassName: string;
100
+ textSpanClassName: string;
101
+ /**
102
+ * The default font family for the text
103
+ * Ex: "Arial, sans-serif"
104
+ *
105
+ * See [Font family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family)
106
+ */
107
+ fontFamily?: React.CSSProperties["fontFamily"];
108
+ /**
109
+ * Font size for the text
110
+ *
111
+ * See [Font size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
112
+ */
113
+ fontSize?: React.CSSProperties["fontSize"];
114
+ rubyClassName: string;
90
115
  };
91
116
  menu: {
92
- container: string;
93
- choiceButton: string;
94
- choiceButtonText: string;
117
+ containerClassName: string;
118
+ choiceButtonClassName: string;
119
+ choiceButtonTextClassName: string;
95
120
  };
96
121
  };
97
122
  app: {
@@ -1,4 +1,8 @@
1
1
  import { IPosition, RawPosition } from "./elements/transform/position";
2
+ import { ITransition } from "./elements/transition/type";
3
+ import { Transform } from "./elements/transform/transform";
4
+ import { EventDispatcher } from "../../util/data";
5
+ import React from "react";
2
6
  export type color = string | {
3
7
  r: number;
4
8
  g: number;
@@ -16,6 +20,12 @@ export type RGBAColor = RGBColor & {
16
20
  export type Color = {
17
21
  color: color;
18
22
  };
23
+ export type Font = {
24
+ italic?: boolean;
25
+ bold?: boolean;
26
+ fontFamily?: React.CSSProperties["fontFamily"];
27
+ fontSize?: React.CSSProperties["fontSize"];
28
+ };
19
29
  export type CommonText = {
20
30
  text: string;
21
31
  } & Color;
@@ -33,8 +43,11 @@ export type Background = {
33
43
  url: string;
34
44
  } | color | null | undefined | StaticImageData;
35
45
  };
46
+ export type ImageSrc = string | StaticImageData;
47
+ export type HexColor = `#${string}`;
48
+ export type ImageColor = color | HexColor;
36
49
  export type CommonImagePosition = "left" | "center" | "right";
37
- export type CommonImage = {
50
+ export type CommonDisplayable = {
38
51
  scale?: number;
39
52
  rotation?: number;
40
53
  position?: RawPosition | IPosition;
@@ -44,3 +57,11 @@ export type CommonImage = {
44
57
  export declare const ImagePosition: {
45
58
  [K in CommonImagePosition]: K;
46
59
  };
60
+ export type DisplayableAnimationEvents = "event:displayable.applyTransform" | "event:displayable.applyTransition" | "event:displayable.init";
61
+ export type EventfulDisplayableEvents = {
62
+ [K in DisplayableAnimationEvents]: K extends "event:displayable.applyTransform" ? [Transform] : K extends "event:displayable.applyTransition" ? [ITransition] : K extends "event:displayable.init" ? [] : never;
63
+ };
64
+ export interface EventfulDisplayable {
65
+ events: EventDispatcher<EventfulDisplayableEvents>;
66
+ toDisplayableTransform(): Transform;
67
+ }
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { EventfulDisplayable } from "../../../nlcore/types";
3
+ import { DisplayableChildHandler, StatefulDisplayable } from "../../elements/displayable/type";
4
+ import { TransformersMap, TransformHandler } from "../../../nlcore/elements/transform/transform";
5
+ import { GameState } from "../../gameState";
6
+ export type DisplayableProps = {
7
+ displayable: {
8
+ skipTransition?: boolean;
9
+ skipTransform?: boolean;
10
+ transformOverwrites?: {
11
+ [K in keyof TransformersMap]?: TransformHandler<TransformersMap[K]>;
12
+ };
13
+ } & ({
14
+ element: EventfulDisplayable & StatefulDisplayable;
15
+ state?: StatefulDisplayable;
16
+ } | {
17
+ element: EventfulDisplayable;
18
+ state: StatefulDisplayable;
19
+ });
20
+ child: DisplayableChildHandler;
21
+ state: GameState;
22
+ };
23
+ export default function Displayable({ state: gameState, displayable, child, }: Readonly<DisplayableProps>): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { GameState } from "../../gameState";
3
+ import { LogicAction } from "../../../nlcore/action/logicAction";
4
+ export default function Displayables({ state, displayable }: Readonly<{
5
+ state: GameState;
6
+ displayable: LogicAction.Displayable[];
7
+ }>): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { GameState } from "../../gameState";
2
+ import { Text as GameText } from "../../../nlcore/elements/text";
3
+ import React from "react";
4
+ export default function Text({ state, text }: Readonly<{
5
+ state: GameState;
6
+ text: GameText;
7
+ }>): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { ElementProp, ITransition } from "../../../nlcore/elements/transition/type";
2
+ import React from "react";
3
+ import { Transform } from "../../../nlcore/elements/transform/transform";
4
+ import { GameState } from "../../gameState";
5
+ export type DisplayableChildProps = {
6
+ transition: ITransition | null;
7
+ transform: Transform | null;
8
+ transformProps: ElementProp<Element, React.HTMLAttributes<Element>>;
9
+ transformRef: React.MutableRefObject<HTMLDivElement | null>;
10
+ state: GameState;
11
+ };
12
+ export type DisplayableChildHandler = (props: Readonly<DisplayableChildProps>) => React.ReactElement;
13
+ export type StatefulDisplayable = {
14
+ state: Record<any, any>;
15
+ };
@@ -1,8 +1,7 @@
1
1
  import { Image as GameImage } from "../../../nlcore/elements/image";
2
2
  import React from "react";
3
3
  import { GameState } from "../../gameState";
4
- export default function Image({ image, state, onAnimationEnd }: Readonly<{
4
+ export default function Image({ image, state, }: Readonly<{
5
5
  image: GameImage;
6
6
  state: GameState;
7
- onAnimationEnd?: () => any;
8
7
  }>): React.JSX.Element;
@@ -1,6 +1,6 @@
1
- import type { Sentence } from "../../../nlcore/elements/text";
2
1
  import type { Choice } from "../../../nlcore/elements/menu";
3
2
  import type { GameState } from "../../gameState";
3
+ import { Sentence } from "../../../nlcore/elements/character/sentence";
4
4
  export interface MenuElementProps {
5
5
  prompt: Sentence;
6
6
  choices: Choice[];
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { GameState } from "../../gameState";
3
+ import { Sentence as GameSentence } from "../../../nlcore/elements/character/sentence";
4
+ export default function Sentence({ sentence, gameState, useTypeEffect, onCompleted, finished, count, className, }: Readonly<{
5
+ sentence: GameSentence;
6
+ gameState: GameState;
7
+ useTypeEffect?: boolean;
8
+ onCompleted?: () => void;
9
+ finished?: boolean;
10
+ count?: number;
11
+ className?: string;
12
+ }>): React.JSX.Element;
@@ -1,9 +1,13 @@
1
1
  import React from "react";
2
2
  interface TypingEffectProps {
3
3
  text: string;
4
+ color: string;
4
5
  speed: number;
5
6
  onComplete?: () => void;
6
7
  className?: string;
7
8
  }
8
9
  declare const TypingEffect: React.FC<TypingEffectProps>;
10
+ export declare function Lines({ text }: {
11
+ text: string;
12
+ }): React.JSX.Element;
9
13
  export default TypingEffect;
@@ -1,5 +1,6 @@
1
- import type { Character, Sentence } from "../../../nlcore/elements/text";
1
+ import type { Character } from "../../../nlcore/elements/character";
2
2
  import type { GameState } from "../../gameState";
3
+ import { Sentence } from "../../../nlcore/elements/character/sentence";
3
4
  export interface SayElementProps {
4
5
  action: {
5
6
  sentence: Sentence;
@@ -1,20 +1,23 @@
1
1
  import { CalledActionResult } from "../nlcore/gameTypes";
2
2
  import { EventDispatcher, Logger } from "../../util/data";
3
- import { Sentence } from "../nlcore/elements/text";
4
3
  import { Choice, MenuData } from "../nlcore/elements/menu";
5
4
  import { Image, ImageEventTypes } from "../nlcore/elements/image";
6
5
  import { Scene } from "../nlcore/elements/scene";
7
6
  import { Sound } from "../nlcore/elements/sound";
8
7
  import * as Howler from "howler";
9
- import { SrcManager } from "../nlcore/elements/srcManager";
8
+ import { HowlOptions } from "howler";
9
+ import { SrcManager } from "../nlcore/action/srcManager";
10
10
  import { LogicAction } from "../nlcore/action/logicAction";
11
11
  import { Storable } from "../nlcore/store/storable";
12
12
  import { Game } from "../nlcore/game";
13
13
  import { Clickable, MenuElement, TextElement } from "./gameState.type";
14
+ import { Sentence } from "../nlcore/elements/character/sentence";
15
+ import { Text, TextEventTypes } from "../nlcore/elements/text";
14
16
  type PlayerStateElement = {
15
17
  texts: Clickable<TextElement>[];
16
18
  menus: Clickable<MenuElement, Choice>[];
17
19
  images: Image[];
20
+ displayable: LogicAction.Displayable[];
18
21
  };
19
22
  export type PlayerState = {
20
23
  sounds: Sound[];
@@ -66,6 +69,10 @@ export declare class GameState {
66
69
  scene: Scene;
67
70
  ele: PlayerStateElement;
68
71
  } | null;
72
+ findElementByDisplayable(displayable: LogicAction.Displayable): {
73
+ scene: Scene;
74
+ ele: PlayerStateElement;
75
+ } | null;
69
76
  addScene(scene: Scene): this;
70
77
  popScene(): this;
71
78
  removeScene(scene: Scene): this;
@@ -75,18 +82,34 @@ export declare class GameState {
75
82
  }[];
76
83
  getLastScene(): Scene | null;
77
84
  sceneExists(scene?: Scene): boolean;
85
+ isSceneActive(scene: Scene): boolean;
78
86
  handle(action: PlayerAction): this;
79
87
  createText(id: string, sentence: Sentence, afterClick?: () => void, scene?: Scene): void;
80
88
  createMenu(menu: MenuData, afterChoose?: (choice: Choice) => void, scene?: Scene): void;
81
89
  createImage(image: Image, scene?: Scene): this;
82
90
  disposeImage(image: Image, scene?: Scene): this;
91
+ createDisplayable(displayable: LogicAction.Displayable, scene?: Scene): this;
92
+ disposeDisplayable(displayable: LogicAction.Displayable, scene?: Scene): this;
83
93
  forceReset(): void;
84
- playSound(howl: Howler.Howl, onEnd?: () => void): any;
94
+ initSound(sound: Sound, options?: Partial<HowlOptions>): Sound;
95
+ playSound(sound: Sound, onEnd?: () => void, options?: Partial<HowlOptions>): any;
96
+ stopSound(sound: Sound): typeof sound;
97
+ transitionSound(prev: Sound | undefined | null, cur: Sound | undefined | null, duration: number | undefined | null): Promise<void>;
98
+ fadeSound(sound: Sound, target: number, duration: number): Promise<void>;
85
99
  getHowl(): typeof Howler.Howl;
86
100
  animateImage<T extends keyof ImageEventTypes>(type: T, target: Image, args: ImageEventTypes[T], onEnd: () => void): undefined;
101
+ animateText<T extends keyof TextEventTypes>(type: T, target: Text, args: TextEventTypes[T], onEnd: () => void): undefined;
87
102
  registerSrcManager(srcManager: SrcManager): this;
88
103
  offSrcManager(srcManager: SrcManager): this;
89
104
  getStorable(): Storable;
105
+ /**
106
+ * Dispose the game state
107
+ *
108
+ * This is an irreversible action, once disposed, the game state cannot be used again.
109
+ *
110
+ * Do not call this method directly
111
+ */
112
+ dispose(): void;
90
113
  toData(): PlayerStateData;
91
114
  loadData(data: PlayerStateData, elementMap: Map<string, LogicAction.GameElement>): void;
92
115
  initScenes(): void;
@@ -1,5 +1,6 @@
1
- import { Character, Sentence } from "../nlcore/elements/text";
1
+ import { Character } from "../nlcore/elements/character";
2
2
  import { Choice } from "../nlcore/elements/menu";
3
+ import { Sentence } from "../nlcore/elements/character/sentence";
3
4
  export type Clickable<T, U = undefined> = {
4
5
  action: T;
5
6
  onClick: U extends undefined ? () => void : (arg0: U) => void;
@@ -1,5 +1,5 @@
1
1
  import { Sound } from "../../nlcore/elements/sound";
2
- import { Src } from "../../nlcore/elements/srcManager";
2
+ import { Src } from "../../nlcore/action/srcManager";
3
3
  import { EventDispatcher } from "../../../util/data";
4
4
  import { Image } from "../../nlcore/elements/image";
5
5
  export type PreloadedSrcTypes = "image" | "audio" | "video";
@@ -1,4 +1,3 @@
1
1
  import Isolated from "./lib/isolated";
2
2
  import Say from "./elements/say/Say";
3
- import ColoredSentence from "./elements/menu/Sentence";
4
- export { Isolated, Say, ColoredSentence, };
3
+ export { Isolated, Say, };