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.
- package/dist/game/nlcore/action/action.d.ts +29 -24
- package/dist/game/nlcore/action/actionHistory.d.ts +48 -39
- package/dist/game/nlcore/action/actionTypes.d.ts +142 -142
- package/dist/game/nlcore/action/actionable.d.ts +5 -5
- package/dist/game/nlcore/action/actions/characterAction.d.ts +19 -17
- package/dist/game/nlcore/action/actions/conditionAction.d.ts +26 -17
- package/dist/game/nlcore/action/actions/controlAction.d.ts +26 -38
- package/dist/game/nlcore/action/actions/displayableAction.d.ts +26 -22
- package/dist/game/nlcore/action/actions/imageAction.d.ts +25 -23
- package/dist/game/nlcore/action/actions/layerAction.d.ts +16 -13
- package/dist/game/nlcore/action/actions/menuAction.d.ts +21 -16
- package/dist/game/nlcore/action/actions/persistentAction.d.ts +17 -13
- package/dist/game/nlcore/action/actions/sceneAction.d.ts +47 -44
- package/dist/game/nlcore/action/actions/scriptAction.d.ts +14 -10
- package/dist/game/nlcore/action/actions/soundAction.d.ts +20 -18
- package/dist/game/nlcore/action/actions/storyAction.d.ts +8 -8
- package/dist/game/nlcore/action/actions/textAction.d.ts +16 -14
- package/dist/game/nlcore/action/actions/videoAction.d.ts +26 -22
- package/dist/game/nlcore/action/actions.d.ts +20 -13
- package/dist/game/nlcore/action/baseElement.d.ts +2 -2
- package/dist/game/nlcore/action/chain.d.ts +17 -17
- package/dist/game/nlcore/action/constructable.d.ts +5 -5
- package/dist/game/nlcore/action/gameHistory.d.ts +32 -32
- package/dist/game/nlcore/action/logicAction.d.ts +52 -52
- package/dist/game/nlcore/action/serviceAction.d.ts +24 -11
- package/dist/game/nlcore/action/srcManager.d.ts +47 -47
- package/dist/game/nlcore/action/stackModel.d.ts +106 -0
- package/dist/game/nlcore/action/tree/actionTree.d.ts +56 -56
- package/dist/game/nlcore/common/Utils.d.ts +25 -25
- package/dist/game/nlcore/common/core.d.ts +8 -8
- package/dist/game/nlcore/common/elements.d.ts +19 -19
- package/dist/game/nlcore/common/game.d.ts +8 -7
- package/dist/game/nlcore/common/player.d.ts +7 -7
- package/dist/game/nlcore/common/position.d.ts +2 -2
- package/dist/game/nlcore/common/transition.d.ts +6 -6
- package/dist/game/nlcore/common/types.d.ts +9 -9
- package/dist/game/nlcore/elements/character/pause.d.ts +8 -8
- package/dist/game/nlcore/elements/character/sentence.d.ts +25 -25
- package/dist/game/nlcore/elements/character/word.d.ts +18 -18
- package/dist/game/nlcore/elements/character.d.ts +56 -52
- package/dist/game/nlcore/elements/condition.d.ts +20 -20
- package/dist/game/nlcore/elements/control.d.ts +76 -76
- package/dist/game/nlcore/elements/displayable/displayable.d.ts +76 -76
- package/dist/game/nlcore/elements/displayable/image.d.ts +102 -102
- package/dist/game/nlcore/elements/displayable/text.d.ts +74 -74
- package/dist/game/nlcore/elements/layer.d.ts +33 -33
- package/dist/game/nlcore/elements/menu.d.ts +45 -45
- package/dist/game/nlcore/elements/persistent/storable.d.ts +24 -24
- package/dist/game/nlcore/elements/persistent/type.d.ts +3 -3
- package/dist/game/nlcore/elements/persistent.d.ts +86 -86
- package/dist/game/nlcore/elements/scene.d.ts +76 -76
- package/dist/game/nlcore/elements/script.d.ts +16 -16
- package/dist/game/nlcore/elements/service.d.ts +59 -59
- package/dist/game/nlcore/elements/sound.d.ts +89 -89
- package/dist/game/nlcore/elements/story.d.ts +92 -78
- package/dist/game/nlcore/elements/transform/position.d.ts +99 -103
- package/dist/game/nlcore/elements/transform/transform.d.ts +119 -119
- package/dist/game/nlcore/elements/transform/type.d.ts +32 -32
- package/dist/game/nlcore/elements/transition/transition.d.ts +29 -29
- package/dist/game/nlcore/elements/transition/transitions/image/darkness.d.ts +20 -20
- package/dist/game/nlcore/elements/transition/transitions/image/dissolve.d.ts +17 -17
- package/dist/game/nlcore/elements/transition/transitions/image/fadeIn.d.ts +20 -20
- package/dist/game/nlcore/elements/transition/transitions/image/imageTransition.d.ts +28 -28
- package/dist/game/nlcore/elements/transition/transitions/text/fontSize.d.ts +13 -13
- package/dist/game/nlcore/elements/transition/transitions/text/textTransition.d.ts +10 -10
- package/dist/game/nlcore/elements/transition/type.d.ts +51 -51
- package/dist/game/nlcore/elements/type.d.ts +16 -16
- package/dist/game/nlcore/elements/video.d.ts +23 -23
- package/dist/game/nlcore/game/liveGame.d.ts +148 -138
- package/dist/game/nlcore/game/plugin/plugin.d.ts +16 -16
- package/dist/game/nlcore/game/preference.d.ts +32 -32
- package/dist/game/nlcore/game.d.ts +79 -116
- package/dist/game/nlcore/gameTypes.d.ts +439 -337
- package/dist/game/nlcore/types.d.ts +67 -67
- package/dist/game/player/Tasks.d.ts +125 -106
- package/dist/game/player/elements/Player.d.ts +4 -4
- package/dist/game/player/elements/displayable/Displayable.d.ts +1 -1
- package/dist/game/player/elements/displayable/Displayables.d.ts +1 -1
- package/dist/game/player/elements/displayable/Text.d.ts +1 -1
- package/dist/game/player/elements/displayable/type.d.ts +1 -1
- package/dist/game/player/elements/elements.d.ts +8 -8
- package/dist/game/player/elements/image/AspectScaleImage.d.ts +1 -1
- package/dist/game/player/elements/image/Image.d.ts +3 -3
- package/dist/game/player/elements/menu/PlayerMenu.d.ts +3 -3
- package/dist/game/player/elements/menu/UIMenu/Item.d.ts +12 -12
- package/dist/game/player/elements/menu/UIMenu/Menu.d.ts +6 -6
- package/dist/game/player/elements/menu/UIMenu/context.d.ts +23 -23
- package/dist/game/player/elements/menu/type.d.ts +16 -16
- package/dist/game/player/elements/notification/Notifications.d.ts +3 -3
- package/dist/game/player/elements/notification/PlayerNotification.d.ts +4 -4
- package/dist/game/player/elements/notification/context.d.ts +11 -11
- package/dist/game/player/elements/notification/type.d.ts +18 -19
- package/dist/game/player/elements/player/KeyEventAnnouncer.d.ts +1 -1
- package/dist/game/player/elements/player/Layer.d.ts +8 -8
- package/dist/game/player/elements/player/PreferenceUpdateAnnouncer.d.ts +4 -4
- package/dist/game/player/elements/player/RenderEventAnnoucer.d.ts +4 -4
- package/dist/game/player/elements/player/SizeUpdateAnnouncer.d.ts +1 -1
- package/dist/game/player/elements/preload/Preload.d.ts +1 -1
- package/dist/game/player/elements/say/Dialog.d.ts +13 -13
- package/dist/game/player/elements/say/Nametag.d.ts +2 -2
- package/dist/game/player/elements/say/Sentence.d.ts +37 -37
- package/dist/game/player/elements/say/UIDialog.d.ts +72 -71
- package/dist/game/player/elements/say/context.d.ts +4 -4
- package/dist/game/player/elements/say/type.d.ts +53 -53
- package/dist/game/player/elements/say/useDialog.d.ts +18 -18
- package/dist/game/player/elements/scene/Scene.d.ts +1 -1
- package/dist/game/player/elements/type.d.ts +53 -53
- package/dist/game/player/elements/video/video.d.ts +1 -1
- package/dist/game/player/gameState.d.ts +193 -191
- package/dist/game/player/gameState.type.d.ts +1 -1
- package/dist/game/player/guard.d.ts +24 -24
- package/dist/game/player/lib/AspectRatio.d.ts +7 -7
- package/dist/game/player/lib/AudioManager.d.ts +50 -50
- package/dist/game/player/lib/Cursor.d.ts +6 -6
- package/dist/game/player/lib/ErrorBoundary.d.ts +24 -24
- package/dist/game/player/lib/ErrorFallback.d.ts +5 -5
- package/dist/game/player/lib/ImageCacheManager.d.ts +26 -26
- package/dist/game/player/lib/Inspect.d.ts +36 -36
- package/dist/game/player/lib/PageRouter/AnimatePresence.d.ts +4 -4
- package/dist/game/player/lib/PageRouter/Page.d.ts +9 -9
- package/dist/game/player/lib/PageRouter/PageRouter.d.ts +27 -27
- package/dist/game/player/lib/PageRouter/Stage.d.ts +6 -6
- package/dist/game/player/lib/PageRouter/router.d.ts +28 -23
- package/dist/game/player/lib/PlayerFrames.d.ts +10 -10
- package/dist/game/player/lib/Preloaded.d.ts +48 -48
- package/dist/game/player/lib/flush.d.ts +5 -5
- package/dist/game/player/lib/isolated.d.ts +7 -7
- package/dist/game/player/lib/notification.d.ts +47 -47
- package/dist/game/player/lib/preferences.d.ts +8 -8
- package/dist/game/player/lib/useElementVisibility.d.ts +5 -5
- package/dist/game/player/lib/useExposeState.d.ts +10 -10
- package/dist/game/player/lib/useLiveGame.d.ts +1 -1
- package/dist/game/player/libElements.d.ts +12 -12
- package/dist/game/player/provider/game-state.d.ts +24 -24
- package/dist/game/player/provider/preloaded.d.ts +1 -1
- package/dist/game/player/provider/providers.d.ts +7 -7
- package/dist/game/player/provider/ratio.d.ts +1 -1
- package/dist/game/player/type.d.ts +68 -68
- package/dist/index.d.ts +3 -3
- package/dist/main.js +43 -45
- package/dist/util/config.d.ts +37 -37
- package/dist/util/data.d.ts +346 -309
- package/dist/util/logger.d.ts +21 -21
- package/dist/util/singleton.d.ts +5 -5
- 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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
static
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
static
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
}
|