@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.
Files changed (181) hide show
  1. package/dist/jsx-dev-runtime--ZXLAgUi.d.mts +600 -0
  2. package/dist/jsx-dev-runtime--ZXLAgUi.d.ts +600 -0
  3. package/dist/jsx-dev-runtime.cjs +27 -0
  4. package/dist/jsx-dev-runtime.d.mts +4 -0
  5. package/dist/jsx-dev-runtime.d.ts +4 -0
  6. package/dist/jsx-dev-runtime.mjs +6 -0
  7. package/dist/jsx-runtime.cjs +28 -0
  8. package/dist/jsx-runtime.d.mts +4 -0
  9. package/dist/jsx-runtime.d.ts +4 -0
  10. package/dist/jsx-runtime.mjs +7 -0
  11. package/dist/lib.cjs +1610 -0
  12. package/dist/lib.d.mts +668 -0
  13. package/dist/lib.d.ts +668 -15
  14. package/dist/lib.mjs +1641 -0
  15. package/package.json +29 -8
  16. package/dist/bindings/AnimationFormat.d.ts +0 -1
  17. package/dist/bindings/AnimationFormat.js +0 -3
  18. package/dist/bindings/AnimationFrameCallbackEvent.d.ts +0 -3
  19. package/dist/bindings/AnimationFrameCallbackEvent.js +0 -3
  20. package/dist/bindings/AnimationProps.d.ts +0 -6
  21. package/dist/bindings/AnimationProps.js +0 -2
  22. package/dist/bindings/AudioCommand.d.ts +0 -54
  23. package/dist/bindings/AudioCommand.js +0 -2
  24. package/dist/bindings/AudioSettings.d.ts +0 -42
  25. package/dist/bindings/AudioSettings.js +0 -3
  26. package/dist/bindings/BackdropProps.d.ts +0 -6
  27. package/dist/bindings/BackdropProps.js +0 -2
  28. package/dist/bindings/BeforeUnloadEvent.d.ts +0 -1
  29. package/dist/bindings/BeforeUnloadEvent.js +0 -3
  30. package/dist/bindings/ClipProps.d.ts +0 -4
  31. package/dist/bindings/ClipProps.js +0 -3
  32. package/dist/bindings/CustomEvent.d.ts +0 -18
  33. package/dist/bindings/CustomEvent.js +0 -3
  34. package/dist/bindings/EffectParams.d.ts +0 -6
  35. package/dist/bindings/EffectParams.js +0 -3
  36. package/dist/bindings/FilterKind.d.ts +0 -34
  37. package/dist/bindings/FilterKind.js +0 -3
  38. package/dist/bindings/FilterProps.d.ts +0 -4
  39. package/dist/bindings/FilterProps.js +0 -2
  40. package/dist/bindings/FocusEvent.d.ts +0 -5
  41. package/dist/bindings/FocusEvent.js +0 -2
  42. package/dist/bindings/FocusEventKind.d.ts +0 -1
  43. package/dist/bindings/FocusEventKind.js +0 -3
  44. package/dist/bindings/FullScreenEvent.d.ts +0 -4
  45. package/dist/bindings/FullScreenEvent.js +0 -2
  46. package/dist/bindings/FullscreenEventKind.d.ts +0 -1
  47. package/dist/bindings/FullscreenEventKind.js +0 -3
  48. package/dist/bindings/GameEvent.d.ts +0 -1
  49. package/dist/bindings/GameEvent.js +0 -3
  50. package/dist/bindings/Gamepad.d.ts +0 -44
  51. package/dist/bindings/Gamepad.js +0 -2
  52. package/dist/bindings/GamepadButton.d.ts +0 -20
  53. package/dist/bindings/GamepadButton.js +0 -3
  54. package/dist/bindings/GamepadCommand.d.ts +0 -9
  55. package/dist/bindings/GamepadCommand.js +0 -2
  56. package/dist/bindings/GamepadEvent.d.ts +0 -12
  57. package/dist/bindings/GamepadEvent.js +0 -2
  58. package/dist/bindings/GamepadHapticActuator.d.ts +0 -11
  59. package/dist/bindings/GamepadHapticActuator.js +0 -3
  60. package/dist/bindings/KeyboardEventKind.d.ts +0 -1
  61. package/dist/bindings/KeyboardEventKind.js +0 -3
  62. package/dist/bindings/KeyboardLocation.d.ts +0 -1
  63. package/dist/bindings/KeyboardLocation.js +0 -3
  64. package/dist/bindings/Literal.d.ts +0 -3
  65. package/dist/bindings/Literal.js +0 -3
  66. package/dist/bindings/MouseEventKind.d.ts +0 -1
  67. package/dist/bindings/MouseEventKind.js +0 -3
  68. package/dist/bindings/MoyuCursor.d.ts +0 -1
  69. package/dist/bindings/MoyuCursor.js +0 -3
  70. package/dist/bindings/NineSliceMode.d.ts +0 -1
  71. package/dist/bindings/NineSliceMode.js +0 -3
  72. package/dist/bindings/NodeEvent.d.ts +0 -4
  73. package/dist/bindings/NodeEvent.js +0 -3
  74. package/dist/bindings/NodeProps.d.ts +0 -20
  75. package/dist/bindings/NodeProps.js +0 -2
  76. package/dist/bindings/RawKeyboardEvent.d.ts +0 -16
  77. package/dist/bindings/RawKeyboardEvent.js +0 -2
  78. package/dist/bindings/RawMouseEvent.d.ts +0 -12
  79. package/dist/bindings/RawMouseEvent.js +0 -2
  80. package/dist/bindings/RawTouchEvent.d.ts +0 -13
  81. package/dist/bindings/RawTouchEvent.js +0 -2
  82. package/dist/bindings/RawWheelEvent.d.ts +0 -10
  83. package/dist/bindings/RawWheelEvent.js +0 -2
  84. package/dist/bindings/ResizeEvent.d.ts +0 -4
  85. package/dist/bindings/ResizeEvent.js +0 -3
  86. package/dist/bindings/ResolvedArgument.d.ts +0 -5
  87. package/dist/bindings/ResolvedArgument.js +0 -2
  88. package/dist/bindings/ResolvedCommandLine.d.ts +0 -5
  89. package/dist/bindings/ResolvedCommandLine.js +0 -2
  90. package/dist/bindings/ResolvedSystemCallLine.d.ts +0 -5
  91. package/dist/bindings/ResolvedSystemCallLine.js +0 -2
  92. package/dist/bindings/ScenarioCommand.d.ts +0 -103
  93. package/dist/bindings/ScenarioCommand.js +0 -2
  94. package/dist/bindings/ScenarioEvent.d.ts +0 -4
  95. package/dist/bindings/ScenarioEvent.js +0 -2
  96. package/dist/bindings/SpriteMode.d.ts +0 -1
  97. package/dist/bindings/SpriteMode.js +0 -3
  98. package/dist/bindings/SpriteProps.d.ts +0 -11
  99. package/dist/bindings/SpriteProps.js +0 -2
  100. package/dist/bindings/SystemCommand.d.ts +0 -30
  101. package/dist/bindings/SystemCommand.js +0 -2
  102. package/dist/bindings/TextCommand.d.ts +0 -9
  103. package/dist/bindings/TextCommand.js +0 -3
  104. package/dist/bindings/TextEvent.d.ts +0 -1
  105. package/dist/bindings/TextEvent.js +0 -3
  106. package/dist/bindings/TextLine.d.ts +0 -5
  107. package/dist/bindings/TextLine.js +0 -3
  108. package/dist/bindings/TextPrintMode.d.ts +0 -4
  109. package/dist/bindings/TextPrintMode.js +0 -3
  110. package/dist/bindings/TextProps.d.ts +0 -41
  111. package/dist/bindings/TextProps.js +0 -2
  112. package/dist/bindings/TouchEventKind.d.ts +0 -1
  113. package/dist/bindings/TouchEventKind.js +0 -3
  114. package/dist/bindings/VideoCommand.d.ts +0 -21
  115. package/dist/bindings/VideoCommand.js +0 -3
  116. package/dist/bindings/VideoEvent.d.ts +0 -1
  117. package/dist/bindings/VideoEvent.js +0 -3
  118. package/dist/bindings/VideoProps.d.ts +0 -7
  119. package/dist/bindings/VideoProps.js +0 -3
  120. package/dist/bindings/WheelEventDeltaMode.d.ts +0 -1
  121. package/dist/bindings/WheelEventDeltaMode.js +0 -3
  122. package/dist/bindings/WindowState.d.ts +0 -1
  123. package/dist/bindings/WindowState.js +0 -3
  124. package/dist/bindings/serde_json/JsonValue.d.ts +0 -3
  125. package/dist/bindings/serde_json/JsonValue.js +0 -3
  126. package/dist/commands.d.ts +0 -17
  127. package/dist/commands.js +0 -24
  128. package/dist/components/navigation.d.ts +0 -154
  129. package/dist/components/navigation.js +0 -252
  130. package/dist/declaration.d.ts +0 -80
  131. package/dist/declaration.js +0 -2
  132. package/dist/events/base.d.ts +0 -16
  133. package/dist/events/base.js +0 -19
  134. package/dist/events/globals.d.ts +0 -2
  135. package/dist/events/globals.js +0 -122
  136. package/dist/events/keyboard.d.ts +0 -37
  137. package/dist/events/keyboard.js +0 -2
  138. package/dist/events/listener.d.ts +0 -1
  139. package/dist/events/listener.js +0 -13
  140. package/dist/events/mouse.d.ts +0 -15
  141. package/dist/events/mouse.js +0 -2
  142. package/dist/events/touch.d.ts +0 -16
  143. package/dist/events/touch.js +0 -2
  144. package/dist/events/wheel.d.ts +0 -9
  145. package/dist/events/wheel.js +0 -2
  146. package/dist/events.d.ts +0 -33
  147. package/dist/events.js +0 -49
  148. package/dist/hooks/useFadeInOut.d.ts +0 -16
  149. package/dist/hooks/useFadeInOut.js +0 -62
  150. package/dist/hooks/useScenario.d.ts +0 -13
  151. package/dist/hooks/useScenario.js +0 -64
  152. package/dist/hooks/useSoundEffect.d.ts +0 -4
  153. package/dist/hooks/useSoundEffect.js +0 -63
  154. package/dist/hooks/useStage.d.ts +0 -126
  155. package/dist/hooks/useStage.js +0 -706
  156. package/dist/hooks.d.ts +0 -4
  157. package/dist/hooks.js +0 -20
  158. package/dist/lib.js +0 -54
  159. package/dist/moyu.d.ts +0 -19
  160. package/dist/moyu.js +0 -49
  161. package/dist/node.d.ts +0 -16
  162. package/dist/node.js +0 -105
  163. package/dist/react.d.ts +0 -20
  164. package/dist/react.js +0 -222
  165. package/dist/runtime-globals.d.ts +0 -65
  166. package/dist/runtime-globals.js +0 -2
  167. package/dist/sandbox.d.ts +0 -1
  168. package/dist/sandbox.js +0 -88
  169. package/dist/spring/animated.d.ts +0 -27
  170. package/dist/spring/animated.js +0 -2
  171. package/dist/spring/index.d.ts +0 -5
  172. package/dist/spring/index.js +0 -35
  173. package/dist/spring/primitives.d.ts +0 -3
  174. package/dist/spring/primitives.js +0 -13
  175. package/dist/state.d.ts +0 -6
  176. package/dist/state.js +0 -8
  177. package/dist/utils.d.ts +0 -10
  178. package/dist/utils.js +0 -10
  179. package/dist/zod-patch.d.ts +0 -10
  180. package/dist/zod-patch.js +0 -2
  181. package/jsx-runtime.d.ts +0 -1
package/dist/events.js DELETED
@@ -1,49 +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("./events/base"), exports);
18
- __exportStar(require("./events/globals"), exports);
19
- __exportStar(require("./events/keyboard"), exports);
20
- __exportStar(require("./events/listener"), exports);
21
- __exportStar(require("./events/mouse"), exports);
22
- __exportStar(require("./events/touch"), exports);
23
- __exportStar(require("./events/wheel"), exports);
24
- __exportStar(require("./bindings/AnimationFrameCallbackEvent"), exports);
25
- __exportStar(require("./bindings/BeforeUnloadEvent"), exports);
26
- __exportStar(require("./bindings/CustomEvent"), exports);
27
- __exportStar(require("./bindings/FocusEvent"), exports);
28
- __exportStar(require("./bindings/FocusEventKind"), exports);
29
- __exportStar(require("./bindings/FullScreenEvent"), exports);
30
- __exportStar(require("./bindings/FullscreenEventKind"), exports);
31
- __exportStar(require("./bindings/GameEvent"), exports);
32
- __exportStar(require("./bindings/Gamepad"), exports);
33
- __exportStar(require("./bindings/GamepadButton"), exports);
34
- __exportStar(require("./bindings/GamepadEvent"), exports);
35
- __exportStar(require("./bindings/GamepadHapticActuator"), exports);
36
- __exportStar(require("./bindings/KeyboardEventKind"), exports);
37
- __exportStar(require("./bindings/KeyboardLocation"), exports);
38
- __exportStar(require("./bindings/Literal"), exports);
39
- __exportStar(require("./bindings/MouseEventKind"), exports);
40
- __exportStar(require("./bindings/NodeEvent"), exports);
41
- __exportStar(require("./bindings/ResizeEvent"), exports);
42
- __exportStar(require("./bindings/ResolvedArgument"), exports);
43
- __exportStar(require("./bindings/ResolvedCommandLine"), exports);
44
- __exportStar(require("./bindings/ResolvedSystemCallLine"), exports);
45
- __exportStar(require("./bindings/TextLine"), exports);
46
- __exportStar(require("./bindings/ScenarioEvent"), exports);
47
- __exportStar(require("./bindings/TextEvent"), exports);
48
- __exportStar(require("./bindings/TouchEventKind"), exports);
49
- __exportStar(require("./bindings/WheelEventDeltaMode"), exports);
@@ -1,16 +0,0 @@
1
- import { type SpringRef, type SpringValues } from '../spring';
2
- export declare function useFadeInOut(inTime: number, _keepTime: number, _outTime: number, pause?: boolean, onFinished?: () => void): [SpringValues<{
3
- opacity: number;
4
- }>, SpringRef<{
5
- opacity: number;
6
- }>, () => void];
7
- export declare function useFadeIn(inTime: number, pause?: boolean, onFinished?: () => void): [SpringValues<{
8
- opacity: number;
9
- }>, SpringRef<{
10
- opacity: number;
11
- }>, () => void];
12
- export declare function useFadeOut(outTime: number, pause?: boolean, onFinished?: () => void): [SpringValues<{
13
- opacity: number;
14
- }>, SpringRef<{
15
- opacity: number;
16
- }>, () => void];
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useFadeInOut = useFadeInOut;
4
- exports.useFadeIn = useFadeIn;
5
- exports.useFadeOut = useFadeOut;
6
- const spring_1 = require("../spring");
7
- function useFadeInOut(inTime, _keepTime, _outTime, pause = false, onFinished) {
8
- const [style, api] = (0, spring_1.useSpring)(() => ({
9
- from: { opacity: 0 },
10
- to: { opacity: 1 },
11
- config: { duration: inTime },
12
- pause,
13
- onRest: (result) => {
14
- if (result.value.opacity === 1) {
15
- void api.start({ reverse: true, delay: 1500, config: { duration: 1000 } });
16
- }
17
- else {
18
- onFinished?.();
19
- }
20
- },
21
- }), []);
22
- const skip = () => {
23
- api.stop();
24
- api.set({ opacity: 0 });
25
- onFinished?.();
26
- };
27
- return [style, api, skip];
28
- }
29
- function useFadeIn(inTime, pause = false, onFinished) {
30
- const [style, api] = (0, spring_1.useSpring)(() => ({
31
- from: { opacity: 0 },
32
- to: { opacity: 1 },
33
- config: { duration: inTime },
34
- pause,
35
- onRest: () => {
36
- onFinished?.();
37
- },
38
- }), []);
39
- const skip = () => {
40
- api.stop();
41
- api.set({ opacity: 1 });
42
- onFinished?.();
43
- };
44
- return [style, api, skip];
45
- }
46
- function useFadeOut(outTime, pause = false, onFinished) {
47
- const [style, api] = (0, spring_1.useSpring)(() => ({
48
- from: { opacity: 1 },
49
- to: { opacity: 0 },
50
- config: { duration: outTime },
51
- pause,
52
- onRest: () => {
53
- onFinished?.();
54
- },
55
- }), []);
56
- const skip = () => {
57
- api.stop();
58
- api.set({ opacity: 1 });
59
- onFinished?.();
60
- };
61
- return [style, api, skip];
62
- }
@@ -1,13 +0,0 @@
1
- /** Advance to the next line in the current story. */
2
- export declare function nextLine(): any;
3
- /** Set a timed wait, optionally skippable. */
4
- export declare function setWaiting(time: number, skippable: boolean): void;
5
- /**
6
- * Custom hook to manage scenario lifecycle (load, start, terminate).
7
- *
8
- * @param {string[]} stories - An array of story names to load.
9
- * @param {string} [startName] - The name of the story to start.
10
- * @param {string} [entryName] - The entry point within the story to start from.
11
- * @param {boolean} [goNextOnLoad=false] - Whether to automatically advance to the next line after loading.
12
- */
13
- export declare function useScenario(stories: string[], startName?: string, entryName?: string, goNextOnLoad?: boolean): void;
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nextLine = nextLine;
4
- exports.setWaiting = setWaiting;
5
- exports.useScenario = useScenario;
6
- const moyu_1 = require("../moyu");
7
- const react_1 = require("react");
8
- /** Advance to the next line in the current story. */
9
- function nextLine() {
10
- return (0, moyu_1.executePluginCommand)('scenario', { subCommand: 'nextLine' });
11
- }
12
- /** Set a timed wait, optionally skippable. */
13
- function setWaiting(time, skippable) {
14
- (0, moyu_1.executePluginCommand)('scenario', { subCommand: 'setWaiting', time, skippable });
15
- }
16
- /**
17
- * Custom hook to manage scenario lifecycle (load, start, terminate).
18
- *
19
- * @param {string[]} stories - An array of story names to load.
20
- * @param {string} [startName] - The name of the story to start.
21
- * @param {string} [entryName] - The entry point within the story to start from.
22
- * @param {boolean} [goNextOnLoad=false] - Whether to automatically advance to the next line after loading.
23
- */
24
- function useScenario(stories, startName, entryName, goNextOnLoad = false) {
25
- (0, react_1.useEffect)(() => {
26
- const loadScenario = async () => {
27
- for (const story of stories) {
28
- if (!story)
29
- continue;
30
- try {
31
- await (0, moyu_1.executePluginCommand)('scenario', {
32
- subCommand: 'addStory',
33
- name: story,
34
- });
35
- }
36
- catch (error) {
37
- console.error(`Failed to load scenario:`, error);
38
- }
39
- }
40
- };
41
- void loadScenario().then(async () => {
42
- try {
43
- if (startName) {
44
- await (0, moyu_1.executePluginCommand)('scenario', {
45
- subCommand: 'startStory',
46
- name: startName,
47
- entry: entryName,
48
- });
49
- }
50
- if (goNextOnLoad) {
51
- await nextLine();
52
- }
53
- }
54
- catch (error) {
55
- console.error(`Failed to start scenario ${startName}:`, error);
56
- }
57
- });
58
- return () => {
59
- (0, moyu_1.executePluginCommand)('scenario', {
60
- subCommand: 'terminateStory',
61
- });
62
- };
63
- }, [stories, startName, entryName, goNextOnLoad]);
64
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * Used to load a sound effect and provide a function to play it.
3
- */
4
- export declare function useSoundEffect(src: string): () => void;
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSoundEffect = useSoundEffect;
4
- const moyu_1 = require("../moyu");
5
- const react_1 = require("react");
6
- // avoid loading or releasing the same sound effect multiple times
7
- const LOADED_SOUNDS = new Set();
8
- /**
9
- * Used to load a sound effect and provide a function to play it.
10
- */
11
- function useSoundEffect(src) {
12
- (0, react_1.useEffect)(() => {
13
- // Load the sound effect when the component mounts
14
- const loadSound = async () => {
15
- try {
16
- await (0, moyu_1.executePluginCommand)('audio', {
17
- subCommand: 'load',
18
- name: src,
19
- src,
20
- });
21
- }
22
- catch (error) {
23
- console.error(`Failed to load sound effect ${src}:`, error);
24
- }
25
- LOADED_SOUNDS.add(src);
26
- };
27
- let needRelease = false;
28
- if (!LOADED_SOUNDS.has(src)) {
29
- void loadSound();
30
- needRelease = true;
31
- }
32
- // Cleanup function to unload the sound effect when the component unmounts
33
- return () => {
34
- const releaseSound = () => {
35
- try {
36
- (0, moyu_1.executePluginCommand)('audio', {
37
- subCommand: 'release',
38
- name: src,
39
- });
40
- }
41
- catch (error) {
42
- console.error(`Failed to release sound effect ${src}:`, error);
43
- }
44
- LOADED_SOUNDS.delete(src);
45
- };
46
- if (needRelease) {
47
- releaseSound();
48
- }
49
- };
50
- }, [src]);
51
- // Function to play the sound effect
52
- return (0, react_1.useCallback)(() => {
53
- try {
54
- (0, moyu_1.executePluginCommand)('audio', {
55
- subCommand: 'play',
56
- name: src,
57
- });
58
- }
59
- catch (error) {
60
- console.error(`Failed to play sound effect ${src}:`, error);
61
- }
62
- }, [src]);
63
- }
@@ -1,126 +0,0 @@
1
- import { ZodType } from 'zod';
2
- import { ResolvedCommandLine, TextLine } from '../events';
3
- /** Flow control interface passed to every handler. */
4
- export interface GameControl {
5
- /** Timed wait — blocks auto-advance. Engine fires scenariowaitingcancelled on timeout or skip. */
6
- setWaiting(time: number, skippable: boolean): void;
7
- /** Indefinite hold — blocks auto-advance until user action. */
8
- hold(): void;
9
- /** Manually advance (rarely needed, e.g. `!` tailing). */
10
- nextLine(): void;
11
- /** Mark this dispatch cycle as unskippable. If skipping, hold() will stop skip instead of advancing. */
12
- unskippable(): void;
13
- /** Record the current runtime snapshot for backlog usage. */
14
- record(meta: Record<string, any>): string;
15
- }
16
- export interface ScenarioCommandBaseType {
17
- command: string;
18
- [key: string]: unknown;
19
- }
20
- /** Command handler function. */
21
- export type CommandHandler<T extends ScenarioCommandBaseType = ScenarioCommandBaseType> = (cmd: T, control: GameControl) => void;
22
- /** Text line handler function. */
23
- export type TextLineHandler = (text: TextLine, control: GameControl) => void;
24
- export interface AutoTicketOptions {
25
- label?: string;
26
- tailMs?: number;
27
- }
28
- export interface AutoTicketHandle {
29
- done(): void;
30
- cancel(): void;
31
- }
32
- /** Reactive skip state. Actors read via useIsSkipping(). */
33
- export declare const skipState: {
34
- active: boolean;
35
- };
36
- /** Reactive auto state. Actors read via useIsAutoing(). */
37
- export declare const autoState: {
38
- active: boolean;
39
- };
40
- /** Reactively returns whether skip (Ctrl fast-forward) is active. */
41
- export declare function useIsSkipping(): boolean;
42
- /** Reactively returns whether auto mode is active. */
43
- export declare function useIsAutoing(): boolean;
44
- /** Set the default tail delay in milliseconds for newly created auto tickets. */
45
- export declare function setDefaultAutoTailMs(ms: number): void;
46
- export declare function createStage(): {
47
- registerCommandSchema: <T extends ZodType>(schema: T) => () => void;
48
- registerCommand: <T extends ScenarioCommandBaseType>(commands: string | string[], handler: CommandHandler<T>) => () => void;
49
- registerTextLine: (handler: TextLineHandler) => () => void;
50
- addSkipCallback: (cb: () => void) => () => void;
51
- addInterruptCallback: (cb: () => boolean) => () => void;
52
- addSkipBlocker: (cb: () => boolean) => () => void;
53
- addAutoBlocker: (cb: () => boolean) => () => void;
54
- addBeforeHandleCommandCallback: (cb: (upcomingCommand: ResolvedCommandLine) => void) => () => void;
55
- issueAutoTicket: (options?: AutoTicketOptions) => AutoTicketHandle | null;
56
- tryInterrupt: () => boolean;
57
- startSkip: () => void;
58
- stopSkip: () => void;
59
- isSkipping: () => boolean;
60
- startAuto: () => void;
61
- stopAuto: () => void;
62
- isAutoing: () => boolean;
63
- bindEvents: () => () => void;
64
- };
65
- export type StageInstance = ReturnType<typeof createStage>;
66
- /** Access the stage instance from within StageContextProvider. */
67
- export declare function useStageContext(): StageInstance;
68
- export declare function StageContextProvider({ stage, children }: {
69
- stage: StageInstance;
70
- children: React.ReactNode;
71
- }): import("react").FunctionComponentElement<import("react").ProviderProps<{
72
- registerCommandSchema: <T extends ZodType>(schema: T) => () => void;
73
- registerCommand: <T extends ScenarioCommandBaseType>(commands: string | string[], handler: CommandHandler<T>) => () => void;
74
- registerTextLine: (handler: TextLineHandler) => () => void;
75
- addSkipCallback: (cb: () => void) => () => void;
76
- addInterruptCallback: (cb: () => boolean) => () => void;
77
- addSkipBlocker: (cb: () => boolean) => () => void;
78
- addAutoBlocker: (cb: () => boolean) => () => void;
79
- addBeforeHandleCommandCallback: (cb: (upcomingCommand: ResolvedCommandLine) => void) => () => void;
80
- issueAutoTicket: (options?: AutoTicketOptions) => AutoTicketHandle | null;
81
- tryInterrupt: () => boolean;
82
- startSkip: () => void;
83
- stopSkip: () => void;
84
- isSkipping: () => boolean;
85
- startAuto: () => void;
86
- stopAuto: () => void;
87
- isAutoing: () => boolean;
88
- bindEvents: () => () => void;
89
- } | null>>;
90
- /**
91
- * Register a skip callback that fires when scenariowaitingcancelled is received.
92
- * Automatically removed on unmount.
93
- */
94
- export declare function useSkipCallback(callback: () => void): void;
95
- /**
96
- * Register an interrupt callback for user click handling.
97
- * Return `true` from the callback to consume the click.
98
- * Automatically removed on unmount.
99
- */
100
- export declare function useInterruptCallback(callback: () => boolean): void;
101
- /**
102
- * Register a skip blocker callback. Return `true` to block skipping.
103
- * When any blocker is active, skip mode cannot start or will be stopped.
104
- * Automatically removed on unmount.
105
- *
106
- * NOTE: `callback` must be a stable reference (wrap with `useCallback`).
107
- */
108
- export declare function useSkipBlocker(callback: () => boolean): void;
109
- /**
110
- * Register an auto blocker callback. Return `true` to block auto mode.
111
- * Automatically removed on unmount.
112
- *
113
- * NOTE: `callback` must be a stable reference (wrap with `useCallback`).
114
- */
115
- export declare function useAutoBlocker(callback: () => boolean): void;
116
- /**
117
- * Get a function that issues an auto ticket for the current active barrier.
118
- * Returns `null` when auto is inactive or the collection window has closed.
119
- */
120
- export declare function useAutoTicket(): (options?: AutoTicketOptions) => AutoTicketHandle | null;
121
- /**
122
- * Register a callback to be invoked before handling each command.
123
- * The callback receives the upcoming command object, allowing conditional logic.
124
- * Automatically removed on unmount.
125
- */
126
- export declare function useBeforeHandleCommandCallback(callback: (upcomingCommand: ResolvedCommandLine) => void): void;