import { LeoIconMotionState } from '../components/ui/leo-icon.js'; import 'react/jsx-runtime'; import 'react'; type LeoGenerationState = "inited" | "thinking" | "completed"; declare const LEO_GENERATION_LABEL: Record; /** Leo mark gesture for each lifecycle state. `inited` plays on mount. */ declare const LEO_GENERATION_ICON_STATE: Record; interface UseLeoGenerationOptions { /** How long `inited` holds before thinking begins. Default 1200ms. */ initedMs?: number; /** How long the lone check holds before the placeholder leaves. Default 900ms. */ doneMs?: number; /** How long `thinking` runs when using `run()`. Default 3000ms. */ thinkingMs?: number; } declare function useLeoGeneration({ initedMs, thinkingMs, doneMs }?: UseLeoGenerationOptions): { /** `null` when Leo is not generating. */ state: LeoGenerationState | null; isActive: boolean; /** True once a `run()` has finished: the placeholder is gone, show the data. */ delivered: boolean; set: (next: LeoGenerationState | null) => void; run: () => void; /** True after `stop()`; cleared by the next `run()` or `set()`. */ stopped: boolean; /** Cancels an in-flight generation. Nothing is delivered. */ stop: () => void; reset: () => void; }; /** * One parent generation that creates several children (a dashboard that is * three charts, a table that gains five rows). Each child runs the same * lifecycle; the parent's state is derived from them. * * Parent state while running: * any child thinking → `thinking` * else any child waiting/inited → `inited` * else (all remaining completed)→ `completed` * When every child is delivered or stopped, the run ends: `parent.state` is * `null` and `parent.delivered` is true. * * Stopping the parent stops every child that has not been delivered yet. * Stopping a child leaves its siblings running. */ interface LeoChildStatus { id: string; /** `null` while waiting its turn, and again after delivery or a stop. */ state: LeoGenerationState | null; delivered: boolean; stopped: boolean; /** Waiting to start (run in progress, this child not begun). */ pending: boolean; } interface UseLeoGenerationGroupOptions extends UseLeoGenerationOptions { /** Delay between one child starting and the next. Default 900ms. */ staggerMs?: number; } declare function useLeoGenerationGroup(childIds: readonly string[], { initedMs, thinkingMs, doneMs, staggerMs }?: UseLeoGenerationGroupOptions): { parent: { state: LeoGenerationState | null; /** A run finished with at least one child delivered. */ delivered: boolean; running: boolean; stopped: boolean; }; children: LeoChildStatus[]; run: () => void; stop: () => void; stopChild: (id: string) => void; }; export { LEO_GENERATION_ICON_STATE, LEO_GENERATION_LABEL, type LeoChildStatus, type LeoGenerationState, type UseLeoGenerationGroupOptions, type UseLeoGenerationOptions, useLeoGeneration, useLeoGenerationGroup };