import { IconDefinition } from '@fortawesome/fontawesome-svg-core';

export interface Command {
  id: string;
  title: string;
  description?: string;
  icon?: IconDefinition;
  category: CommandCategory;
  keywords: string[];
  shortcut?: string[];
  handler: () => void | Promise<void>;
  visible?: boolean;
  disabled?: boolean;
  order?: number;
  aliases?: string[];
}

export interface CommandGroup {
  category: CommandCategory;
  title: string;
  commands: Command[];
  order?: number;
}

export interface CommandSearchResult {
  command: Command;
  score: number;
  highlightRanges: Array<{ start: number; end: number }>;
}

export interface CommandPaletteConfig {
  maxResults?: number;
  showCategories?: boolean;
  showShortcuts?: boolean;
  showRecent?: boolean;
  recentLimit?: number;
  placeholder?: string;
  noResultsMessage?: string;
  fuzzySearchThreshold?: number;
}

export enum CommandCategory {
  NAVIGATION = 'navigation',
  ACTIONS = 'actions', 
  SETTINGS = 'settings',
  SEARCH = 'search',
  HELP = 'help',
  RECENT = 'recent',
  FILE = 'file',
  EDIT = 'edit',
  VIEW = 'view',
  TOOLS = 'tools'
}

export interface RecentCommand {
  commandId: string;
  lastUsed: Date;
  useCount: number;
}

export interface CommandExecutionContext {
  source: 'keyboard' | 'click' | 'programmatic';
  timestamp: Date;
}