/**
 * PathInput — controlled, shell-style path input for the IntroScreen
 * "Change directory" flow.
 *
 * Design goal: behave like a terminal prompt. Users type a path with
 * `Tab` autocompleting the trailing segment, `↑`/`↓` cycling through
 * candidate matches, `Enter` to submit, `Esc` to cancel. We replaced
 * the previous DirectoryPicker (a tree navigator) because typing-with-
 * completion is what muscle memory expects from a CLI.
 *
 * Why a custom controlled input instead of `@inkjs/ui` `TextInput`:
 *   - `TextInput` is uncontrolled and hides the intermediate value, so
 *     we can't replace the trailing segment when the user hits Tab.
 *   - We need to render a block cursor at a specific position, and we
 *     need to render candidate matches *below* the input as the user
 *     cycles. Both require owning the render.
 *
 * Performance:
 *   - `readdirSync` only fires on Tab / ↑ / ↓ — never per keystroke.
 *     Slow filesystems (network mounts, sandboxed FS layers) would
 *     otherwise lag every character.
 *   - We cache the most recent completion result keyed on the
 *     "completion stem" (everything up to and including the last `/`)
 *     so cycling with arrows is instant.
 *
 * Tilde expansion + validation goes through the shared helpers in
 * `src/utils/install-dir.ts` — this file MUST NOT duplicate that logic.
 */
import { resolveUserPath, type ValidationResult } from '../../../utils/install-dir.js';
export interface PathInputProps {
    /** Path to seed the input with. Shown using `~` substitution. */
    initialValue: string;
    /**
     * Called with a resolved, validated absolute path when the user
     * submits a directory that exists.
     */
    onSubmit: (absolutePath: string) => void;
    /** Called when the user presses Esc without submitting. */
    onCancel: () => void;
}
export { resolveUserPath };
/**
 * Validate a user-typed path. Returns a tagged union — the caller
 * renders different copy for each `reason`.
 *
 * Wraps the shared resolver but rewrites error messages to use the
 * `~`-shortened form so the inline UI stays compact. Exported for
 * unit tests + tests that pre-existed against the old PathInput.
 */
export declare function validatePath(input: string): ValidationResult;
/**
 * A completion candidate produced from `readdirSync`.
 */
export interface Completion {
    /** Directory name without any trailing separator. */
    name: string;
    /** Always true today — we only complete directories. */
    isDirectory: boolean;
}
/**
 * Split an input into the completion stem (everything up to and
 * including the last `/`) and the trailing partial segment. If the
 * input has no `/`, the stem is the empty string and the trailing
 * segment is the whole input.
 *
 * Examples:
 *   "~/proj"             → { stem: "~/",       partial: "proj" }
 *   "~/projects/my-"     → { stem: "~/projects/", partial: "my-" }
 *   "/etc"               → { stem: "/",        partial: "etc" }
 *   "myfolder"           → { stem: "",         partial: "myfolder" }
 *   ""                   → { stem: "",         partial: "" }
 *   "~/"                 → { stem: "~/",       partial: "" }
 *   "/usr/local/"        → { stem: "/usr/local/", partial: "" }
 *
 * We use `/` as the separator on every platform — paths typed into
 * the wizard's input are conventionally POSIX-style. Windows users
 * who type backslashes still get correct expansion via `expandTilde`
 * (which accepts both forms) at submit time.
 */
export declare function splitStem(input: string): {
    stem: string;
    partial: string;
};
/**
 * Resolve the directory we should `readdir` to find completions for
 * `input`. For a stem of "~/projects/" we resolve to the absolute
 * `$HOME/projects` directory. For an empty stem (no `/` typed yet)
 * we list `cwd`.
 */
export declare function resolveCompletionDir(stem: string, cwd: string): string;
/**
 * Compute completion candidates for the trailing segment of `input`.
 * Returns directories whose names start with the partial segment.
 *
 * - Hidden directories (leading `.`) are filtered unless the partial
 *   itself begins with a dot, matching shell behavior.
 * - Matching is case-sensitive on POSIX, case-insensitive on Windows.
 * - Errors (missing parent, permission denied) yield an empty list.
 */
export declare function computeCompletions(input: string, cwd: string): {
    stem: string;
    partial: string;
    candidates: Completion[];
};
/**
 * Compute the longest common prefix of an array of strings. Used when
 * Tab finds multiple matches: shells fill the prompt with the LCP and
 * leave the rest to the user.
 */
export declare function longestCommonPrefix(items: string[]): string;
/**
 * Replace the trailing segment of `input` with `candidateName`, optionally
 * appending a separator. Pure — no filesystem access.
 */
export declare function applyCompletion(input: string, candidateName: string, appendSeparator?: boolean): string;
export declare const PathInput: ({ initialValue, onSubmit, onCancel, }: PathInputProps) => import("react/jsx-runtime").JSX.Element;
