@momoyu-ink/kit 0.4.2 → 0.5.1
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/jsx-dev-runtime--ZXLAgUi.d.mts +600 -0
- package/dist/jsx-dev-runtime--ZXLAgUi.d.ts +600 -0
- package/dist/jsx-dev-runtime.cjs +27 -0
- package/dist/jsx-dev-runtime.d.mts +4 -0
- package/dist/jsx-dev-runtime.d.ts +4 -0
- package/dist/jsx-dev-runtime.mjs +6 -0
- package/dist/jsx-runtime.cjs +28 -0
- package/dist/jsx-runtime.d.mts +4 -0
- package/dist/jsx-runtime.d.ts +4 -0
- package/dist/jsx-runtime.mjs +7 -0
- package/dist/lib.cjs +1610 -0
- package/dist/lib.d.mts +668 -0
- package/dist/lib.d.ts +668 -15
- package/dist/lib.mjs +1641 -0
- package/package.json +29 -8
- package/dist/bindings/AnimationFormat.d.ts +0 -1
- package/dist/bindings/AnimationFormat.js +0 -3
- package/dist/bindings/AnimationFrameCallbackEvent.d.ts +0 -3
- package/dist/bindings/AnimationFrameCallbackEvent.js +0 -3
- package/dist/bindings/AnimationProps.d.ts +0 -6
- package/dist/bindings/AnimationProps.js +0 -2
- package/dist/bindings/AudioCommand.d.ts +0 -54
- package/dist/bindings/AudioCommand.js +0 -2
- package/dist/bindings/AudioSettings.d.ts +0 -42
- package/dist/bindings/AudioSettings.js +0 -3
- package/dist/bindings/BackdropProps.d.ts +0 -6
- package/dist/bindings/BackdropProps.js +0 -2
- package/dist/bindings/BeforeUnloadEvent.d.ts +0 -1
- package/dist/bindings/BeforeUnloadEvent.js +0 -3
- package/dist/bindings/ClipProps.d.ts +0 -4
- package/dist/bindings/ClipProps.js +0 -3
- package/dist/bindings/CustomEvent.d.ts +0 -18
- package/dist/bindings/CustomEvent.js +0 -3
- package/dist/bindings/EffectParams.d.ts +0 -6
- package/dist/bindings/EffectParams.js +0 -3
- package/dist/bindings/FilterKind.d.ts +0 -34
- package/dist/bindings/FilterKind.js +0 -3
- package/dist/bindings/FilterProps.d.ts +0 -4
- package/dist/bindings/FilterProps.js +0 -2
- package/dist/bindings/FocusEvent.d.ts +0 -5
- package/dist/bindings/FocusEvent.js +0 -2
- package/dist/bindings/FocusEventKind.d.ts +0 -1
- package/dist/bindings/FocusEventKind.js +0 -3
- package/dist/bindings/FullScreenEvent.d.ts +0 -4
- package/dist/bindings/FullScreenEvent.js +0 -2
- package/dist/bindings/FullscreenEventKind.d.ts +0 -1
- package/dist/bindings/FullscreenEventKind.js +0 -3
- package/dist/bindings/GameEvent.d.ts +0 -1
- package/dist/bindings/GameEvent.js +0 -3
- package/dist/bindings/Gamepad.d.ts +0 -44
- package/dist/bindings/Gamepad.js +0 -2
- package/dist/bindings/GamepadButton.d.ts +0 -20
- package/dist/bindings/GamepadButton.js +0 -3
- package/dist/bindings/GamepadCommand.d.ts +0 -9
- package/dist/bindings/GamepadCommand.js +0 -2
- package/dist/bindings/GamepadEvent.d.ts +0 -12
- package/dist/bindings/GamepadEvent.js +0 -2
- package/dist/bindings/GamepadHapticActuator.d.ts +0 -11
- package/dist/bindings/GamepadHapticActuator.js +0 -3
- package/dist/bindings/KeyboardEventKind.d.ts +0 -1
- package/dist/bindings/KeyboardEventKind.js +0 -3
- package/dist/bindings/KeyboardLocation.d.ts +0 -1
- package/dist/bindings/KeyboardLocation.js +0 -3
- package/dist/bindings/Literal.d.ts +0 -3
- package/dist/bindings/Literal.js +0 -3
- package/dist/bindings/MouseEventKind.d.ts +0 -1
- package/dist/bindings/MouseEventKind.js +0 -3
- package/dist/bindings/MoyuCursor.d.ts +0 -1
- package/dist/bindings/MoyuCursor.js +0 -3
- package/dist/bindings/NineSliceMode.d.ts +0 -1
- package/dist/bindings/NineSliceMode.js +0 -3
- package/dist/bindings/NodeEvent.d.ts +0 -4
- package/dist/bindings/NodeEvent.js +0 -3
- package/dist/bindings/NodeProps.d.ts +0 -20
- package/dist/bindings/NodeProps.js +0 -2
- package/dist/bindings/RawKeyboardEvent.d.ts +0 -16
- package/dist/bindings/RawKeyboardEvent.js +0 -2
- package/dist/bindings/RawMouseEvent.d.ts +0 -12
- package/dist/bindings/RawMouseEvent.js +0 -2
- package/dist/bindings/RawTouchEvent.d.ts +0 -13
- package/dist/bindings/RawTouchEvent.js +0 -2
- package/dist/bindings/RawWheelEvent.d.ts +0 -10
- package/dist/bindings/RawWheelEvent.js +0 -2
- package/dist/bindings/ResizeEvent.d.ts +0 -4
- package/dist/bindings/ResizeEvent.js +0 -3
- package/dist/bindings/ResolvedArgument.d.ts +0 -5
- package/dist/bindings/ResolvedArgument.js +0 -2
- package/dist/bindings/ResolvedCommandLine.d.ts +0 -5
- package/dist/bindings/ResolvedCommandLine.js +0 -2
- package/dist/bindings/ResolvedSystemCallLine.d.ts +0 -5
- package/dist/bindings/ResolvedSystemCallLine.js +0 -2
- package/dist/bindings/ScenarioCommand.d.ts +0 -103
- package/dist/bindings/ScenarioCommand.js +0 -2
- package/dist/bindings/ScenarioEvent.d.ts +0 -4
- package/dist/bindings/ScenarioEvent.js +0 -2
- package/dist/bindings/SpriteMode.d.ts +0 -1
- package/dist/bindings/SpriteMode.js +0 -3
- package/dist/bindings/SpriteProps.d.ts +0 -11
- package/dist/bindings/SpriteProps.js +0 -2
- package/dist/bindings/SystemCommand.d.ts +0 -30
- package/dist/bindings/SystemCommand.js +0 -2
- package/dist/bindings/TextCommand.d.ts +0 -9
- package/dist/bindings/TextCommand.js +0 -3
- package/dist/bindings/TextEvent.d.ts +0 -1
- package/dist/bindings/TextEvent.js +0 -3
- package/dist/bindings/TextLine.d.ts +0 -5
- package/dist/bindings/TextLine.js +0 -3
- package/dist/bindings/TextPrintMode.d.ts +0 -4
- package/dist/bindings/TextPrintMode.js +0 -3
- package/dist/bindings/TextProps.d.ts +0 -41
- package/dist/bindings/TextProps.js +0 -2
- package/dist/bindings/TouchEventKind.d.ts +0 -1
- package/dist/bindings/TouchEventKind.js +0 -3
- package/dist/bindings/VideoCommand.d.ts +0 -21
- package/dist/bindings/VideoCommand.js +0 -3
- package/dist/bindings/VideoEvent.d.ts +0 -1
- package/dist/bindings/VideoEvent.js +0 -3
- package/dist/bindings/VideoProps.d.ts +0 -7
- package/dist/bindings/VideoProps.js +0 -3
- package/dist/bindings/WheelEventDeltaMode.d.ts +0 -1
- package/dist/bindings/WheelEventDeltaMode.js +0 -3
- package/dist/bindings/WindowState.d.ts +0 -1
- package/dist/bindings/WindowState.js +0 -3
- package/dist/bindings/serde_json/JsonValue.d.ts +0 -3
- package/dist/bindings/serde_json/JsonValue.js +0 -3
- package/dist/commands.d.ts +0 -17
- package/dist/commands.js +0 -24
- package/dist/components/navigation.d.ts +0 -154
- package/dist/components/navigation.js +0 -252
- package/dist/declaration.d.ts +0 -80
- package/dist/declaration.js +0 -2
- package/dist/events/base.d.ts +0 -16
- package/dist/events/base.js +0 -19
- package/dist/events/globals.d.ts +0 -2
- package/dist/events/globals.js +0 -122
- package/dist/events/keyboard.d.ts +0 -37
- package/dist/events/keyboard.js +0 -2
- package/dist/events/listener.d.ts +0 -1
- package/dist/events/listener.js +0 -13
- package/dist/events/mouse.d.ts +0 -15
- package/dist/events/mouse.js +0 -2
- package/dist/events/touch.d.ts +0 -16
- package/dist/events/touch.js +0 -2
- package/dist/events/wheel.d.ts +0 -9
- package/dist/events/wheel.js +0 -2
- package/dist/events.d.ts +0 -33
- package/dist/events.js +0 -49
- package/dist/hooks/useFadeInOut.d.ts +0 -16
- package/dist/hooks/useFadeInOut.js +0 -62
- package/dist/hooks/useScenario.d.ts +0 -13
- package/dist/hooks/useScenario.js +0 -64
- package/dist/hooks/useSoundEffect.d.ts +0 -4
- package/dist/hooks/useSoundEffect.js +0 -63
- package/dist/hooks/useStage.d.ts +0 -126
- package/dist/hooks/useStage.js +0 -706
- package/dist/hooks.d.ts +0 -4
- package/dist/hooks.js +0 -20
- package/dist/lib.js +0 -54
- package/dist/moyu.d.ts +0 -19
- package/dist/moyu.js +0 -49
- package/dist/node.d.ts +0 -16
- package/dist/node.js +0 -105
- package/dist/react.d.ts +0 -20
- package/dist/react.js +0 -222
- package/dist/runtime-globals.d.ts +0 -65
- package/dist/runtime-globals.js +0 -2
- package/dist/sandbox.d.ts +0 -1
- package/dist/sandbox.js +0 -88
- package/dist/spring/animated.d.ts +0 -27
- package/dist/spring/animated.js +0 -2
- package/dist/spring/index.d.ts +0 -5
- package/dist/spring/index.js +0 -35
- package/dist/spring/primitives.d.ts +0 -3
- package/dist/spring/primitives.js +0 -13
- package/dist/state.d.ts +0 -6
- package/dist/state.js +0 -8
- package/dist/utils.d.ts +0 -10
- package/dist/utils.js +0 -10
- package/dist/zod-patch.d.ts +0 -10
- package/dist/zod-patch.js +0 -2
- package/jsx-runtime.d.ts +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { WheelEventDeltaMode } from './WheelEventDeltaMode';
|
|
2
|
-
export type RawWheelEvent = {
|
|
3
|
-
kind: string;
|
|
4
|
-
targetId: number;
|
|
5
|
-
bubbleTargetIds: Array<number>;
|
|
6
|
-
deltaX: number;
|
|
7
|
-
deltaY: number;
|
|
8
|
-
deltaZ: number;
|
|
9
|
-
deltaMode: WheelEventDeltaMode;
|
|
10
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import type { JsonValue } from './serde_json/JsonValue';
|
|
2
|
-
export type ScenarioCommand = {
|
|
3
|
-
subCommand: 'addStory';
|
|
4
|
-
name: string;
|
|
5
|
-
} | {
|
|
6
|
-
subCommand: 'removeStory';
|
|
7
|
-
name: string;
|
|
8
|
-
} | {
|
|
9
|
-
subCommand: 'hasStory';
|
|
10
|
-
name: string;
|
|
11
|
-
} | {
|
|
12
|
-
subCommand: 'getStoryList';
|
|
13
|
-
} | {
|
|
14
|
-
subCommand: 'startStory';
|
|
15
|
-
/**
|
|
16
|
-
* The name of the story to start
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
/**
|
|
20
|
-
* The entry point to start from
|
|
21
|
-
*/
|
|
22
|
-
entry?: string;
|
|
23
|
-
} | {
|
|
24
|
-
subCommand: 'terminateStory';
|
|
25
|
-
} | {
|
|
26
|
-
subCommand: 'nextLine';
|
|
27
|
-
} | {
|
|
28
|
-
subCommand: 'setWaiting';
|
|
29
|
-
/**
|
|
30
|
-
* waiting time in milliseconds
|
|
31
|
-
* use f64 to avoid conversion issues with JavaScript numbers
|
|
32
|
-
*/
|
|
33
|
-
time: number;
|
|
34
|
-
/**
|
|
35
|
-
* whether the waiting can be skipped by user input
|
|
36
|
-
*/
|
|
37
|
-
skippable: boolean;
|
|
38
|
-
} | {
|
|
39
|
-
subCommand: 'setVariable';
|
|
40
|
-
name: string;
|
|
41
|
-
value: JsonValue;
|
|
42
|
-
} | {
|
|
43
|
-
subCommand: 'getVariable';
|
|
44
|
-
name: string;
|
|
45
|
-
} | {
|
|
46
|
-
subCommand: 'setVariables';
|
|
47
|
-
variables: {
|
|
48
|
-
[key in string]: JsonValue;
|
|
49
|
-
};
|
|
50
|
-
} | {
|
|
51
|
-
subCommand: 'getVariables';
|
|
52
|
-
} | {
|
|
53
|
-
subCommand: 'setPermanentVariable';
|
|
54
|
-
key: string;
|
|
55
|
-
value: JsonValue;
|
|
56
|
-
} | {
|
|
57
|
-
subCommand: 'getPermanentVariable';
|
|
58
|
-
key: string;
|
|
59
|
-
} | {
|
|
60
|
-
subCommand: 'setPermanentVariables';
|
|
61
|
-
variables: {
|
|
62
|
-
[key in string]: JsonValue;
|
|
63
|
-
};
|
|
64
|
-
} | {
|
|
65
|
-
subCommand: 'getPermanentVariables';
|
|
66
|
-
} | {
|
|
67
|
-
subCommand: 'clearPermanentVariables';
|
|
68
|
-
} | {
|
|
69
|
-
subCommand: 'saveGame';
|
|
70
|
-
name: string;
|
|
71
|
-
extra?: JsonValue;
|
|
72
|
-
} | {
|
|
73
|
-
subCommand: 'record';
|
|
74
|
-
meta: {
|
|
75
|
-
[key in string]: JsonValue;
|
|
76
|
-
};
|
|
77
|
-
} | {
|
|
78
|
-
subCommand: 'getRecords';
|
|
79
|
-
offset?: number;
|
|
80
|
-
limit?: number;
|
|
81
|
-
} | {
|
|
82
|
-
subCommand: 'jumpToRecord';
|
|
83
|
-
recordId: string;
|
|
84
|
-
} | {
|
|
85
|
-
subCommand: 'loadGame';
|
|
86
|
-
name: string;
|
|
87
|
-
/**
|
|
88
|
-
* if true, will overwrite the current game session with the loaded one,
|
|
89
|
-
* otherwise an error will be returned if the current session is not empty
|
|
90
|
-
*/
|
|
91
|
-
overwrite: boolean;
|
|
92
|
-
} | {
|
|
93
|
-
subCommand: 'resetGame';
|
|
94
|
-
} | {
|
|
95
|
-
subCommand: 'removeGame';
|
|
96
|
-
name: string;
|
|
97
|
-
} | {
|
|
98
|
-
subCommand: 'getGameList';
|
|
99
|
-
/**
|
|
100
|
-
* matches the name of the game session
|
|
101
|
-
*/
|
|
102
|
-
pattern?: string;
|
|
103
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ResolvedCommandLine } from './ResolvedCommandLine';
|
|
2
|
-
import type { ResolvedSystemCallLine } from './ResolvedSystemCallLine';
|
|
3
|
-
import type { TextLine } from './TextLine';
|
|
4
|
-
export type ScenarioEvent = ResolvedCommandLine | ResolvedSystemCallLine | TextLine | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type SpriteMode = 'normal' | 'nineslice';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { NineSliceMode } from './NineSliceMode';
|
|
2
|
-
import type { SpriteMode } from './SpriteMode';
|
|
3
|
-
export type SpriteProps = {
|
|
4
|
-
src: string | null;
|
|
5
|
-
mode?: SpriteMode;
|
|
6
|
-
area?: [number, number, number, number];
|
|
7
|
-
bounds?: [number, number, number, number];
|
|
8
|
-
nineSliceMode?: NineSliceMode;
|
|
9
|
-
targetWidth?: number;
|
|
10
|
-
targetHeight?: number;
|
|
11
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { WindowState } from './WindowState';
|
|
2
|
-
export type SystemCommand = {
|
|
3
|
-
subCommand: 'setWindowSize';
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
factor?: number;
|
|
7
|
-
} | {
|
|
8
|
-
subCommand: 'setWindowState';
|
|
9
|
-
state: WindowState;
|
|
10
|
-
} | {
|
|
11
|
-
subCommand: 'setTitle';
|
|
12
|
-
title: string;
|
|
13
|
-
} | {
|
|
14
|
-
subCommand: 'getWindowState';
|
|
15
|
-
} | {
|
|
16
|
-
subCommand: 'getWindowInnerPosition';
|
|
17
|
-
} | {
|
|
18
|
-
subCommand: 'getWindowInnerSize';
|
|
19
|
-
} | {
|
|
20
|
-
subCommand: 'getStageSize';
|
|
21
|
-
} | {
|
|
22
|
-
subCommand: 'takeSnapshot';
|
|
23
|
-
width?: number;
|
|
24
|
-
height?: number;
|
|
25
|
-
keepAspectRatio?: boolean;
|
|
26
|
-
} | {
|
|
27
|
-
subCommand: 'getParams';
|
|
28
|
-
} | {
|
|
29
|
-
subCommand: 'quit';
|
|
30
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type TextEvent = null | number;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { TextPrintMode } from './TextPrintMode';
|
|
2
|
-
/**
|
|
3
|
-
* To be compatible with react-spring inside JS runtime, we have to flatten the struct.
|
|
4
|
-
* FIXME: But `#[serde(flatten)]` works not quite well when there are more than one `#[serde(flatten)]` in a struct.
|
|
5
|
-
* So we do it manually.
|
|
6
|
-
*/
|
|
7
|
-
export type TextProps = {
|
|
8
|
-
text?: string;
|
|
9
|
-
printMode?: TextPrintMode;
|
|
10
|
-
printSpeed?: number;
|
|
11
|
-
/**
|
|
12
|
-
* the writing direction of the text in the box,
|
|
13
|
-
* only `Horizontal` (right-to-left) or `Vertical` (top-to-bottom) is valid.
|
|
14
|
-
*/
|
|
15
|
-
direction?: 'horizontal' | 'vertical';
|
|
16
|
-
/**
|
|
17
|
-
* the width of box.
|
|
18
|
-
*/
|
|
19
|
-
boxWidth?: number;
|
|
20
|
-
/**
|
|
21
|
-
* the height of box.
|
|
22
|
-
*/
|
|
23
|
-
boxHeight?: number;
|
|
24
|
-
/**
|
|
25
|
-
* the size of the glyph grid which each character be fit to, usually equals to `font_size`.
|
|
26
|
-
*/
|
|
27
|
-
glyphGridSize?: number;
|
|
28
|
-
fontSize?: number;
|
|
29
|
-
fillColor?: string;
|
|
30
|
-
lineHeight?: number;
|
|
31
|
-
indent?: number;
|
|
32
|
-
stroke?: boolean;
|
|
33
|
-
shadow?: boolean;
|
|
34
|
-
strokeColor?: string;
|
|
35
|
-
strokeWidth?: number;
|
|
36
|
-
shadowColor?: string;
|
|
37
|
-
shadowOffsetX?: number;
|
|
38
|
-
shadowOffsetY?: number;
|
|
39
|
-
shadowBlur?: number;
|
|
40
|
-
shadowWidth?: number;
|
|
41
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type TouchEventKind = 'TouchStart' | 'TouchMove' | 'TouchEnd' | 'TouchCancel';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type VideoCommand = {
|
|
2
|
-
subCommand: 'play';
|
|
3
|
-
} | {
|
|
4
|
-
subCommand: 'pause';
|
|
5
|
-
} | {
|
|
6
|
-
subCommand: 'resume';
|
|
7
|
-
} | {
|
|
8
|
-
subCommand: 'stop';
|
|
9
|
-
} | {
|
|
10
|
-
subCommand: 'seek';
|
|
11
|
-
time: number;
|
|
12
|
-
} | {
|
|
13
|
-
subCommand: 'setVolume';
|
|
14
|
-
volume: number;
|
|
15
|
-
} | {
|
|
16
|
-
subCommand: 'setMuted';
|
|
17
|
-
muted: boolean;
|
|
18
|
-
} | {
|
|
19
|
-
subCommand: 'setLoop';
|
|
20
|
-
enabled: boolean;
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type VideoEvent = null | string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type WheelEventDeltaMode = 'pixel' | 'line' | 'page';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type WindowState = 'idle' | 'maximized' | 'minimized' | 'fullscreen';
|
package/dist/commands.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AudioCommand } from './bindings/AudioCommand';
|
|
2
|
-
import { GamepadCommand } from './bindings/GamepadCommand';
|
|
3
|
-
import { ScenarioCommand } from './bindings/ScenarioCommand';
|
|
4
|
-
import { SystemCommand } from './bindings/SystemCommand';
|
|
5
|
-
import { TextCommand } from './bindings/TextCommand';
|
|
6
|
-
import { MakeNullOptional } from './utils';
|
|
7
|
-
type _Command = AudioCommand | TextCommand | GamepadCommand | ScenarioCommand | SystemCommand;
|
|
8
|
-
export type Command = MakeNullOptional<_Command>;
|
|
9
|
-
export type MaybePromise = any;
|
|
10
|
-
export * from './bindings/AudioCommand';
|
|
11
|
-
export * from './bindings/GamepadCommand';
|
|
12
|
-
export * from './bindings/ScenarioCommand';
|
|
13
|
-
export * from './bindings/SystemCommand';
|
|
14
|
-
export * from './bindings/TextCommand';
|
|
15
|
-
export * from './bindings/AudioSettings';
|
|
16
|
-
export * from './bindings/EffectParams';
|
|
17
|
-
export * from './bindings/WindowState';
|
package/dist/commands.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./bindings/AudioCommand"), exports);
|
|
18
|
-
__exportStar(require("./bindings/GamepadCommand"), exports);
|
|
19
|
-
__exportStar(require("./bindings/ScenarioCommand"), exports);
|
|
20
|
-
__exportStar(require("./bindings/SystemCommand"), exports);
|
|
21
|
-
__exportStar(require("./bindings/TextCommand"), exports);
|
|
22
|
-
__exportStar(require("./bindings/AudioSettings"), exports);
|
|
23
|
-
__exportStar(require("./bindings/EffectParams"), exports);
|
|
24
|
-
__exportStar(require("./bindings/WindowState"), exports);
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Context for page parameters
|
|
4
|
-
* Used to provide params to page components via React tree
|
|
5
|
-
*/
|
|
6
|
-
export declare const PageParamsContext: React.Context<Record<string, any> | undefined>;
|
|
7
|
-
/**
|
|
8
|
-
* Context for overlay parameters
|
|
9
|
-
* Used to provide params to overlay components via React tree
|
|
10
|
-
*/
|
|
11
|
-
export declare const OverlayParamsContext: React.Context<Record<string, any> | undefined>;
|
|
12
|
-
/**
|
|
13
|
-
* Placeholder for global navigation types.
|
|
14
|
-
* Projects can augment this interface to provide type safety for the global navigator.
|
|
15
|
-
* @example
|
|
16
|
-
* declare module './utils/navigation' {
|
|
17
|
-
* interface RootNavigatorList {
|
|
18
|
-
* pages: typeof myPages;
|
|
19
|
-
* overlays: typeof myOverlays;
|
|
20
|
-
* }
|
|
21
|
-
* }
|
|
22
|
-
*/
|
|
23
|
-
export interface RootNavigatorList {
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Type helper to register a navigator instance's types globally.
|
|
27
|
-
* Use this in a declare module block to get automatic type safety.
|
|
28
|
-
*/
|
|
29
|
-
export type RegisterNavigator<T extends Navigator<any, any>> = {
|
|
30
|
-
pages: T extends Navigator<infer P, any> ? Record<P, any> : never;
|
|
31
|
-
overlays: T extends Navigator<any, infer O> ? Record<O, any> : never;
|
|
32
|
-
};
|
|
33
|
-
type GetPages<T> = T extends {
|
|
34
|
-
pages: infer P;
|
|
35
|
-
} ? (P extends Record<string, any> ? keyof P & string : string) : string;
|
|
36
|
-
type GetOverlays<T> = T extends {
|
|
37
|
-
overlays: infer O;
|
|
38
|
-
} ? O extends Record<string, any> ? keyof O & string : string : string;
|
|
39
|
-
export type DefaultPageName = GetPages<RootNavigatorList>;
|
|
40
|
-
export type DefaultOverlayName = GetOverlays<RootNavigatorList>;
|
|
41
|
-
export interface PageDescriptor {
|
|
42
|
-
component: React.ComponentType<any>;
|
|
43
|
-
options?: Record<string, any>;
|
|
44
|
-
requiredParams?: string[];
|
|
45
|
-
}
|
|
46
|
-
export interface OverlayDescriptor {
|
|
47
|
-
component: React.ComponentType<any>;
|
|
48
|
-
options?: Record<string, any>;
|
|
49
|
-
requiredParams?: string[];
|
|
50
|
-
}
|
|
51
|
-
export type PageConfig = PageDescriptor['component'] | PageDescriptor;
|
|
52
|
-
export type OverlayConfig = OverlayDescriptor['component'] | OverlayDescriptor;
|
|
53
|
-
export interface StackNavigatorOptions<Pages extends Record<string, PageConfig>, Overlays extends Record<string, OverlayConfig>> {
|
|
54
|
-
initialPage: keyof Pages & string;
|
|
55
|
-
pages: Pages;
|
|
56
|
-
overlays?: Overlays;
|
|
57
|
-
}
|
|
58
|
-
export interface Navigator<PageName extends string = DefaultPageName, OverlayName extends string = DefaultOverlayName> {
|
|
59
|
-
/**
|
|
60
|
-
* Navigate to a page
|
|
61
|
-
* @param page Page name
|
|
62
|
-
* @param params Parameters to pass to the page (optional)
|
|
63
|
-
*/
|
|
64
|
-
navigate: (page: PageName, params?: Record<string, any>) => void;
|
|
65
|
-
/**
|
|
66
|
-
* Go back to the previous page (not implemented yet)
|
|
67
|
-
*/
|
|
68
|
-
goBack: () => void;
|
|
69
|
-
/**
|
|
70
|
-
* Push an overlay to the overlay stack
|
|
71
|
-
* @param overlay Overlay name
|
|
72
|
-
* @param params Parameters to pass to the overlay (optional)
|
|
73
|
-
*/
|
|
74
|
-
pushOverlay: (overlay: OverlayName, params?: Record<string, any>) => void;
|
|
75
|
-
/**
|
|
76
|
-
* Pop the top overlay from the stack
|
|
77
|
-
*/
|
|
78
|
-
popOverlay: () => void;
|
|
79
|
-
/**
|
|
80
|
-
* Clear all overlays
|
|
81
|
-
*/
|
|
82
|
-
clearOverlays: () => void;
|
|
83
|
-
/**
|
|
84
|
-
* Get current page name
|
|
85
|
-
*/
|
|
86
|
-
getCurrentPage: () => PageName;
|
|
87
|
-
/**
|
|
88
|
-
* Get current page parameters
|
|
89
|
-
*/
|
|
90
|
-
getParams: () => Record<string, any> | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* Get overlay stack
|
|
93
|
-
*/
|
|
94
|
-
getOverlayStack: () => OverlayInfo[];
|
|
95
|
-
/**
|
|
96
|
-
* Check if an overlay is active
|
|
97
|
-
* @param type Overlay type/name
|
|
98
|
-
*/
|
|
99
|
-
isOverlayActive: (type: OverlayName) => boolean;
|
|
100
|
-
/** @internal */
|
|
101
|
-
_descriptors: {
|
|
102
|
-
pages: Record<string, PageDescriptor>;
|
|
103
|
-
overlays: Record<string, OverlayDescriptor>;
|
|
104
|
-
};
|
|
105
|
-
/** @internal */
|
|
106
|
-
_state: NavigationState;
|
|
107
|
-
}
|
|
108
|
-
export interface OverlayInfo {
|
|
109
|
-
type: string;
|
|
110
|
-
id: string;
|
|
111
|
-
}
|
|
112
|
-
interface NavigationState {
|
|
113
|
-
currentPage: string;
|
|
114
|
-
pageParams: Record<string, Record<string, any>>;
|
|
115
|
-
overlayStack: OverlayInfo[];
|
|
116
|
-
overlayParams: Record<string, Record<string, any>>;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Create a stack navigator
|
|
120
|
-
* @param options Navigator configuration
|
|
121
|
-
* @returns Navigator instance
|
|
122
|
-
*/
|
|
123
|
-
export declare function createStackNavigator<Pages extends Record<string, PageConfig>, Overlays extends Record<string, OverlayConfig>>(options: StackNavigatorOptions<Pages, Overlays>): Navigator<keyof Pages & string, keyof Overlays & string>;
|
|
124
|
-
/**
|
|
125
|
-
* Create a navigation component for a navigator
|
|
126
|
-
* @param navigator The navigator instance
|
|
127
|
-
* @returns A React component that renders the navigation state
|
|
128
|
-
*/
|
|
129
|
-
export declare function createStaticNavigation(navigator: Navigator<any, any>): React.FC;
|
|
130
|
-
/**
|
|
131
|
-
* Get the navigator instance (stable reference)
|
|
132
|
-
* Can be used in both components and state logic
|
|
133
|
-
* @returns Navigator object
|
|
134
|
-
*/
|
|
135
|
-
export declare function getNavigator<PageName extends string = DefaultPageName, OverlayName extends string = DefaultOverlayName>(): Navigator<PageName, OverlayName>;
|
|
136
|
-
/**
|
|
137
|
-
* Hook to get the navigator instance in components
|
|
138
|
-
*/
|
|
139
|
-
export declare const useNavigation: typeof getNavigator;
|
|
140
|
-
/**
|
|
141
|
-
* Get navigation parameters for current component
|
|
142
|
-
* @returns Parameters object (cast as T)
|
|
143
|
-
*
|
|
144
|
-
* This hook reads params from React Context, which is provided by the router.
|
|
145
|
-
* - If called from within an overlay context, returns overlay params
|
|
146
|
-
* - If called from within a page context, returns page params
|
|
147
|
-
* - Supports multiple nested overlays (each gets its own params)
|
|
148
|
-
*
|
|
149
|
-
* Note: We cast the result to T and provide an empty object as fallback.
|
|
150
|
-
* Since required parameters are validated at navigation entry points, we can
|
|
151
|
-
* safely assume the runtime object matches T.
|
|
152
|
-
*/
|
|
153
|
-
export declare function useNavigationParams<T = Record<string, any>>(): T;
|
|
154
|
-
export {};
|