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,22 +1,26 @@
1
- import { DisplayableActionContentType, DisplayableActionTypes } from "../../action/actionTypes";
2
- import { GameState } from "../../../player/gameState";
3
- import { TypedAction } from "../../action/actions";
4
- import { Awaitable, Values } from "../../../../util/data";
5
- import { Displayable } from "../../elements/displayable/displayable";
6
- import type { CalledActionResult } from "../../gameTypes";
7
- import { Scene } from "../../elements/scene";
8
- import { Transform } from "../../elements/transform/transform";
9
- import { Transition } from "../../elements/transition/transition";
10
- import { Layer } from "../../elements/layer";
11
- export declare class DisplayableAction<T extends Values<typeof DisplayableActionTypes> = Values<typeof DisplayableActionTypes>, Self extends Displayable<any, any, any> = Displayable<any, any>, TransitionType extends Transition = Transition> extends TypedAction<DisplayableActionContentType<TransitionType>, T, Self> {
12
- static ActionTypes: {
13
- readonly action: "displayable:action";
14
- readonly applyTransform: "displayable:applyTransform";
15
- readonly applyTransition: "displayable:applyTransition";
16
- readonly init: "displayable:init";
17
- };
18
- executeAction(gameState: GameState): Awaitable<CalledActionResult<any>, CalledActionResult<any>>;
19
- applyTransform(state: GameState, element: Displayable<any, any>, transform: Transform, onFinished?: () => void): Awaitable<CalledActionResult<any>, CalledActionResult<any>>;
20
- applyTransition(state: GameState, element: Displayable<any, any>, transition: TransitionType, onFinished?: () => void): Awaitable<CalledActionResult<any>, CalledActionResult<any>>;
21
- initDisplayable(state: GameState, scene: Scene | null, element: Displayable<any, any>, layer: Layer | null, isElement?: boolean | undefined): Awaitable<CalledActionResult>;
22
- }
1
+ import { DisplayableActionContentType, DisplayableActionTypes } from "../../action/actionTypes";
2
+ import { GameState } from "../../../player/gameState";
3
+ import { TypedAction } from "../../action/actions";
4
+ import { Awaitable, Values } from "../../../../util/data";
5
+ import { Displayable } from "../../elements/displayable/displayable";
6
+ import type { CalledActionResult } from "../../gameTypes";
7
+ import { Scene } from "../../elements/scene";
8
+ import { Transform } from "../../elements/transform/transform";
9
+ import { Transition } from "../../elements/transition/transition";
10
+ import { Layer } from "../../elements/layer";
11
+ import { LogicAction } from "../../action/logicAction";
12
+ import { ActionExecutionInjection, ExecutedActionResult } from "../../action/action";
13
+ import { Story } from "../../elements/story";
14
+ export declare class DisplayableAction<T extends Values<typeof DisplayableActionTypes> = Values<typeof DisplayableActionTypes>, Self extends Displayable<any, any, any> = Displayable<any, any>, TransitionType extends Transition = Transition> extends TypedAction<DisplayableActionContentType<TransitionType>, T, Self> {
15
+ static ActionTypes: {
16
+ readonly action: "displayable:action";
17
+ readonly applyTransform: "displayable:applyTransform";
18
+ readonly applyTransition: "displayable:applyTransition";
19
+ readonly init: "displayable:init";
20
+ };
21
+ executeAction(gameState: GameState, injection: ActionExecutionInjection): ExecutedActionResult;
22
+ applyTransform(state: GameState, element: Displayable<any, any>, transform: Transform, injection: ActionExecutionInjection, onFinished?: () => void): Awaitable<CalledActionResult, CalledActionResult>;
23
+ applyTransition(state: GameState, element: Displayable<any, any>, transition: TransitionType, injection: ActionExecutionInjection, onFinished?: () => void): Awaitable<CalledActionResult, CalledActionResult>;
24
+ initDisplayable(state: GameState, scene: Scene | null, element: Displayable<any, any>, layer: Layer | null, isElement: boolean | undefined, injection: ActionExecutionInjection): Awaitable<CalledActionResult>;
25
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
26
+ }
@@ -1,23 +1,25 @@
1
- import { ImageActionContentType, ImageActionTypes } from "../../action/actionTypes";
2
- import { Image } from "../../elements/displayable/image";
3
- import { GameState } from "../../../player/gameState";
4
- import type { CalledActionResult } from "../../gameTypes";
5
- import { Awaitable } from "../../../../util/data";
6
- import { ContentNode } from "../../action/tree/actionTree";
7
- import { TypedAction } from "../../action/actions";
8
- import { Color } from "../../types";
9
- export declare class ImageAction<T extends typeof ImageActionTypes[keyof typeof ImageActionTypes] = typeof ImageActionTypes[keyof typeof ImageActionTypes]> extends TypedAction<ImageActionContentType, T, Image> {
10
- static ActionTypes: {
11
- readonly action: "image:action";
12
- readonly setSrc: "image:setSrc";
13
- readonly flush: "image:flush";
14
- readonly initWearable: "image:initWearable";
15
- readonly setAppearance: "image:setAppearance";
16
- readonly setDarkness: "image:setDarkness";
17
- };
18
- static resolveTagSrc(image: Image, tags: string[]): string;
19
- static resolveCurrentSrc(image: Image): string | Color;
20
- type: T;
21
- contentNode: ContentNode<ImageActionContentType[T]>;
22
- executeAction(state: GameState): CalledActionResult | Awaitable<CalledActionResult, any>;
23
- }
1
+ import { ImageActionContentType, ImageActionTypes } from "../../action/actionTypes";
2
+ import { Image } from "../../elements/displayable/image";
3
+ import { GameState } from "../../../player/gameState";
4
+ import { ContentNode } from "../../action/tree/actionTree";
5
+ import { TypedAction } from "../../action/actions";
6
+ import { Color } from "../../types";
7
+ import { ActionExecutionInjection, ExecutedActionResult } from "../../action/action";
8
+ import { LogicAction } from "../../action/logicAction";
9
+ import { Story } from "../../elements/story";
10
+ export declare class ImageAction<T extends typeof ImageActionTypes[keyof typeof ImageActionTypes] = typeof ImageActionTypes[keyof typeof ImageActionTypes]> extends TypedAction<ImageActionContentType, T, Image> {
11
+ static ActionTypes: {
12
+ readonly action: "image:action";
13
+ readonly setSrc: "image:setSrc";
14
+ readonly flush: "image:flush";
15
+ readonly initWearable: "image:initWearable";
16
+ readonly setAppearance: "image:setAppearance";
17
+ readonly setDarkness: "image:setDarkness";
18
+ };
19
+ static resolveTagSrc(image: Image, tags: string[]): string;
20
+ static resolveCurrentSrc(image: Image): string | Color;
21
+ type: T;
22
+ contentNode: ContentNode<ImageActionContentType[T]>;
23
+ executeAction(state: GameState, injection: ActionExecutionInjection): ExecutedActionResult;
24
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
25
+ }
@@ -1,13 +1,16 @@
1
- import { LayerActionContentType, LayerActionTypes } from "../../action/actionTypes";
2
- import { TypedAction } from "../../action/actions";
3
- import { GameState } from "../../../player/gameState";
4
- import { CalledActionResult } from "../../gameTypes";
5
- import { Awaitable, Values } from "../../../../util/data";
6
- import { Layer } from "../../elements/layer";
7
- export declare class LayerAction<T extends Values<typeof LayerActionTypes> = Values<typeof LayerActionTypes>> extends TypedAction<LayerActionContentType, T, Layer> {
8
- static ActionTypes: {
9
- readonly action: "layer:action";
10
- readonly setZIndex: "layer:setZIndex";
11
- };
12
- executeAction(gameState: GameState): CalledActionResult | Awaitable<CalledActionResult, any>;
13
- }
1
+ import { LayerActionContentType, LayerActionTypes } from "../../action/actionTypes";
2
+ import { TypedAction } from "../../action/actions";
3
+ import { Layer } from "../../elements/layer";
4
+ import { Values } from "../../../../util/data";
5
+ import { GameState } from "../../../player/gameState";
6
+ import { ActionExecutionInjection, ExecutedActionResult } from "../../action/action";
7
+ import { LogicAction } from "../../action/logicAction";
8
+ import { Story } from "../../elements/story";
9
+ export declare class LayerAction<T extends Values<typeof LayerActionTypes> = Values<typeof LayerActionTypes>> extends TypedAction<LayerActionContentType, T, Layer> {
10
+ static ActionTypes: {
11
+ readonly action: "layer:action";
12
+ readonly setZIndex: "layer:setZIndex";
13
+ };
14
+ executeAction(gameState: GameState, injection: ActionExecutionInjection): ExecutedActionResult;
15
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
16
+ }
@@ -1,16 +1,21 @@
1
- import { MenuActionContentType, MenuActionTypes } from "../../action/actionTypes";
2
- import type { Menu } from "../../elements/menu";
3
- import { GameState } from "../../../player/gameState";
4
- import { Awaitable } from "../../../../util/data";
5
- import type { CalledActionResult } from "../../gameTypes";
6
- import { TypedAction } from "../../action/actions";
7
- import { Story } from "../../elements/story";
8
- import { LogicAction } from "../../action/logicAction";
9
- import { ActionSearchOptions } from "../../types";
10
- export declare class MenuAction<T extends typeof MenuActionTypes[keyof typeof MenuActionTypes] = typeof MenuActionTypes[keyof typeof MenuActionTypes]> extends TypedAction<MenuActionContentType, T, Menu> {
11
- static ActionTypes: {
12
- readonly action: "menu:action";
13
- };
14
- executeAction(state: GameState): Awaitable<CalledActionResult<any>, CalledActionResult<any>>;
15
- getFutureActions(story: Story, options: ActionSearchOptions): LogicAction.Actions[];
16
- }
1
+ import { MenuActionContentType, MenuActionTypes } from "../../action/actionTypes";
2
+ import type { Menu } from "../../elements/menu";
3
+ import { GameState } from "../../../player/gameState";
4
+ import { Awaitable } from "../../../../util/data";
5
+ import type { CalledActionResult } from "../../gameTypes";
6
+ import { TypedAction } from "../../action/actions";
7
+ import { Story } from "../../elements/story";
8
+ import { LogicAction } from "../../action/logicAction";
9
+ import { ActionSearchOptions } from "../../types";
10
+ import { ActionExecutionInjection } from "../../action/action";
11
+ export declare class MenuAction<T extends typeof MenuActionTypes[keyof typeof MenuActionTypes] = typeof MenuActionTypes[keyof typeof MenuActionTypes]> extends TypedAction<MenuActionContentType, T, Menu> {
12
+ static ActionTypes: {
13
+ readonly action: "menu:action";
14
+ };
15
+ executeAction(gameState: GameState, injection: ActionExecutionInjection): (Awaitable<CalledActionResult, CalledActionResult> | {
16
+ type: T;
17
+ node: import("../../action/tree/actionTree").RenderableNode | null;
18
+ })[];
19
+ getFutureActions(story: Story, options: ActionSearchOptions): LogicAction.Actions[];
20
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
21
+ }
@@ -1,13 +1,17 @@
1
- import { PersistentActionContentType, PersistentActionTypes } from "../../action/actionTypes";
2
- import { GameState } from "../../../player/gameState";
3
- import { TypedAction } from "../../action/actions";
4
- import { Values } from "../../../../util/data";
5
- import { Persistent } from "../../elements/persistent";
6
- export declare class PersistentAction<T extends Values<typeof PersistentActionTypes> = Values<typeof PersistentActionTypes>> extends TypedAction<PersistentActionContentType, T, Persistent<any>> {
7
- static ActionTypes: {
8
- readonly action: "persistent:action";
9
- readonly set: "persistent:set";
10
- readonly assign: "persistent:assign";
11
- };
12
- executeAction(gameState: GameState): import("../../gameTypes").CalledActionResult<any> | import("../../../../util/data").Awaitable<import("../../gameTypes").CalledActionResult<any>, any>;
13
- }
1
+ import { PersistentActionContentType, PersistentActionTypes } from "../../action/actionTypes";
2
+ import { GameState } from "../../../player/gameState";
3
+ import { TypedAction } from "../../action/actions";
4
+ import { Values } from "../../../../util/data";
5
+ import { Persistent } from "../../elements/persistent";
6
+ import { ActionExecutionInjection } from "../../action/action";
7
+ import { LogicAction } from "../../action/logicAction";
8
+ import { Story } from "../../elements/story";
9
+ export declare class PersistentAction<T extends Values<typeof PersistentActionTypes> = Values<typeof PersistentActionTypes>> extends TypedAction<PersistentActionContentType, T, Persistent<any>> {
10
+ static ActionTypes: {
11
+ readonly action: "persistent:action";
12
+ readonly set: "persistent:set";
13
+ readonly assign: "persistent:assign";
14
+ };
15
+ executeAction(gameState: GameState, injection: ActionExecutionInjection): import("../../action/action").ExecutedActionResult;
16
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
17
+ }
@@ -1,44 +1,47 @@
1
- import { SceneActionContentType, SceneActionTypes } from "../../action/actionTypes";
2
- import type { Scene, SceneDataRaw } from "../../elements/scene";
3
- import { GameState, PlayerStateElementSnapshot } from "../../../player/gameState";
4
- import { Awaitable } from "../../../../util/data";
5
- import type { CalledActionResult } from "../../gameTypes";
6
- import { ContentNode } from "../../action/tree/actionTree";
7
- import { LogicAction } from "../../action/logicAction";
8
- import { TypedAction } from "../../action/actions";
9
- import { Story } from "../../elements/story";
10
- import { ImageTransition } from "../../elements/transition/transitions/image/imageTransition";
11
- import { ActionSearchOptions } from "../../types";
12
- import { ExposedState, ExposedStateType } from "../../../player/type";
13
- import { ImageDataRaw } from "../../elements/displayable/image";
14
- type SceneSnapshot = {
15
- state: SceneDataRaw | null;
16
- local: Record<string, any>;
17
- element: PlayerStateElementSnapshot;
18
- background: ImageDataRaw | null;
19
- };
20
- export declare class SceneAction<T extends typeof SceneActionTypes[keyof typeof SceneActionTypes] = typeof SceneActionTypes[keyof typeof SceneActionTypes]> extends TypedAction<SceneActionContentType, T, Scene> {
21
- static ActionTypes: {
22
- readonly action: "scene:action";
23
- readonly init: "scene:init";
24
- readonly exit: "scene:exit";
25
- readonly jumpTo: "scene:jumpTo";
26
- readonly setBackgroundMusic: "scene:setBackgroundMusic";
27
- readonly preUnmount: "scene:preUnmount";
28
- readonly transitionToScene: "scene:transitionToScene";
29
- };
30
- static handleSceneInit(scene: Scene, next: CalledActionResult, state: GameState, awaitable: Awaitable<CalledActionResult, any>): {
31
- type: any;
32
- node: ContentNode<any> | null;
33
- } | Awaitable<CalledActionResult<any>, any>;
34
- static initBackgroundMusic(scene: Scene, exposed: ExposedState[ExposedStateType.scene]): void;
35
- static createSceneSnapshot(scene: Scene, state: GameState): SceneSnapshot;
36
- static restoreSceneSnapshot(snapshot: SceneSnapshot, state: GameState): void;
37
- applyTransition(gameState: GameState, transition: ImageTransition): Awaitable<CalledActionResult<any>, CalledActionResult<any>>;
38
- exit(state: GameState): void;
39
- executeAction(gameState: GameState): CalledActionResult | Awaitable<CalledActionResult, any>;
40
- getFutureActions(story: Story, searchOptions?: ActionSearchOptions): LogicAction.Actions[];
41
- _sceneNotFoundError(sceneId: string): Error;
42
- getSceneName(scene: Scene | string): string;
43
- }
44
- export {};
1
+ import { SceneActionContentType, SceneActionTypes } from "../../action/actionTypes";
2
+ import type { Scene, SceneDataRaw } from "../../elements/scene";
3
+ import { GameState, PlayerStateElementSnapshot } from "../../../player/gameState";
4
+ import { Awaitable } from "../../../../util/data";
5
+ import type { CalledActionResult } from "../../gameTypes";
6
+ import { ContentNode } from "../../action/tree/actionTree";
7
+ import { LogicAction } from "../../action/logicAction";
8
+ import { TypedAction } from "../../action/actions";
9
+ import { Story } from "../../elements/story";
10
+ import { ImageTransition } from "../../elements/transition/transitions/image/imageTransition";
11
+ import { ActionSearchOptions } from "../../types";
12
+ import { ExposedState, ExposedStateType } from "../../../player/type";
13
+ import { ImageDataRaw } from "../../elements/displayable/image";
14
+ import { ActionExecutionInjection, ExecutedActionResult } from "../action";
15
+ type SceneSnapshot = {
16
+ state: SceneDataRaw | null;
17
+ local: Record<string, any>;
18
+ element: PlayerStateElementSnapshot;
19
+ background: ImageDataRaw | null;
20
+ };
21
+ export declare class SceneAction<T extends typeof SceneActionTypes[keyof typeof SceneActionTypes] = typeof SceneActionTypes[keyof typeof SceneActionTypes]> extends TypedAction<SceneActionContentType, T, Scene> {
22
+ static ActionTypes: {
23
+ readonly action: "scene:action";
24
+ readonly init: "scene:init";
25
+ readonly exit: "scene:exit";
26
+ readonly jumpTo: "scene:jumpTo";
27
+ readonly setBackgroundMusic: "scene:setBackgroundMusic";
28
+ readonly preUnmount: "scene:preUnmount";
29
+ readonly transitionToScene: "scene:transitionToScene";
30
+ };
31
+ static handleSceneInit(scene: Scene, next: CalledActionResult, state: GameState, awaitable: Awaitable<CalledActionResult, any>): {
32
+ type: any;
33
+ node: ContentNode<any> | null;
34
+ wait?: import("../../gameTypes").StackModelWaiting | null;
35
+ } | Awaitable<CalledActionResult, any>;
36
+ static initBackgroundMusic(scene: Scene, exposed: ExposedState[ExposedStateType.scene]): void;
37
+ static createSceneSnapshot(scene: Scene, state: GameState): SceneSnapshot;
38
+ static restoreSceneSnapshot(snapshot: SceneSnapshot, state: GameState): void;
39
+ applyTransition(gameState: GameState, transition: ImageTransition, injection: ActionExecutionInjection): Awaitable<CalledActionResult, CalledActionResult>;
40
+ exit(state: GameState): void;
41
+ executeAction(gameState: GameState, injection: ActionExecutionInjection): ExecutedActionResult;
42
+ getFutureActions(story: Story, searchOptions?: ActionSearchOptions): LogicAction.Actions[];
43
+ _sceneNotFoundError(sceneId: string): Error;
44
+ getSceneName(scene: Scene | string): string;
45
+ stringify(story: Story, seen: Set<LogicAction.Actions>, _strict: boolean): string;
46
+ }
47
+ export {};
@@ -1,10 +1,14 @@
1
- import { ScriptActionContentType, ScriptActionTypes } from "../../action/actionTypes";
2
- import type { Script } from "../../elements/script";
3
- import { GameState } from "../../../player/gameState";
4
- import { TypedAction } from "../../action/actions";
5
- export declare class ScriptAction<T extends typeof ScriptActionTypes[keyof typeof ScriptActionTypes] = typeof ScriptActionTypes[keyof typeof ScriptActionTypes]> extends TypedAction<ScriptActionContentType, T, Script> {
6
- static ActionTypes: {
7
- readonly action: "script:action";
8
- };
9
- executeAction(gameState: GameState): import("../../gameTypes").CalledActionResult<any> | import("../../../../util/data").Awaitable<import("../../gameTypes").CalledActionResult<any>, any>;
10
- }
1
+ import { ScriptActionContentType, ScriptActionTypes } from "../../action/actionTypes";
2
+ import type { Script } from "../../elements/script";
3
+ import { GameState } from "../../../player/gameState";
4
+ import { TypedAction } from "../../action/actions";
5
+ import { ActionExecutionInjection } from "../action";
6
+ import { Story } from "../../elements/story";
7
+ import { LogicAction } from "../../action/logicAction";
8
+ export declare class ScriptAction<T extends typeof ScriptActionTypes[keyof typeof ScriptActionTypes] = typeof ScriptActionTypes[keyof typeof ScriptActionTypes]> extends TypedAction<ScriptActionContentType, T, Script> {
9
+ static ActionTypes: {
10
+ readonly action: "script:action";
11
+ };
12
+ executeAction(gameState: GameState, injection: ActionExecutionInjection): import("../action").ExecutedActionResult;
13
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
14
+ }
@@ -1,18 +1,20 @@
1
- import { SoundActionContentType, SoundActionTypes } from "../../action/actionTypes";
2
- import type { Sound } from "../../elements/sound";
3
- import { GameState } from "../../../player/gameState";
4
- import type { CalledActionResult } from "../../gameTypes";
5
- import { Awaitable } from "../../../../util/data";
6
- import { TypedAction } from "../../action/actions";
7
- export declare class SoundAction<T extends typeof SoundActionTypes[keyof typeof SoundActionTypes] = typeof SoundActionTypes[keyof typeof SoundActionTypes]> extends TypedAction<SoundActionContentType, T, Sound> {
8
- static ActionTypes: {
9
- readonly action: "sound:action";
10
- readonly play: "sound:play";
11
- readonly stop: "sound:stop";
12
- readonly setVolume: "sound:setVolume";
13
- readonly setRate: "sound:setRate";
14
- readonly pause: "sound:pause";
15
- readonly resume: "sound:resume";
16
- };
17
- executeAction(state: GameState): CalledActionResult | Awaitable<CalledActionResult, any>;
18
- }
1
+ import { TypedAction } from "../../action/actions";
2
+ import { SoundActionContentType, SoundActionTypes } from "../../action/actionTypes";
3
+ import type { Sound } from "../../elements/sound";
4
+ import { GameState } from "../../../player/gameState";
5
+ import { ActionExecutionInjection, ExecutedActionResult } from "../../action/action";
6
+ import { LogicAction } from "../../action/logicAction";
7
+ import { Story } from "../../elements/story";
8
+ export declare class SoundAction<T extends typeof SoundActionTypes[keyof typeof SoundActionTypes] = typeof SoundActionTypes[keyof typeof SoundActionTypes]> extends TypedAction<SoundActionContentType, T, Sound> {
9
+ static ActionTypes: {
10
+ readonly action: "sound:action";
11
+ readonly play: "sound:play";
12
+ readonly stop: "sound:stop";
13
+ readonly setVolume: "sound:setVolume";
14
+ readonly setRate: "sound:setRate";
15
+ readonly pause: "sound:pause";
16
+ readonly resume: "sound:resume";
17
+ };
18
+ executeAction(state: GameState, injection: ActionExecutionInjection): ExecutedActionResult;
19
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
20
+ }
@@ -1,8 +1,8 @@
1
- import { StoryActionContentType, StoryActionTypes } from "../../action/actionTypes";
2
- import type { Story } from "../../elements/story";
3
- import { TypedAction } from "../../action/actions";
4
- export declare class StoryAction<T extends typeof StoryActionTypes[keyof typeof StoryActionTypes] = typeof StoryActionTypes[keyof typeof StoryActionTypes]> extends TypedAction<StoryActionContentType, T, Story> {
5
- static ActionTypes: {
6
- readonly action: "story:action";
7
- };
8
- }
1
+ import { StoryActionContentType, StoryActionTypes } from "../../action/actionTypes";
2
+ import type { Story } from "../../elements/story";
3
+ import { TypedAction } from "../../action/actions";
4
+ export declare class StoryAction<T extends typeof StoryActionTypes[keyof typeof StoryActionTypes] = typeof StoryActionTypes[keyof typeof StoryActionTypes]> extends TypedAction<StoryActionContentType, T, Story> {
5
+ static ActionTypes: {
6
+ readonly action: "story:action";
7
+ };
8
+ }
@@ -1,14 +1,16 @@
1
- import { TextActionContentType, TextActionTypes } from "../../action/actionTypes";
2
- import { TypedAction } from "../../action/actions";
3
- import { GameState } from "../../../player/gameState";
4
- import { CalledActionResult } from "../../gameTypes";
5
- import { Awaitable } from "../../../../util/data";
6
- import { Text } from "../../elements/displayable/text";
7
- export declare class TextAction<T extends typeof TextActionTypes[keyof typeof TextActionTypes] = typeof TextActionTypes[keyof typeof TextActionTypes]> extends TypedAction<TextActionContentType, T, Text> {
8
- static ActionTypes: {
9
- readonly action: "text:action";
10
- readonly setText: "text:setText";
11
- readonly setFontSize: "text:setFontSize";
12
- };
13
- executeAction(state: GameState): CalledActionResult | Awaitable<CalledActionResult, any>;
14
- }
1
+ import { TextActionContentType, TextActionTypes } from "../../action/actionTypes";
2
+ import { TypedAction } from "../../action/actions";
3
+ import { Text } from "../../elements/displayable/text";
4
+ import { GameState } from "../../../player/gameState";
5
+ import { ActionExecutionInjection, ExecutedActionResult } from "../../action/action";
6
+ import { LogicAction } from "../../action/logicAction";
7
+ import { Story } from "../../elements/story";
8
+ export declare class TextAction<T extends typeof TextActionTypes[keyof typeof TextActionTypes] = typeof TextActionTypes[keyof typeof TextActionTypes]> extends TypedAction<TextActionContentType, T, Text> {
9
+ static ActionTypes: {
10
+ readonly action: "text:action";
11
+ readonly setText: "text:setText";
12
+ readonly setFontSize: "text:setFontSize";
13
+ };
14
+ executeAction(state: GameState, injection: ActionExecutionInjection): ExecutedActionResult;
15
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
16
+ }
@@ -1,22 +1,26 @@
1
- import { VideoActionContentType, VideoActionTypes } from "../../action/actionTypes";
2
- import { TypedAction } from "../../action/actions";
3
- import { Video } from "../../elements/video";
4
- import { GameState } from "../../../player/gameState";
5
- import { Awaitable, Values } from "../../../../util/data";
6
- import type { CalledActionResult } from "../../gameTypes";
7
- export declare class VideoAction<T extends Values<typeof VideoActionTypes> = Values<typeof VideoActionTypes>> extends TypedAction<VideoActionContentType, T, Video> {
8
- static ActionTypes: {
9
- readonly action: "video:action";
10
- readonly show: "video:show";
11
- readonly hide: "video:hide";
12
- readonly play: "video:play";
13
- readonly pause: "video:pause";
14
- readonly resume: "video:resume";
15
- readonly stop: "video:stop";
16
- readonly seek: "video:seek";
17
- };
18
- executeAction(gameState: GameState): Awaitable<CalledActionResult>;
19
- private changeStateBase;
20
- private changeState;
21
- private changeStateAsync;
22
- }
1
+ import { VideoActionContentType, VideoActionTypes } from "../../action/actionTypes";
2
+ import { TypedAction } from "../../action/actions";
3
+ import { Video } from "../../elements/video";
4
+ import { GameState } from "../../../player/gameState";
5
+ import { Awaitable, Values } from "../../../../util/data";
6
+ import type { CalledActionResult } from "../../gameTypes";
7
+ import { ActionExecutionInjection } from "../../action/action";
8
+ import { LogicAction } from "../../action/logicAction";
9
+ import { Story } from "../../elements/story";
10
+ export declare class VideoAction<T extends Values<typeof VideoActionTypes> = Values<typeof VideoActionTypes>> extends TypedAction<VideoActionContentType, T, Video> {
11
+ static ActionTypes: {
12
+ readonly action: "video:action";
13
+ readonly show: "video:show";
14
+ readonly hide: "video:hide";
15
+ readonly play: "video:play";
16
+ readonly pause: "video:pause";
17
+ readonly resume: "video:resume";
18
+ readonly stop: "video:stop";
19
+ readonly seek: "video:seek";
20
+ };
21
+ executeAction(gameState: GameState, injection: ActionExecutionInjection): Awaitable<CalledActionResult>;
22
+ private changeStateBase;
23
+ private changeState;
24
+ private changeStateAsync;
25
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
26
+ }
@@ -1,13 +1,20 @@
1
- import { ContentNode } from "../action/tree/actionTree";
2
- import { LogicAction } from "../action/logicAction";
3
- import { Action } from "../action/action";
4
- import { Chained, Proxied } from "../action/chain";
5
- import { Awaitable } from "../../../util/data";
6
- import { CalledActionResult } from "../gameTypes";
7
- export declare class TypedAction<ContentType extends Record<string, any> = Record<string, any>, T extends keyof ContentType & string = keyof ContentType & string, Callee extends LogicAction.GameElement = LogicAction.GameElement> extends Action<ContentType[T], Callee, T> {
8
- callee: Callee;
9
- constructor(callee: Proxied<Callee, Chained<LogicAction.Actions, Callee>>, type: T, contentNode: ContentNode<ContentType[T]>);
10
- unknownTypeError(): void;
11
- resolveAwaitable<T extends CalledActionResult = any>(handler: (resolve: ((value: T) => void), awaitable: Awaitable<CalledActionResult, T>) => Promise<void> | void, awaitable?: Awaitable<CalledActionResult, T>): Awaitable<CalledActionResult, T>;
12
- is<T extends LogicAction.Actions>(parent: new (...args: any[]) => T, type: string): this is T;
13
- }
1
+ import { ContentNode } from "../action/tree/actionTree";
2
+ import { LogicAction } from "../action/logicAction";
3
+ import { Action } from "../action/action";
4
+ import { Chained, Proxied } from "../action/chain";
5
+ import { Awaitable } from "../../../util/data";
6
+ import { CalledActionResult } from "../gameTypes";
7
+ import type { Story } from "../elements/story";
8
+ export declare class TypedAction<ContentType extends Record<string, any> = Record<string, any>, T extends keyof ContentType & string = keyof ContentType & string, Callee extends LogicAction.GameElement = LogicAction.GameElement> extends Action<ContentType[T], Callee, T> {
9
+ callee: Callee;
10
+ constructor(callee: Proxied<Callee, Chained<LogicAction.Actions, Callee>>, type: T, contentNode: ContentNode<ContentType[T]>);
11
+ unknownTypeError(): void;
12
+ resolveAwaitable<T extends CalledActionResult = any>(handler: (resolve: ((value: T) => void), awaitable: Awaitable<CalledActionResult, T>) => Promise<void> | void, awaitable?: Awaitable<CalledActionResult, T>): Awaitable<CalledActionResult, T>;
13
+ is<T extends LogicAction.Actions>(parent: new (...args: any[]) => T, type: string): this is T;
14
+ /**
15
+ * {Action Name}#{Action ID}(Action Type){{Action Content}}
16
+ */
17
+ stringify(_story: Story, _seen: Set<LogicAction.Actions>, _strict: boolean): string;
18
+ stringifyWithName(name: string): string;
19
+ stringifyWithContent(name: string, content: string): string;
20
+ }
@@ -1,2 +1,2 @@
1
- export declare class BaseElement {
2
- }
1
+ export declare class BaseElement {
2
+ }
@@ -1,17 +1,17 @@
1
- import { LogicAction } from "../action/logicAction";
2
- import { BaseElement } from "../action/baseElement";
3
- import Actions = LogicAction.Actions;
4
- import GameElement = LogicAction.GameElement;
5
- export type Proxied<T extends Record<any, any>, U extends Record<any, any>> = T & U;
6
- export type ChainedAction = Proxied<GameElement, Chained<LogicAction.Actions>>;
7
- export type ChainedActions = (ChainedAction | ChainedAction[] | Actions | Actions[])[];
8
- export declare class Chained<T, Self extends Chainable<any, any> = any> {
9
- static isChained<T>(value: any): value is Chained<T>;
10
- static toActions(chainedActions: ChainedActions): Actions[];
11
- }
12
- /**
13
- * - T - the action type
14
- * - U - self constructor
15
- */
16
- export declare class Chainable<T, U extends Chainable<any, any>> extends BaseElement {
17
- }
1
+ import { LogicAction } from "../action/logicAction";
2
+ import { BaseElement } from "../action/baseElement";
3
+ import Actions = LogicAction.Actions;
4
+ import GameElement = LogicAction.GameElement;
5
+ export type Proxied<T extends Record<any, any>, U extends Record<any, any>> = T & U;
6
+ export type ChainedAction = Proxied<GameElement, Chained<LogicAction.Actions>>;
7
+ export type ChainedActions = (ChainedAction | ChainedAction[] | Actions | Actions[])[];
8
+ export declare class Chained<T, Self extends Chainable<any, any> = any> {
9
+ static isChained<T>(value: any): value is Chained<T>;
10
+ static toActions(chainedActions: ChainedActions): Actions[];
11
+ }
12
+ /**
13
+ * - T - the action type
14
+ * - U - self constructor
15
+ */
16
+ export declare class Chainable<T, U extends Chainable<any, any>> extends BaseElement {
17
+ }
@@ -1,5 +1,5 @@
1
- import { LogicAction } from "../action/logicAction";
2
- import { Chainable } from "../action/chain";
3
- export declare class Constructable<TAction extends LogicAction.Actions = LogicAction.Actions, Self extends Constructable<TAction> = any> extends Chainable<LogicAction.Actions, Self> {
4
- constructor();
5
- }
1
+ import { LogicAction } from "../action/logicAction";
2
+ import { Chainable } from "../action/chain";
3
+ export declare class Constructable<TAction extends LogicAction.Actions = LogicAction.Actions, Self extends Constructable<TAction> = any> extends Chainable<LogicAction.Actions, Self> {
4
+ constructor();
5
+ }