/**
 * Shared types for the keybinding subsystem. Reconstructed from
 * consumer usages (parser, resolver, match, defaultBindings,
 * validate, useKeybinding, shortcutFormat, template) after the
 * original file was lost.
 */

/** Context domain name (e.g. 'global', 'editor', 'agent-picker'). */
export type KeybindingContextName = string

/** A single parsed keystroke like Ctrl+Shift+K. */
export interface ParsedKeystroke {
  key: string
  ctrl: boolean
  alt: boolean
  shift: boolean
  meta: boolean
  super: boolean
}

/** A chord is one or more keystrokes pressed in sequence (e.g. Ctrl+K Ctrl+S). */
export type Chord = ParsedKeystroke[]

/** A fully-resolved binding ready for matching against runtime keystrokes. */
export interface ParsedBinding {
  chord: Chord
  action: string
  context: KeybindingContextName
}

/**
 * A block of bindings from the JSON config. Each block scopes a set
 * of key-string → action-string entries to a single context.
 */
export interface KeybindingBlock {
  context: KeybindingContextName
  bindings: Record<string, string>
}
