import { type KeyId } from "./keys.js";
/**
 * Names of the bindable behaviors the line editor understands. Each value
 * here is a logical action that one or more physical keys may trigger.
 */
export type EditorAction = "cursorUp" | "cursorDown" | "cursorLeft" | "cursorRight" | "cursorWordLeft" | "cursorWordRight" | "cursorLineStart" | "cursorLineEnd" | "pageUp" | "pageDown" | "deleteCharBackward" | "deleteCharForward" | "deleteWordBackward" | "deleteWordForward" | "deleteToLineStart" | "deleteToLineEnd" | "newLine" | "submit" | "tab" | "selectUp" | "selectDown" | "selectPageUp" | "selectPageDown" | "selectConfirm" | "selectCancel" | "copy" | "yank" | "yankPop" | "undo" | "expandTools" | "toggleSessionPath" | "toggleSessionSort" | "renameSession" | "deleteSession" | "deleteSessionNoninvasive";
export type { KeyId };
/**
 * A mapping from editor actions to the key (or keys) that should fire them.
 */
export type EditorKeybindingsConfig = {
    [K in EditorAction]?: KeyId | KeyId[];
};
export type KeybindingPreset = "default" | "vim";
export interface KeybindingConflict {
    key: string;
    actions: EditorAction[];
}
/**
 * The keybinding layer applied to every editor before any user overrides.
 *
 * The table below is organized into category blocks (caret motion, deletion,
 * text entry, completion popup, clipboard/kill-ring, history, tool expansion,
 * session management). Each block is flattened, in declaration order, into one
 * ordered map. The flat order is preserved exactly.
 *
 * Provenance: bindings derived from GNU readline are marked "[readline]" and
 * use readline's chord exactly. Bindings unique to the indus editor are marked
 * "[indus-original]" and were picked by this project.
 */
export declare const DEFAULT_EDITOR_KEYBINDINGS: Required<EditorKeybindingsConfig>;
export declare const VIM_EDITOR_KEYBINDINGS: Partial<Required<EditorKeybindingsConfig>>;
/**
 * Resolves which keys are wired to which editor action, layering presets,
 * user config, and per-component overrides on top of one another.
 */
export declare class EditorKeybindingsManager {
    private readonly registry;
    private componentOverrides;
    constructor(config?: EditorKeybindingsConfig, preset?: KeybindingPreset);
    private rebuildRegistry;
    private resolveKeys;
    /**
     * Report whether the given raw key data triggers the named action.
     */
    matches(data: string, action: EditorAction, componentId?: string): boolean;
    /**
     * List every key currently wired to the given action.
     */
    getKeys(action: EditorAction): KeyId[];
    registerAction(action: EditorAction, keys: KeyId | KeyId[]): void;
    getRegisteredActions(): EditorAction[];
    /**
     * Swap in a fresh config (and optional preset), rebuilding the bindings.
     */
    setConfig(config: EditorKeybindingsConfig, preset?: KeybindingPreset): void;
    setComponentOverride(componentId: string, config: EditorKeybindingsConfig): void;
    clearComponentOverride(componentId: string): void;
    detectConflicts(): KeybindingConflict[];
}
export declare function getEditorKeybindings(): EditorKeybindingsManager;
export declare function setEditorKeybindings(manager: EditorKeybindingsManager): void;
