@momoyu-ink/kit 0.9.1 → 0.10.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/AGENTS.md +3 -1
- package/dist/{jsx-dev-runtime-I0t9y4BC.d.mts → jsx-dev-runtime-x1NET2hA.d.mts} +294 -111
- package/dist/{jsx-dev-runtime-I0t9y4BC.d.ts → jsx-dev-runtime-x1NET2hA.d.ts} +294 -111
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/lib.cjs +607 -17
- package/dist/lib.d.mts +152 -49
- package/dist/lib.d.ts +152 -49
- package/dist/lib.mjs +611 -14
- package/package.json +1 -1
package/dist/lib.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactElement, Component, ForwardRefExoticComponent, CSSProperties, FC, ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { S as ShaderDirection, M as
|
|
4
|
-
export { A as AudioCommand,
|
|
3
|
+
import { S as ShaderDirection, M as MoyuEvent, C as Command, a as MaybePromise, J as JSX, L as LayoutEvent, W as WheelEvent, T as TouchEvent, b as MoyuClipAttributes, c as MoyuVBoxAttributes, d as MoyuSpriteAttributes, e as TextProps, f as MoyuNodeAttributes, g as MouseEvent, h as SpriteProps, i as JsonValue } from './jsx-dev-runtime-x1NET2hA.mjs';
|
|
4
|
+
export { A as AudioCommand, j as AudioSettings, B as BubbleEvent, D as DetailedMoyuProps, E as EffectParams, G as GamepadCommand, K as KeyboardEvent, k as KeyboardEventKind, l as MakeNullOptional, m as MouseEventKind, n as MoyuAnimationAttributes, o as MoyuBackdropAttributes, p as MoyuContainerAttributes, q as MoyuEventHandler, r as MoyuFilterAttributes, s as MoyuHBoxAttributes, t as MoyuListenerAttributes, u as MoyuShaderAttributes, v as MoyuShaderSlotAttributes, w as MoyuTextAttributes, x as MoyuVideoAttributes, N as Node, O as OverlayDialog, y as OverlayNotificationPosition, z as OverlayStoreFlag, R as RetainMode, F as ScenarioCommand, H as ShaderCommand, I as ShaderParam, P as ShaderParamType, Q as ShaderSource, U as ShaderTimeControl, V as SteamCommand, X as SystemCommand, Y as TextCommand, Z as TimelinePossibleClip, _ as TouchEventKind, $ as Tuple2, a0 as Tuple3, a1 as Tuple4, a2 as WheelEventDeltaMode, a3 as WindowState, a4 as createBubbleEvent, a5 as getStageSize, a6 as mergeEvent } from './jsx-dev-runtime-x1NET2hA.mjs';
|
|
5
5
|
import { FluidValue } from '@react-spring/shared';
|
|
6
6
|
import { ElementType, AssignableKeys, ComponentPropsWithRef } from '@react-spring/types';
|
|
7
7
|
import { Snapshot } from 'valtio';
|
|
8
|
-
import {
|
|
9
|
-
import { SpringValues, SpringRef } from '@react-spring/core';
|
|
8
|
+
import { SpringValue, SpringValues, SpringRef } from '@react-spring/core';
|
|
10
9
|
export * from '@react-spring/core';
|
|
10
|
+
import { ZodType } from 'zod';
|
|
11
11
|
import 'react/jsx-runtime';
|
|
12
12
|
import 'react/jsx-dev-runtime';
|
|
13
13
|
|
|
@@ -32,54 +32,11 @@ interface RootOptions {
|
|
|
32
32
|
}
|
|
33
33
|
declare function createRoot(options?: RootOptions): RootHandle;
|
|
34
34
|
|
|
35
|
-
type ShaderBuiltin = {
|
|
36
|
-
name: 'crossfade';
|
|
37
|
-
} | {
|
|
38
|
-
name: 'wipe';
|
|
39
|
-
softness: number;
|
|
40
|
-
direction: ShaderDirection;
|
|
41
|
-
} | {
|
|
42
|
-
name: 'fade';
|
|
43
|
-
out: number;
|
|
44
|
-
hold: number;
|
|
45
|
-
in: number;
|
|
46
|
-
color: string;
|
|
47
|
-
} | {
|
|
48
|
-
name: 'push';
|
|
49
|
-
direction: ShaderDirection;
|
|
50
|
-
} | {
|
|
51
|
-
name: 'slideaway';
|
|
52
|
-
direction: ShaderDirection;
|
|
53
|
-
} | {
|
|
54
|
-
name: 'zoom';
|
|
55
|
-
startScale: number;
|
|
56
|
-
endScale: number;
|
|
57
|
-
origin: [number, number];
|
|
58
|
-
} | {
|
|
59
|
-
name: 'pixellate';
|
|
60
|
-
steps: number;
|
|
61
|
-
} | {
|
|
62
|
-
name: 'mask';
|
|
63
|
-
rule: string;
|
|
64
|
-
softness: number;
|
|
65
|
-
reverse: boolean;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
type ShaderBuiltinName = 'crossfade' | 'wipe' | 'fade' | 'push' | 'slideaway' | 'zoom' | 'pixellate' | 'mask';
|
|
69
|
-
|
|
70
35
|
declare const globalEventListeners: Record<string, ((event: unknown) => void)[]>;
|
|
71
36
|
declare const globalRequestAnimationFrameListeners: FrameRequestCallback[];
|
|
72
37
|
|
|
73
38
|
declare function addEventListener(name: string, callback: (...args: any[]) => void): () => void;
|
|
74
39
|
|
|
75
|
-
interface WheelEvent extends Omit<MouseEvent, 'kind'> {
|
|
76
|
-
kind: 'wheel';
|
|
77
|
-
deltaX: number;
|
|
78
|
-
deltaY: number;
|
|
79
|
-
deltaZ: number;
|
|
80
|
-
deltaMode: WheelEventDeltaMode;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
40
|
type AnimationFrameCallbackEvent = {
|
|
84
41
|
timestamp: number;
|
|
85
42
|
};
|
|
@@ -262,7 +219,44 @@ type MarkerEnter = {
|
|
|
262
219
|
|
|
263
220
|
type ScenarioEvent = MarkerEnter | ResolvedCommandLine | ResolvedSystemCallLine | TextLine | null | null | null | null;
|
|
264
221
|
|
|
265
|
-
type
|
|
222
|
+
type ShaderBuiltin = {
|
|
223
|
+
name: 'crossfade';
|
|
224
|
+
} | {
|
|
225
|
+
name: 'wipe';
|
|
226
|
+
softness: number;
|
|
227
|
+
direction: ShaderDirection;
|
|
228
|
+
} | {
|
|
229
|
+
name: 'fade';
|
|
230
|
+
out: number;
|
|
231
|
+
hold: number;
|
|
232
|
+
in: number;
|
|
233
|
+
color: string;
|
|
234
|
+
} | {
|
|
235
|
+
name: 'push';
|
|
236
|
+
direction: ShaderDirection;
|
|
237
|
+
} | {
|
|
238
|
+
name: 'slideaway';
|
|
239
|
+
direction: ShaderDirection;
|
|
240
|
+
} | {
|
|
241
|
+
name: 'zoom';
|
|
242
|
+
startScale: number;
|
|
243
|
+
endScale: number;
|
|
244
|
+
origin: [number, number];
|
|
245
|
+
} | {
|
|
246
|
+
name: 'pixellate';
|
|
247
|
+
steps: number;
|
|
248
|
+
} | {
|
|
249
|
+
name: 'mask';
|
|
250
|
+
softness: number;
|
|
251
|
+
reverse: boolean;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
type ShaderBuiltinName = 'crossfade' | 'wipe' | 'fade' | 'push' | 'slideaway' | 'zoom' | 'pixellate' | 'mask';
|
|
255
|
+
|
|
256
|
+
type DlcProgress = {
|
|
257
|
+
downloadedBytes: string;
|
|
258
|
+
totalBytes: string;
|
|
259
|
+
};
|
|
266
260
|
|
|
267
261
|
declare global {
|
|
268
262
|
interface Window {
|
|
@@ -575,6 +569,115 @@ declare function useNavigationState(): Snapshot<NavigationState>;
|
|
|
575
569
|
*/
|
|
576
570
|
declare function useNavigationParams<T = Record<string, any>>(): T;
|
|
577
571
|
|
|
572
|
+
interface UseScrollViewOptions {
|
|
573
|
+
viewportHeight: number;
|
|
574
|
+
initialPosition?: 'start' | 'end';
|
|
575
|
+
wheelStep?: number;
|
|
576
|
+
}
|
|
577
|
+
interface ScrollViewController {
|
|
578
|
+
scrollOffset: SpringValue<number>;
|
|
579
|
+
contentHeight: number;
|
|
580
|
+
maxScroll: number;
|
|
581
|
+
handleContentLayout: (event: LayoutEvent) => void;
|
|
582
|
+
handleWheel: (event: WheelEvent) => void;
|
|
583
|
+
handleTouchStart: (event: TouchEvent) => void;
|
|
584
|
+
handleTouchMove: (event: TouchEvent) => void;
|
|
585
|
+
handleTouchEnd: (event: TouchEvent) => void;
|
|
586
|
+
scrollTo: (offset: number, immediate?: boolean) => void;
|
|
587
|
+
scrollToRatio: (ratio: number, immediate?: boolean) => void;
|
|
588
|
+
}
|
|
589
|
+
declare function useScrollView({ viewportHeight, initialPosition, wheelStep, }: UseScrollViewOptions): ScrollViewController;
|
|
590
|
+
|
|
591
|
+
interface ScrollViewProps {
|
|
592
|
+
width: number;
|
|
593
|
+
height: number;
|
|
594
|
+
controller: ScrollViewController;
|
|
595
|
+
children?: ReactNode;
|
|
596
|
+
clipProps?: Omit<MoyuClipAttributes, 'children' | 'height' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart' | 'onWheel' | 'width'>;
|
|
597
|
+
contentProps?: Omit<MoyuVBoxAttributes, 'children' | 'onLayout' | 'y'>;
|
|
598
|
+
}
|
|
599
|
+
declare function ScrollView({ width, height, controller, children, clipProps, contentProps }: ScrollViewProps): JSX.Element;
|
|
600
|
+
|
|
601
|
+
type ControlState = 'idle' | 'hover' | 'press' | 'disabled';
|
|
602
|
+
type ControlStateValue<T> = T | readonly [idle: T, hover?: T, press?: T, disabled?: T];
|
|
603
|
+
type ControlTextStyle = Omit<TextProps, 'text'>;
|
|
604
|
+
interface ControlSpriteProps extends Omit<MoyuSpriteAttributes, 'children' | 'src'> {
|
|
605
|
+
src: ControlStateValue<string>;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
type PressEvent = MouseEvent | TouchEvent;
|
|
609
|
+
interface ButtonProps extends Omit<MoyuNodeAttributes, 'onClick'> {
|
|
610
|
+
sprite: ControlSpriteProps;
|
|
611
|
+
disabled?: boolean;
|
|
612
|
+
lockOn?: Exclude<ControlState, 'disabled'>;
|
|
613
|
+
onPress?: (event: PressEvent) => void;
|
|
614
|
+
text?: string;
|
|
615
|
+
textStyle?: ControlStateValue<ControlTextStyle>;
|
|
616
|
+
textOffsetX?: number;
|
|
617
|
+
textOffsetY?: number;
|
|
618
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
619
|
+
}
|
|
620
|
+
declare function Button({ sprite, disabled, lockOn, onPress, text, textStyle, textOffsetX, textOffsetY, textAlign, children, anchor, pivot, interactive, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onTouchStart, onTouchEnd, onTouchCancel, ...containerProps }: ButtonProps): JSX.Element;
|
|
621
|
+
|
|
622
|
+
interface CheckboxProps extends Omit<ButtonProps, 'lockOn' | 'sprite'> {
|
|
623
|
+
checked?: boolean;
|
|
624
|
+
defaultChecked?: boolean;
|
|
625
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
626
|
+
uncheckedSprite: ControlSpriteProps;
|
|
627
|
+
checkedSprite: ControlSpriteProps;
|
|
628
|
+
}
|
|
629
|
+
declare function Checkbox({ checked, defaultChecked, onCheckedChange, uncheckedSprite, checkedSprite, onPress, ...buttonProps }: CheckboxProps): JSX.Element;
|
|
630
|
+
|
|
631
|
+
interface SelectOption {
|
|
632
|
+
text: string;
|
|
633
|
+
value: string;
|
|
634
|
+
}
|
|
635
|
+
interface SelectListProps extends Omit<SpriteProps, 'src' | 'targetHeight'> {
|
|
636
|
+
src: string;
|
|
637
|
+
paddingX?: number;
|
|
638
|
+
paddingY?: number;
|
|
639
|
+
gap?: number;
|
|
640
|
+
offsetX?: number;
|
|
641
|
+
offsetY?: number;
|
|
642
|
+
}
|
|
643
|
+
interface SelectOptionSpriteProps extends Omit<ControlSpriteProps, 'targetHeight'> {
|
|
644
|
+
targetHeight: number;
|
|
645
|
+
}
|
|
646
|
+
interface SelectProps extends Omit<MoyuNodeAttributes, 'onClick'> {
|
|
647
|
+
value?: string;
|
|
648
|
+
defaultValue?: string;
|
|
649
|
+
onValueChange?: (value: string, option: SelectOption) => void;
|
|
650
|
+
onPress?: (event: PressEvent) => void;
|
|
651
|
+
disabled?: boolean;
|
|
652
|
+
options: readonly SelectOption[];
|
|
653
|
+
trigger: ControlSpriteProps;
|
|
654
|
+
list: SelectListProps;
|
|
655
|
+
option: SelectOptionSpriteProps;
|
|
656
|
+
textStyle?: ControlStateValue<ControlTextStyle>;
|
|
657
|
+
textOffsetX?: number;
|
|
658
|
+
textOffsetY?: number;
|
|
659
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
660
|
+
}
|
|
661
|
+
declare function Select({ value, defaultValue, onValueChange, onPress, disabled, options, trigger, list, option, textStyle, textOffsetX, textOffsetY, textAlign, anchor, pivot, ...containerProps }: SelectProps): JSX.Element;
|
|
662
|
+
|
|
663
|
+
interface SliderTrackProps extends Omit<ControlSpriteProps, 'targetWidth'> {
|
|
664
|
+
targetWidth: number;
|
|
665
|
+
}
|
|
666
|
+
interface SliderThumbProps extends Omit<ControlSpriteProps, 'targetWidth'> {
|
|
667
|
+
targetWidth: number;
|
|
668
|
+
}
|
|
669
|
+
interface SliderProps extends Omit<MoyuNodeAttributes, 'onClick'> {
|
|
670
|
+
value?: number;
|
|
671
|
+
defaultValue?: number;
|
|
672
|
+
onValueChange?: (value: number) => void;
|
|
673
|
+
onValueCommit?: (value: number) => void;
|
|
674
|
+
onPress?: (event: PressEvent) => void;
|
|
675
|
+
disabled?: boolean;
|
|
676
|
+
track: SliderTrackProps;
|
|
677
|
+
thumb: SliderThumbProps;
|
|
678
|
+
}
|
|
679
|
+
declare function Slider({ value, defaultValue, onValueChange, onValueCommit, onPress, disabled, track, thumb, anchor, pivot, interactive, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onMouseMove, onTouchStart, onTouchMove, onTouchEnd, onTouchCancel, ...containerProps }: SliderProps): JSX.Element;
|
|
680
|
+
|
|
578
681
|
type ExecutionCursor = {
|
|
579
682
|
story: string;
|
|
580
683
|
paragraph: string;
|
|
@@ -913,4 +1016,4 @@ declare module 'zod' {
|
|
|
913
1016
|
}
|
|
914
1017
|
}
|
|
915
1018
|
|
|
916
|
-
export { type AnimatedComponent, type AnimatedProps, type AnimationFrameCallbackEvent, type AppStateAdapter, type AutoTicketHandle, type AutoTicketOptions, type BeforeUnloadEvent, type CombinedCheckpoint, Command, type CommandHandler, type CustomEvent, DEBUG_EMPTY_PAGE, type DebugSessionConfig, type DebugSessionController, type DebugWarpBoundary, type DebugWarpOptions, type DefaultOverlayName, type DefaultPageName, type FastForwardOptions, type FocusEvent, type FocusEventKind, type FullScreenEvent, type FullscreenEventKind, type GameControl, type GameEvent, type GameStateSourceProps, type GameStateStore, type Gamepad, type GamepadButton, type GamepadEvent, type GamepadHapticActuator, JSX, type KeyboardLocation, type Literal, MaybePromise, MouseEvent, MoyuEvent, type NavigationState, type Navigator, type NodeEvent, type OverlayConfig, type OverlayDescriptor, type OverlayInfo, OverlayParamsContext, type PageConfig, type PageDescriptor, PageParamsContext, type RegisterNavigator, type ResizeEvent, type ResolvedArgument, type ResolvedCommandLine, type ResolvedSystemCallLine, type RootErrorInfo, type RootHandle, type RootNavigatorList, type RootOptions, type RootUiDataMap, type RootUncaughtErrorInfo, type ScenarioCommandBaseType, type ScenarioEvent, type ShaderBuiltin, type ShaderBuiltinName, type ShaderEvent, type StackNavigatorOptions, StageContextProvider, type StageInstance, type TextLine, type TextLineHandler,
|
|
1019
|
+
export { type AnimatedComponent, type AnimatedProps, type AnimationFrameCallbackEvent, type AppStateAdapter, type AutoTicketHandle, type AutoTicketOptions, type BeforeUnloadEvent, Button, type ButtonProps, Checkbox, type CheckboxProps, type CombinedCheckpoint, Command, type CommandHandler, type ControlSpriteProps, type ControlState, type ControlStateValue, type ControlTextStyle, type CustomEvent, DEBUG_EMPTY_PAGE, type DebugSessionConfig, type DebugSessionController, type DebugWarpBoundary, type DebugWarpOptions, type DefaultOverlayName, type DefaultPageName, type DlcProgress, type FastForwardOptions, type FocusEvent, type FocusEventKind, type FullScreenEvent, type FullscreenEventKind, type GameControl, type GameEvent, type GameStateSourceProps, type GameStateStore, type Gamepad, type GamepadButton, type GamepadEvent, type GamepadHapticActuator, JSX, type KeyboardLocation, LayoutEvent, type Literal, MaybePromise, MouseEvent, MoyuClipAttributes, MoyuEvent, MoyuNodeAttributes, MoyuSpriteAttributes, MoyuVBoxAttributes, type NavigationState, type Navigator, type NodeEvent, type OverlayConfig, type OverlayDescriptor, type OverlayInfo, OverlayParamsContext, type PageConfig, type PageDescriptor, PageParamsContext, type PressEvent, type RegisterNavigator, type ResizeEvent, type ResolvedArgument, type ResolvedCommandLine, type ResolvedSystemCallLine, type RootErrorInfo, type RootHandle, type RootNavigatorList, type RootOptions, type RootUiDataMap, type RootUncaughtErrorInfo, type ScenarioCommandBaseType, type ScenarioEvent, ScrollView, type ScrollViewController, type ScrollViewProps, Select, type SelectListProps, type SelectOption, type SelectOptionSpriteProps, type SelectProps, type ShaderBuiltin, type ShaderBuiltinName, type ShaderEvent, Slider, type SliderProps, type SliderThumbProps, type SliderTrackProps, type StackNavigatorOptions, StageContextProvider, type StageInstance, type TextLine, type TextLineHandler, TouchEvent, type UseScrollViewOptions, WheelEvent, type WithAnimated, animated as a, addEventListener, animated, autoState, createGameStateContext, createRoot, createStackNavigator, createStage, createStaticNavigation, ensureArchiveVariableDefaults, executeNodeCommand, executePluginCommand, fastForwardState, getAppStateAdapter, getNavigator, getSeekingType, getUiData, globalEventListeners, globalRequestAnimationFrameListeners, initGlobalVariableDefaults, initUiData, loadVariablesDocument, moyu, nextLine, registerAppStateAdapter, replaceUiData, setDefaultAutoTailMs, setWaiting, skipState, startDebugSession, startRuntimeDebugSession, stopDebugSession, stopRuntimeDebugSession, useAutoBlocker, useAutoTicket, useBeforeHandleCommandCallback, useDebugSession, useFadeIn, useFadeInOut, useFadeOut, useInterruptCallback, useIsAutoing, useIsSeeking, useIsSkipping, useNavigation, useNavigationParams, useNavigationState, useScenario, useScrollView, useSkipBlocker, useSkipCallback, useSoundEffect, useStageContext, useUiData, warpState };
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactElement, Component, ForwardRefExoticComponent, CSSProperties, FC, ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { S as ShaderDirection, M as
|
|
4
|
-
export { A as AudioCommand,
|
|
3
|
+
import { S as ShaderDirection, M as MoyuEvent, C as Command, a as MaybePromise, J as JSX, L as LayoutEvent, W as WheelEvent, T as TouchEvent, b as MoyuClipAttributes, c as MoyuVBoxAttributes, d as MoyuSpriteAttributes, e as TextProps, f as MoyuNodeAttributes, g as MouseEvent, h as SpriteProps, i as JsonValue } from './jsx-dev-runtime-x1NET2hA.js';
|
|
4
|
+
export { A as AudioCommand, j as AudioSettings, B as BubbleEvent, D as DetailedMoyuProps, E as EffectParams, G as GamepadCommand, K as KeyboardEvent, k as KeyboardEventKind, l as MakeNullOptional, m as MouseEventKind, n as MoyuAnimationAttributes, o as MoyuBackdropAttributes, p as MoyuContainerAttributes, q as MoyuEventHandler, r as MoyuFilterAttributes, s as MoyuHBoxAttributes, t as MoyuListenerAttributes, u as MoyuShaderAttributes, v as MoyuShaderSlotAttributes, w as MoyuTextAttributes, x as MoyuVideoAttributes, N as Node, O as OverlayDialog, y as OverlayNotificationPosition, z as OverlayStoreFlag, R as RetainMode, F as ScenarioCommand, H as ShaderCommand, I as ShaderParam, P as ShaderParamType, Q as ShaderSource, U as ShaderTimeControl, V as SteamCommand, X as SystemCommand, Y as TextCommand, Z as TimelinePossibleClip, _ as TouchEventKind, $ as Tuple2, a0 as Tuple3, a1 as Tuple4, a2 as WheelEventDeltaMode, a3 as WindowState, a4 as createBubbleEvent, a5 as getStageSize, a6 as mergeEvent } from './jsx-dev-runtime-x1NET2hA.js';
|
|
5
5
|
import { FluidValue } from '@react-spring/shared';
|
|
6
6
|
import { ElementType, AssignableKeys, ComponentPropsWithRef } from '@react-spring/types';
|
|
7
7
|
import { Snapshot } from 'valtio';
|
|
8
|
-
import {
|
|
9
|
-
import { SpringValues, SpringRef } from '@react-spring/core';
|
|
8
|
+
import { SpringValue, SpringValues, SpringRef } from '@react-spring/core';
|
|
10
9
|
export * from '@react-spring/core';
|
|
10
|
+
import { ZodType } from 'zod';
|
|
11
11
|
import 'react/jsx-runtime';
|
|
12
12
|
import 'react/jsx-dev-runtime';
|
|
13
13
|
|
|
@@ -32,54 +32,11 @@ interface RootOptions {
|
|
|
32
32
|
}
|
|
33
33
|
declare function createRoot(options?: RootOptions): RootHandle;
|
|
34
34
|
|
|
35
|
-
type ShaderBuiltin = {
|
|
36
|
-
name: 'crossfade';
|
|
37
|
-
} | {
|
|
38
|
-
name: 'wipe';
|
|
39
|
-
softness: number;
|
|
40
|
-
direction: ShaderDirection;
|
|
41
|
-
} | {
|
|
42
|
-
name: 'fade';
|
|
43
|
-
out: number;
|
|
44
|
-
hold: number;
|
|
45
|
-
in: number;
|
|
46
|
-
color: string;
|
|
47
|
-
} | {
|
|
48
|
-
name: 'push';
|
|
49
|
-
direction: ShaderDirection;
|
|
50
|
-
} | {
|
|
51
|
-
name: 'slideaway';
|
|
52
|
-
direction: ShaderDirection;
|
|
53
|
-
} | {
|
|
54
|
-
name: 'zoom';
|
|
55
|
-
startScale: number;
|
|
56
|
-
endScale: number;
|
|
57
|
-
origin: [number, number];
|
|
58
|
-
} | {
|
|
59
|
-
name: 'pixellate';
|
|
60
|
-
steps: number;
|
|
61
|
-
} | {
|
|
62
|
-
name: 'mask';
|
|
63
|
-
rule: string;
|
|
64
|
-
softness: number;
|
|
65
|
-
reverse: boolean;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
type ShaderBuiltinName = 'crossfade' | 'wipe' | 'fade' | 'push' | 'slideaway' | 'zoom' | 'pixellate' | 'mask';
|
|
69
|
-
|
|
70
35
|
declare const globalEventListeners: Record<string, ((event: unknown) => void)[]>;
|
|
71
36
|
declare const globalRequestAnimationFrameListeners: FrameRequestCallback[];
|
|
72
37
|
|
|
73
38
|
declare function addEventListener(name: string, callback: (...args: any[]) => void): () => void;
|
|
74
39
|
|
|
75
|
-
interface WheelEvent extends Omit<MouseEvent, 'kind'> {
|
|
76
|
-
kind: 'wheel';
|
|
77
|
-
deltaX: number;
|
|
78
|
-
deltaY: number;
|
|
79
|
-
deltaZ: number;
|
|
80
|
-
deltaMode: WheelEventDeltaMode;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
40
|
type AnimationFrameCallbackEvent = {
|
|
84
41
|
timestamp: number;
|
|
85
42
|
};
|
|
@@ -262,7 +219,44 @@ type MarkerEnter = {
|
|
|
262
219
|
|
|
263
220
|
type ScenarioEvent = MarkerEnter | ResolvedCommandLine | ResolvedSystemCallLine | TextLine | null | null | null | null;
|
|
264
221
|
|
|
265
|
-
type
|
|
222
|
+
type ShaderBuiltin = {
|
|
223
|
+
name: 'crossfade';
|
|
224
|
+
} | {
|
|
225
|
+
name: 'wipe';
|
|
226
|
+
softness: number;
|
|
227
|
+
direction: ShaderDirection;
|
|
228
|
+
} | {
|
|
229
|
+
name: 'fade';
|
|
230
|
+
out: number;
|
|
231
|
+
hold: number;
|
|
232
|
+
in: number;
|
|
233
|
+
color: string;
|
|
234
|
+
} | {
|
|
235
|
+
name: 'push';
|
|
236
|
+
direction: ShaderDirection;
|
|
237
|
+
} | {
|
|
238
|
+
name: 'slideaway';
|
|
239
|
+
direction: ShaderDirection;
|
|
240
|
+
} | {
|
|
241
|
+
name: 'zoom';
|
|
242
|
+
startScale: number;
|
|
243
|
+
endScale: number;
|
|
244
|
+
origin: [number, number];
|
|
245
|
+
} | {
|
|
246
|
+
name: 'pixellate';
|
|
247
|
+
steps: number;
|
|
248
|
+
} | {
|
|
249
|
+
name: 'mask';
|
|
250
|
+
softness: number;
|
|
251
|
+
reverse: boolean;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
type ShaderBuiltinName = 'crossfade' | 'wipe' | 'fade' | 'push' | 'slideaway' | 'zoom' | 'pixellate' | 'mask';
|
|
255
|
+
|
|
256
|
+
type DlcProgress = {
|
|
257
|
+
downloadedBytes: string;
|
|
258
|
+
totalBytes: string;
|
|
259
|
+
};
|
|
266
260
|
|
|
267
261
|
declare global {
|
|
268
262
|
interface Window {
|
|
@@ -575,6 +569,115 @@ declare function useNavigationState(): Snapshot<NavigationState>;
|
|
|
575
569
|
*/
|
|
576
570
|
declare function useNavigationParams<T = Record<string, any>>(): T;
|
|
577
571
|
|
|
572
|
+
interface UseScrollViewOptions {
|
|
573
|
+
viewportHeight: number;
|
|
574
|
+
initialPosition?: 'start' | 'end';
|
|
575
|
+
wheelStep?: number;
|
|
576
|
+
}
|
|
577
|
+
interface ScrollViewController {
|
|
578
|
+
scrollOffset: SpringValue<number>;
|
|
579
|
+
contentHeight: number;
|
|
580
|
+
maxScroll: number;
|
|
581
|
+
handleContentLayout: (event: LayoutEvent) => void;
|
|
582
|
+
handleWheel: (event: WheelEvent) => void;
|
|
583
|
+
handleTouchStart: (event: TouchEvent) => void;
|
|
584
|
+
handleTouchMove: (event: TouchEvent) => void;
|
|
585
|
+
handleTouchEnd: (event: TouchEvent) => void;
|
|
586
|
+
scrollTo: (offset: number, immediate?: boolean) => void;
|
|
587
|
+
scrollToRatio: (ratio: number, immediate?: boolean) => void;
|
|
588
|
+
}
|
|
589
|
+
declare function useScrollView({ viewportHeight, initialPosition, wheelStep, }: UseScrollViewOptions): ScrollViewController;
|
|
590
|
+
|
|
591
|
+
interface ScrollViewProps {
|
|
592
|
+
width: number;
|
|
593
|
+
height: number;
|
|
594
|
+
controller: ScrollViewController;
|
|
595
|
+
children?: ReactNode;
|
|
596
|
+
clipProps?: Omit<MoyuClipAttributes, 'children' | 'height' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart' | 'onWheel' | 'width'>;
|
|
597
|
+
contentProps?: Omit<MoyuVBoxAttributes, 'children' | 'onLayout' | 'y'>;
|
|
598
|
+
}
|
|
599
|
+
declare function ScrollView({ width, height, controller, children, clipProps, contentProps }: ScrollViewProps): JSX.Element;
|
|
600
|
+
|
|
601
|
+
type ControlState = 'idle' | 'hover' | 'press' | 'disabled';
|
|
602
|
+
type ControlStateValue<T> = T | readonly [idle: T, hover?: T, press?: T, disabled?: T];
|
|
603
|
+
type ControlTextStyle = Omit<TextProps, 'text'>;
|
|
604
|
+
interface ControlSpriteProps extends Omit<MoyuSpriteAttributes, 'children' | 'src'> {
|
|
605
|
+
src: ControlStateValue<string>;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
type PressEvent = MouseEvent | TouchEvent;
|
|
609
|
+
interface ButtonProps extends Omit<MoyuNodeAttributes, 'onClick'> {
|
|
610
|
+
sprite: ControlSpriteProps;
|
|
611
|
+
disabled?: boolean;
|
|
612
|
+
lockOn?: Exclude<ControlState, 'disabled'>;
|
|
613
|
+
onPress?: (event: PressEvent) => void;
|
|
614
|
+
text?: string;
|
|
615
|
+
textStyle?: ControlStateValue<ControlTextStyle>;
|
|
616
|
+
textOffsetX?: number;
|
|
617
|
+
textOffsetY?: number;
|
|
618
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
619
|
+
}
|
|
620
|
+
declare function Button({ sprite, disabled, lockOn, onPress, text, textStyle, textOffsetX, textOffsetY, textAlign, children, anchor, pivot, interactive, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onTouchStart, onTouchEnd, onTouchCancel, ...containerProps }: ButtonProps): JSX.Element;
|
|
621
|
+
|
|
622
|
+
interface CheckboxProps extends Omit<ButtonProps, 'lockOn' | 'sprite'> {
|
|
623
|
+
checked?: boolean;
|
|
624
|
+
defaultChecked?: boolean;
|
|
625
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
626
|
+
uncheckedSprite: ControlSpriteProps;
|
|
627
|
+
checkedSprite: ControlSpriteProps;
|
|
628
|
+
}
|
|
629
|
+
declare function Checkbox({ checked, defaultChecked, onCheckedChange, uncheckedSprite, checkedSprite, onPress, ...buttonProps }: CheckboxProps): JSX.Element;
|
|
630
|
+
|
|
631
|
+
interface SelectOption {
|
|
632
|
+
text: string;
|
|
633
|
+
value: string;
|
|
634
|
+
}
|
|
635
|
+
interface SelectListProps extends Omit<SpriteProps, 'src' | 'targetHeight'> {
|
|
636
|
+
src: string;
|
|
637
|
+
paddingX?: number;
|
|
638
|
+
paddingY?: number;
|
|
639
|
+
gap?: number;
|
|
640
|
+
offsetX?: number;
|
|
641
|
+
offsetY?: number;
|
|
642
|
+
}
|
|
643
|
+
interface SelectOptionSpriteProps extends Omit<ControlSpriteProps, 'targetHeight'> {
|
|
644
|
+
targetHeight: number;
|
|
645
|
+
}
|
|
646
|
+
interface SelectProps extends Omit<MoyuNodeAttributes, 'onClick'> {
|
|
647
|
+
value?: string;
|
|
648
|
+
defaultValue?: string;
|
|
649
|
+
onValueChange?: (value: string, option: SelectOption) => void;
|
|
650
|
+
onPress?: (event: PressEvent) => void;
|
|
651
|
+
disabled?: boolean;
|
|
652
|
+
options: readonly SelectOption[];
|
|
653
|
+
trigger: ControlSpriteProps;
|
|
654
|
+
list: SelectListProps;
|
|
655
|
+
option: SelectOptionSpriteProps;
|
|
656
|
+
textStyle?: ControlStateValue<ControlTextStyle>;
|
|
657
|
+
textOffsetX?: number;
|
|
658
|
+
textOffsetY?: number;
|
|
659
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
660
|
+
}
|
|
661
|
+
declare function Select({ value, defaultValue, onValueChange, onPress, disabled, options, trigger, list, option, textStyle, textOffsetX, textOffsetY, textAlign, anchor, pivot, ...containerProps }: SelectProps): JSX.Element;
|
|
662
|
+
|
|
663
|
+
interface SliderTrackProps extends Omit<ControlSpriteProps, 'targetWidth'> {
|
|
664
|
+
targetWidth: number;
|
|
665
|
+
}
|
|
666
|
+
interface SliderThumbProps extends Omit<ControlSpriteProps, 'targetWidth'> {
|
|
667
|
+
targetWidth: number;
|
|
668
|
+
}
|
|
669
|
+
interface SliderProps extends Omit<MoyuNodeAttributes, 'onClick'> {
|
|
670
|
+
value?: number;
|
|
671
|
+
defaultValue?: number;
|
|
672
|
+
onValueChange?: (value: number) => void;
|
|
673
|
+
onValueCommit?: (value: number) => void;
|
|
674
|
+
onPress?: (event: PressEvent) => void;
|
|
675
|
+
disabled?: boolean;
|
|
676
|
+
track: SliderTrackProps;
|
|
677
|
+
thumb: SliderThumbProps;
|
|
678
|
+
}
|
|
679
|
+
declare function Slider({ value, defaultValue, onValueChange, onValueCommit, onPress, disabled, track, thumb, anchor, pivot, interactive, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onMouseMove, onTouchStart, onTouchMove, onTouchEnd, onTouchCancel, ...containerProps }: SliderProps): JSX.Element;
|
|
680
|
+
|
|
578
681
|
type ExecutionCursor = {
|
|
579
682
|
story: string;
|
|
580
683
|
paragraph: string;
|
|
@@ -913,4 +1016,4 @@ declare module 'zod' {
|
|
|
913
1016
|
}
|
|
914
1017
|
}
|
|
915
1018
|
|
|
916
|
-
export { type AnimatedComponent, type AnimatedProps, type AnimationFrameCallbackEvent, type AppStateAdapter, type AutoTicketHandle, type AutoTicketOptions, type BeforeUnloadEvent, type CombinedCheckpoint, Command, type CommandHandler, type CustomEvent, DEBUG_EMPTY_PAGE, type DebugSessionConfig, type DebugSessionController, type DebugWarpBoundary, type DebugWarpOptions, type DefaultOverlayName, type DefaultPageName, type FastForwardOptions, type FocusEvent, type FocusEventKind, type FullScreenEvent, type FullscreenEventKind, type GameControl, type GameEvent, type GameStateSourceProps, type GameStateStore, type Gamepad, type GamepadButton, type GamepadEvent, type GamepadHapticActuator, JSX, type KeyboardLocation, type Literal, MaybePromise, MouseEvent, MoyuEvent, type NavigationState, type Navigator, type NodeEvent, type OverlayConfig, type OverlayDescriptor, type OverlayInfo, OverlayParamsContext, type PageConfig, type PageDescriptor, PageParamsContext, type RegisterNavigator, type ResizeEvent, type ResolvedArgument, type ResolvedCommandLine, type ResolvedSystemCallLine, type RootErrorInfo, type RootHandle, type RootNavigatorList, type RootOptions, type RootUiDataMap, type RootUncaughtErrorInfo, type ScenarioCommandBaseType, type ScenarioEvent, type ShaderBuiltin, type ShaderBuiltinName, type ShaderEvent, type StackNavigatorOptions, StageContextProvider, type StageInstance, type TextLine, type TextLineHandler,
|
|
1019
|
+
export { type AnimatedComponent, type AnimatedProps, type AnimationFrameCallbackEvent, type AppStateAdapter, type AutoTicketHandle, type AutoTicketOptions, type BeforeUnloadEvent, Button, type ButtonProps, Checkbox, type CheckboxProps, type CombinedCheckpoint, Command, type CommandHandler, type ControlSpriteProps, type ControlState, type ControlStateValue, type ControlTextStyle, type CustomEvent, DEBUG_EMPTY_PAGE, type DebugSessionConfig, type DebugSessionController, type DebugWarpBoundary, type DebugWarpOptions, type DefaultOverlayName, type DefaultPageName, type DlcProgress, type FastForwardOptions, type FocusEvent, type FocusEventKind, type FullScreenEvent, type FullscreenEventKind, type GameControl, type GameEvent, type GameStateSourceProps, type GameStateStore, type Gamepad, type GamepadButton, type GamepadEvent, type GamepadHapticActuator, JSX, type KeyboardLocation, LayoutEvent, type Literal, MaybePromise, MouseEvent, MoyuClipAttributes, MoyuEvent, MoyuNodeAttributes, MoyuSpriteAttributes, MoyuVBoxAttributes, type NavigationState, type Navigator, type NodeEvent, type OverlayConfig, type OverlayDescriptor, type OverlayInfo, OverlayParamsContext, type PageConfig, type PageDescriptor, PageParamsContext, type PressEvent, type RegisterNavigator, type ResizeEvent, type ResolvedArgument, type ResolvedCommandLine, type ResolvedSystemCallLine, type RootErrorInfo, type RootHandle, type RootNavigatorList, type RootOptions, type RootUiDataMap, type RootUncaughtErrorInfo, type ScenarioCommandBaseType, type ScenarioEvent, ScrollView, type ScrollViewController, type ScrollViewProps, Select, type SelectListProps, type SelectOption, type SelectOptionSpriteProps, type SelectProps, type ShaderBuiltin, type ShaderBuiltinName, type ShaderEvent, Slider, type SliderProps, type SliderThumbProps, type SliderTrackProps, type StackNavigatorOptions, StageContextProvider, type StageInstance, type TextLine, type TextLineHandler, TouchEvent, type UseScrollViewOptions, WheelEvent, type WithAnimated, animated as a, addEventListener, animated, autoState, createGameStateContext, createRoot, createStackNavigator, createStage, createStaticNavigation, ensureArchiveVariableDefaults, executeNodeCommand, executePluginCommand, fastForwardState, getAppStateAdapter, getNavigator, getSeekingType, getUiData, globalEventListeners, globalRequestAnimationFrameListeners, initGlobalVariableDefaults, initUiData, loadVariablesDocument, moyu, nextLine, registerAppStateAdapter, replaceUiData, setDefaultAutoTailMs, setWaiting, skipState, startDebugSession, startRuntimeDebugSession, stopDebugSession, stopRuntimeDebugSession, useAutoBlocker, useAutoTicket, useBeforeHandleCommandCallback, useDebugSession, useFadeIn, useFadeInOut, useFadeOut, useInterruptCallback, useIsAutoing, useIsSeeking, useIsSkipping, useNavigation, useNavigationParams, useNavigationState, useScenario, useScrollView, useSkipBlocker, useSkipCallback, useSoundEffect, useStageContext, useUiData, warpState };
|