/**
 * buildParseApprovalFromSquash
 *
 * Companion to buildParseApprovalFromTui. Handles the squashed-modal case:
 * the terminal has re-flowed the approval frame so the rendered text is a
 * single run of lowercase-alnum bytes (e.g. `doyoutrustthecontentsofthisdirectory…1yescontinue2noquit`).
 *
 * Author declares:
 *   - `cues`        — compact substrings/regexes that identify the modal
 *   - `footers`     — optional compact substrings that must also be present
 *   - `buttonRules` — compact→labels mappings used to recover button labels
 *
 * Returns the same shape as buildParseApprovalFromTui — a CliApprovalModal
 * (message + buttons) or null when no rule matches. Caller composes the two
 * builders: try the regular modal first, then fall back to squash. Codex
 * needs both because at narrow widths the terminal renders the squash form,
 * and at wider widths it renders the regular framed form.
 */
import type { CliApprovalInput, CliParseApprovalFn } from '../../types/cli/index.js';
interface SquashCueSpec {
    compact: string;
    kind?: 'substring' | 'regex';
    label?: string;
    messageWhenMatched?: string;
}
interface SquashFooterSpec {
    compact: string;
    kind?: 'substring' | 'regex';
}
interface SquashButtonRuleSpec {
    compact: string;
    kind?: 'substring' | 'regex';
    labels: string[];
}
export interface ApprovalSquashSpec {
    $schema: 'adhdev:tui/approval-squash@1';
    cues: SquashCueSpec[];
    footers?: SquashFooterSpec[];
    buttonRules: SquashButtonRuleSpec[];
    scope?: 'tail-window' | 'whole-screen';
    tailWindowLines?: number;
}
/**
 * The canonical normalisation. Identical to codex-cli's `compactText`:
 * lowercase, then strip everything that is not a-z or 0-9.
 *
 * Exported for tests and for the (rare) provider that wants to compose this
 * with extra normalisation steps.
 */
export declare function compactText(value: string): string;
declare function matchSubstringOrRegex(needle: string, kind: 'substring' | 'regex' | undefined, haystack: string): boolean;
declare function scopeText(spec: ApprovalSquashSpec, input: CliApprovalInput): string;
export declare function buildParseApprovalFromSquash(spec: ApprovalSquashSpec): CliParseApprovalFn;
export declare const __internal: {
    compactText: typeof compactText;
    matchSubstringOrRegex: typeof matchSubstringOrRegex;
    scopeText: typeof scopeText;
};
export {};
