@vui-rs/vue 0.1.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.
@@ -0,0 +1,1763 @@
1
+ import { Component, InjectionKey, PropType, VNode, computed, defineComponent, h, nextTick, onBeforeUnmount, onMounted, onUnmounted, reactive, ref, shallowReactive, shallowRef, toRef, toRefs, watch, watchEffect } from "@vue/runtime-core";
2
+ import { AlignValue, Attr, Dim, EditBuffer, EditMotion, EditMotionCode, EditorView, InputEvent, InputEvent as InputEvent$1, JustifyValue, Key, KeyEvent, MouseEvent, MouseEvent as MouseEvent$1, Renderer, Sides, TextRun, TextWrapMode, TextWrapMode as TextWrapMode$1, VuiNode, VuiStyle, matchesKey, parseColor, rgba } from "@vui-rs/core";
3
+
4
+ //#region src/host/link-registry.d.ts
5
+ declare class LinkRegistry {
6
+ #private;
7
+ /** Stable id for `uri` (assigning one on first sight). 0 if the table is full. */
8
+ idFor(uri: string): number;
9
+ /** All `(id, uri)` entries, for staging the renderer's link table each frame. */
10
+ entries(): Array<[number, string]>;
11
+ get size(): number;
12
+ }
13
+ //#endregion
14
+ //#region src/host/selection.d.ts
15
+ interface SelPoint {
16
+ x: number;
17
+ y: number;
18
+ }
19
+ declare class HostSelection {
20
+ anchor: SelPoint | null;
21
+ focus: SelPoint | null;
22
+ /** Left/right screen columns (half-open) of the anchored text region. */
23
+ left: number;
24
+ right: number;
25
+ /** True once the drag covers more than the single anchor cell. */
26
+ get active(): boolean;
27
+ begin(x: number, y: number, left: number, right: number): void;
28
+ update(x: number, y: number): void;
29
+ clear(): void;
30
+ /** Anchor/focus ordered top-left-first, or null when no selection exists. */
31
+ ordered(): {
32
+ start: SelPoint;
33
+ end: SelPoint;
34
+ } | null;
35
+ /**
36
+ * The half-open `[x0, x1)` column span selected on row `y` (line-flow), clamped
37
+ * to the region bounds; null when the row is outside the selection.
38
+ */
39
+ rowRange(y: number): {
40
+ x0: number;
41
+ x1: number;
42
+ } | null;
43
+ }
44
+ //#endregion
45
+ //#region src/host/focus.d.ts
46
+ /** An input event as seen by handlers — augmented with bubble control. */
47
+ type DispatchableEvent = InputEvent$1 & {
48
+ defaultPrevented: boolean;
49
+ preventDefault: () => void;
50
+ };
51
+ type DispatchableMouseEvent = MouseEvent$1 & {
52
+ defaultPrevented: boolean;
53
+ preventDefault: () => void;
54
+ };
55
+ interface HostFocusManager {
56
+ focus(node: Renderable): void;
57
+ blur(): void;
58
+ focusNext(): void;
59
+ focusPrev(): void;
60
+ current(): Renderable | null;
61
+ /** Drop a node from focus if it currently holds it (called when it unmounts). */
62
+ release(node: Renderable): void;
63
+ /** Route an input event to its target, then bubble to ancestors. */
64
+ dispatch(ev: InputEvent$1): void;
65
+ /**
66
+ * Capture the pointer to `node`: until released, all mouse move/drag/up events
67
+ * route to it regardless of what's under the cursor — so a drag that leaves the
68
+ * node (e.g. dragging a 1-cell scrollbar thumb sideways) keeps tracking.
69
+ */
70
+ setPointerCapture(node: Renderable): void;
71
+ releasePointerCapture(node?: Renderable): void;
72
+ }
73
+ declare function createHostFocusManager(ctx: HostContext): HostFocusManager;
74
+ //#endregion
75
+ //#region src/host/animation/easing.d.ts
76
+ /** An easing curve: normalized time `[0,1]` → eased progress (may overshoot mid-way). */
77
+ type EasingFn = (t: number) => number;
78
+ declare function outBounce(t: number): number;
79
+ /** The standard easing catalogue, keyed by name. */
80
+ declare const easings: {
81
+ linear: (t: number) => number;
82
+ inQuad: (t: number) => number;
83
+ outQuad: (t: number) => number;
84
+ inOutQuad: (t: number) => number;
85
+ inCubic: (t: number) => number;
86
+ outCubic: (t: number) => number;
87
+ inOutCubic: (t: number) => number;
88
+ inQuart: (t: number) => number;
89
+ outQuart: (t: number) => number;
90
+ inOutQuart: (t: number) => number;
91
+ inSine: (t: number) => number;
92
+ outSine: (t: number) => number;
93
+ inOutSine: (t: number) => number;
94
+ inExpo: (t: number) => number;
95
+ outExpo: (t: number) => number;
96
+ inOutExpo: (t: number) => number;
97
+ inCirc: (t: number) => number;
98
+ outCirc: (t: number) => number;
99
+ inOutCirc: (t: number) => number;
100
+ inBack: (t: number) => number;
101
+ outBack: (t: number) => number;
102
+ inOutBack: (t: number) => number;
103
+ inElastic: (t: number) => number;
104
+ outElastic: (t: number) => number;
105
+ inOutElastic: (t: number) => number;
106
+ inBounce: (t: number) => number;
107
+ outBounce: typeof outBounce;
108
+ inOutBounce: (t: number) => number;
109
+ };
110
+ /** Name of a built-in easing curve. */
111
+ type EasingName = keyof typeof easings;
112
+ /** Resolve an easing name (or a custom function) to a callable curve; unknown → linear. */
113
+ declare function resolveEasing(easing: EasingName | EasingFn | undefined): EasingFn;
114
+ //#endregion
115
+ //#region src/host/animation/timeline.d.ts
116
+ /** Options for a single number tween. */
117
+ interface AnimateOptions {
118
+ /** Start value. */
119
+ from: number;
120
+ /** End value. */
121
+ to: number;
122
+ /** Tween length in milliseconds (≤0 = apply `to` immediately). */
123
+ duration: number;
124
+ /** Easing curve (name or custom fn); default `linear`. */
125
+ easing?: EasingName | EasingFn;
126
+ /** Milliseconds to wait before the tween starts. */
127
+ delay?: number;
128
+ /** `true` = loop forever, a number = repeat that many times, else play once. */
129
+ loop?: boolean | number;
130
+ /** Ping-pong: reverse direction every loop so it goes `from→to→from→…`. */
131
+ alternate?: boolean;
132
+ /** Called with each tweened value (wire to a reactive ref). */
133
+ onUpdate: (value: number) => void;
134
+ /** Called once when the tween finishes naturally (not on `cancel`). */
135
+ onComplete?: () => void;
136
+ }
137
+ /** A running tween. The scheduler drives it via `tick`; components control it via pause/resume/cancel. */
138
+ interface Animation {
139
+ /** Latest emitted value. */
140
+ readonly value: number;
141
+ /** True once finished or cancelled (the registry prunes it). */
142
+ readonly done: boolean;
143
+ /** True while paused (ticks are ignored). */
144
+ readonly paused: boolean;
145
+ /** Advance by `dt` ms; emits an updated value and fires completion/loop logic. */
146
+ tick(dt: number): void;
147
+ /** Suspend ticking (value frozen) until `resume`. */
148
+ pause(): void;
149
+ /** Resume ticking after `pause`. */
150
+ resume(): void;
151
+ /** Stop immediately without firing `onComplete`; marks `done` so the registry drops it. */
152
+ cancel(): void;
153
+ /** Rewind to the start (re-arms delay and loops) and un-pause. */
154
+ restart(): void;
155
+ }
156
+ declare function createAnimation(opts: AnimateOptions): Animation;
157
+ /**
158
+ * Holds the active animations and drives them as a batch. `onActive(true|false)`
159
+ * fires on the empty↔non-empty edge so the scheduler starts/stops its frame loop
160
+ * (no loop while idle). The registry itself owns no timer — it is ticked from the
161
+ * outside with the frame delta.
162
+ */
163
+ interface AnimationRegistry {
164
+ add(a: Animation): void;
165
+ remove(a: Animation): void;
166
+ readonly size: number;
167
+ /** Advance every animation by `dt` ms, then drop the ones that finished. */
168
+ tick(dt: number): void;
169
+ /** Drop all animations (used on dispose). */
170
+ clear(): void;
171
+ }
172
+ declare function createAnimationRegistry(onActive: (active: boolean) => void): AnimationRegistry;
173
+ //#endregion
174
+ //#region src/theme/loader.d.ts
175
+ /** A literal color (`#rrggbb(aa)`, `rgb()/rgba()`, named) or a `defs`/token ref. */
176
+ type ColorValue = string | number | {
177
+ dark: string | number;
178
+ light: string | number;
179
+ };
180
+ /** The on-disk theme shape. */
181
+ interface ThemeJson {
182
+ $schema?: string;
183
+ /** Named color palette; token values may reference these by name. */
184
+ defs?: Record<string, string | number>;
185
+ /** Semantic tokens; keys are theme token names. */
186
+ theme: Record<string, ColorValue>;
187
+ }
188
+ /**
189
+ * Resolve a theme JSON into a fully packed `Theme` for the given mode. Every token
190
+ * falls back to a sensible related token when omitted (so partial/older theme
191
+ * files still load), and the legacy `fg`/`bg`/`muted` aliases mirror
192
+ * `text`/`background`/`textMuted` for backward compatibility.
193
+ */
194
+ declare function resolveThemeJson(json: ThemeJson, mode?: 'dark' | 'light'): Theme;
195
+ /** Read + parse a theme JSON file from disk (`~/.vui/themes/*.json`). */
196
+ declare function loadThemeFile(path: string): Promise<ThemeJson>;
197
+ //#endregion
198
+ //#region src/theme/registry.d.ts
199
+ /** Built-in themes, keyed by name. Each carries dark + light. */
200
+ declare const BUILTIN_THEMES: Record<string, ThemeJson>;
201
+ /** Register (or replace) a theme JSON under `name`, available to `resolveTheme()`. */
202
+ declare function registerTheme(name: string, json: ThemeJson): void;
203
+ /** All registered theme names (built-in + registered). */
204
+ declare function listThemes(): string[];
205
+ /** Resolve a registered theme name to a packed `Theme` for the given mode. */
206
+ declare function resolveTheme(name: string, mode?: 'dark' | 'light'): Theme;
207
+ /**
208
+ * Detect the terminal's light/dark preference without querying it. Honors an
209
+ * explicit `VUI_THEME_MODE`, then `COLORFGBG` (the background ANSI index: 0–6 is
210
+ * dark, 7–15 light — set by many terminals), then defaults to dark.
211
+ */
212
+ declare function detectColorScheme(): 'dark' | 'light';
213
+ /** The default dark theme (Catppuccin Mocha) — the app theme when none is set. */
214
+ declare const darkTheme: Theme;
215
+ /** The default light theme (Catppuccin Latte). */
216
+ declare const lightTheme: Theme;
217
+ /** What `setTheme()` accepts: a registered name, a theme JSON, a packed `Theme`, or a partial override. */
218
+ type ThemeInput = string | ThemeJson | Theme | Partial<Theme>;
219
+ //#endregion
220
+ //#region src/theme.d.ts
221
+ /**
222
+ * Semantic color tokens. Values are packed `0xRRGGBBAA` numbers.
223
+ * `fg`/`bg`/`muted` are legacy aliases of
224
+ * `text`/`background`/`textMuted`, kept for backward compatibility.
225
+ */
226
+ interface Theme {
227
+ primary: number;
228
+ secondary: number;
229
+ /** The one highlight color (spinners, focused affordances, links); maps to `primary`. */
230
+ accent: number;
231
+ error: number;
232
+ warning: number;
233
+ success: number;
234
+ info: number;
235
+ text: number;
236
+ textMuted: number;
237
+ /** Foreground for a selected list item. */
238
+ selectedText: number;
239
+ background: number;
240
+ backgroundPanel: number;
241
+ backgroundElement: number;
242
+ backgroundMenu: number;
243
+ border: number;
244
+ borderActive: number;
245
+ borderSubtle: number;
246
+ diffAdded: number;
247
+ diffRemoved: number;
248
+ diffContext: number;
249
+ diffHunkHeader: number;
250
+ diffAddedBg: number;
251
+ diffRemovedBg: number;
252
+ diffContextBg: number;
253
+ markdownText: number;
254
+ markdownHeading: number;
255
+ markdownLink: number;
256
+ markdownLinkText: number;
257
+ markdownCode: number;
258
+ markdownBlockQuote: number;
259
+ markdownEmph: number;
260
+ markdownStrong: number;
261
+ markdownHorizontalRule: number;
262
+ markdownListItem: number;
263
+ markdownListEnumeration: number;
264
+ markdownImage: number;
265
+ markdownImageText: number;
266
+ markdownCodeBlock: number;
267
+ syntaxComment: number;
268
+ syntaxKeyword: number;
269
+ syntaxFunction: number;
270
+ syntaxVariable: number;
271
+ syntaxString: number;
272
+ syntaxNumber: number;
273
+ syntaxType: number;
274
+ syntaxOperator: number;
275
+ syntaxPunctuation: number;
276
+ /** Default foreground (alias of `text`). */
277
+ fg: number;
278
+ /** Canvas background (alias of `background`). */
279
+ bg: number;
280
+ /** De-emphasised text (alias of `textMuted`). */
281
+ muted: number;
282
+ }
283
+ /** Injection key for the active theme; `useTheme()` reads it, `provideTheme()` sets it. */
284
+ declare const ThemeSymbol: InjectionKey<Theme>;
285
+ //#endregion
286
+ //#region src/host/renderable.d.ts
287
+ type RenderableKind = 'box' | 'text' | 'edit' | 'textarea' | 'span' | 'raw-text' | 'comment';
288
+ /** Run-style a `span` folds into its enclosing `<text>` (mirrors host-node RunStyle). */
289
+ interface RunStyle {
290
+ fg?: number;
291
+ bg?: number;
292
+ attrs: number;
293
+ /** OSC 8 link target; resolved to a link id and ORed into the run's attrs. */
294
+ link?: string;
295
+ }
296
+ /**
297
+ * Opaque dim backdrop an overlay can paint under itself: each covered cell is
298
+ * read back and rewritten with its glyph kept but its fg/bg scaled toward black
299
+ * by `darken` (0..1). No real alpha — the terminal has none — just a darker
300
+ * opaque rewrite, enough to push the layer behind a modal into the background.
301
+ */
302
+ interface Backdrop {
303
+ /** Brightness multiplier for the covered cells (0 = black, 1 = unchanged). */
304
+ darken: number;
305
+ }
306
+ /** Visual (non-layout) props a Renderable paints with. The JS twin of Rust PaintProps. */
307
+ interface PaintProps$1 {
308
+ bg?: number;
309
+ fg?: number;
310
+ /** Combined attr bits (base | flags), recomputed on change. */
311
+ attrs: number;
312
+ /** Explicitly-set numeric `attrs`, OR-ed with the boolean attr flags. */
313
+ baseAttrs: number;
314
+ attrFlags: Record<string, number>;
315
+ border: 'none' | 'single' | 'double' | 'rounded';
316
+ borderColor?: number;
317
+ title: string;
318
+ titleAlign: 'left' | 'center' | 'right';
319
+ visible: boolean;
320
+ opacity: number;
321
+ wrap: TextWrapMode$1;
322
+ /**
323
+ * How children that exceed this node's content box are treated at paint time.
324
+ * `visible` (default) lets them spill — children are clipped only by the
325
+ * inherited ancestor clip, not this box's content box. `hidden`/`scroll` clip
326
+ * children to the content box (a viewport); `scroll` additionally pairs with a
327
+ * scroll offset + scrollbar. Paint-only — layout (taffy) is unaffected.
328
+ */
329
+ overflow: 'visible' | 'hidden' | 'scroll';
330
+ /** Paint order among siblings (and among overlays); higher draws later/on top. */
331
+ zIndex: number;
332
+ /** Opaque dim backdrop painted under an overlay's content; undefined = none. */
333
+ backdrop?: Backdrop;
334
+ }
335
+ /** Edge insets (padding/border) a laid-out node reports, in cells. */
336
+ interface Edges {
337
+ left: number;
338
+ right: number;
339
+ top: number;
340
+ bottom: number;
341
+ }
342
+ /** A node's computed box from layout (Phase 03). Origin is parent-relative. */
343
+ interface LayoutRect {
344
+ x: number;
345
+ y: number;
346
+ w: number;
347
+ h: number;
348
+ padding: Edges;
349
+ border: Edges;
350
+ }
351
+ /** Half-open clip rect `[x0,x1) × [y0,y1)` — the JS twin of paint.rs `Clip`. */
352
+ interface Clip {
353
+ x0: number;
354
+ y0: number;
355
+ x1: number;
356
+ y1: number;
357
+ }
358
+ /** Absolute rounded half-open screen rect cached during the paint walk. */
359
+ type ScreenRect = Clip;
360
+ /**
361
+ * Paint surface a Renderable draws into — the native cell buffer, via the
362
+ * clip-aware prims. Every op takes the clip (already intersected with the
363
+ * buffer). `bgUnder` reads the current cell background so a transparent glyph
364
+ * keeps whatever it sits on (the JS twin of paint.rs `bg_under`).
365
+ */
366
+ interface PaintBuffer {
367
+ fillRect(x: number, y: number, w: number, h: number, bg: number, clip: Clip): void;
368
+ setCell(x: number, y: number, ch: number, fg: number, bg: number, attrs: number, clip: Clip): void;
369
+ /** Draw a whole string on a row, clipped (one FFI op). Used by the canvas ctx. */
370
+ drawText(x: number, y: number, text: string, fg: number, bg: number, attrs: number, clip: Clip): void;
371
+ /** Draw a native editor view in one clipped FFI op. */
372
+ drawEditor(view: import('@vui-rs/core').EditorView, x: number, y: number, fg: number, bg: number, cursorBg: number, attrs: number, clip: Clip): void;
373
+ /** Draw a native text-buffer view in one clipped FFI op. */
374
+ drawTextBuffer(view: import('@vui-rs/core').TextBufferView, x: number, y: number, fg: number, bg: number | undefined, attrs: number, clip: Clip): void;
375
+ /** Composite an offscreen buffer into the back buffer at `(dstX,dstY)`, clipped. */
376
+ blit(src: import('@vui-rs/core').OffscreenBuffer, dstX: number, dstY: number, clip: Clip): void;
377
+ bgUnder(x: number, y: number): number;
378
+ /**
379
+ * The whole cell currently at `(x,y)` — glyph + colors + attrs — read back from
380
+ * the live buffer. Lets the overlay backdrop darken a cell in place while
381
+ * keeping its glyph (the JS-only twin of `bgUnder`, widened to all fields).
382
+ */
383
+ cellUnder(x: number, y: number): CellUnder;
384
+ }
385
+ /** A cell read back from the buffer: packed colors as `0xRRGGBBAA`. */
386
+ interface CellUnder {
387
+ ch: number;
388
+ fg: number;
389
+ bg: number;
390
+ attrs: number;
391
+ }
392
+ /**
393
+ * Geometry a Renderable paints with, computed by the paint walk: the rounded
394
+ * absolute border box (`x0..y1`) + its clip, and the content box (`cx0..cy1`,
395
+ * inset by border+padding) + its clip. The JS twin of paint.rs `paint_node`'s
396
+ * locals, handed to `renderSelf`.
397
+ */
398
+ interface PaintCtx {
399
+ x0: number;
400
+ y0: number;
401
+ x1: number;
402
+ y1: number;
403
+ clip: Clip;
404
+ cx0: number;
405
+ cy0: number;
406
+ cx1: number;
407
+ cy1: number;
408
+ contentClip: Clip;
409
+ }
410
+ /**
411
+ * Base host node. `box`/`text`/`edit` get dedicated subclasses (with a real
412
+ * `renderSelf` in Phase 04); `span`/`raw-text`/`comment` stay base instances —
413
+ * they own no rect and fold into the enclosing `<text>`'s runs.
414
+ */
415
+ declare class Renderable {
416
+ ctx: HostContext;
417
+ kind: RenderableKind;
418
+ tag: string;
419
+ parent: Renderable | null;
420
+ children: Renderable[];
421
+ /**
422
+ * Layout-only native node for `box`/`text`/`edit` (taffy style + text-for-
423
+ * measure ONLY — no paint props; the Renderable paints itself in JS). `null`
424
+ * for virtual nodes (span/raw-text/comment). The L1 layout-via-FFI backing.
425
+ */
426
+ layoutNode: VuiNode | null;
427
+ /** Layout bucket (taffy style), flushed to the layout node (Phase 03). */
428
+ style: VuiStyle;
429
+ paint: PaintProps$1;
430
+ /** Run-style for `span` nodes. */
431
+ spanStyle: RunStyle;
432
+ /** Value for `raw-text`/`comment`; default-run text for a `<text>` set via setElementText. */
433
+ text: string;
434
+ directText: string | null;
435
+ events: Map<string, (...args: unknown[]) => void>;
436
+ focusable: boolean;
437
+ /** Unknown props, kept for debugging (parity with the FFI patch-prop). */
438
+ props: Record<string, unknown>;
439
+ /** Computed box from layout; null until the first layout pass. */
440
+ rect: LayoutRect | null;
441
+ /** Paint-time scroll offset applied to this node's children. */
442
+ scrollX: number;
443
+ scrollY: number;
444
+ /** Absolute rounded border box from the last paint walk; null until painted. */
445
+ screenRect: ScreenRect | null;
446
+ /**
447
+ * Overlay/portal root: laid out absolute on the terminal (its layout node is
448
+ * hoisted under the renderer root), skipped by the main paint walk, and drawn
449
+ * by the separate overlay pass on top of the tree. Set by `OverlayRenderable`.
450
+ */
451
+ isOverlay: boolean;
452
+ /**
453
+ * A focus-trapping overlay: while mounted, Tab/Shift-Tab focus is confined to
454
+ * this overlay's subtree (the active modal). Non-trapping overlays (toasts,
455
+ * popups) leave the underlying tab order intact. Set via the `trapFocus` prop.
456
+ */
457
+ trapFocus: boolean;
458
+ /** Dirty since the last paint walk (drives dirty-subtree skipping in Phase 06). */
459
+ dirty: boolean;
460
+ constructor(ctx: HostContext, kind: RenderableKind, tag: string);
461
+ /** Draw this node into the buffer with the walk-computed geometry. Overridden by subclasses. */
462
+ renderSelf(_buffer: PaintBuffer, _ctx: PaintCtx): void;
463
+ /** Mark this node (and request a render) as needing repaint. */
464
+ markDirty(): void;
465
+ /**
466
+ * Release any native resources this node owns (e.g. a canvas's offscreen
467
+ * buffer). Called for every node in a removed subtree. Base: nothing to free.
468
+ */
469
+ dispose(): void;
470
+ }
471
+ /**
472
+ * Per-app wiring for the JS host path. The native `Renderer` (cell buffer owner)
473
+ * is only known at mount. `paint`/`layout` hooks are filled by later phases; in
474
+ * Phase 01 they are null and `scheduleRender` just bumps the counter.
475
+ */
476
+ interface HostContext {
477
+ renderer: import('@vui-rs/core').Renderer | null;
478
+ root: Renderable | null;
479
+ /**
480
+ * Overlay/portal roots, painted after the main tree (low zIndex first) on top
481
+ * of everything. Registered by node-ops when an `<overlay>` mounts.
482
+ */
483
+ overlays: Renderable[];
484
+ theme: Theme;
485
+ /** Renderables whose layout style changed since the last layout pass. */
486
+ dirtyLayout: Set<Renderable>;
487
+ /** Renderables whose text runs changed (re-flattened on paint). */
488
+ dirtyText: Set<Renderable>;
489
+ /** URI → stable OSC 8 link id, staged to the renderer each frame before flush. */
490
+ links: LinkRegistry;
491
+ /** Active drag-selection over static `<text>`/`<markdown>` (highlight + copy). */
492
+ selection: HostSelection;
493
+ /** Renderer size at the last layout pass; a change (resize) forces a relayout. */
494
+ layoutW: number;
495
+ layoutH: number;
496
+ scheduleRender: () => void;
497
+ flushNow: () => void;
498
+ dispose: () => void;
499
+ renderCount: number;
500
+ /**
501
+ * Callbacks run after the layout pass and before paint, while rects are fresh.
502
+ * Scroll viewports register here to clamp/stick their offset to the just-laid-
503
+ * out content size (stick-to-bottom) with no one-frame lag. Mutate paint state
504
+ * + `markDirty()` only — do NOT `scheduleRender()` (paint runs next this frame).
505
+ */
506
+ afterLayout: Set<() => void>;
507
+ /** Layout pass (Phase 03); null until wired. */
508
+ layout: ((ctx: HostContext) => void) | null;
509
+ /** Paint walk (Phase 04); null until wired. */
510
+ paint: ((ctx: HostContext) => void) | null;
511
+ /** Keyboard focus model; wired at mount (null in offscreen-only tests). */
512
+ focusManager: HostFocusManager | null;
513
+ /**
514
+ * Active animations (Phase: animation/timeline). The scheduler drives a frame
515
+ * loop only while this is non-empty; each tween's `onUpdate` sets a reactive
516
+ * ref → the existing coalesced render. Empty ⇒ zero-render-on-idle holds.
517
+ */
518
+ animations: AnimationRegistry;
519
+ }
520
+ /**
521
+ * Injection key for the per-app `HostContext`, provided at mount. Composables
522
+ * like `useTimeline()` inject it to reach the animation registry/scheduler
523
+ * without threading a host-element ref through the component.
524
+ */
525
+ declare const HostContextSymbol: InjectionKey<HostContext>;
526
+ //#endregion
527
+ //#region src/host/create-host-app.d.ts
528
+ interface HostMountOptions {
529
+ renderer?: Renderer;
530
+ width?: number;
531
+ height?: number;
532
+ altScreen?: boolean;
533
+ theme?: Theme;
534
+ }
535
+ interface VuiHostApp {
536
+ mount(options?: HostMountOptions): VuiHostApp;
537
+ unmount(): void;
538
+ /** Swap the active theme at runtime (by name, JSON, full theme, or partial) — no remount. */
539
+ setTheme(input: ThemeInput, mode?: 'dark' | 'light'): void;
540
+ readonly renderer: Renderer | null;
541
+ readonly context: HostContext;
542
+ }
543
+ declare function createHostApp(rootComponent: Component, rootProps?: Record<string, unknown>): VuiHostApp;
544
+ //#endregion
545
+ //#region src/create-app.d.ts
546
+ /** Mount options (renderer/size/altScreen/theme). Alias of the host's options. */
547
+ type MountOptions = HostMountOptions;
548
+ /** A mounted app handle (mount/unmount/renderer/context). Alias of the host app. */
549
+ type VuiApp = VuiHostApp;
550
+ /** Create a vui-rs app from a root component. Mount it with `.mount()`. */
551
+ declare function createApp(rootComponent: Component, rootProps?: Record<string, unknown>): VuiApp;
552
+ //#endregion
553
+ //#region src/host/catalogue.d.ts
554
+ /** Build a Renderable for `tag` in `ctx`. Custom entries supply their own factory. */
555
+ type RenderableFactory = (ctx: HostContext, tag: string) => Renderable;
556
+ interface CatalogueEntry {
557
+ kind: Renderable['kind'];
558
+ /** For `span` kinds: attribute bits the tag contributes (bold/italic/…). */
559
+ spanAttrs: number;
560
+ /** Custom constructor (from `extend`); defaults to the built-in for `kind`. */
561
+ make?: RenderableFactory;
562
+ }
563
+ /** Register custom element kinds. Overrides existing tags. */
564
+ declare function extend(map: Record<string, CatalogueEntry>): void;
565
+ /**
566
+ * Is `tag` a vui *element* (vs. a Vue component) for the SFC compiler's
567
+ * `isCustomElement`? `box`/`text`/`canvas` and the inline `span`-kind tags are
568
+ * elements; `edit`-kind tags (`<input>`) are NOT — they resolve to the
569
+ * `VuiHostInput` component (registered at app create) so v-model round-trips
570
+ * through its editing logic. `textarea-host` is the internal element rendered by
571
+ * the public `<textarea>` component. Only knows built-in + `extend()`-ed tags in THIS
572
+ * process; the Vite build lists runtime tags in the plugin separately.
573
+ */
574
+ declare function isVuiTag(tag: string): boolean;
575
+ //#endregion
576
+ //#region src/host/canvas-renderable.d.ts
577
+ /** Optional per-cell style for the canvas draw ops. */
578
+ interface CanvasStyle {
579
+ fg?: number;
580
+ bg?: number;
581
+ attrs?: number;
582
+ }
583
+ /** The laid-out rect handed to `onDraw` (absolute cells). Local draw coords are 0-based. */
584
+ interface CanvasRect {
585
+ x: number;
586
+ y: number;
587
+ width: number;
588
+ height: number;
589
+ }
590
+ /**
591
+ * The clamped drawing surface passed to a canvas's `onDraw`. Coordinates are
592
+ * LOCAL to the canvas content box (0,0 = its top-left); every op is clipped to
593
+ * the box so a canvas can never corrupt a sibling.
594
+ */
595
+ interface CanvasContext {
596
+ readonly width: number;
597
+ readonly height: number;
598
+ clear(bg?: number): void;
599
+ fillRect(x: number, y: number, w: number, h: number, bg: number): void;
600
+ setCell(x: number, y: number, ch: string | number, style?: CanvasStyle): void;
601
+ drawText(x: number, y: number, text: string, style?: CanvasStyle): void;
602
+ }
603
+ type CanvasDraw = (ctx: CanvasContext, rect: CanvasRect) => void;
604
+ declare class CanvasRenderable extends Renderable {
605
+ #private;
606
+ /** Number of `onDraw` invocations — instrumentation for the buffered-redraw test. */
607
+ drawCount: number;
608
+ constructor(ctx: HostContext, tag: string);
609
+ /** Buffered mode owns an offscreen framebuffer; toggled by the `buffered` prop. */
610
+ get buffered(): boolean;
611
+ /** Force a buffered canvas to re-run `onDraw` on the next paint. */
612
+ redraw(): void;
613
+ renderSelf(buffer: PaintBuffer, ctx: PaintCtx): void;
614
+ dispose(): void;
615
+ }
616
+ //#endregion
617
+ //#region src/host/box-renderable.d.ts
618
+ declare class BoxRenderable extends Renderable {
619
+ constructor(ctx: HostContext, tag: string);
620
+ renderSelf(buffer: PaintBuffer, ctx: PaintCtx): void;
621
+ }
622
+ //#endregion
623
+ //#region src/host/overlay.d.ts
624
+ /**
625
+ * An `<overlay>` host node: a top-layer box laid out absolute over the whole
626
+ * terminal. Defaults to filling the screen (`position:absolute`, all insets 0) so
627
+ * a centered modal can flex-center within it and a backdrop covers everything;
628
+ * authors override the layout props as usual.
629
+ */
630
+ declare class OverlayRenderable extends BoxRenderable {
631
+ constructor(ctx: HostContext, tag: string);
632
+ }
633
+ //#endregion
634
+ //#region src/host/image-renderable.d.ts
635
+ declare class ImageRenderable extends Renderable {
636
+ #private;
637
+ constructor(ctx: HostContext, tag: string);
638
+ get src(): string;
639
+ renderSelf(buffer: PaintBuffer, ctx: PaintCtx): void;
640
+ }
641
+ //#endregion
642
+ //#region src/host/image-encode.d.ts
643
+ type ImageEncoding = 'kitty' | 'iterm2' | 'halfblock';
644
+ type Env = Record<string, string | undefined>;
645
+ /**
646
+ * Choose an encoding from an explicit override or terminal detection. Auto-order:
647
+ * Kitty → iTerm2 → half-block (the universal fallback).
648
+ */
649
+ declare function selectImageEncoding(env?: Env): ImageEncoding;
650
+ //#endregion
651
+ //#region src/host/edit-renderable.d.ts
652
+ /** Editable state surfaced to paint (cursor is a grapheme index; column is derived). */
653
+ interface EditState {
654
+ value: string;
655
+ placeholder: string;
656
+ cursor: number;
657
+ focused: boolean;
658
+ maxLength?: number;
659
+ cursorColor?: number;
660
+ placeholderColor?: number;
661
+ }
662
+ declare class EditRenderable extends Renderable {
663
+ #private;
664
+ edit: EditState;
665
+ constructor(ctx: HostContext, tag: string);
666
+ renderSelf(buffer: PaintBuffer, ctx: PaintCtx): void;
667
+ getValue(): string;
668
+ /** External value write (v-model): replace, cursor to end. No change emit. */
669
+ setValue(text: string): void;
670
+ insert(text: string): void;
671
+ backspace(): void;
672
+ delete(): void;
673
+ move(motion: number): void;
674
+ }
675
+ //#endregion
676
+ //#region src/host/components/input.d.ts
677
+ type ColorProp$3 = string | number;
678
+ declare const VuiHostInput: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
679
+ value: {
680
+ type: StringConstructor;
681
+ default: string;
682
+ };
683
+ placeholder: {
684
+ type: StringConstructor;
685
+ default: string;
686
+ };
687
+ placeholderColor: {
688
+ type: PropType<ColorProp$3>;
689
+ default: undefined;
690
+ };
691
+ cursorColor: {
692
+ type: PropType<ColorProp$3>;
693
+ default: undefined;
694
+ };
695
+ maxLength: {
696
+ type: NumberConstructor;
697
+ default: undefined;
698
+ };
699
+ focused: {
700
+ type: BooleanConstructor;
701
+ default: boolean;
702
+ };
703
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
704
+ [key: string]: any;
705
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("update:value" | "input" | "change" | "enter")[], "update:value" | "input" | "change" | "enter", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
706
+ value: {
707
+ type: StringConstructor;
708
+ default: string;
709
+ };
710
+ placeholder: {
711
+ type: StringConstructor;
712
+ default: string;
713
+ };
714
+ placeholderColor: {
715
+ type: PropType<ColorProp$3>;
716
+ default: undefined;
717
+ };
718
+ cursorColor: {
719
+ type: PropType<ColorProp$3>;
720
+ default: undefined;
721
+ };
722
+ maxLength: {
723
+ type: NumberConstructor;
724
+ default: undefined;
725
+ };
726
+ focused: {
727
+ type: BooleanConstructor;
728
+ default: boolean;
729
+ };
730
+ }>> & Readonly<{
731
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
732
+ onInput?: ((...args: any[]) => any) | undefined;
733
+ onChange?: ((...args: any[]) => any) | undefined;
734
+ onEnter?: ((...args: any[]) => any) | undefined;
735
+ }>, {
736
+ value: string;
737
+ placeholder: string;
738
+ placeholderColor: ColorProp$3;
739
+ cursorColor: ColorProp$3;
740
+ maxLength: number;
741
+ focused: boolean;
742
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
743
+ //#endregion
744
+ //#region src/host/textarea-renderable.d.ts
745
+ interface TextareaState {
746
+ placeholder: string;
747
+ focused: boolean;
748
+ cursorColor?: number;
749
+ placeholderColor?: number;
750
+ wrap: TextWrapMode$1;
751
+ autoWidth: boolean;
752
+ autoHeight: boolean;
753
+ tabBehavior: 'focus' | 'indent';
754
+ tabSize: number;
755
+ }
756
+ declare class TextareaRenderable extends Renderable {
757
+ #private;
758
+ edit: EditBuffer;
759
+ editor: EditorView;
760
+ textarea: TextareaState;
761
+ constructor(ctx: HostContext, tag: string);
762
+ renderSelf(buffer: PaintBuffer, ctx: PaintCtx): void;
763
+ getValue(): string;
764
+ setValue(value: string): void;
765
+ insert(text: string): void;
766
+ newline(): void;
767
+ backspace(): void;
768
+ delete(): void;
769
+ move(motion: EditMotionCode, selecting?: boolean): void;
770
+ syncAutoSizeStyle(): boolean;
771
+ selectAll(): void;
772
+ hasSelection(): boolean;
773
+ selectedText(): string;
774
+ deleteSelection(): boolean;
775
+ undo(): void;
776
+ redo(): void;
777
+ dispose(): void;
778
+ }
779
+ //#endregion
780
+ //#region src/host/components/textarea.d.ts
781
+ type ColorProp$2 = string | number;
782
+ declare const VuiHostTextarea: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
783
+ value: {
784
+ type: StringConstructor;
785
+ default: string;
786
+ };
787
+ placeholder: {
788
+ type: StringConstructor;
789
+ default: string;
790
+ };
791
+ placeholderColor: {
792
+ type: PropType<ColorProp$2>;
793
+ default: undefined;
794
+ };
795
+ cursorColor: {
796
+ type: PropType<ColorProp$2>;
797
+ default: undefined;
798
+ };
799
+ focused: {
800
+ type: BooleanConstructor;
801
+ default: boolean;
802
+ };
803
+ wrap: {
804
+ type: PropType<"word" | "char" | "nowrap">;
805
+ default: string;
806
+ };
807
+ tabBehavior: {
808
+ type: PropType<"focus" | "indent">;
809
+ default: string;
810
+ };
811
+ tabSize: {
812
+ type: NumberConstructor;
813
+ default: number;
814
+ };
815
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
816
+ [key: string]: any;
817
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("update:value" | "input" | "change" | "enter")[], "update:value" | "input" | "change" | "enter", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
818
+ value: {
819
+ type: StringConstructor;
820
+ default: string;
821
+ };
822
+ placeholder: {
823
+ type: StringConstructor;
824
+ default: string;
825
+ };
826
+ placeholderColor: {
827
+ type: PropType<ColorProp$2>;
828
+ default: undefined;
829
+ };
830
+ cursorColor: {
831
+ type: PropType<ColorProp$2>;
832
+ default: undefined;
833
+ };
834
+ focused: {
835
+ type: BooleanConstructor;
836
+ default: boolean;
837
+ };
838
+ wrap: {
839
+ type: PropType<"word" | "char" | "nowrap">;
840
+ default: string;
841
+ };
842
+ tabBehavior: {
843
+ type: PropType<"focus" | "indent">;
844
+ default: string;
845
+ };
846
+ tabSize: {
847
+ type: NumberConstructor;
848
+ default: number;
849
+ };
850
+ }>> & Readonly<{
851
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
852
+ onInput?: ((...args: any[]) => any) | undefined;
853
+ onChange?: ((...args: any[]) => any) | undefined;
854
+ onEnter?: ((...args: any[]) => any) | undefined;
855
+ }>, {
856
+ value: string;
857
+ placeholder: string;
858
+ placeholderColor: ColorProp$2;
859
+ cursorColor: ColorProp$2;
860
+ focused: boolean;
861
+ wrap: "nowrap" | "char" | "word";
862
+ tabBehavior: "focus" | "indent";
863
+ tabSize: number;
864
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
865
+ //#endregion
866
+ //#region src/host/components/scroll-box.d.ts
867
+ declare const VuiScrollBox: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
868
+ modelValue: {
869
+ type: NumberConstructor;
870
+ default: undefined;
871
+ };
872
+ scrollY: {
873
+ type: NumberConstructor;
874
+ default: undefined;
875
+ };
876
+ step: {
877
+ type: NumberConstructor;
878
+ default: number;
879
+ };
880
+ pageStep: {
881
+ type: NumberConstructor;
882
+ default: undefined;
883
+ };
884
+ focused: {
885
+ type: BooleanConstructor;
886
+ default: boolean;
887
+ };
888
+ focusable: {
889
+ type: BooleanConstructor;
890
+ default: boolean;
891
+ };
892
+ /**
893
+ * Chat/transcript mode: keep the view pinned to the bottom as content grows,
894
+ * unless the user has scrolled up. Uncontrolled only — don't bind modelValue.
895
+ */
896
+ stickToBottom: {
897
+ type: BooleanConstructor;
898
+ default: boolean;
899
+ }; /** Render an integrated vertical scrollbar (indicator + drag) on the right edge. */
900
+ scrollbar: {
901
+ type: BooleanConstructor;
902
+ default: boolean;
903
+ };
904
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
905
+ [key: string]: any;
906
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("scroll" | "update:modelValue" | "update:scrollY")[], "scroll" | "update:modelValue" | "update:scrollY", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
907
+ modelValue: {
908
+ type: NumberConstructor;
909
+ default: undefined;
910
+ };
911
+ scrollY: {
912
+ type: NumberConstructor;
913
+ default: undefined;
914
+ };
915
+ step: {
916
+ type: NumberConstructor;
917
+ default: number;
918
+ };
919
+ pageStep: {
920
+ type: NumberConstructor;
921
+ default: undefined;
922
+ };
923
+ focused: {
924
+ type: BooleanConstructor;
925
+ default: boolean;
926
+ };
927
+ focusable: {
928
+ type: BooleanConstructor;
929
+ default: boolean;
930
+ };
931
+ /**
932
+ * Chat/transcript mode: keep the view pinned to the bottom as content grows,
933
+ * unless the user has scrolled up. Uncontrolled only — don't bind modelValue.
934
+ */
935
+ stickToBottom: {
936
+ type: BooleanConstructor;
937
+ default: boolean;
938
+ }; /** Render an integrated vertical scrollbar (indicator + drag) on the right edge. */
939
+ scrollbar: {
940
+ type: BooleanConstructor;
941
+ default: boolean;
942
+ };
943
+ }>> & Readonly<{
944
+ onScroll?: ((...args: any[]) => any) | undefined;
945
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
946
+ "onUpdate:scrollY"?: ((...args: any[]) => any) | undefined;
947
+ }>, {
948
+ focused: boolean;
949
+ focusable: boolean;
950
+ modelValue: number;
951
+ scrollY: number;
952
+ step: number;
953
+ pageStep: number;
954
+ stickToBottom: boolean;
955
+ scrollbar: boolean;
956
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
957
+ //#endregion
958
+ //#region src/host/components/scroll-bar.d.ts
959
+ declare const VuiScrollBar: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
960
+ scrollY: {
961
+ type: NumberConstructor;
962
+ default: number;
963
+ };
964
+ viewportHeight: {
965
+ type: NumberConstructor;
966
+ required: true;
967
+ };
968
+ contentHeight: {
969
+ type: NumberConstructor;
970
+ required: true;
971
+ };
972
+ thumbBg: {
973
+ type: (StringConstructor | NumberConstructor)[];
974
+ default: string;
975
+ };
976
+ trackBg: {
977
+ type: (StringConstructor | NumberConstructor)[];
978
+ default: undefined;
979
+ };
980
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
981
+ [key: string]: any;
982
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("scroll" | "update:scrollY")[], "scroll" | "update:scrollY", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
983
+ scrollY: {
984
+ type: NumberConstructor;
985
+ default: number;
986
+ };
987
+ viewportHeight: {
988
+ type: NumberConstructor;
989
+ required: true;
990
+ };
991
+ contentHeight: {
992
+ type: NumberConstructor;
993
+ required: true;
994
+ };
995
+ thumbBg: {
996
+ type: (StringConstructor | NumberConstructor)[];
997
+ default: string;
998
+ };
999
+ trackBg: {
1000
+ type: (StringConstructor | NumberConstructor)[];
1001
+ default: undefined;
1002
+ };
1003
+ }>> & Readonly<{
1004
+ onScroll?: ((...args: any[]) => any) | undefined;
1005
+ "onUpdate:scrollY"?: ((...args: any[]) => any) | undefined;
1006
+ }>, {
1007
+ scrollY: number;
1008
+ thumbBg: string | number;
1009
+ trackBg: string | number;
1010
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
1011
+ //#endregion
1012
+ //#region src/host/components/select-list.d.ts
1013
+ type ColorProp$1 = string | number;
1014
+ type SelectItemValue = string | number;
1015
+ type SelectItem = SelectItemValue | {
1016
+ label: string;
1017
+ value: SelectItemValue;
1018
+ disabled?: boolean;
1019
+ };
1020
+ declare const VuiSelectList: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
1021
+ items: {
1022
+ type: PropType<SelectItem[]>;
1023
+ required: true;
1024
+ };
1025
+ modelValue: {
1026
+ type: PropType<SelectItemValue | undefined>;
1027
+ default: undefined;
1028
+ };
1029
+ focused: {
1030
+ type: BooleanConstructor;
1031
+ default: boolean;
1032
+ };
1033
+ focusable: {
1034
+ type: BooleanConstructor;
1035
+ default: boolean;
1036
+ };
1037
+ activeBg: {
1038
+ type: PropType<ColorProp$1>;
1039
+ default: string;
1040
+ };
1041
+ activeFg: {
1042
+ type: PropType<ColorProp$1>;
1043
+ default: string;
1044
+ };
1045
+ selectedBg: {
1046
+ type: PropType<ColorProp$1>;
1047
+ default: undefined;
1048
+ };
1049
+ selectedFg: {
1050
+ type: PropType<ColorProp$1>;
1051
+ default: undefined;
1052
+ };
1053
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
1054
+ [key: string]: any;
1055
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("select" | "update:modelValue" | "active")[], "select" | "update:modelValue" | "active", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1056
+ items: {
1057
+ type: PropType<SelectItem[]>;
1058
+ required: true;
1059
+ };
1060
+ modelValue: {
1061
+ type: PropType<SelectItemValue | undefined>;
1062
+ default: undefined;
1063
+ };
1064
+ focused: {
1065
+ type: BooleanConstructor;
1066
+ default: boolean;
1067
+ };
1068
+ focusable: {
1069
+ type: BooleanConstructor;
1070
+ default: boolean;
1071
+ };
1072
+ activeBg: {
1073
+ type: PropType<ColorProp$1>;
1074
+ default: string;
1075
+ };
1076
+ activeFg: {
1077
+ type: PropType<ColorProp$1>;
1078
+ default: string;
1079
+ };
1080
+ selectedBg: {
1081
+ type: PropType<ColorProp$1>;
1082
+ default: undefined;
1083
+ };
1084
+ selectedFg: {
1085
+ type: PropType<ColorProp$1>;
1086
+ default: undefined;
1087
+ };
1088
+ }>> & Readonly<{
1089
+ onSelect?: ((...args: any[]) => any) | undefined;
1090
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
1091
+ onActive?: ((...args: any[]) => any) | undefined;
1092
+ }>, {
1093
+ focused: boolean;
1094
+ focusable: boolean;
1095
+ modelValue: SelectItemValue | undefined;
1096
+ activeBg: ColorProp$1;
1097
+ activeFg: ColorProp$1;
1098
+ selectedBg: ColorProp$1;
1099
+ selectedFg: ColorProp$1;
1100
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
1101
+ declare const VuiSelect: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
1102
+ items: {
1103
+ type: PropType<SelectItem[]>;
1104
+ required: true;
1105
+ };
1106
+ modelValue: {
1107
+ type: PropType<SelectItemValue | undefined>;
1108
+ default: undefined;
1109
+ };
1110
+ focused: {
1111
+ type: BooleanConstructor;
1112
+ default: boolean;
1113
+ };
1114
+ focusable: {
1115
+ type: BooleanConstructor;
1116
+ default: boolean;
1117
+ };
1118
+ activeBg: {
1119
+ type: PropType<ColorProp$1>;
1120
+ default: string;
1121
+ };
1122
+ activeFg: {
1123
+ type: PropType<ColorProp$1>;
1124
+ default: string;
1125
+ };
1126
+ selectedBg: {
1127
+ type: PropType<ColorProp$1>;
1128
+ default: undefined;
1129
+ };
1130
+ selectedFg: {
1131
+ type: PropType<ColorProp$1>;
1132
+ default: undefined;
1133
+ };
1134
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
1135
+ [key: string]: any;
1136
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("select" | "update:modelValue" | "active")[], "select" | "update:modelValue" | "active", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1137
+ items: {
1138
+ type: PropType<SelectItem[]>;
1139
+ required: true;
1140
+ };
1141
+ modelValue: {
1142
+ type: PropType<SelectItemValue | undefined>;
1143
+ default: undefined;
1144
+ };
1145
+ focused: {
1146
+ type: BooleanConstructor;
1147
+ default: boolean;
1148
+ };
1149
+ focusable: {
1150
+ type: BooleanConstructor;
1151
+ default: boolean;
1152
+ };
1153
+ activeBg: {
1154
+ type: PropType<ColorProp$1>;
1155
+ default: string;
1156
+ };
1157
+ activeFg: {
1158
+ type: PropType<ColorProp$1>;
1159
+ default: string;
1160
+ };
1161
+ selectedBg: {
1162
+ type: PropType<ColorProp$1>;
1163
+ default: undefined;
1164
+ };
1165
+ selectedFg: {
1166
+ type: PropType<ColorProp$1>;
1167
+ default: undefined;
1168
+ };
1169
+ }>> & Readonly<{
1170
+ onSelect?: ((...args: any[]) => any) | undefined;
1171
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
1172
+ onActive?: ((...args: any[]) => any) | undefined;
1173
+ }>, {
1174
+ focused: boolean;
1175
+ focusable: boolean;
1176
+ modelValue: SelectItemValue | undefined;
1177
+ activeBg: ColorProp$1;
1178
+ activeFg: ColorProp$1;
1179
+ selectedBg: ColorProp$1;
1180
+ selectedFg: ColorProp$1;
1181
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
1182
+ //#endregion
1183
+ //#region src/components/spinner.d.ts
1184
+ type ColorProp = string | number;
1185
+ /** Built-in spinner frame sets, selectable via the `preset` prop. */
1186
+ declare const SPINNER_PRESETS: {
1187
+ readonly braille: readonly ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
1188
+ readonly dots: readonly ["⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"];
1189
+ readonly line: readonly ["-", "\\", "|", "/"];
1190
+ readonly bounce: readonly ["⠁", "⠂", "⠄", "⠂"];
1191
+ readonly arc: readonly ["◜", "◠", "◝", "◞", "◡", "◟"];
1192
+ readonly circle: readonly ["◐", "◓", "◑", "◒"];
1193
+ readonly arrow: readonly ["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"];
1194
+ readonly toggle: readonly ["▰▱▱", "▱▰▱", "▱▱▰", "▱▰▱"];
1195
+ readonly pulse: readonly ["·", "•", "●", "•"];
1196
+ };
1197
+ type SpinnerPreset = keyof typeof SPINNER_PRESETS;
1198
+ declare const VuiSpinner: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
1199
+ /** Animation frames, cycled in order. Overrides `preset` when set. */frames: {
1200
+ type: PropType<string[]>;
1201
+ default: undefined;
1202
+ }; /** Named built-in frame set; ignored when `frames` is provided. */
1203
+ preset: {
1204
+ type: PropType<SpinnerPreset>;
1205
+ default: string;
1206
+ }; /** Milliseconds between frames. */
1207
+ interval: {
1208
+ type: NumberConstructor;
1209
+ default: number;
1210
+ }; /** Spinner color; defaults to the active theme's accent. */
1211
+ color: {
1212
+ type: PropType<ColorProp>;
1213
+ default: undefined;
1214
+ }; /** Optional label rendered after the spinner glyph. */
1215
+ label: {
1216
+ type: StringConstructor;
1217
+ default: string;
1218
+ };
1219
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
1220
+ [key: string]: any;
1221
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1222
+ /** Animation frames, cycled in order. Overrides `preset` when set. */frames: {
1223
+ type: PropType<string[]>;
1224
+ default: undefined;
1225
+ }; /** Named built-in frame set; ignored when `frames` is provided. */
1226
+ preset: {
1227
+ type: PropType<SpinnerPreset>;
1228
+ default: string;
1229
+ }; /** Milliseconds between frames. */
1230
+ interval: {
1231
+ type: NumberConstructor;
1232
+ default: number;
1233
+ }; /** Spinner color; defaults to the active theme's accent. */
1234
+ color: {
1235
+ type: PropType<ColorProp>;
1236
+ default: undefined;
1237
+ }; /** Optional label rendered after the spinner glyph. */
1238
+ label: {
1239
+ type: StringConstructor;
1240
+ default: string;
1241
+ };
1242
+ }>> & Readonly<{}>, {
1243
+ label: string;
1244
+ frames: string[];
1245
+ preset: "toggle" | "braille" | "dots" | "line" | "bounce" | "arc" | "circle" | "arrow" | "pulse";
1246
+ interval: number;
1247
+ color: ColorProp;
1248
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
1249
+ //#endregion
1250
+ //#region src/host/animation/use-timeline.d.ts
1251
+ /** A timeline handle: spawn tweens that the component owns and that clean up on unmount. */
1252
+ interface Timeline {
1253
+ /** Start a tween; it auto-registers with the scheduler and is cancelled on unmount. */
1254
+ animate(opts: AnimateOptions): Animation;
1255
+ /** Cancel every tween this timeline started (also run automatically on unmount). */
1256
+ stop(): void;
1257
+ }
1258
+ /**
1259
+ * Create a component-scoped timeline. Tweens started via the returned `animate`
1260
+ * are driven by the shared frame loop and cancelled when the component unmounts.
1261
+ */
1262
+ declare function useTimeline(): Timeline;
1263
+ /**
1264
+ * Convenience wrapper for the common one-tween case: start a single animation and
1265
+ * get its handle. Equivalent to `useTimeline().animate(opts)`.
1266
+ */
1267
+ declare function useAnimation(opts: AnimateOptions): Animation;
1268
+ //#endregion
1269
+ //#region src/host/highlighter.d.ts
1270
+ /** One highlighted line: an ordered list of styled runs (alias of `TextRun[]`). */
1271
+ type StyledLine = TextRun[];
1272
+ /** A swappable syntax engine. Returns one `StyledLine` per source line. */
1273
+ interface Highlighter {
1274
+ highlight(code: string, lang?: string): StyledLine[];
1275
+ }
1276
+ /**
1277
+ * Color + attrs for a highlight scope. Keyed by highlight.js scope name (the part
1278
+ * after `hljs-`). Values are author-friendly color strings OR packed `0xRRGGBBAA`
1279
+ * numbers (e.g. from a `Theme`), resolved once via `parseColor`. Tuned for a dark
1280
+ * theme (Catppuccin Mocha); override via `createDefaultHighlighter`.
1281
+ */
1282
+ interface SyntaxPalette {
1283
+ [scope: string]: string | number;
1284
+ }
1285
+ /**
1286
+ * Build a syntax palette from a theme's `syntax*` tokens. Returned partial overrides
1287
+ * the built-in defaults in `createDefaultHighlighter`, so `<code>`/`<markdown>`
1288
+ * fences recolor with the active theme (and on a runtime `setTheme()`).
1289
+ */
1290
+ declare function syntaxPaletteFromTheme(theme: Theme): SyntaxPalette;
1291
+ /**
1292
+ * The built-in highlighter: highlight.js over a registered set of common
1293
+ * languages (ts/js/rust/python/go/json/bash/html/css), adapted to styled runs.
1294
+ * Unknown or omitted languages fall back to uncolored lines — never throws.
1295
+ */
1296
+ declare function createDefaultHighlighter(palette?: SyntaxPalette): Highlighter;
1297
+ /** The shared default highlighter instance used by `<code>`/`<markdown>`. */
1298
+ declare const defaultHighlighter: Highlighter;
1299
+ //#endregion
1300
+ //#region src/host/components/markdown.d.ts
1301
+ declare const VuiMarkdown: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
1302
+ /** Markdown source. */content: {
1303
+ type: StringConstructor;
1304
+ default: string;
1305
+ }; /** Highlighter for fenced code; defaults to the built-in highlight.js one. */
1306
+ highlighter: {
1307
+ type: PropType<Highlighter>;
1308
+ default: undefined;
1309
+ };
1310
+ }>, () => VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
1311
+ [key: string]: any;
1312
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1313
+ /** Markdown source. */content: {
1314
+ type: StringConstructor;
1315
+ default: string;
1316
+ }; /** Highlighter for fenced code; defaults to the built-in highlight.js one. */
1317
+ highlighter: {
1318
+ type: PropType<Highlighter>;
1319
+ default: undefined;
1320
+ };
1321
+ }>> & Readonly<{}>, {
1322
+ content: string;
1323
+ highlighter: Highlighter;
1324
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
1325
+ //#endregion
1326
+ //#region src/host/components/code.d.ts
1327
+ declare const VuiCode: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
1328
+ /** Source code to render. */text: {
1329
+ type: StringConstructor;
1330
+ default: string;
1331
+ }; /** Language id/extension (ts, js, rust, python, go, …); omit for no color. */
1332
+ lang: {
1333
+ type: StringConstructor;
1334
+ default: undefined;
1335
+ }; /** Swappable engine; defaults to the built-in highlight.js highlighter. */
1336
+ highlighter: {
1337
+ type: PropType<Highlighter>;
1338
+ default: undefined;
1339
+ }; /** Render a left line-number gutter. */
1340
+ lineNumbers: {
1341
+ type: BooleanConstructor;
1342
+ default: boolean;
1343
+ }; /** Wrap mode for long lines; code defaults to `nowrap` (clip/scroll). */
1344
+ wrap: {
1345
+ type: PropType<TextWrapMode$1>;
1346
+ default: string;
1347
+ };
1348
+ }>, () => VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
1349
+ [key: string]: any;
1350
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1351
+ /** Source code to render. */text: {
1352
+ type: StringConstructor;
1353
+ default: string;
1354
+ }; /** Language id/extension (ts, js, rust, python, go, …); omit for no color. */
1355
+ lang: {
1356
+ type: StringConstructor;
1357
+ default: undefined;
1358
+ }; /** Swappable engine; defaults to the built-in highlight.js highlighter. */
1359
+ highlighter: {
1360
+ type: PropType<Highlighter>;
1361
+ default: undefined;
1362
+ }; /** Render a left line-number gutter. */
1363
+ lineNumbers: {
1364
+ type: BooleanConstructor;
1365
+ default: boolean;
1366
+ }; /** Wrap mode for long lines; code defaults to `nowrap` (clip/scroll). */
1367
+ wrap: {
1368
+ type: PropType<TextWrapMode$1>;
1369
+ default: string;
1370
+ };
1371
+ }>> & Readonly<{}>, {
1372
+ wrap: TextWrapMode$1;
1373
+ text: string;
1374
+ highlighter: Highlighter;
1375
+ lang: string;
1376
+ lineNumbers: boolean;
1377
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
1378
+ //#endregion
1379
+ //#region src/host/components/diff.d.ts
1380
+ declare const VuiDiff: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
1381
+ /** Unified-diff text (`git diff` output). */patch: {
1382
+ type: StringConstructor;
1383
+ default: string;
1384
+ }; /** `unified` (default). `split` is accepted but renders unified for now. */
1385
+ mode: {
1386
+ type: PropType<"unified" | "split">;
1387
+ default: string;
1388
+ }; /** Render an old/new line-number gutter. */
1389
+ lineNumbers: {
1390
+ type: BooleanConstructor;
1391
+ default: boolean;
1392
+ };
1393
+ }>, () => import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
1394
+ [key: string]: any;
1395
+ }>, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
1396
+ /** Unified-diff text (`git diff` output). */patch: {
1397
+ type: StringConstructor;
1398
+ default: string;
1399
+ }; /** `unified` (default). `split` is accepted but renders unified for now. */
1400
+ mode: {
1401
+ type: PropType<"unified" | "split">;
1402
+ default: string;
1403
+ }; /** Render an old/new line-number gutter. */
1404
+ lineNumbers: {
1405
+ type: BooleanConstructor;
1406
+ default: boolean;
1407
+ };
1408
+ }>> & Readonly<{}>, {
1409
+ mode: "split" | "unified";
1410
+ lineNumbers: boolean;
1411
+ patch: string;
1412
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
1413
+ //#endregion
1414
+ //#region src/host/markdown-parser.d.ts
1415
+ /** An inline run with the formatting flags a `<span>` can carry. */
1416
+ interface MdSpan {
1417
+ text: string;
1418
+ bold?: boolean;
1419
+ italic?: boolean;
1420
+ strike?: boolean;
1421
+ /** Inline `code` span — rendered with the code accent + subtle background. */
1422
+ code?: boolean;
1423
+ /** Link target (text is the visible label); rendered underlined. */
1424
+ href?: string;
1425
+ }
1426
+ interface MdHeading {
1427
+ type: 'heading';
1428
+ level: number;
1429
+ spans: MdSpan[];
1430
+ }
1431
+ interface MdParagraph {
1432
+ type: 'paragraph';
1433
+ spans: MdSpan[];
1434
+ }
1435
+ interface MdCode {
1436
+ type: 'code';
1437
+ text: string;
1438
+ lang?: string;
1439
+ }
1440
+ interface MdListItem {
1441
+ spans: MdSpan[];
1442
+ /** Nested sub-list, if any. */
1443
+ children?: MdList;
1444
+ }
1445
+ interface MdList {
1446
+ type: 'list';
1447
+ ordered: boolean;
1448
+ start: number;
1449
+ items: MdListItem[];
1450
+ }
1451
+ interface MdBlockquote {
1452
+ type: 'blockquote';
1453
+ blocks: MdBlock[];
1454
+ }
1455
+ interface MdHr {
1456
+ type: 'hr';
1457
+ }
1458
+ interface MdTable {
1459
+ type: 'table';
1460
+ header: MdSpan[][];
1461
+ rows: MdSpan[][][];
1462
+ }
1463
+ type MdBlock = MdHeading | MdParagraph | MdCode | MdList | MdBlockquote | MdHr | MdTable;
1464
+ /** Parse markdown source into a flat list of renderable blocks. */
1465
+ declare function parseMarkdown(content: string): MdBlock[];
1466
+ //#endregion
1467
+ //#region src/host/diff-parser.d.ts
1468
+ type DiffLineKind = 'meta' | 'hunk' | 'add' | 'del' | 'context';
1469
+ interface DiffLine {
1470
+ kind: DiffLineKind;
1471
+ /** Line content without the leading +/-/space marker. */
1472
+ text: string;
1473
+ /** 1-based line number in the old file (del/context), else undefined. */
1474
+ oldNo?: number;
1475
+ /** 1-based line number in the new file (add/context), else undefined. */
1476
+ newNo?: number;
1477
+ }
1478
+ /** Parse a unified-diff patch into classified, line-numbered rows. */
1479
+ declare function parseUnifiedDiff(patch: string): DiffLine[];
1480
+ //#endregion
1481
+ //#region src/vui-elements.d.ts
1482
+ /** A color: a CSS/hex/name string or a packed `0xRRGGBBAA` number (see `rgba`). */
1483
+ type Color = string | number;
1484
+ /** Layout props — folded into the node's taffy style (mirror of `VuiStyle`). */
1485
+ interface LayoutProps {
1486
+ display?: 'flex' | 'none';
1487
+ position?: 'relative' | 'absolute';
1488
+ flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
1489
+ flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
1490
+ alignItems?: AlignValue;
1491
+ alignSelf?: AlignValue;
1492
+ justifyContent?: JustifyValue;
1493
+ flexGrow?: number;
1494
+ flexShrink?: number;
1495
+ flexBasis?: Dim;
1496
+ width?: Dim;
1497
+ height?: Dim;
1498
+ minWidth?: Dim;
1499
+ minHeight?: Dim;
1500
+ maxWidth?: Dim;
1501
+ maxHeight?: Dim;
1502
+ padding?: Sides;
1503
+ margin?: Sides;
1504
+ inset?: Sides;
1505
+ /** Per-side `inset` shorthands (absolute positioning). */
1506
+ top?: Dim;
1507
+ right?: Dim;
1508
+ bottom?: Dim;
1509
+ left?: Dim;
1510
+ gap?: number | {
1511
+ width?: number;
1512
+ height?: number;
1513
+ };
1514
+ /** Border thickness in layout cells; `border` (paint) sets this implicitly. */
1515
+ borderWidth?: Dim;
1516
+ /** A whole `VuiStyle` object, spread through `patchProp`. */
1517
+ style?: VuiStyle;
1518
+ }
1519
+ /** Paint props — applied immediately to the Rust node (`set_*`). */
1520
+ interface PaintProps {
1521
+ bg?: Color;
1522
+ backgroundColor?: Color;
1523
+ fg?: Color;
1524
+ color?: Color;
1525
+ /** Raw attribute bitmask (OR of `Attr.*`); the boolean flags below OR onto it. */
1526
+ attrs?: number;
1527
+ bold?: boolean;
1528
+ dim?: boolean;
1529
+ italic?: boolean;
1530
+ underline?: boolean;
1531
+ strikethrough?: boolean;
1532
+ inverse?: boolean;
1533
+ border?: boolean | 'none' | 'single' | 'double' | 'rounded';
1534
+ borderColor?: Color;
1535
+ title?: string;
1536
+ titleAlign?: 'left' | 'center' | 'right';
1537
+ visible?: boolean;
1538
+ opacity?: number;
1539
+ wrap?: 'word' | 'char' | 'nowrap';
1540
+ /**
1541
+ * Clip children to this box's content box. `visible` (default) lets them
1542
+ * spill; `hidden`/`scroll` make it a viewport (`scroll` pairs with scrollY).
1543
+ */
1544
+ overflow?: 'visible' | 'hidden' | 'scroll';
1545
+ /** Paint order among siblings; higher draws on top (default 0). */
1546
+ zIndex?: number;
1547
+ }
1548
+ /** Focus + keyboard event props (dispatched by the focus manager). */
1549
+ interface FocusProps {
1550
+ /** Participate in Tab focus traversal. */
1551
+ focusable?: boolean;
1552
+ /** Controlled focus: focus this node on mount / when true. */
1553
+ focused?: boolean;
1554
+ onKeyDown?: (ev: DispatchableEvent) => void;
1555
+ onPaste?: (ev: DispatchableEvent) => void;
1556
+ onMouseDown?: (ev: DispatchableMouseEvent) => void;
1557
+ onMouseUp?: (ev: DispatchableMouseEvent) => void;
1558
+ onMouseMove?: (ev: DispatchableMouseEvent) => void;
1559
+ onWheel?: (ev: DispatchableMouseEvent) => void;
1560
+ onFocus?: () => void;
1561
+ onBlur?: () => void;
1562
+ }
1563
+ /** `<box>` — a flex container; the only element that may hold boxes/text. */
1564
+ type BoxProps = LayoutProps & PaintProps & FocusProps;
1565
+ /** `<text>` — holds strings + inline run-style tags; sizes/colors its content. */
1566
+ type TextProps = LayoutProps & PaintProps & FocusProps;
1567
+ interface ScrollProps {
1568
+ /** Paint-time child offset; layout still measures the full child tree. */
1569
+ scrollX?: number;
1570
+ scrollY?: number;
1571
+ }
1572
+ /**
1573
+ * Inline run-style tags (`<span>`/`<b>`/`<i>`/`<u>`/`<em>`/`<strong>`) — virtual
1574
+ * nodes that fold style into the enclosing `<text>`'s runs. They take only run
1575
+ * style, not layout.
1576
+ */
1577
+ interface SpanProps {
1578
+ fg?: Color;
1579
+ color?: Color;
1580
+ bg?: Color;
1581
+ backgroundColor?: Color;
1582
+ attrs?: number;
1583
+ bold?: boolean;
1584
+ dim?: boolean;
1585
+ italic?: boolean;
1586
+ underline?: boolean;
1587
+ strikethrough?: boolean;
1588
+ inverse?: boolean;
1589
+ }
1590
+ /**
1591
+ * `<input>` — resolves to the `VuiInput` component (registered globally in
1592
+ * create-app.ts). v-model uses `value` / `update:value`; both `v-model:value`
1593
+ * and bare `v-model` type-check (the latter via the `modelValue` aliases here,
1594
+ * which the build-time directive transform rewrites to `value`). Layout/paint
1595
+ * props fall through to the underlying edit node.
1596
+ */
1597
+ interface InputProps extends LayoutProps, PaintProps, FocusProps {
1598
+ value?: string;
1599
+ /** Alias so bare `v-model` type-checks; rewritten to `value` at build time. */
1600
+ modelValue?: string;
1601
+ placeholder?: string;
1602
+ placeholderColor?: Color;
1603
+ cursorColor?: Color;
1604
+ maxLength?: number;
1605
+ 'onUpdate:value'?: (value: string) => void;
1606
+ 'onUpdate:modelValue'?: (value: string) => void;
1607
+ onInput?: (value: string) => void;
1608
+ onChange?: (value: string) => void;
1609
+ onEnter?: (value: string) => void;
1610
+ }
1611
+ /** `<textarea>` — multi-line native-backed editor. */
1612
+ interface TextareaProps extends LayoutProps, PaintProps, FocusProps {
1613
+ value?: string;
1614
+ modelValue?: string;
1615
+ placeholder?: string;
1616
+ placeholderColor?: Color;
1617
+ cursorColor?: Color;
1618
+ wrap?: 'word' | 'char' | 'nowrap';
1619
+ tabBehavior?: 'focus' | 'indent';
1620
+ tabSize?: number;
1621
+ 'onUpdate:value'?: (value: string) => void;
1622
+ 'onUpdate:modelValue'?: (value: string) => void;
1623
+ onInput?: (value: string) => void;
1624
+ onChange?: (value: string) => void;
1625
+ onEnter?: (value: string) => void;
1626
+ }
1627
+ /**
1628
+ * `<canvas>` — first-class custom drawing (JS host). `@draw` receives a clamped,
1629
+ * clipped `CanvasContext` (local 0-based coords) + the laid-out rect; `buffered`
1630
+ * switches to an offscreen framebuffer that re-runs `@draw` only on change.
1631
+ */
1632
+ interface CanvasProps extends LayoutProps, PaintProps, FocusProps {
1633
+ buffered?: boolean;
1634
+ onDraw?: (ctx: CanvasContext, rect: CanvasRect) => void;
1635
+ }
1636
+ interface ScrollBoxProps extends LayoutProps, PaintProps, FocusProps {
1637
+ modelValue?: number;
1638
+ scrollY?: number;
1639
+ step?: number;
1640
+ pageStep?: number;
1641
+ /** Pin the view to the bottom as content grows (chat/transcript). */
1642
+ stickToBottom?: boolean;
1643
+ /** Render an integrated vertical scrollbar (indicator + drag) on the right edge. */
1644
+ scrollbar?: boolean;
1645
+ 'onUpdate:modelValue'?: (value: number) => void;
1646
+ 'onUpdate:scrollY'?: (value: number) => void;
1647
+ onScroll?: (value: number) => void;
1648
+ }
1649
+ interface ScrollBarProps extends LayoutProps, PaintProps, FocusProps {
1650
+ scrollY?: number;
1651
+ viewportHeight: number;
1652
+ contentHeight: number;
1653
+ thumbBg?: Color;
1654
+ trackBg?: Color;
1655
+ 'onUpdate:scrollY'?: (value: number) => void;
1656
+ onScroll?: (value: number) => void;
1657
+ }
1658
+ /**
1659
+ * `<overlay>` — a top-layer box (modal/dialog/toast). Laid out absolute over the
1660
+ * whole terminal by default and drawn on top of the tree, ignoring ancestor
1661
+ * clips. `backdrop` dims everything behind it (opaque).
1662
+ */
1663
+ interface OverlayProps extends LayoutProps, PaintProps, FocusProps {
1664
+ /** Opaque dim layer behind the overlay: `true` (default dim), a `0..1`
1665
+ * brightness multiplier, or `{ darken }`. Omit for no backdrop. */
1666
+ backdrop?: boolean | number | {
1667
+ darken?: number;
1668
+ };
1669
+ /** Confine Tab/Shift-Tab focus to this overlay's subtree while open (modal).
1670
+ * Default `false`; non-trapping overlays (toasts/popups) keep the tab order. */
1671
+ trapFocus?: boolean;
1672
+ }
1673
+ type SelectItemValue$1 = string | number;
1674
+ type SelectItem$1 = SelectItemValue$1 | {
1675
+ label: string;
1676
+ value: SelectItemValue$1;
1677
+ disabled?: boolean;
1678
+ };
1679
+ interface SelectListProps extends LayoutProps, PaintProps, FocusProps {
1680
+ items: SelectItem$1[];
1681
+ modelValue?: SelectItemValue$1;
1682
+ activeBg?: Color;
1683
+ activeFg?: Color;
1684
+ selectedBg?: Color;
1685
+ selectedFg?: Color;
1686
+ 'onUpdate:modelValue'?: (value: SelectItemValue$1) => void;
1687
+ onSelect?: (value: SelectItemValue$1, item: SelectItem$1, index: number) => void;
1688
+ onActive?: (index: number) => void;
1689
+ }
1690
+ /**
1691
+ * `<markdown>` — renders a markdown string into box/text/span. Inline emphasis
1692
+ * folds into styled runs; fenced code is delegated to `<code>`. `highlighter`
1693
+ * swaps the syntax engine used for fences.
1694
+ */
1695
+ interface MarkdownProps extends LayoutProps, PaintProps {
1696
+ content?: string;
1697
+ highlighter?: Highlighter;
1698
+ }
1699
+ /** `<code>` — a syntax-highlighted code block (pluggable highlighter). */
1700
+ interface CodeProps extends LayoutProps, PaintProps {
1701
+ text?: string;
1702
+ lang?: string;
1703
+ highlighter?: Highlighter;
1704
+ lineNumbers?: boolean;
1705
+ wrap?: 'word' | 'char' | 'nowrap';
1706
+ }
1707
+ /** `<diff>` — a unified-diff viewer (split mode deferred). */
1708
+ interface DiffProps extends LayoutProps, PaintProps {
1709
+ patch?: string;
1710
+ mode?: 'unified' | 'split';
1711
+ lineNumbers?: boolean;
1712
+ }
1713
+ declare module '@vue/runtime-core' {
1714
+ interface GlobalComponents {
1715
+ box: DefineComponent<BoxProps & ScrollProps>;
1716
+ text: DefineComponent<TextProps>;
1717
+ span: DefineComponent<SpanProps>;
1718
+ b: DefineComponent<SpanProps>;
1719
+ i: DefineComponent<SpanProps>;
1720
+ u: DefineComponent<SpanProps>;
1721
+ em: DefineComponent<SpanProps>;
1722
+ strong: DefineComponent<SpanProps>;
1723
+ input: DefineComponent<InputProps>;
1724
+ textarea: DefineComponent<TextareaProps>;
1725
+ canvas: DefineComponent<CanvasProps>;
1726
+ overlay: DefineComponent<OverlayProps & ScrollProps>;
1727
+ 'scroll-box': DefineComponent<ScrollBoxProps>;
1728
+ 'scroll-bar': DefineComponent<ScrollBarProps>;
1729
+ 'select-list': DefineComponent<SelectListProps>;
1730
+ markdown: DefineComponent<MarkdownProps>;
1731
+ code: DefineComponent<CodeProps>;
1732
+ diff: DefineComponent<DiffProps>;
1733
+ }
1734
+ }
1735
+ //#endregion
1736
+ //#region src/use-theme.d.ts
1737
+ /** The active theme for the current component (app theme, or a subtree override). */
1738
+ declare function useTheme(): Theme;
1739
+ /** Override the theme for this component's subtree; merges over the active theme. */
1740
+ declare function provideTheme(theme: Partial<Theme>): Theme;
1741
+ /**
1742
+ * Returns a `setTheme(input, mode?)` that swaps the whole app theme at runtime —
1743
+ * by registered name, theme JSON, full `Theme`, or partial override — with one
1744
+ * coalesced re-render and no remount. `mode` defaults to the detected light/dark
1745
+ * preference. Call inside a component (e.g. from a key handler).
1746
+ */
1747
+ declare function useSetTheme(): (input: ThemeInput, mode?: 'dark' | 'light') => void;
1748
+ //#endregion
1749
+ //#region src/theme/contrast.d.ts
1750
+ /** Perceived luminance (0–1) of a packed color, ITU-R BT.601 weights. */
1751
+ declare function luminance(packed: number): number;
1752
+ /** Whether a background reads as "light" (luminance above the midpoint). */
1753
+ declare function isLight(packed: number): boolean;
1754
+ /**
1755
+ * Choose a foreground color that contrasts with `bg`. On a light background returns
1756
+ * `dark` (default black); on a dark background returns `light` (default white).
1757
+ */
1758
+ declare function pickForeground(bg: number, opts?: {
1759
+ light?: number;
1760
+ dark?: number;
1761
+ }): number;
1762
+ //#endregion
1763
+ export { type AnimateOptions, type Animation, type AnimationRegistry, Attr, BUILTIN_THEMES, type Backdrop, type BoxProps, type CanvasContext, type CanvasDraw, type CanvasProps, type CanvasRect, CanvasRenderable, type CanvasStyle, type CatalogueEntry, type Color, type ColorValue, type DiffLine, type DiffLineKind, type DispatchableEvent, type DispatchableMouseEvent, type EasingFn, type EasingName, EditMotion, EditRenderable, type EditState, type HostFocusManager as FocusManager, type HostFocusManager, type Highlighter, type HostContext, HostContextSymbol, type HostMountOptions, type ImageEncoding, ImageRenderable, type InputEvent, type InputProps, Key, type KeyEvent, type MdBlock, type MdSpan, type MountOptions, type MouseEvent, type OverlayProps, OverlayRenderable, Renderable, type RenderableKind, SPINNER_PRESETS, type ScrollBarProps, type ScrollBoxProps, type SelectItem, type SelectItemValue, type SelectListProps, type SpanProps, type SpinnerPreset, type StyledLine, type SyntaxPalette, type TextProps, type TextWrapMode, type TextareaProps, TextareaRenderable, type TextareaState, type Theme, type ThemeInput, type ThemeJson, ThemeSymbol, type Timeline, type VuiApp, VuiCode, VuiDiff, type VuiHostApp, VuiHostInput, VuiHostInput as VuiInput, VuiHostTextarea, VuiHostTextarea as VuiTextarea, VuiMarkdown, VuiScrollBar, VuiScrollBox, VuiSelect, VuiSelectList, VuiSpinner, computed, createAnimation, createAnimationRegistry, createApp, createDefaultHighlighter, createHostFocusManager as createFocusManager, createHostFocusManager, createHostApp, darkTheme, defaultHighlighter, defineComponent, detectColorScheme, easings, extend, h, isLight, isVuiTag, lightTheme, listThemes, loadThemeFile, luminance, matchesKey, nextTick, onBeforeUnmount, onMounted, onUnmounted, parseColor, parseMarkdown, parseUnifiedDiff, pickForeground, provideTheme, reactive, ref, registerTheme, resolveEasing, resolveTheme, resolveThemeJson, rgba, selectImageEncoding, shallowReactive, shallowRef, syntaxPaletteFromTheme, toRef, toRefs, useAnimation, useSetTheme, useTheme, useTimeline, watch, watchEffect };