import { App, Component, ComponentOptions, ComponentPublicInstance, DeepReadonly, Directive, InjectionKey, Plugin } from "vue"; import { ChalkInstance } from "chalk"; import { Readable, Writable } from "node:stream"; //#region src/color-profile.d.ts /** * A fixed colored-terminal capability for one render session. * * - Boolean `color` values select automatic or plain output; profiles force a precise capability. * - Profiles constrain component styles and SGR already present in rendered text. * * @example Force 256-color output for one mount * ```ts * const color: ColorProfile = "ansi256"; * app.mount({ color }); * ``` * * @example Force truecolor detached output * ```ts * const output = renderToString(Report, { color: "truecolor" }); * ``` */ type ColorProfile = "ansi16" | "ansi256" | "truecolor"; //#endregion //#region src/paint/terminal-style.d.ts type ColorLevel = 0 | 1 | 2 | 3; /** Resolved, session-owned text styling capability. */ interface TerminalStyle { /** Maximum color capability. May be zero while non-color attributes remain enabled. */ readonly colorLevel: ColorLevel; readonly chalk: ChalkInstance; /** Stable identity for paint caches whose bytes depend on this capability. */ readonly cacheKey: string; } //#endregion //#region src/terminal-size-probe.d.ts type TerminalSizeProbeSource = "process-stdout" | "process-stderr" | "environment" | "controlling-tty" | "tput" | "resize"; type TerminalSizeProbeResult = { readonly kind: "detected"; readonly size: { readonly columns: number; readonly rows: number; }; readonly source: TerminalSizeProbeSource; } | { readonly kind: "unavailable"; }; /** Test-only mount seam for deterministic live-host resolution. */ declare const INTERNAL_TERMINAL_SIZE_PROBE: unique symbol; type TerminalSizeProbe = () => TerminalSizeProbeResult; //#endregion //#region src/render-session.d.ts /** The terminal screen model requested when an application mounts. */ type RenderMode = "inline" | "fullscreen"; /** A terminal or deliberately modeled terminal's character-cell dimensions. */ interface RenderSize { readonly columns: number; readonly rows: number; } /** The root area the renderer promises to lay out. `rows: null` is unbounded. */ interface RenderLayoutSize { readonly columns: number; readonly rows: number | null; } interface RenderDimensions { readonly terminal: RenderSize | null; readonly layout: RenderLayoutSize; } type ResolvedLiveDimensions = RenderDimensions; /** * Reactive root-layout dimensions for one mounted live render tree. * Live vs document behavior is derived from the resolved surface kind, not from * snapshot host/mode/output mirrors. */ interface InternalLiveRenderSessionSnapshot { readonly dimensions: RenderDimensions; } /** Fixed dimensions for one synchronous string render tree. */ interface InternalStringRenderSessionSnapshot { readonly dimensions: { readonly terminal: null; readonly layout: RenderLayoutSize; }; } type InternalRenderSessionSnapshot = InternalLiveRenderSessionSnapshot | InternalStringRenderSessionSnapshot; interface InternalRenderSessionServiceBase { readonly session: DeepReadonly; readonly terminalStyle: TerminalStyle; dispose(): void; } interface InternalLiveRenderSessionService extends InternalRenderSessionServiceBase { readonly session: DeepReadonly; updateDimensions(next: ResolvedLiveDimensions): void; } interface InternalStringRenderSessionService extends InternalRenderSessionServiceBase { readonly session: DeepReadonly; } type InternalRenderSessionService = InternalLiveRenderSessionService | InternalStringRenderSessionService; declare function useInternalRenderSession(): InternalRenderSessionService; //#endregion //#region src/io/kitty-keyboard.d.ts type KittyKeyboardOptions = { mode?: "auto" | "enabled" | "disabled"; }; /** Repository-only mount override. Production mounts always use private auto negotiation. */ declare const INTERNAL_KITTY_KEYBOARD: unique symbol; interface InternalKittyKeyboardMountOptions { readonly mode: "auto" | "enabled" | "disabled"; } //#endregion //#region src/io/render-observer.d.ts /** One renderer content commit before output-writer transformation. */ interface InternalContentFrame { /** * Current dynamic region. Renderer-emitted SGR styling is retained; output- * writer lifecycle and screen-update controls are excluded. */ readonly dynamic: string; /** * New `` content produced by this commit, without accumulated replay. * Renderer-emitted SGR styling is retained; output-writer controls are excluded. */ readonly staticOutput: string; /** Whether the renderer committed during the mounted lifetime or teardown. */ readonly phase: "update" | "teardown"; } /** * Internal deterministic-render observer. When its callbacks return normally, * installing it does not select a diagnostic output path, change scheduling, * or manufacture terminal capabilities. Callback errors deliberately propagate * so broken test instrumentation cannot turn into a passing assertion. */ interface InternalRenderObserver { onCommit?(frame: InternalContentFrame): void; } declare const INTERNAL_RENDER_OBSERVER: unique symbol; //#endregion //#region src/process-suspension.d.ts interface SuspensionHooks { /** Temporarily release every terminal resource owned by this session. */ readonly suspend: () => void; /** Reacquire the same effective surface and repaint it after continuation. */ readonly resume: () => void | Promise; } /** The rendering lifecycle depends on this small boundary rather than process signals directly. */ interface SuspensionHost { readonly supported: boolean; readonly register: (hooks: SuspensionHooks) => () => void; } /** Deterministic test host: callers choose exactly when suspension and continuation occur. */ interface ManualSuspensionHost extends SuspensionHost { readonly suspend: () => Promise; readonly resume: () => Promise; } /** Internal mount-option key used by deterministic hosts to replace OS signals. */ declare const INTERNAL_SUSPENSION_HOST: unique symbol; /** * Create a suspension host that never sends operating-system signals. * * Runtime tests can inject this host and call suspend()/resume() around assertions. Its hook * ordering, reentry guards, and unregister behavior are the same as the production host. */ declare function createManualSuspensionHost(options?: { readonly supported?: boolean; }): ManualSuspensionHost; //#endregion //#region src/internal-mount-options.d.ts interface InternalMountOptionPayload { readonly onRender?: (info: { renderTime: number; }) => void; readonly maxFps?: number; readonly terminalStyle?: TerminalStyle; readonly [INTERNAL_KITTY_KEYBOARD]?: InternalKittyKeyboardMountOptions; readonly [INTERNAL_RENDER_OBSERVER]?: InternalRenderObserver; readonly [INTERNAL_TERMINAL_SIZE_PROBE]?: TerminalSizeProbe; readonly [INTERNAL_SUSPENSION_HOST]?: SuspensionHost; } declare const internalMountOptionsBrand: unique symbol; type InternalMountOptions = MountOptions & { readonly [internalMountOptionsBrand]: true; }; type InternalMountOptionsInput = MountOptions & InternalMountOptionPayload; /** * Associate repository-only controls with an otherwise ordinary public-options * object through module-private state. * * This helper is built only into the repository's unpublished `/internal` * entry and Runtime-owned testing entry. The returned object contains only the * documented public keys, so inspecting it cannot reveal or recreate the * private controls. */ declare function createInternalMountOptions(input?: InternalMountOptionsInput): InternalMountOptions; //#endregion //#region src/render.d.ts interface MountOptions { readonly stdout?: Writable; readonly stdin?: Readable; readonly stderr?: Writable; /** * Select the terminal screen model requested by this application. * Omission requests Inline. On a live TTY, an explicit Fullscreen request * requires positive terminal dimensions and otherwise fails before setup or * terminal mutation. On non-TTY stdout, Inline and Fullscreen select the same * supported non-interactive document host. * * @default 'inline' */ readonly mode?: RenderMode; /** * Select terminal styling for this application. Omission and `true` detect * the selected stdout and honor process color controls. `false` emits no SGR * styling; a named profile forces that capability, including for SGR already * present in rendered text. * * @default true */ readonly color?: boolean | ColorProfile; /** * Patch `console.*` methods to route output through the TUI frame * coordinator (writeToStdout / writeToStderr) so that console.log * calls don't corrupt the rendered UI. * * @default true */ readonly patchConsole?: boolean; /** * Exit before delivering an exact Ctrl+C key. Omission leaves Ctrl+C as * ordinary managed input; bracketed paste never triggers this option. * * @default false */ readonly exitOnCtrlC?: boolean; } type ConsumerVuePrivateAppKey = Extract, `_${string}`>; type ConsumerVueFluentAppKey = "use" | "mixin" | "component" | "directive" | "provide" | "filter"; type ConsumerVuePublicAppSurface = Omit, ConsumerVuePrivateAppKey | ConsumerVueFluentAppKey | "mount">; type ConsumerVueCompatFilter = Parameters["filter"]>>[1]; /** * A Vue application whose mount target is a terminal host. * * The ordinary public Vue application surface comes from the consumer's * installed Vue version. Runtime replaces Vue's DOM-oriented `mount()` and * excludes underscore-prefixed renderer internals. */ interface TuiApp extends ConsumerVuePublicAppSurface { use(plugin: Plugin, ...options: NoInfer): this; use(plugin: Plugin, options: NoInfer): this; mixin(mixin: ComponentOptions): this; component(name: string): Component | undefined; component(name: string, component: T): this; directive(name: string): Directive | undefined; directive(name: string, directive: Directive): this; provide | string | number>(key: K, value: K extends InjectionKey ? V : T): this; filter?(name: string): ConsumerVueCompatFilter | undefined; filter?(name: string, filter: ConsumerVueCompatFilter): this; mount(options?: MountOptions): ComponentPublicInstance; waitUntilExit(): Promise; waitUntilRenderFlush(): Promise; } type RootProps = Record; /** * Create a terminal application from a root component. * * - `mount()` is one transaction: a failure rolls back every terminal, stream, * and console change before rethrowing. * - The owner holds `waitUntilExit()` and `waitUntilRenderFlush()`; descendants * get only `useApp().exit()`. * - Component failures stay Vue failures — your `onErrorCaptured()` and * `app.config.errorHandler` still apply. * * @example Start an Inline app and wait for it to finish * ```ts * const app = createApp(App); * app.mount({ exitOnCtrlC: true }); * await app.waitUntilExit(); * ``` * * @example Take over the whole screen * ```ts * createApp(Dashboard).mount({ mode: "fullscreen" }); * ``` */ declare function createApp(root: Component, rootProps?: RootProps | null): TuiApp; //#endregion export { InternalMountOptionsInput as a, SuspensionHost as c, InternalRenderObserver as d, INTERNAL_KITTY_KEYBOARD as f, ColorProfile as g, INTERNAL_TERMINAL_SIZE_PROBE as h, InternalMountOptions as i, createManualSuspensionHost as l, useInternalRenderSession as m, TuiApp as n, createInternalMountOptions as o, KittyKeyboardOptions as p, createApp as r, INTERNAL_SUSPENSION_HOST as s, MountOptions as t, INTERNAL_RENDER_OBSERVER as u };