import { EditorCommand, type KeyBinding, type KeyChord, type KeyMap } from "@sweeteditor/core"; import type { SweetEditorWidget } from "./legacy/sweet-editor-widget-legacy.js"; export interface EditorCommandContext { commandId: number; binding: KeyBinding; widget: SweetEditorWidget; event?: KeyboardEvent | Event | null; } export type EditorCommandHandler = (context: EditorCommandContext) => boolean | void | Promise; export type EditorKeyMapResolveStatus = "matched" | "pending" | "no_match"; export interface EditorKeyMapResolveResult { status: EditorKeyMapResolveStatus; command: number; binding: KeyBinding | null; } interface IEditorKeyMapOptions { pendingTimeoutMs?: number; } export declare class EditorKeyMap implements KeyMap { static readonly BUILT_IN_MAX = EditorCommand.TRIGGER_COMPLETION; private readonly _handlers; private readonly _firstChordMap; private readonly _pendingTimeoutMs; private _bindings; private _pendingSubMap; private _pendingFirstChord; private _pendingSince; private _nextCustomCommandId; constructor(input?: KeyMap | Iterable, options?: IEditorKeyMapOptions); static from(input: KeyMap | Iterable | EditorKeyMap | null | undefined): EditorKeyMap; static defaultKeyMap(): EditorKeyMap; static vscode(): EditorKeyMap; get bindings(): KeyBinding[]; set bindings(value: KeyBinding[]); toKeyMap(): KeyMap; clone(): EditorKeyMap; setBindings(input: KeyMap | Iterable): this; addBinding(binding: KeyBinding): this; registerCommand(binding: KeyBinding, handler: EditorCommandHandler): number; setCommandHandler(command: number, handler: EditorCommandHandler | null): this; getCommandHandler(command: number): EditorCommandHandler | null; isPendingSequence(): boolean; resolve(chord: KeyChord): EditorKeyMapResolveResult; private _clearPending; } export declare function vscode(): EditorKeyMap; export declare function defaultKeyMap(): EditorKeyMap; export {};