narraleaf-react 0.5.0 → 0.6.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 (145) hide show
  1. package/dist/game/nlcore/action/action.d.ts +29 -24
  2. package/dist/game/nlcore/action/actionHistory.d.ts +48 -39
  3. package/dist/game/nlcore/action/actionTypes.d.ts +142 -142
  4. package/dist/game/nlcore/action/actionable.d.ts +5 -5
  5. package/dist/game/nlcore/action/actions/characterAction.d.ts +19 -17
  6. package/dist/game/nlcore/action/actions/conditionAction.d.ts +26 -17
  7. package/dist/game/nlcore/action/actions/controlAction.d.ts +26 -38
  8. package/dist/game/nlcore/action/actions/displayableAction.d.ts +26 -22
  9. package/dist/game/nlcore/action/actions/imageAction.d.ts +25 -23
  10. package/dist/game/nlcore/action/actions/layerAction.d.ts +16 -13
  11. package/dist/game/nlcore/action/actions/menuAction.d.ts +21 -16
  12. package/dist/game/nlcore/action/actions/persistentAction.d.ts +17 -13
  13. package/dist/game/nlcore/action/actions/sceneAction.d.ts +47 -44
  14. package/dist/game/nlcore/action/actions/scriptAction.d.ts +14 -10
  15. package/dist/game/nlcore/action/actions/soundAction.d.ts +20 -18
  16. package/dist/game/nlcore/action/actions/storyAction.d.ts +8 -8
  17. package/dist/game/nlcore/action/actions/textAction.d.ts +16 -14
  18. package/dist/game/nlcore/action/actions/videoAction.d.ts +26 -22
  19. package/dist/game/nlcore/action/actions.d.ts +20 -13
  20. package/dist/game/nlcore/action/baseElement.d.ts +2 -2
  21. package/dist/game/nlcore/action/chain.d.ts +17 -17
  22. package/dist/game/nlcore/action/constructable.d.ts +5 -5
  23. package/dist/game/nlcore/action/gameHistory.d.ts +32 -32
  24. package/dist/game/nlcore/action/logicAction.d.ts +52 -52
  25. package/dist/game/nlcore/action/serviceAction.d.ts +24 -11
  26. package/dist/game/nlcore/action/srcManager.d.ts +47 -47
  27. package/dist/game/nlcore/action/stackModel.d.ts +106 -0
  28. package/dist/game/nlcore/action/tree/actionTree.d.ts +56 -56
  29. package/dist/game/nlcore/common/Utils.d.ts +25 -25
  30. package/dist/game/nlcore/common/core.d.ts +8 -8
  31. package/dist/game/nlcore/common/elements.d.ts +19 -19
  32. package/dist/game/nlcore/common/game.d.ts +8 -7
  33. package/dist/game/nlcore/common/player.d.ts +7 -7
  34. package/dist/game/nlcore/common/position.d.ts +2 -2
  35. package/dist/game/nlcore/common/transition.d.ts +6 -6
  36. package/dist/game/nlcore/common/types.d.ts +9 -9
  37. package/dist/game/nlcore/elements/character/pause.d.ts +8 -8
  38. package/dist/game/nlcore/elements/character/sentence.d.ts +25 -25
  39. package/dist/game/nlcore/elements/character/word.d.ts +18 -18
  40. package/dist/game/nlcore/elements/character.d.ts +56 -52
  41. package/dist/game/nlcore/elements/condition.d.ts +20 -20
  42. package/dist/game/nlcore/elements/control.d.ts +76 -76
  43. package/dist/game/nlcore/elements/displayable/displayable.d.ts +76 -76
  44. package/dist/game/nlcore/elements/displayable/image.d.ts +102 -102
  45. package/dist/game/nlcore/elements/displayable/text.d.ts +74 -74
  46. package/dist/game/nlcore/elements/layer.d.ts +33 -33
  47. package/dist/game/nlcore/elements/menu.d.ts +45 -45
  48. package/dist/game/nlcore/elements/persistent/storable.d.ts +24 -24
  49. package/dist/game/nlcore/elements/persistent/type.d.ts +3 -3
  50. package/dist/game/nlcore/elements/persistent.d.ts +86 -86
  51. package/dist/game/nlcore/elements/scene.d.ts +76 -76
  52. package/dist/game/nlcore/elements/script.d.ts +16 -16
  53. package/dist/game/nlcore/elements/service.d.ts +59 -59
  54. package/dist/game/nlcore/elements/sound.d.ts +89 -89
  55. package/dist/game/nlcore/elements/story.d.ts +92 -78
  56. package/dist/game/nlcore/elements/transform/position.d.ts +99 -103
  57. package/dist/game/nlcore/elements/transform/transform.d.ts +119 -119
  58. package/dist/game/nlcore/elements/transform/type.d.ts +32 -32
  59. package/dist/game/nlcore/elements/transition/transition.d.ts +29 -29
  60. package/dist/game/nlcore/elements/transition/transitions/image/darkness.d.ts +20 -20
  61. package/dist/game/nlcore/elements/transition/transitions/image/dissolve.d.ts +17 -17
  62. package/dist/game/nlcore/elements/transition/transitions/image/fadeIn.d.ts +20 -20
  63. package/dist/game/nlcore/elements/transition/transitions/image/imageTransition.d.ts +28 -28
  64. package/dist/game/nlcore/elements/transition/transitions/text/fontSize.d.ts +13 -13
  65. package/dist/game/nlcore/elements/transition/transitions/text/textTransition.d.ts +10 -10
  66. package/dist/game/nlcore/elements/transition/type.d.ts +51 -51
  67. package/dist/game/nlcore/elements/type.d.ts +16 -16
  68. package/dist/game/nlcore/elements/video.d.ts +23 -23
  69. package/dist/game/nlcore/game/liveGame.d.ts +148 -138
  70. package/dist/game/nlcore/game/plugin/plugin.d.ts +16 -16
  71. package/dist/game/nlcore/game/preference.d.ts +32 -32
  72. package/dist/game/nlcore/game.d.ts +79 -116
  73. package/dist/game/nlcore/gameTypes.d.ts +439 -337
  74. package/dist/game/nlcore/types.d.ts +67 -67
  75. package/dist/game/player/Tasks.d.ts +125 -106
  76. package/dist/game/player/elements/Player.d.ts +4 -4
  77. package/dist/game/player/elements/displayable/Displayable.d.ts +1 -1
  78. package/dist/game/player/elements/displayable/Displayables.d.ts +1 -1
  79. package/dist/game/player/elements/displayable/Text.d.ts +1 -1
  80. package/dist/game/player/elements/displayable/type.d.ts +1 -1
  81. package/dist/game/player/elements/elements.d.ts +8 -8
  82. package/dist/game/player/elements/image/AspectScaleImage.d.ts +1 -1
  83. package/dist/game/player/elements/image/Image.d.ts +3 -3
  84. package/dist/game/player/elements/menu/PlayerMenu.d.ts +3 -3
  85. package/dist/game/player/elements/menu/UIMenu/Item.d.ts +12 -12
  86. package/dist/game/player/elements/menu/UIMenu/Menu.d.ts +6 -6
  87. package/dist/game/player/elements/menu/UIMenu/context.d.ts +23 -23
  88. package/dist/game/player/elements/menu/type.d.ts +16 -16
  89. package/dist/game/player/elements/notification/Notifications.d.ts +3 -3
  90. package/dist/game/player/elements/notification/PlayerNotification.d.ts +4 -4
  91. package/dist/game/player/elements/notification/context.d.ts +11 -11
  92. package/dist/game/player/elements/notification/type.d.ts +18 -19
  93. package/dist/game/player/elements/player/KeyEventAnnouncer.d.ts +1 -1
  94. package/dist/game/player/elements/player/Layer.d.ts +8 -8
  95. package/dist/game/player/elements/player/PreferenceUpdateAnnouncer.d.ts +4 -4
  96. package/dist/game/player/elements/player/RenderEventAnnoucer.d.ts +4 -4
  97. package/dist/game/player/elements/player/SizeUpdateAnnouncer.d.ts +1 -1
  98. package/dist/game/player/elements/preload/Preload.d.ts +1 -1
  99. package/dist/game/player/elements/say/Dialog.d.ts +13 -13
  100. package/dist/game/player/elements/say/Nametag.d.ts +2 -2
  101. package/dist/game/player/elements/say/Sentence.d.ts +37 -37
  102. package/dist/game/player/elements/say/UIDialog.d.ts +72 -71
  103. package/dist/game/player/elements/say/context.d.ts +4 -4
  104. package/dist/game/player/elements/say/type.d.ts +53 -53
  105. package/dist/game/player/elements/say/useDialog.d.ts +18 -18
  106. package/dist/game/player/elements/scene/Scene.d.ts +1 -1
  107. package/dist/game/player/elements/type.d.ts +53 -53
  108. package/dist/game/player/elements/video/video.d.ts +1 -1
  109. package/dist/game/player/gameState.d.ts +193 -191
  110. package/dist/game/player/gameState.type.d.ts +1 -1
  111. package/dist/game/player/guard.d.ts +24 -24
  112. package/dist/game/player/lib/AspectRatio.d.ts +7 -7
  113. package/dist/game/player/lib/AudioManager.d.ts +50 -50
  114. package/dist/game/player/lib/Cursor.d.ts +6 -6
  115. package/dist/game/player/lib/ErrorBoundary.d.ts +24 -24
  116. package/dist/game/player/lib/ErrorFallback.d.ts +5 -5
  117. package/dist/game/player/lib/ImageCacheManager.d.ts +26 -26
  118. package/dist/game/player/lib/Inspect.d.ts +36 -36
  119. package/dist/game/player/lib/PageRouter/AnimatePresence.d.ts +4 -4
  120. package/dist/game/player/lib/PageRouter/Page.d.ts +9 -9
  121. package/dist/game/player/lib/PageRouter/PageRouter.d.ts +27 -27
  122. package/dist/game/player/lib/PageRouter/Stage.d.ts +6 -6
  123. package/dist/game/player/lib/PageRouter/router.d.ts +28 -23
  124. package/dist/game/player/lib/PlayerFrames.d.ts +10 -10
  125. package/dist/game/player/lib/Preloaded.d.ts +48 -48
  126. package/dist/game/player/lib/flush.d.ts +5 -5
  127. package/dist/game/player/lib/isolated.d.ts +7 -7
  128. package/dist/game/player/lib/notification.d.ts +47 -47
  129. package/dist/game/player/lib/preferences.d.ts +8 -8
  130. package/dist/game/player/lib/useElementVisibility.d.ts +5 -5
  131. package/dist/game/player/lib/useExposeState.d.ts +10 -10
  132. package/dist/game/player/lib/useLiveGame.d.ts +1 -1
  133. package/dist/game/player/libElements.d.ts +12 -12
  134. package/dist/game/player/provider/game-state.d.ts +24 -24
  135. package/dist/game/player/provider/preloaded.d.ts +1 -1
  136. package/dist/game/player/provider/providers.d.ts +7 -7
  137. package/dist/game/player/provider/ratio.d.ts +1 -1
  138. package/dist/game/player/type.d.ts +68 -68
  139. package/dist/index.d.ts +3 -3
  140. package/dist/main.js +43 -45
  141. package/dist/util/config.d.ts +37 -37
  142. package/dist/util/data.d.ts +346 -309
  143. package/dist/util/logger.d.ts +21 -21
  144. package/dist/util/singleton.d.ts +5 -5
  145. package/package.json +5 -3
@@ -1,7 +1,8 @@
1
- import { Game } from "../game";
2
- import { GameState } from "../../player/gameState";
3
- import { Storable, Namespace } from "../elements/persistent/storable";
4
- import { LiveGame } from "../game/liveGame";
5
- import type { SavedGame } from "../gameTypes";
6
- export { LiveGame, GameState, Game, Storable, Namespace, };
7
- export type { SavedGame, };
1
+ import { Game } from "../game";
2
+ import { GameState } from "../../player/gameState";
3
+ import { Storable, Namespace } from "../elements/persistent/storable";
4
+ import { LiveGame } from "../game/liveGame";
5
+ import { Preference } from "../game/preference";
6
+ import type { SavedGame } from "../gameTypes";
7
+ export { LiveGame, GameState, Game, Storable, Namespace, Preference, };
8
+ export type { SavedGame, };
@@ -1,7 +1,7 @@
1
- import Player from "../../player/elements/Player";
2
- import GameProviders from "../../player/provider/providers";
3
- import { useGame } from "../../../game/player/provider/game-state";
4
- import { useRouter } from "../../player/lib/PageRouter/router";
5
- export * from "../../player/type";
6
- export * from "../../player/libElements";
7
- export { GameProviders, Player, useGame, useRouter, };
1
+ import Player from "../../player/elements/Player";
2
+ import GameProviders from "../../player/provider/providers";
3
+ import { useGame } from "../../../game/player/provider/game-state";
4
+ import { useRouter } from "../../player/lib/PageRouter/router";
5
+ export * from "../../player/type";
6
+ export * from "../../player/libElements";
7
+ export { GameProviders, Player, useGame, useRouter, };
@@ -1,2 +1,2 @@
1
- import { Align, CommonPosition, Coord2D, CommonPositionType } from "../elements/transform/position";
2
- export { Align, CommonPosition, Coord2D, CommonPositionType };
1
+ import { Align, CommonPosition, Coord2D, CommonPositionType } from "../elements/transform/position";
2
+ export { Align, CommonPosition, Coord2D, CommonPositionType };
@@ -1,6 +1,6 @@
1
- import { Dissolve } from "../elements/transition/transitions/image/dissolve";
2
- import { FadeIn } from "../elements/transition/transitions/image/fadeIn";
3
- import { Transition } from "../elements/transition/transition";
4
- import { ImageTransition } from "../elements/transition/transitions/image/imageTransition";
5
- import { TextTransition } from "../elements/transition/transitions/text/textTransition";
6
- export { Transition, ImageTransition, TextTransition, Dissolve, FadeIn, };
1
+ import { Dissolve } from "../elements/transition/transitions/image/dissolve";
2
+ import { FadeIn } from "../elements/transition/transitions/image/fadeIn";
3
+ import { Transition } from "../elements/transition/transition";
4
+ import { ImageTransition } from "../elements/transition/transitions/image/imageTransition";
5
+ import { TextTransition } from "../elements/transition/transitions/text/textTransition";
6
+ export { Transition, ImageTransition, TextTransition, Dissolve, FadeIn, };
@@ -1,9 +1,9 @@
1
- import { ServiceHandlerCtx } from "../elements/service";
2
- import { Origins } from "../elements/story";
3
- import { TransformDefinitions } from "../elements/transform/type";
4
- import { IGamePluginRegistry } from "../game/plugin/plugin";
5
- import { LiveGameEventToken } from "../types";
6
- import { GameHistory } from "../action/gameHistory";
7
- import { GameConfig, SavedGame } from "../gameTypes";
8
- export * from "../elements/type";
9
- export type { GameHistory, IGamePluginRegistry, LiveGameEventToken, Origins, ServiceHandlerCtx, TransformDefinitions, GameConfig, SavedGame, };
1
+ import { ServiceHandlerCtx } from "../elements/service";
2
+ import { Origins } from "../elements/story";
3
+ import { TransformDefinitions } from "../elements/transform/type";
4
+ import { IGamePluginRegistry } from "../game/plugin/plugin";
5
+ import { LiveGameEventToken } from "../types";
6
+ import { GameHistory } from "../action/gameHistory";
7
+ import { GameConfig, SavedGame, NotificationToken, SavedGameMetaData } from "../gameTypes";
8
+ export * from "../elements/type";
9
+ export type { GameHistory, IGamePluginRegistry, LiveGameEventToken, Origins, ServiceHandlerCtx, TransformDefinitions, GameConfig, SavedGame, NotificationToken, SavedGameMetaData, };
@@ -1,8 +1,8 @@
1
- export type PauseConfig = {
2
- duration?: number;
3
- };
4
- export type Pausing = Pause | PausingShortcut;
5
- export declare class Pause {
6
- static wait(duration: number): Pause;
7
- constructor(config?: Partial<PauseConfig>);
8
- }
1
+ export type PauseConfig = {
2
+ duration?: number;
3
+ };
4
+ export type Pausing = Pause | PausingShortcut;
5
+ export declare class Pause {
6
+ static wait(duration: number): Pause;
7
+ constructor(config?: Partial<PauseConfig>);
8
+ }
@@ -1,25 +1,25 @@
1
- import type { Character } from "../../elements/character";
2
- import { Pausing } from "../../elements/character/pause";
3
- import { Word } from "../../elements/character/word";
4
- import type { ScriptCtx } from "../../elements/script";
5
- import { Sound } from "../../elements/sound";
6
- import { Color, Font } from "../../types";
7
- export type SentenceConfig = {
8
- pause?: boolean | number;
9
- voice: Sound | null;
10
- character: Character | null;
11
- voiceId: string | number | null;
12
- color?: Color;
13
- } & Font;
14
- export type SentenceUserConfig = Partial<Omit<SentenceConfig, "voice"> & {
15
- voice: Sound | string | null | undefined;
16
- }>;
17
- export type DynamicWord = (ctx: ScriptCtx) => DynamicWordResult;
18
- export type DynamicWordResult = string | Word | Pausing | (string | Word | Pausing)[];
19
- export type StaticWord<T extends string | DynamicWord | Pausing = string | DynamicWord | Pausing> = string | Pausing | Word<T>;
20
- export type SingleWord = StaticWord | DynamicWord;
21
- export type SentencePrompt = SingleWord[] | SingleWord;
22
- export declare class Sentence {
23
- constructor(text: SentencePrompt, config?: SentenceUserConfig);
24
- copy(): Sentence;
25
- }
1
+ import type { Character } from "../../elements/character";
2
+ import { Pausing } from "../../elements/character/pause";
3
+ import { Word } from "../../elements/character/word";
4
+ import type { ScriptCtx } from "../../elements/script";
5
+ import { Sound } from "../../elements/sound";
6
+ import { Color, Font } from "../../types";
7
+ export type SentenceConfig = {
8
+ pause?: boolean | number;
9
+ voice: Sound | null;
10
+ character: Character | null;
11
+ voiceId: string | number | null;
12
+ color?: Color;
13
+ } & Font;
14
+ export type SentenceUserConfig = Partial<Omit<SentenceConfig, "voice"> & {
15
+ voice: Sound | string | null | undefined;
16
+ }>;
17
+ export type DynamicWord = (ctx: ScriptCtx) => DynamicWordResult;
18
+ export type DynamicWordResult = string | Word | Pausing | (string | Word | Pausing)[];
19
+ export type StaticWord<T extends string | DynamicWord | Pausing = string | DynamicWord | Pausing> = string | Pausing | Word<T>;
20
+ export type SingleWord = StaticWord | DynamicWord;
21
+ export type SentencePrompt = SingleWord[] | SingleWord;
22
+ export declare class Sentence {
23
+ constructor(text: SentencePrompt, config?: SentenceUserConfig);
24
+ copy(): Sentence;
25
+ }
@@ -1,18 +1,18 @@
1
- import { Color, Font } from "../../types";
2
- import { DynamicWord } from "../../elements/character/sentence";
3
- import { Pausing } from "../../elements/character/pause";
4
- export type WordConfig = {
5
- className: string;
6
- ruby: string;
7
- color: Color;
8
- pause: boolean;
9
- cps?: number;
10
- } & Font;
11
- export declare class Word<T extends string | DynamicWord | Pausing = string | DynamicWord | Pausing> {
12
- static isWord(obj: any): obj is Word;
13
- static color(text: string | Word, color: Color): Word;
14
- static bold(text: string | Word): Word;
15
- static italic(text: string | Word): Word;
16
- constructor(text: T, config?: Partial<WordConfig>);
17
- toString(): string;
18
- }
1
+ import { Color, Font } from "../../types";
2
+ import { DynamicWord } from "../../elements/character/sentence";
3
+ import { Pausing } from "../../elements/character/pause";
4
+ export type WordConfig = {
5
+ className: string;
6
+ ruby: string;
7
+ color: Color;
8
+ pause: boolean;
9
+ cps?: number;
10
+ } & Font;
11
+ export declare class Word<T extends string | DynamicWord | Pausing = string | DynamicWord | Pausing> {
12
+ static isWord(obj: any): obj is Word;
13
+ static color(text: string | Word, color: Color): Word;
14
+ static bold(text: string | Word): Word;
15
+ static italic(text: string | Word): Word;
16
+ constructor(text: T, config?: Partial<WordConfig>);
17
+ toString(): string;
18
+ }
@@ -1,52 +1,56 @@
1
- import { LogicAction } from "../game";
2
- import { Color } from "../types";
3
- import { DeepPartial } from "../../../util/data";
4
- import { Actionable } from "../action/actionable";
5
- import { Chained, Proxied } from "../action/chain";
6
- import { Sentence, SentencePrompt, SentenceUserConfig, SingleWord } from "../elements/character/sentence";
7
- export type CharacterConfig = {
8
- color?: Color;
9
- };
10
- export interface Character {
11
- (content: string, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
12
- (content: Sentence): Proxied<Character, Chained<LogicAction.Actions>>;
13
- (content: SentencePrompt, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
14
- (texts: TemplateStringsArray, ...words: SingleWord[]): Proxied<Character, Chained<LogicAction.Actions>>;
15
- }
16
- export declare class Character extends Actionable<CharacterStateData, Character> {
17
- constructor(name: string | null, config?: DeepPartial<CharacterConfig>);
18
- /**
19
- * Say something
20
- * @example
21
- * ```typescript
22
- * character.say("Hello, world!");
23
- * ```
24
- * @example
25
- * ```typescript
26
- * character
27
- * .say("Hello, world!")
28
- * .say("Hello, world!");
29
- * ```
30
- * @example
31
- * ```typescript
32
- * character.say(new Sentence(character, [
33
- * "Hello, ",
34
- * new Word("world", {color: "#f00"}), // Some words can be colored
35
- * ]));
36
- * @example
37
- * ```typescript
38
- * character.say`Hello, ${Word.color("world", "#f00")}!`;
39
- * ```
40
- * @chainable
41
- */
42
- say(content: string, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
43
- say(content: Sentence): Proxied<Character, Chained<LogicAction.Actions>>;
44
- say(content: SentencePrompt, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
45
- say(texts: TemplateStringsArray, ...words: SingleWord[]): Proxied<Character, Chained<LogicAction.Actions>>;
46
- setName(name: string): Proxied<Character, Chained<LogicAction.Actions>>;
47
- apply(content: string, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
48
- apply(content: Sentence): Proxied<Character, Chained<LogicAction.Actions>>;
49
- apply(content: SentencePrompt, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
50
- apply(texts: TemplateStringsArray, ...words: SingleWord[]): Proxied<Character, Chained<LogicAction.Actions>>;
51
- }
52
- export declare const Narrator: Character;
1
+ import { LogicAction } from "../game";
2
+ import { Color } from "../types";
3
+ import { DeepPartial } from "../../../util/data";
4
+ import { Actionable } from "../action/actionable";
5
+ import { Chained, Proxied } from "../action/chain";
6
+ import { Sentence, SentencePrompt, SentenceUserConfig, SingleWord } from "../elements/character/sentence";
7
+ export type CharacterConfig = {
8
+ color?: Color;
9
+ };
10
+ export interface Character {
11
+ (content: string, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
12
+ (content: Sentence): Proxied<Character, Chained<LogicAction.Actions>>;
13
+ (content: SentencePrompt, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
14
+ (texts: TemplateStringsArray, ...words: SingleWord[]): Proxied<Character, Chained<LogicAction.Actions>>;
15
+ }
16
+ export declare class Character extends Actionable<CharacterStateData, Character> {
17
+ constructor(name: string | null, config?: DeepPartial<CharacterConfig>);
18
+ /**
19
+ * Say something
20
+ * @example
21
+ * ```typescript
22
+ * character.say("Hello, world!");
23
+ * ```
24
+ * @example
25
+ * ```typescript
26
+ * character
27
+ * .say("Hello, world!")
28
+ * .say("Hello, world!");
29
+ * ```
30
+ * @example
31
+ * ```typescript
32
+ * character.say(new Sentence(character, [
33
+ * "Hello, ",
34
+ * new Word("world", {color: "#f00"}), // Some words can be colored
35
+ * ]));
36
+ * @example
37
+ * ```typescript
38
+ * character.say`Hello, ${Word.color("world", "#f00")}!`;
39
+ * ```
40
+ * @example
41
+ * ```typescript
42
+ * character`Hello, ${Word.color("world", "#f00")}!`;
43
+ * ```
44
+ * @chainable
45
+ */
46
+ say(content: string, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
47
+ say(content: Sentence): Proxied<Character, Chained<LogicAction.Actions>>;
48
+ say(content: SentencePrompt, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
49
+ say(texts: TemplateStringsArray, ...words: SingleWord[]): Proxied<Character, Chained<LogicAction.Actions>>;
50
+ setName(name: string): Proxied<Character, Chained<LogicAction.Actions>>;
51
+ apply(content: string, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
52
+ apply(content: Sentence): Proxied<Character, Chained<LogicAction.Actions>>;
53
+ apply(content: SentencePrompt, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
54
+ apply(texts: TemplateStringsArray, ...words: SingleWord[]): Proxied<Character, Chained<LogicAction.Actions>>;
55
+ }
56
+ export declare const Narrator: Character;
@@ -1,20 +1,20 @@
1
- import { LogicAction } from "../action/logicAction";
2
- import { Actionable } from "../action/actionable";
3
- import { Chained, Proxied } from "../action/chain";
4
- import { LambdaHandler, ActionStatements } from "../elements/type";
5
- export declare class Lambda<T = any> {
6
- }
7
- export declare class Condition<Closed extends true | false = false> extends Actionable {
8
- /**
9
- * @chainable
10
- */
11
- static If(condition: Lambda | LambdaHandler<boolean>, action: ActionStatements): Proxied<Condition, Chained<LogicAction.Actions>>;
12
- /**
13
- * @chainable
14
- */
15
- ElseIf(condition: Closed extends false ? (Lambda | LambdaHandler<boolean>) : never, action: Closed extends false ? ActionStatements : never): Closed extends false ? Proxied<Condition, Chained<LogicAction.Actions>> : never;
16
- /**
17
- * @chainable
18
- */
19
- Else(action: Closed extends false ? ActionStatements : never): Closed extends false ? Proxied<Condition<true>, Chained<LogicAction.Actions>> : never;
20
- }
1
+ import { LogicAction } from "../action/logicAction";
2
+ import { Actionable } from "../action/actionable";
3
+ import { Chained, Proxied } from "../action/chain";
4
+ import { LambdaHandler, ActionStatements } from "../elements/type";
5
+ export declare class Lambda<T = any> {
6
+ }
7
+ export declare class Condition<Closed extends true | false = false> extends Actionable {
8
+ /**
9
+ * @chainable
10
+ */
11
+ static If(condition: Lambda | LambdaHandler<boolean>, action: ActionStatements): Proxied<Condition, Chained<LogicAction.Actions>>;
12
+ /**
13
+ * @chainable
14
+ */
15
+ ElseIf(condition: Closed extends false ? (Lambda | LambdaHandler<boolean>) : never, action: Closed extends false ? ActionStatements : never): Closed extends false ? Proxied<Condition, Chained<LogicAction.Actions>> : never;
16
+ /**
17
+ * @chainable
18
+ */
19
+ Else(action: Closed extends false ? ActionStatements : never): Closed extends false ? Proxied<Condition<true>, Chained<LogicAction.Actions>> : never;
20
+ }
@@ -1,76 +1,76 @@
1
- import { Actionable } from "../action/actionable";
2
- import { Awaitable } from "../../../util/data";
3
- import { ActionStatements } from "./type";
4
- export declare class Control extends Actionable {
5
- /**
6
- * Execute actions in order, waiting for each action to complete
7
- * @chainable
8
- */
9
- static do(actions: ActionStatements): ChainedControl;
10
- /**
11
- * Execute actions in order, do not wait for this action to complete
12
- * @chainable
13
- */
14
- static doAsync(actions: ActionStatements): ChainedControl;
15
- /**
16
- * Execute all actions at the same time, waiting for any one action to complete
17
- * @chainable
18
- */
19
- static any(actions: ActionStatements): ChainedControl;
20
- /**
21
- * Execute all actions at the same time, waiting for all actions to complete
22
- * @chainable
23
- */
24
- static all(actions: ActionStatements): ChainedControl;
25
- /**
26
- * Execute all actions at the same time, do not wait for all actions to complete
27
- * @chainable
28
- */
29
- static allAsync(actions: ActionStatements): ChainedControl;
30
- /**
31
- * Execute actions multiple times
32
- * @chainable
33
- */
34
- static repeat(times: number, actions: ActionStatements): ChainedControl;
35
- /**
36
- * Sleep for a duration
37
- * @chainable
38
- */
39
- static sleep(duration: number | Awaitable<any> | Promise<any>): ChainedControl;
40
- constructor(/**@internal */ config?: Partial<ControlConfig>);
41
- /**
42
- * Execute actions in order, waiting for each action to complete
43
- * @chainable
44
- */
45
- do(actions: ActionStatements): ChainedControl;
46
- /**
47
- * Execute actions in order, do not wait for this action to complete
48
- * @chainable
49
- */
50
- doAsync(actions: ActionStatements): ChainedControl;
51
- /**
52
- * Execute all actions at the same time, waiting for any one action to complete
53
- * @chainable
54
- */
55
- any(actions: ActionStatements): ChainedControl;
56
- /**
57
- * Execute all actions at the same time, waiting for all actions to complete
58
- * @chainable
59
- */
60
- all(actions: ActionStatements): ChainedControl;
61
- /**
62
- * Execute all actions at the same time, do not wait for all actions to complete
63
- * @chainable
64
- */
65
- allAsync(actions: ActionStatements): ChainedControl;
66
- /**
67
- * Execute actions multiple times
68
- * @chainable
69
- */
70
- repeat(times: number, actions: ActionStatements): ChainedControl;
71
- /**
72
- * Sleep for a duration
73
- * @chainable
74
- */
75
- sleep(duration: number | Awaitable<any> | Promise<any>): ChainedControl;
76
- }
1
+ import { Actionable } from "../action/actionable";
2
+ import { Awaitable } from "../../../util/data";
3
+ import { ActionStatements } from "./type";
4
+ export declare class Control extends Actionable {
5
+ /**
6
+ * Execute actions in order, waiting for each action to complete
7
+ * @chainable
8
+ */
9
+ static do(actions: ActionStatements): ChainedControl;
10
+ /**
11
+ * Execute actions in order, do not wait for this action to complete
12
+ * @chainable
13
+ */
14
+ static doAsync(actions: ActionStatements): ChainedControl;
15
+ /**
16
+ * Execute all actions at the same time, waiting for any one action to complete
17
+ * @chainable
18
+ */
19
+ static any(actions: ActionStatements): ChainedControl;
20
+ /**
21
+ * Execute all actions at the same time, waiting for all actions to complete
22
+ * @chainable
23
+ */
24
+ static all(actions: ActionStatements): ChainedControl;
25
+ /**
26
+ * Execute all actions at the same time, do not wait for all actions to complete
27
+ * @chainable
28
+ */
29
+ static allAsync(actions: ActionStatements): ChainedControl;
30
+ /**
31
+ * Execute actions multiple times
32
+ * @chainable
33
+ */
34
+ static repeat(times: number, actions: ActionStatements): ChainedControl;
35
+ /**
36
+ * Sleep for a duration
37
+ * @chainable
38
+ */
39
+ static sleep(duration: number | Awaitable<any> | Promise<any>): ChainedControl;
40
+ constructor(/**@internal */ config?: Partial<ControlConfig>);
41
+ /**
42
+ * Execute actions in order, waiting for each action to complete
43
+ * @chainable
44
+ */
45
+ do(actions: ActionStatements): ChainedControl;
46
+ /**
47
+ * Execute actions in order, do not wait for this action to complete
48
+ * @chainable
49
+ */
50
+ doAsync(actions: ActionStatements): ChainedControl;
51
+ /**
52
+ * Execute all actions at the same time, waiting for any one action to complete
53
+ * @chainable
54
+ */
55
+ any(actions: ActionStatements): ChainedControl;
56
+ /**
57
+ * Execute all actions at the same time, waiting for all actions to complete
58
+ * @chainable
59
+ */
60
+ all(actions: ActionStatements): ChainedControl;
61
+ /**
62
+ * Execute all actions at the same time, do not wait for all actions to complete
63
+ * @chainable
64
+ */
65
+ allAsync(actions: ActionStatements): ChainedControl;
66
+ /**
67
+ * Execute actions multiple times
68
+ * @chainable
69
+ */
70
+ repeat(times: number, actions: ActionStatements): ChainedControl;
71
+ /**
72
+ * Sleep for a duration
73
+ * @chainable
74
+ */
75
+ sleep(duration: number | Awaitable<any> | Promise<any>): ChainedControl;
76
+ }
@@ -1,76 +1,76 @@
1
- import { Actionable } from "../../action/actionable";
2
- import { Transform } from "../../elements/transform/transform";
3
- import { Chained, Proxied } from "../../action/chain";
4
- import { LogicAction } from "../../action/logicAction";
5
- import { EventfulDisplayable } from "../../../player/elements/displayable/type";
6
- import type { TransformDefinitions } from "../../elements/transform/type";
7
- export declare abstract class Displayable<StateData extends Record<string, any>, Self extends Displayable<any, any, any>, TransformType extends TransformDefinitions.Types = TransformDefinitions.Types> extends Actionable<StateData, Self> implements EventfulDisplayable {
8
- /**
9
- * Set Image Position
10
- *
11
- * @param position - The position of the image, expected {@link RawPosition} or {@link IPosition}
12
- * @param duration - The duration of the position animation
13
- * @param easing - The easing of the position animation
14
- * @chainable
15
- */
16
- pos(position: TransformDefinitions.ImageTransformProps["position"], duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
17
- /**
18
- * Set Image Scale
19
- * @param scale - The scale of the image, between 0 and 1
20
- * @param duration - The duration of the scale animation
21
- * @param easing - The easing of the scale animation
22
- * @chainable
23
- */
24
- scale(scale: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
25
- /**
26
- * Set Image Rotation
27
- * @param rotation - The rotation of the image, in degrees
28
- * @param duration - The duration of the rotation animation
29
- * @param easing - The easing of the rotation animation
30
- * @chainable
31
- */
32
- rotate(rotation: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
33
- /**
34
- * Set Image Opacity
35
- * @param opacity - The opacity of the image, between 0 and 1
36
- * @param duration - The duration of the opacity animation
37
- * @param easing - The easing of the opacity animation
38
- * @chainable
39
- */
40
- opacity(opacity: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
41
- /**
42
- * Apply a transform to the Displayable
43
- * @chainable
44
- */
45
- transform(transform: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions, Self>>;
46
- /**
47
- * Show the Displayable
48
- *
49
- * if options are provided, the displayable will show with the provided transform options
50
- * @example
51
- * ```ts
52
- * text.show({
53
- * duration: 1000,
54
- * });
55
- * ```
56
- * @chainable
57
- */
58
- show(): Proxied<Self, Chained<LogicAction.Actions>>;
59
- show(options: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions>>;
60
- show(options: Partial<TransformDefinitions.CommonTransformProps>): Proxied<Self, Chained<LogicAction.Actions>>;
61
- /**
62
- * Hide the Displayable
63
- *
64
- * if options are provided, the displayable will hide with the provided transform options
65
- * @example
66
- * ```ts
67
- * text.hide({
68
- * duration: 1000,
69
- * });
70
- * ```
71
- * @chainable
72
- */
73
- hide(): Proxied<Self, Chained<LogicAction.Actions>>;
74
- hide(options: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions>>;
75
- hide(options: Partial<TransformDefinitions.CommonTransformProps>): Proxied<Self, Chained<LogicAction.Actions>>;
76
- }
1
+ import { Actionable } from "../../action/actionable";
2
+ import { Transform } from "../../elements/transform/transform";
3
+ import { Chained, Proxied } from "../../action/chain";
4
+ import { LogicAction } from "../../action/logicAction";
5
+ import { EventfulDisplayable } from "../../../player/elements/displayable/type";
6
+ import type { TransformDefinitions } from "../../elements/transform/type";
7
+ export declare abstract class Displayable<StateData extends Record<string, any>, Self extends Displayable<any, any, any>, TransformType extends TransformDefinitions.Types = TransformDefinitions.Types> extends Actionable<StateData, Self> implements EventfulDisplayable {
8
+ /**
9
+ * Set Image Position
10
+ *
11
+ * @param position - The position of the image, expected {@link RawPosition} or {@link IPosition}
12
+ * @param duration - The duration of the position animation
13
+ * @param easing - The easing of the position animation
14
+ * @chainable
15
+ */
16
+ pos(position: TransformDefinitions.ImageTransformProps["position"], duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
17
+ /**
18
+ * Set Image Scale
19
+ * @param scale - The scale of the image, between 0 and 1
20
+ * @param duration - The duration of the scale animation
21
+ * @param easing - The easing of the scale animation
22
+ * @chainable
23
+ */
24
+ scale(scale: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
25
+ /**
26
+ * Set Image Rotation
27
+ * @param rotation - The rotation of the image, in degrees
28
+ * @param duration - The duration of the rotation animation
29
+ * @param easing - The easing of the rotation animation
30
+ * @chainable
31
+ */
32
+ rotate(rotation: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
33
+ /**
34
+ * Set Image Opacity
35
+ * @param opacity - The opacity of the image, between 0 and 1
36
+ * @param duration - The duration of the opacity animation
37
+ * @param easing - The easing of the opacity animation
38
+ * @chainable
39
+ */
40
+ opacity(opacity: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
41
+ /**
42
+ * Apply a transform to the Displayable
43
+ * @chainable
44
+ */
45
+ transform(transform: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions, Self>>;
46
+ /**
47
+ * Show the Displayable
48
+ *
49
+ * if options are provided, the displayable will show with the provided transform options
50
+ * @example
51
+ * ```ts
52
+ * text.show({
53
+ * duration: 1000,
54
+ * });
55
+ * ```
56
+ * @chainable
57
+ */
58
+ show(): Proxied<Self, Chained<LogicAction.Actions>>;
59
+ show(options: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions>>;
60
+ show(options: Partial<TransformDefinitions.CommonTransformProps>): Proxied<Self, Chained<LogicAction.Actions>>;
61
+ /**
62
+ * Hide the Displayable
63
+ *
64
+ * if options are provided, the displayable will hide with the provided transform options
65
+ * @example
66
+ * ```ts
67
+ * text.hide({
68
+ * duration: 1000,
69
+ * });
70
+ * ```
71
+ * @chainable
72
+ */
73
+ hide(): Proxied<Self, Chained<LogicAction.Actions>>;
74
+ hide(options: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions>>;
75
+ hide(options: Partial<TransformDefinitions.CommonTransformProps>): Proxied<Self, Chained<LogicAction.Actions>>;
76
+ }