/**
 * buildParseApprovalFromTui
 *
 * Turns a `tui/modal@1` block into a runtime
 * `(input: CliApprovalInput) => CliApprovalModal | null` function.
 *
 * Contract rules enforced (sprint-2026-06):
 *   - Returns null when the question pattern is not visible.
 *   - Returns null when the button list is empty or shorter than minButtons.
 *   - Button labels are raw text; never rewritten (e.g. "Yes, and don't ask
 *     again for X" stays verbatim).
 *   - Modal scope respects between-last-two-separators / window-around-question
 *     / whole-screen to avoid false-positives from numbered lists in
 *     assistant prose.
 */
import type { CliParseApprovalFn } from '../../types/cli/index.js';
import { type VisibleRegionSpec } from './visible-region.js';
interface ModalQuestionVariant {
    regex: string;
    flags?: string;
    label?: string;
}
interface ModalContextHeader {
    regex: string;
    flags?: string;
}
export interface ModalTuiSpec {
    $schema: 'adhdev:tui/modal@1';
    questionPattern: string;
    questionFlags?: string;
    questionVariants?: ModalQuestionVariant[];
    buttonPattern: string;
    buttonFlags?: string;
    buttonLabelGroup?: number;
    /**
     * Optional fallback for terminals that render all options on a single line
     * (e.g. Antigravity feedback survey: `[0] skip [1] yes [2] no [3] still using`).
     * When per-line button extraction collects fewer than `minButtons`, the
     * builder makes a second pass with this regex (global match, capture group 1
     * is the label).
     */
    inlineButtonPattern?: string;
    inlineButtonFlags?: string;
    scope?: 'between-last-two-separators' | 'window-around-question' | 'whole-screen';
    scopeWindowLines?: number;
    contextHeader?: ModalContextHeader;
    continuationLines?: boolean;
    minButtons?: number;
}
declare function findQuestionLineIndex(spec: ModalTuiSpec, lines: string[]): {
    index: number;
    matchedSource: 'primary' | string;
} | null;
declare function scopeLines(spec: ModalTuiSpec, lines: string[], questionIndex: number): {
    start: number;
    end: number;
};
declare function extractButtons(spec: ModalTuiSpec, lines: string[], windowStart: number, windowEnd: number): string[];
export declare function buildParseApprovalFromTui(spec: ModalTuiSpec, visibleRegion?: VisibleRegionSpec): CliParseApprovalFn;
export declare const __internal: {
    findQuestionLineIndex: typeof findQuestionLineIndex;
    scopeLines: typeof scopeLines;
    extractButtons: typeof extractButtons;
};
export {};
