@momoyu-ink/kit 0.9.1 → 0.10.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/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 MouseEvent, a as MoyuEvent, C as Command, b as MaybePromise, J as JSX, c as JsonValue } from './jsx-dev-runtime-I0t9y4BC.mjs';
4
- export { A as AudioCommand, d as AudioSettings, B as BubbleEvent, D as DetailedMoyuProps, E as EffectParams, G as GamepadCommand, K as KeyboardEvent, e as KeyboardEventKind, f as MakeNullOptional, g as MouseEventKind, h as MoyuAnimationAttributes, i as MoyuBackdropAttributes, j as MoyuClipAttributes, k as MoyuContainerAttributes, l as MoyuEventHandler, m as MoyuFilterAttributes, n as MoyuListenerAttributes, o as MoyuNodeAttributes, p as MoyuShaderAttributes, q as MoyuShaderSlotAttributes, r as MoyuSpriteAttributes, s as MoyuTextAttributes, t as MoyuVideoAttributes, N as Node, R as RetainMode, u as ScenarioCommand, v as ShaderCommand, w as ShaderParam, x as ShaderParamType, y as ShaderSource, z as ShaderTimeControl, F as SystemCommand, T as TextCommand, H as TouchEvent, I as TouchEventKind, L as Tuple2, O as Tuple3, P as Tuple4, W as WindowState, Q as createBubbleEvent, U as getStageSize } from './jsx-dev-runtime-I0t9y4BC.mjs';
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-gGlb6FbX.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, R as RetainMode, y as ScenarioCommand, z as ShaderCommand, F as ShaderParam, H as ShaderParamType, I as ShaderSource, O as ShaderTimeControl, P as SystemCommand, Q as TextCommand, U as TouchEventKind, V as Tuple2, X as Tuple3, Y as Tuple4, Z as WheelEventDeltaMode, _ as WindowState, $ as createBubbleEvent, a0 as getStageSize, a1 as mergeEvent } from './jsx-dev-runtime-gGlb6FbX.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 { ZodType } from 'zod';
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,40 @@ type MarkerEnter = {
262
219
 
263
220
  type ScenarioEvent = MarkerEnter | ResolvedCommandLine | ResolvedSystemCallLine | TextLine | null | null | null | null;
264
221
 
265
- type WheelEventDeltaMode = 'pixel' | 'line' | 'page';
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
+ rule: string;
251
+ softness: number;
252
+ reverse: boolean;
253
+ };
254
+
255
+ type ShaderBuiltinName = 'crossfade' | 'wipe' | 'fade' | 'push' | 'slideaway' | 'zoom' | 'pixellate' | 'mask';
266
256
 
267
257
  declare global {
268
258
  interface Window {
@@ -575,6 +565,116 @@ declare function useNavigationState(): Snapshot<NavigationState>;
575
565
  */
576
566
  declare function useNavigationParams<T = Record<string, any>>(): T;
577
567
 
568
+ interface UseScrollViewOptions {
569
+ viewportHeight: number;
570
+ initialPosition?: 'start' | 'end';
571
+ wheelStep?: number;
572
+ }
573
+ interface ScrollViewController {
574
+ scrollOffset: SpringValue<number>;
575
+ contentHeight: number;
576
+ maxScroll: number;
577
+ handleContentLayout: (event: LayoutEvent) => void;
578
+ handleWheel: (event: WheelEvent) => void;
579
+ handleTouchStart: (event: TouchEvent) => void;
580
+ handleTouchMove: (event: TouchEvent) => void;
581
+ handleTouchEnd: (event: TouchEvent) => void;
582
+ scrollTo: (offset: number, immediate?: boolean) => void;
583
+ scrollToRatio: (ratio: number, immediate?: boolean) => void;
584
+ }
585
+ declare function useScrollView({ viewportHeight, initialPosition, wheelStep, }: UseScrollViewOptions): ScrollViewController;
586
+
587
+ interface ScrollViewProps {
588
+ width: number;
589
+ height: number;
590
+ controller: ScrollViewController;
591
+ children?: ReactNode;
592
+ clipProps?: Omit<MoyuClipAttributes, 'children' | 'height' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart' | 'onWheel' | 'width'>;
593
+ contentProps?: Omit<MoyuVBoxAttributes, 'children' | 'onLayout' | 'y'>;
594
+ }
595
+ declare function ScrollView({ width, height, controller, children, clipProps, contentProps }: ScrollViewProps): JSX.Element;
596
+
597
+ type ControlState = 'idle' | 'hover' | 'press' | 'disabled';
598
+ type ControlStateValue<T> = T | readonly [idle: T, hover?: T, press?: T, disabled?: T];
599
+ type ControlTextStyle = Omit<TextProps, 'text'>;
600
+ interface ControlSpriteProps extends Omit<MoyuSpriteAttributes, 'children' | 'src'> {
601
+ src: ControlStateValue<string>;
602
+ }
603
+
604
+ type PressEvent = MouseEvent | TouchEvent;
605
+ interface ButtonProps extends Omit<MoyuNodeAttributes, 'onClick'> {
606
+ sprite: ControlSpriteProps;
607
+ disabled?: boolean;
608
+ lockOn?: Exclude<ControlState, 'disabled'>;
609
+ onPress?: (event: PressEvent) => void;
610
+ text?: string;
611
+ textStyle?: ControlStateValue<ControlTextStyle>;
612
+ textOffsetX?: number;
613
+ textOffsetY?: number;
614
+ textAlign?: 'left' | 'center' | 'right';
615
+ }
616
+ declare function Button({ sprite, disabled, lockOn, onPress, text, textStyle, textOffsetX, textOffsetY, textAlign, anchor, pivot, interactive, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onTouchStart, onTouchEnd, onTouchCancel, ...containerProps }: ButtonProps): JSX.Element;
617
+
618
+ interface CheckboxProps extends Omit<ButtonProps, 'lockOn' | 'sprite'> {
619
+ checked?: boolean;
620
+ defaultChecked?: boolean;
621
+ onCheckedChange?: (checked: boolean) => void;
622
+ uncheckedSprite: ControlSpriteProps;
623
+ checkedSprite: ControlSpriteProps;
624
+ }
625
+ declare function Checkbox({ checked, defaultChecked, onCheckedChange, uncheckedSprite, checkedSprite, onPress, ...buttonProps }: CheckboxProps): JSX.Element;
626
+
627
+ interface SelectOption {
628
+ text: string;
629
+ value: string;
630
+ }
631
+ interface SelectListProps extends Omit<SpriteProps, 'src' | 'targetHeight'> {
632
+ src: string;
633
+ paddingX?: number;
634
+ paddingY?: number;
635
+ gap?: number;
636
+ offsetX?: number;
637
+ offsetY?: number;
638
+ }
639
+ interface SelectOptionSpriteProps extends Omit<ControlSpriteProps, 'targetHeight'> {
640
+ targetHeight: number;
641
+ }
642
+ interface SelectProps extends Omit<MoyuNodeAttributes, 'onClick'> {
643
+ value?: string;
644
+ defaultValue?: string;
645
+ onValueChange?: (value: string, option: SelectOption) => void;
646
+ onPress?: (event: PressEvent) => void;
647
+ disabled?: boolean;
648
+ options: readonly SelectOption[];
649
+ trigger: ControlSpriteProps;
650
+ list: SelectListProps;
651
+ option: SelectOptionSpriteProps;
652
+ textStyle?: ControlStateValue<ControlTextStyle>;
653
+ textOffsetX?: number;
654
+ textOffsetY?: number;
655
+ textAlign?: 'left' | 'center' | 'right';
656
+ }
657
+ declare function Select({ value, defaultValue, onValueChange, onPress, disabled, options, trigger, list, option, textStyle, textOffsetX, textOffsetY, textAlign, anchor, pivot, ...containerProps }: SelectProps): JSX.Element;
658
+
659
+ interface SliderTrackProps extends Omit<SpriteProps, 'src' | 'targetWidth'> {
660
+ src: ControlStateValue<string>;
661
+ targetWidth: number;
662
+ }
663
+ interface SliderThumbProps extends Omit<SpriteProps, 'src' | 'targetWidth'> {
664
+ src: ControlStateValue<string>;
665
+ targetWidth: number;
666
+ }
667
+ interface SliderProps extends Omit<MoyuNodeAttributes, 'onClick'> {
668
+ value?: number;
669
+ defaultValue?: number;
670
+ onValueChange?: (value: number) => void;
671
+ onPress?: (event: PressEvent) => void;
672
+ disabled?: boolean;
673
+ track: SliderTrackProps;
674
+ thumb: SliderThumbProps;
675
+ }
676
+ declare function Slider({ value, defaultValue, onValueChange, onPress, disabled, track, thumb, anchor, pivot, interactive, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onMouseMove, onTouchStart, onTouchMove, onTouchEnd, onTouchCancel, ...containerProps }: SliderProps): JSX.Element;
677
+
578
678
  type ExecutionCursor = {
579
679
  story: string;
580
680
  paragraph: string;
@@ -913,4 +1013,4 @@ declare module 'zod' {
913
1013
  }
914
1014
  }
915
1015
 
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, type WheelEvent, type WheelEventDeltaMode, 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, useSkipBlocker, useSkipCallback, useSoundEffect, useStageContext, useUiData, warpState };
1016
+ 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 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 MouseEvent, a as MoyuEvent, C as Command, b as MaybePromise, J as JSX, c as JsonValue } from './jsx-dev-runtime-I0t9y4BC.js';
4
- export { A as AudioCommand, d as AudioSettings, B as BubbleEvent, D as DetailedMoyuProps, E as EffectParams, G as GamepadCommand, K as KeyboardEvent, e as KeyboardEventKind, f as MakeNullOptional, g as MouseEventKind, h as MoyuAnimationAttributes, i as MoyuBackdropAttributes, j as MoyuClipAttributes, k as MoyuContainerAttributes, l as MoyuEventHandler, m as MoyuFilterAttributes, n as MoyuListenerAttributes, o as MoyuNodeAttributes, p as MoyuShaderAttributes, q as MoyuShaderSlotAttributes, r as MoyuSpriteAttributes, s as MoyuTextAttributes, t as MoyuVideoAttributes, N as Node, R as RetainMode, u as ScenarioCommand, v as ShaderCommand, w as ShaderParam, x as ShaderParamType, y as ShaderSource, z as ShaderTimeControl, F as SystemCommand, T as TextCommand, H as TouchEvent, I as TouchEventKind, L as Tuple2, O as Tuple3, P as Tuple4, W as WindowState, Q as createBubbleEvent, U as getStageSize } from './jsx-dev-runtime-I0t9y4BC.js';
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-gGlb6FbX.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, R as RetainMode, y as ScenarioCommand, z as ShaderCommand, F as ShaderParam, H as ShaderParamType, I as ShaderSource, O as ShaderTimeControl, P as SystemCommand, Q as TextCommand, U as TouchEventKind, V as Tuple2, X as Tuple3, Y as Tuple4, Z as WheelEventDeltaMode, _ as WindowState, $ as createBubbleEvent, a0 as getStageSize, a1 as mergeEvent } from './jsx-dev-runtime-gGlb6FbX.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 { ZodType } from 'zod';
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,40 @@ type MarkerEnter = {
262
219
 
263
220
  type ScenarioEvent = MarkerEnter | ResolvedCommandLine | ResolvedSystemCallLine | TextLine | null | null | null | null;
264
221
 
265
- type WheelEventDeltaMode = 'pixel' | 'line' | 'page';
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
+ rule: string;
251
+ softness: number;
252
+ reverse: boolean;
253
+ };
254
+
255
+ type ShaderBuiltinName = 'crossfade' | 'wipe' | 'fade' | 'push' | 'slideaway' | 'zoom' | 'pixellate' | 'mask';
266
256
 
267
257
  declare global {
268
258
  interface Window {
@@ -575,6 +565,116 @@ declare function useNavigationState(): Snapshot<NavigationState>;
575
565
  */
576
566
  declare function useNavigationParams<T = Record<string, any>>(): T;
577
567
 
568
+ interface UseScrollViewOptions {
569
+ viewportHeight: number;
570
+ initialPosition?: 'start' | 'end';
571
+ wheelStep?: number;
572
+ }
573
+ interface ScrollViewController {
574
+ scrollOffset: SpringValue<number>;
575
+ contentHeight: number;
576
+ maxScroll: number;
577
+ handleContentLayout: (event: LayoutEvent) => void;
578
+ handleWheel: (event: WheelEvent) => void;
579
+ handleTouchStart: (event: TouchEvent) => void;
580
+ handleTouchMove: (event: TouchEvent) => void;
581
+ handleTouchEnd: (event: TouchEvent) => void;
582
+ scrollTo: (offset: number, immediate?: boolean) => void;
583
+ scrollToRatio: (ratio: number, immediate?: boolean) => void;
584
+ }
585
+ declare function useScrollView({ viewportHeight, initialPosition, wheelStep, }: UseScrollViewOptions): ScrollViewController;
586
+
587
+ interface ScrollViewProps {
588
+ width: number;
589
+ height: number;
590
+ controller: ScrollViewController;
591
+ children?: ReactNode;
592
+ clipProps?: Omit<MoyuClipAttributes, 'children' | 'height' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart' | 'onWheel' | 'width'>;
593
+ contentProps?: Omit<MoyuVBoxAttributes, 'children' | 'onLayout' | 'y'>;
594
+ }
595
+ declare function ScrollView({ width, height, controller, children, clipProps, contentProps }: ScrollViewProps): JSX.Element;
596
+
597
+ type ControlState = 'idle' | 'hover' | 'press' | 'disabled';
598
+ type ControlStateValue<T> = T | readonly [idle: T, hover?: T, press?: T, disabled?: T];
599
+ type ControlTextStyle = Omit<TextProps, 'text'>;
600
+ interface ControlSpriteProps extends Omit<MoyuSpriteAttributes, 'children' | 'src'> {
601
+ src: ControlStateValue<string>;
602
+ }
603
+
604
+ type PressEvent = MouseEvent | TouchEvent;
605
+ interface ButtonProps extends Omit<MoyuNodeAttributes, 'onClick'> {
606
+ sprite: ControlSpriteProps;
607
+ disabled?: boolean;
608
+ lockOn?: Exclude<ControlState, 'disabled'>;
609
+ onPress?: (event: PressEvent) => void;
610
+ text?: string;
611
+ textStyle?: ControlStateValue<ControlTextStyle>;
612
+ textOffsetX?: number;
613
+ textOffsetY?: number;
614
+ textAlign?: 'left' | 'center' | 'right';
615
+ }
616
+ declare function Button({ sprite, disabled, lockOn, onPress, text, textStyle, textOffsetX, textOffsetY, textAlign, anchor, pivot, interactive, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onTouchStart, onTouchEnd, onTouchCancel, ...containerProps }: ButtonProps): JSX.Element;
617
+
618
+ interface CheckboxProps extends Omit<ButtonProps, 'lockOn' | 'sprite'> {
619
+ checked?: boolean;
620
+ defaultChecked?: boolean;
621
+ onCheckedChange?: (checked: boolean) => void;
622
+ uncheckedSprite: ControlSpriteProps;
623
+ checkedSprite: ControlSpriteProps;
624
+ }
625
+ declare function Checkbox({ checked, defaultChecked, onCheckedChange, uncheckedSprite, checkedSprite, onPress, ...buttonProps }: CheckboxProps): JSX.Element;
626
+
627
+ interface SelectOption {
628
+ text: string;
629
+ value: string;
630
+ }
631
+ interface SelectListProps extends Omit<SpriteProps, 'src' | 'targetHeight'> {
632
+ src: string;
633
+ paddingX?: number;
634
+ paddingY?: number;
635
+ gap?: number;
636
+ offsetX?: number;
637
+ offsetY?: number;
638
+ }
639
+ interface SelectOptionSpriteProps extends Omit<ControlSpriteProps, 'targetHeight'> {
640
+ targetHeight: number;
641
+ }
642
+ interface SelectProps extends Omit<MoyuNodeAttributes, 'onClick'> {
643
+ value?: string;
644
+ defaultValue?: string;
645
+ onValueChange?: (value: string, option: SelectOption) => void;
646
+ onPress?: (event: PressEvent) => void;
647
+ disabled?: boolean;
648
+ options: readonly SelectOption[];
649
+ trigger: ControlSpriteProps;
650
+ list: SelectListProps;
651
+ option: SelectOptionSpriteProps;
652
+ textStyle?: ControlStateValue<ControlTextStyle>;
653
+ textOffsetX?: number;
654
+ textOffsetY?: number;
655
+ textAlign?: 'left' | 'center' | 'right';
656
+ }
657
+ declare function Select({ value, defaultValue, onValueChange, onPress, disabled, options, trigger, list, option, textStyle, textOffsetX, textOffsetY, textAlign, anchor, pivot, ...containerProps }: SelectProps): JSX.Element;
658
+
659
+ interface SliderTrackProps extends Omit<SpriteProps, 'src' | 'targetWidth'> {
660
+ src: ControlStateValue<string>;
661
+ targetWidth: number;
662
+ }
663
+ interface SliderThumbProps extends Omit<SpriteProps, 'src' | 'targetWidth'> {
664
+ src: ControlStateValue<string>;
665
+ targetWidth: number;
666
+ }
667
+ interface SliderProps extends Omit<MoyuNodeAttributes, 'onClick'> {
668
+ value?: number;
669
+ defaultValue?: number;
670
+ onValueChange?: (value: number) => void;
671
+ onPress?: (event: PressEvent) => void;
672
+ disabled?: boolean;
673
+ track: SliderTrackProps;
674
+ thumb: SliderThumbProps;
675
+ }
676
+ declare function Slider({ value, defaultValue, onValueChange, onPress, disabled, track, thumb, anchor, pivot, interactive, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onMouseMove, onTouchStart, onTouchMove, onTouchEnd, onTouchCancel, ...containerProps }: SliderProps): JSX.Element;
677
+
578
678
  type ExecutionCursor = {
579
679
  story: string;
580
680
  paragraph: string;
@@ -913,4 +1013,4 @@ declare module 'zod' {
913
1013
  }
914
1014
  }
915
1015
 
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, type WheelEvent, type WheelEventDeltaMode, 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, useSkipBlocker, useSkipCallback, useSoundEffect, useStageContext, useUiData, warpState };
1016
+ 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 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 };