import { E as kittyModifiers, S as KittyKeyboardOptions, T as kittyFlags, a as MountOptions, b as KittyFlagName, n as renderToString, o as TuiApp, s as createApp, t as RenderToStringOptions } from "./render-to-string-WECUP9vJ.mjs"; import * as _$vue from "vue"; import { ExtractPublicPropTypes, MaybeRef, MaybeRefOrGetter, PropType, Ref, ShallowRef, VNode, VNodeChild } from "vue"; import cliBoxes from "cli-boxes"; import * as _$_vue_runtime_core0 from "@vue/runtime-core"; //#region src/components/box-props.d.ts type Spacing = number; type FlexDirection = "row" | "row-reverse" | "column" | "column-reverse"; type FlexWrap = "nowrap" | "wrap" | "wrap-reverse"; type Align = "flex-start" | "center" | "flex-end" | "stretch" | "baseline"; type AlignSelf = "auto" | "flex-start" | "center" | "flex-end" | "stretch" | "baseline"; type AlignContent = "flex-start" | "center" | "flex-end" | "stretch" | "space-between" | "space-around" | "space-evenly"; type Justify = "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly"; type BorderStyle = "single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic" | "arrow"; type BoxStyle = (typeof cliBoxes)[keyof cliBoxes.Boxes]; type BoxLayoutStyle = Pick; type AriaRole = "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar"; interface AriaState { busy?: boolean; checked?: boolean; disabled?: boolean; expanded?: boolean; multiline?: boolean; multiselectable?: boolean; readonly?: boolean; required?: boolean; selected?: boolean; } declare const boxProps: { flexDirection: PropType; flexGrow: NumberConstructor; flexShrink: NumberConstructor; flexBasis: (StringConstructor | NumberConstructor)[]; flexWrap: PropType; alignItems: PropType; alignSelf: PropType; justifyContent: PropType; gap: NumberConstructor; columnGap: NumberConstructor; rowGap: NumberConstructor; width: (StringConstructor | NumberConstructor)[]; height: (StringConstructor | NumberConstructor)[]; minWidth: (StringConstructor | NumberConstructor)[]; minHeight: (StringConstructor | NumberConstructor)[]; maxWidth: (StringConstructor | NumberConstructor)[]; maxHeight: (StringConstructor | NumberConstructor)[]; aspectRatio: NumberConstructor; alignContent: PropType; position: PropType<"absolute" | "relative" | "static">; top: (StringConstructor | NumberConstructor)[]; right: (StringConstructor | NumberConstructor)[]; bottom: (StringConstructor | NumberConstructor)[]; left: (StringConstructor | NumberConstructor)[]; margin: PropType; marginX: NumberConstructor; marginY: NumberConstructor; marginTop: NumberConstructor; marginBottom: NumberConstructor; marginLeft: NumberConstructor; marginRight: NumberConstructor; padding: NumberConstructor; paddingX: NumberConstructor; paddingY: NumberConstructor; paddingTop: NumberConstructor; paddingBottom: NumberConstructor; paddingLeft: NumberConstructor; paddingRight: NumberConstructor; borderStyle: PropType; borderColor: StringConstructor; borderDimColor: { type: PropType; default: undefined; }; borderTopDimColor: { type: PropType; default: undefined; }; borderBottomDimColor: { type: PropType; default: undefined; }; borderLeftDimColor: { type: PropType; default: undefined; }; borderRightDimColor: { type: PropType; default: undefined; }; borderTop: { type: BooleanConstructor; default: boolean; }; borderBottom: { type: BooleanConstructor; default: boolean; }; borderLeft: { type: BooleanConstructor; default: boolean; }; borderRight: { type: BooleanConstructor; default: boolean; }; borderTopColor: StringConstructor; borderBottomColor: StringConstructor; borderLeftColor: StringConstructor; borderRightColor: StringConstructor; borderBackgroundColor: StringConstructor; borderTopBackgroundColor: StringConstructor; borderBottomBackgroundColor: StringConstructor; borderLeftBackgroundColor: StringConstructor; borderRightBackgroundColor: StringConstructor; backgroundColor: StringConstructor; overflow: PropType<"visible" | "hidden">; overflowX: PropType<"visible" | "hidden">; overflowY: PropType<"visible" | "hidden">; display: PropType<"flex" | "none">; ariaLabel: StringConstructor; ariaHidden: BooleanConstructor; ariaRole: PropType; ariaState: PropType; }; /** Props accepted by `` — the vue-tui analogue of Ink's `BoxProps`. */ type BoxProps = ExtractPublicPropTypes; //#endregion //#region src/components/box.vue.d.ts type __VLS_Slots$1 = { default?: () => unknown; }; declare const __VLS_base$1: _$_vue_runtime_core0.DefineComponent<_$_vue_runtime_core0.ExtractPropTypes<{ flexDirection: _$_vue_runtime_core0.PropType<"row" | "row-reverse" | "column" | "column-reverse">; flexGrow: NumberConstructor; flexShrink: NumberConstructor; flexBasis: (StringConstructor | NumberConstructor)[]; flexWrap: _$_vue_runtime_core0.PropType<"nowrap" | "wrap" | "wrap-reverse">; alignItems: _$_vue_runtime_core0.PropType<"flex-start" | "center" | "flex-end" | "stretch" | "baseline">; alignSelf: _$_vue_runtime_core0.PropType<"flex-start" | "center" | "flex-end" | "stretch" | "baseline" | "auto">; justifyContent: _$_vue_runtime_core0.PropType<"flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly">; gap: NumberConstructor; columnGap: NumberConstructor; rowGap: NumberConstructor; width: (StringConstructor | NumberConstructor)[]; height: (StringConstructor | NumberConstructor)[]; minWidth: (StringConstructor | NumberConstructor)[]; minHeight: (StringConstructor | NumberConstructor)[]; maxWidth: (StringConstructor | NumberConstructor)[]; maxHeight: (StringConstructor | NumberConstructor)[]; aspectRatio: NumberConstructor; alignContent: _$_vue_runtime_core0.PropType<"flex-start" | "center" | "flex-end" | "stretch" | "space-between" | "space-around" | "space-evenly">; position: _$_vue_runtime_core0.PropType<"absolute" | "relative" | "static">; top: (StringConstructor | NumberConstructor)[]; right: (StringConstructor | NumberConstructor)[]; bottom: (StringConstructor | NumberConstructor)[]; left: (StringConstructor | NumberConstructor)[]; margin: _$_vue_runtime_core0.PropType; marginX: NumberConstructor; marginY: NumberConstructor; marginTop: NumberConstructor; marginBottom: NumberConstructor; marginLeft: NumberConstructor; marginRight: NumberConstructor; padding: NumberConstructor; paddingX: NumberConstructor; paddingY: NumberConstructor; paddingTop: NumberConstructor; paddingBottom: NumberConstructor; paddingLeft: NumberConstructor; paddingRight: NumberConstructor; borderStyle: _$_vue_runtime_core0.PropType<("single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic" | "arrow") | BoxStyle>; borderColor: StringConstructor; borderDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderTopDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderBottomDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderLeftDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderRightDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderTop: { type: BooleanConstructor; default: boolean; }; borderBottom: { type: BooleanConstructor; default: boolean; }; borderLeft: { type: BooleanConstructor; default: boolean; }; borderRight: { type: BooleanConstructor; default: boolean; }; borderTopColor: StringConstructor; borderBottomColor: StringConstructor; borderLeftColor: StringConstructor; borderRightColor: StringConstructor; borderBackgroundColor: StringConstructor; borderTopBackgroundColor: StringConstructor; borderBottomBackgroundColor: StringConstructor; borderLeftBackgroundColor: StringConstructor; borderRightBackgroundColor: StringConstructor; backgroundColor: StringConstructor; overflow: _$_vue_runtime_core0.PropType<"visible" | "hidden">; overflowX: _$_vue_runtime_core0.PropType<"visible" | "hidden">; overflowY: _$_vue_runtime_core0.PropType<"visible" | "hidden">; display: _$_vue_runtime_core0.PropType<"flex" | "none">; ariaLabel: StringConstructor; ariaHidden: BooleanConstructor; ariaRole: _$_vue_runtime_core0.PropType; ariaState: _$_vue_runtime_core0.PropType; }>, {}, {}, {}, {}, _$_vue_runtime_core0.ComponentOptionsMixin, _$_vue_runtime_core0.ComponentOptionsMixin, {}, string, _$_vue_runtime_core0.PublicProps, Readonly<_$_vue_runtime_core0.ExtractPropTypes<{ flexDirection: _$_vue_runtime_core0.PropType<"row" | "row-reverse" | "column" | "column-reverse">; flexGrow: NumberConstructor; flexShrink: NumberConstructor; flexBasis: (StringConstructor | NumberConstructor)[]; flexWrap: _$_vue_runtime_core0.PropType<"nowrap" | "wrap" | "wrap-reverse">; alignItems: _$_vue_runtime_core0.PropType<"flex-start" | "center" | "flex-end" | "stretch" | "baseline">; alignSelf: _$_vue_runtime_core0.PropType<"flex-start" | "center" | "flex-end" | "stretch" | "baseline" | "auto">; justifyContent: _$_vue_runtime_core0.PropType<"flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly">; gap: NumberConstructor; columnGap: NumberConstructor; rowGap: NumberConstructor; width: (StringConstructor | NumberConstructor)[]; height: (StringConstructor | NumberConstructor)[]; minWidth: (StringConstructor | NumberConstructor)[]; minHeight: (StringConstructor | NumberConstructor)[]; maxWidth: (StringConstructor | NumberConstructor)[]; maxHeight: (StringConstructor | NumberConstructor)[]; aspectRatio: NumberConstructor; alignContent: _$_vue_runtime_core0.PropType<"flex-start" | "center" | "flex-end" | "stretch" | "space-between" | "space-around" | "space-evenly">; position: _$_vue_runtime_core0.PropType<"absolute" | "relative" | "static">; top: (StringConstructor | NumberConstructor)[]; right: (StringConstructor | NumberConstructor)[]; bottom: (StringConstructor | NumberConstructor)[]; left: (StringConstructor | NumberConstructor)[]; margin: _$_vue_runtime_core0.PropType; marginX: NumberConstructor; marginY: NumberConstructor; marginTop: NumberConstructor; marginBottom: NumberConstructor; marginLeft: NumberConstructor; marginRight: NumberConstructor; padding: NumberConstructor; paddingX: NumberConstructor; paddingY: NumberConstructor; paddingTop: NumberConstructor; paddingBottom: NumberConstructor; paddingLeft: NumberConstructor; paddingRight: NumberConstructor; borderStyle: _$_vue_runtime_core0.PropType<("single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic" | "arrow") | BoxStyle>; borderColor: StringConstructor; borderDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderTopDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderBottomDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderLeftDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderRightDimColor: { type: _$_vue_runtime_core0.PropType; default: undefined; }; borderTop: { type: BooleanConstructor; default: boolean; }; borderBottom: { type: BooleanConstructor; default: boolean; }; borderLeft: { type: BooleanConstructor; default: boolean; }; borderRight: { type: BooleanConstructor; default: boolean; }; borderTopColor: StringConstructor; borderBottomColor: StringConstructor; borderLeftColor: StringConstructor; borderRightColor: StringConstructor; borderBackgroundColor: StringConstructor; borderTopBackgroundColor: StringConstructor; borderBottomBackgroundColor: StringConstructor; borderLeftBackgroundColor: StringConstructor; borderRightBackgroundColor: StringConstructor; backgroundColor: StringConstructor; overflow: _$_vue_runtime_core0.PropType<"visible" | "hidden">; overflowX: _$_vue_runtime_core0.PropType<"visible" | "hidden">; overflowY: _$_vue_runtime_core0.PropType<"visible" | "hidden">; display: _$_vue_runtime_core0.PropType<"flex" | "none">; ariaLabel: StringConstructor; ariaHidden: BooleanConstructor; ariaRole: _$_vue_runtime_core0.PropType; ariaState: _$_vue_runtime_core0.PropType; }>> & Readonly<{}>, { borderDimColor: boolean | undefined; borderTopDimColor: boolean | undefined; borderBottomDimColor: boolean | undefined; borderLeftDimColor: boolean | undefined; borderRightDimColor: boolean | undefined; borderTop: boolean; borderBottom: boolean; borderLeft: boolean; borderRight: boolean; ariaHidden: boolean; }, {}, {}, {}, string, _$_vue_runtime_core0.ComponentProvideOptions, true, {}, any>; declare const __VLS_export$2: __VLS_WithSlots$1; declare const _default$2: typeof __VLS_export$2; type __VLS_WithSlots$1 = T & { new (): { $slots: S; }; }; //#endregion //#region src/components/text.vue.d.ts type __VLS_Slots = { default?: () => unknown; }; declare const __VLS_base: _$_vue_runtime_core0.DefineComponent<_$_vue_runtime_core0.ExtractPropTypes<{ color: StringConstructor; backgroundColor: StringConstructor; dimColor: BooleanConstructor; bold: BooleanConstructor; italic: BooleanConstructor; underline: BooleanConstructor; strikethrough: BooleanConstructor; inverse: BooleanConstructor; wrap: { type: _$_vue_runtime_core0.PropType<"wrap" | "hard" | "truncate" | "truncate-end" | "truncate-middle" | "truncate-start">; default: string; }; ariaLabel: StringConstructor; ariaHidden: BooleanConstructor; }>, {}, {}, {}, {}, _$_vue_runtime_core0.ComponentOptionsMixin, _$_vue_runtime_core0.ComponentOptionsMixin, {}, string, _$_vue_runtime_core0.PublicProps, Readonly<_$_vue_runtime_core0.ExtractPropTypes<{ color: StringConstructor; backgroundColor: StringConstructor; dimColor: BooleanConstructor; bold: BooleanConstructor; italic: BooleanConstructor; underline: BooleanConstructor; strikethrough: BooleanConstructor; inverse: BooleanConstructor; wrap: { type: _$_vue_runtime_core0.PropType<"wrap" | "hard" | "truncate" | "truncate-end" | "truncate-middle" | "truncate-start">; default: string; }; ariaLabel: StringConstructor; ariaHidden: BooleanConstructor; }>> & Readonly<{}>, { wrap: "wrap" | "hard" | "truncate" | "truncate-end" | "truncate-middle" | "truncate-start"; bold: boolean; ariaHidden: boolean; dimColor: boolean; italic: boolean; underline: boolean; strikethrough: boolean; inverse: boolean; }, {}, {}, {}, string, _$_vue_runtime_core0.ComponentProvideOptions, true, {}, any>; declare const __VLS_export$1: __VLS_WithSlots; declare const _default$1: typeof __VLS_export$1; type __VLS_WithSlots = T & { new (): { $slots: S; }; }; //#endregion //#region src/components/with-children.d.ts type DefaultSlot = () => VNodeChild; type DefaultChildren = VNodeChild | DefaultSlot | { default: DefaultSlot; }; /** * Adds an optional `children` prop to a component's JSX `$props` so that TSX * written under the automatic runtime (`jsx: "react-jsx"` + `jsxImportSource: * "vue"`) accepts child content. Vue's JSX namespace defines no * `ElementChildrenAttribute`, so the automatic runtime passes children as a * `children` prop — which must be present on `$props` to type-check. Vue routes * that prop to the default slot at runtime, so this is a type-only shim with no * runtime effect. */ type WithChildren = C & { new (): { $props: { children?: T; }; }; }; //#endregion //#region src/components/static-props.d.ts /** The `{ item, index }` object a `` scoped slot receives per item. */ interface StaticSlotProps { item: T; index: number; } /** A `` default scoped slot: rendered once per item. */ type StaticSlot = (props: StaticSlotProps) => VNodeChild; /** Accepted `` children: a bare scoped slot or a `{ default }` slot object. */ type StaticChildren = StaticSlot | { default: StaticSlot; }; /** ``'s `style` surface — the same layout style keys a `` accepts. */ type StaticStyle = BoxLayoutStyle; declare const staticProps: { items: { type: PropType; required: true; }; style: { type: PropType; default: undefined; }; }; type StaticBaseProps = ExtractPublicPropTypes; /** * Props accepted by `` — the vue-tui analogue of Ink's `StaticProps`. * Generic over the item type so `items: T[]` flows into the scoped slot's `item`. */ type StaticProps = Omit & { items: T[]; }; //#endregion //#region src/components/spacer-props.d.ts declare const spacerProps: {}; /** Props accepted by `` — the vue-tui analogue of Ink's `SpacerProps`. */ type SpacerProps = ExtractPublicPropTypes; //#endregion //#region src/components/text-props.d.ts type WrapMode = "wrap" | "hard" | "truncate" | "truncate-end" | "truncate-middle" | "truncate-start"; declare const textProps: { color: StringConstructor; backgroundColor: StringConstructor; dimColor: BooleanConstructor; bold: BooleanConstructor; italic: BooleanConstructor; underline: BooleanConstructor; strikethrough: BooleanConstructor; inverse: BooleanConstructor; wrap: { type: PropType; default: string; }; ariaLabel: StringConstructor; ariaHidden: BooleanConstructor; }; /** Props accepted by `` — the vue-tui analogue of Ink's `TextProps`. */ type TextProps = ExtractPublicPropTypes; //#endregion //#region src/components/newline.vue.d.ts declare const __VLS_export: _$_vue_runtime_core0.DefineComponent<_$_vue_runtime_core0.ExtractPropTypes<{ count: { type: NumberConstructor; default: number; }; }>, {}, {}, {}, {}, _$_vue_runtime_core0.ComponentOptionsMixin, _$_vue_runtime_core0.ComponentOptionsMixin, {}, string, _$_vue_runtime_core0.PublicProps, Readonly<_$_vue_runtime_core0.ExtractPropTypes<{ count: { type: NumberConstructor; default: number; }; }>> & Readonly<{}>, { count: number; }, {}, {}, {}, string, _$_vue_runtime_core0.ComponentProvideOptions, true, {}, any>; declare const _default: typeof __VLS_export; //#endregion //#region src/components/newline-props.d.ts declare const newlineProps: { count: { type: NumberConstructor; default: number; }; }; /** Props accepted by `` — the vue-tui analogue of Ink's `NewlineProps`. */ type NewlineProps = ExtractPublicPropTypes; //#endregion //#region src/components/transform.d.ts type TransformFn = (line: string, lineIndex: number) => string; declare const transformProps: { transform: { type: PropType; required: true; }; accessibilityLabel: StringConstructor; }; declare const TransformImpl: _$vue.DefineComponent<_$vue.ExtractPropTypes<{ transform: { type: PropType; required: true; }; accessibilityLabel: StringConstructor; }>, () => VNode<_$vue.RendererNode, _$vue.RendererElement, { [key: string]: any; }> | null, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{ transform: { type: PropType; required: true; }; accessibilityLabel: StringConstructor; }>> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>; declare const Transform: WithChildren; /** Props accepted by `` — the vue-tui analogue of Ink's `TransformProps`. */ type TransformProps = ExtractPublicPropTypes; //#endregion //#region src/composables/useApp.d.ts /** The public app-lifecycle surface returned by {@link useApp}. Mirrors Ink's `useApp()`. */ interface UseAppReturn { readonly exit: (errorOrResult?: unknown) => void; readonly waitUntilRenderFlush: () => Promise; } /** * Returns app-level lifecycle controls for a component inside the render tree: * * - `exit(error?)` — end the app. Pass an `Error` to reject `app.waitUntilExit()` * (and any awaiter); pass any other value to resolve with it as the result; * call with no args to resolve with `undefined`. * - `waitUntilRenderFlush()` — resolve once the next frame has been committed and * flushed to the output stream. * * Mirrors Ink's `useApp()`. Streams are reached through the dedicated peer * composables (`useStdin`, `useStdout`, `useStderr`), exactly as in Ink. */ declare function useApp(): UseAppReturn; //#endregion //#region src/composables/useInput.d.ts interface Key { upArrow: boolean; downArrow: boolean; leftArrow: boolean; rightArrow: boolean; pageDown: boolean; pageUp: boolean; home: boolean; end: boolean; return: boolean; escape: boolean; ctrl: boolean; shift: boolean; tab: boolean; backspace: boolean; delete: boolean; meta: boolean; super: boolean; hyper: boolean; capsLock: boolean; numLock: boolean; eventType?: "press" | "repeat" | "release"; } interface UseInputOptions { isActive?: MaybeRefOrGetter; } type InputHandler = (input: string, key: Key) => void; declare function useInput(handler: MaybeRef, options?: UseInputOptions): void; //#endregion //#region src/composables/usePaste.d.ts interface UsePasteOptions { isActive?: MaybeRefOrGetter; } type PasteHandler = (text: string) => void; declare function usePaste(handler: MaybeRef, options?: UsePasteOptions): void; //#endregion //#region src/composables/useFocus.d.ts interface UseFocusOptions { autoFocus?: MaybeRefOrGetter; isActive?: MaybeRefOrGetter; id?: MaybeRefOrGetter; } declare function useFocus(options?: UseFocusOptions): { isFocused: ShallowRef; focus: (id: string) => void; }; //#endregion //#region src/composables/useFocusManager.d.ts declare function useFocusManager(): { enableFocus: () => void; disableFocus: () => void; focusNext: () => void; focusPrevious: () => void; focus: (id: string) => void; activeId: ShallowRef; }; //#endregion //#region src/composables/useStdin.d.ts /** * The public stdin surface returned by {@link useStdin}. Mirrors Ink's `useStdin()`, * which returns its `PublicProps` — not the full context. The raw-mode ref-counting * primitives and the paste/event-emitter plumbing on the internal `StdinContext` are * reached by the framework's own composables (`useInput` / `useFocus` / `usePaste`) via * `inject(StdinContextKey)`, and are deliberately not part of this public surface. */ interface UseStdinReturn { readonly stdin: NodeJS.ReadStream; readonly setRawMode: (mode: boolean) => void; readonly isRawModeSupported: boolean; } declare function useStdin(): UseStdinReturn; //#endregion //#region src/composables/useStdout.d.ts /** The public stdout surface returned by {@link useStdout}. Mirrors Ink's `useStdout()`. */ interface UseStdoutReturn { readonly stdout: NodeJS.WriteStream; readonly write: (data: string) => void; } declare function useStdout(): UseStdoutReturn; //#endregion //#region src/composables/useStderr.d.ts /** The public stderr surface returned by {@link useStderr}. Mirrors Ink's `useStderr()`. */ interface UseStderrReturn { readonly stderr: NodeJS.WriteStream; readonly write: (data: string) => void; } declare function useStderr(): UseStderrReturn; //#endregion //#region src/composables/useWindowSize.d.ts /** * A terminal's character-cell dimensions. Mirrors Ink's `WindowSize` exactly * (`columns`/`rows`, not `width`/`height`). * * Note the Vue-vs-React shape: Ink's `useWindowSize()` returns a `WindowSize` * snapshot, whereas vue-tui's `useWindowSize()` returns reactive **refs** of * these dimensions * (`{ columns: ShallowRef; rows: ShallowRef }`). The data shape * is the same; the reactivity wrapper is the framework difference. */ interface WindowSize { readonly columns: number; readonly rows: number; } declare function useWindowSize(): { columns: ShallowRef; rows: ShallowRef; }; //#endregion //#region src/composables/useCursor.d.ts /** * A cursor position in output-origin coordinates. Mirrors Ink's `CursorPosition`. */ interface CursorPosition { x: number; y: number; } /** * Returns `setCursorPosition` so a component can control the terminal cursor. * * Setting a position makes the cursor visible at the given coordinates * (relative to the output origin). Pass `undefined` to hide the cursor. * * The declared position **persists**: the runtime re-asserts it at the end of * every frame, so the caret stays put across unrelated repaints (a spinner tick, * a log line) until you set a new position or clear it — you do not need to * re-set it on every render. The position is automatically cleared when the * component unmounts. */ declare function useCursor(): { setCursorPosition: (position: CursorPosition | undefined) => void; }; //#endregion //#region src/composables/useIsScreenReaderEnabled.d.ts declare function useIsScreenReaderEnabled(): boolean; //#endregion //#region src/composables/useAnimation.d.ts interface UseAnimationOptions { /** * Time between ticks in milliseconds. * * Reactive: pass a ref/getter to change the interval on a live animation. * While ACTIVE, changing it resets `frame`/`time`/`delta` to `0` and * re-subscribes at the new interval (Ink parity — `shouldReset` recomputes * `safeInterval` every render and resets when it differs while active). * While INACTIVE, the new value is recorded but nothing resets and no timer * starts; it takes effect on the next activation. A plain `number` keeps the * previous fixed behavior (the type is a strict superset). * @default 100 */ interval?: MaybeRefOrGetter; /** * Whether the animation is running. When set to `false`, the animation stops. * When toggled back to `true`, all values reset to `0`. * @default true */ isActive?: MaybeRefOrGetter; } interface UseAnimationReturn { /** * Discrete counter that increments by 1 each interval. * Useful for indexed sequences like spinner frames. */ readonly frame: Readonly>; /** * Total elapsed time in milliseconds since the animation started or was last reset. * Useful for continuous math-based animations like sine waves. */ readonly time: Readonly>; /** * Time in milliseconds since the previous tick. * Accounts for throttled renders. Useful for physics-based or velocity-driven motion. */ readonly delta: Readonly>; /** * Resets `frame`, `time`, and `delta` to `0` and restarts timing from the * current moment. Useful for one-shot animations triggered by events. * * While the animation is INACTIVE (paused via `isActive`), `reset()` keeps the * last frame frozen instead of zeroing immediately; the zeroing is deferred to * the next resume (Ink parity — Ink's reset bumps a key consumed only by the * isActive-gated effect, so a paused reset zeros on resume, not before). */ readonly reset: () => void; } /** * A composable that drives animations. Returns a frame counter, elapsed time, * frame delta, and a reset function. * * @example * ```vue * * * ``` */ declare function useAnimation(options?: UseAnimationOptions): UseAnimationReturn; //#endregion //#region src/composables/useBoxMetrics.d.ts interface BoxMetrics { /** Element width. */ readonly width: number; /** Element height. */ readonly height: number; /** Distance from the left edge of the parent. */ readonly left: number; /** Distance from the top edge of the parent. */ readonly top: number; } interface UseBoxMetricsReturn { /** Reactive element width. */ readonly width: ShallowRef; /** Reactive element height. */ readonly height: ShallowRef; /** Reactive distance from the left edge of the parent. */ readonly left: ShallowRef; /** Reactive distance from the top edge of the parent. */ readonly top: ShallowRef; /** Whether the currently tracked element has been measured in the latest layout pass. */ readonly hasMeasured: ShallowRef; } /** * Imperative function that reads yoga computed dimensions from a TUI node. * * Returns `{ width: 0, height: 0 }` when the ref is not attached to an element, * and also as a safe fallback when the node's computed dimension is non-finite — * i.e. it has a yoga node but has not been through a layout pass yet (yoga * reports `NaN` pre-layout). `0` here is a sentinel meaning "not yet computed", * NOT the box's true size; the correct pattern is to read *after* layout (see the * timing note below). * * Timing matters: layout is computed inside the commit scheduler's post-flush * callback, which can run *after* your own `watchPostEffect`/render-time code in * the same flush. A bare `measureElement()` called there reads layout that has * not been recalculated yet, so it does not return the current size. Read it * only *after* the layout commit: * - wrap the read in `nextTick(() => measureElement(ref.value))` (the pattern * {@link useBoxMetrics} itself uses), or * - call it from an input handler or timer callback that fires after a flush. * * For reactive metrics that stay in sync across renders and resizes, prefer * {@link useBoxMetrics}, which handles this timing for you. * * @example * ```tsx * const boxRef = ref(null); * watchPostEffect(() => { * // Defer the read so it runs after layout is committed. * void nextTick(() => { * const { width } = measureElement(boxRef.value); * }); * }); * ``` */ declare function measureElement(node: unknown): { width: number; height: number; }; /** * Reactive composable that returns computed layout metrics for a tracked box element. * Updates after each render commit when yoga layout has been calculated. * * Subscribes to the root node's layout listener so metrics update on terminal * resize and sibling layout changes, even when the tracked ref doesn't change. * Matches Ink's useBoxMetrics architecture. * * Returns `{ width, height, left, top, hasMeasured }` where all values are * reactive refs. `hasMeasured` starts `false` and becomes `true` after the * first layout pass. * * @example * ```tsx * const boxRef = ref(null); * const { width, height, left, top, hasMeasured } = useBoxMetrics(boxRef); * return () => ( * * {hasMeasured.value ? `${width.value}x${height.value}` : "Measuring..."} * * ); * ``` */ declare function useBoxMetrics(ref: Ref): UseBoxMetricsReturn; //#endregion //#region src/index.d.ts declare const Box: WithChildren; declare const Text: WithChildren; declare const Spacer: { new (): { $props: SpacerProps & { children?: never; }; }; }; declare const Static: { new (): { $props: StaticProps & { children?: StaticChildren; }; $slots: { default?: StaticSlot; }; }; }; //#endregion export { type AriaRole, type AriaState, Box, type BoxLayoutStyle, type BoxMetrics, type BoxProps, type BoxStyle, type CursorPosition, type Key, type KittyFlagName, type KittyKeyboardOptions, type MountOptions, _default as Newline, type NewlineProps, type RenderToStringOptions, Spacer, type SpacerProps, Static, type StaticChildren, type StaticProps, type StaticSlot, type StaticSlotProps, type StaticStyle, Text, type TextProps, Transform, type TransformProps, type TuiApp, type UseAnimationOptions, type UseAnimationReturn, type UseAppReturn, type UseBoxMetricsReturn, type UseFocusOptions, type UseInputOptions, type UsePasteOptions, type UseStderrReturn, type UseStdinReturn, type UseStdoutReturn, type WindowSize, createApp, kittyFlags, kittyModifiers, measureElement, renderToString, useAnimation, useApp, useBoxMetrics, useCursor, useFocus, useFocusManager, useInput, useIsScreenReaderEnabled, usePaste, useStderr, useStdin, useStdout, useWindowSize };