/** * Editing a single line of text in a wizard field. * * The field accepted exactly two things — typing at the end and deleting * backwards. Anyone who wanted to change the middle of an alias * (`@/shared/components` to `@app/shared/components`) pressed the arrow keys, * saw nothing happen, and was left with no option but to delete everything and * retype it. Here the cursor is real: it moves, inserts in the middle, and * deletes in both directions. */ import type { KeyEvent } from '../ui/engine/index.js'; export interface TextInput { readonly value: string; /** Cursor position, in characters — never outside `[0, length]`. */ readonly caret: number; /** * True while the field still shows the suggestion and the user has not touched * it: the first key typed replaces the whole suggestion instead of appending * to it. Moving the cursor or deleting adopts the value and starts editing it. */ readonly pristine: boolean; } export declare function startInput(value: string): TextInput; /** * Applies one key to the field. * * Returns `null` when the key is not an editing key — `enter` and `escape` * belong to the wizard's flow, and it decides what to do with them. */ export declare function editInput(state: TextInput, event: KeyEvent): TextInput | null; //# sourceMappingURL=text-input.d.ts.map