/**
 * AttackPath type definitions
 * @countermeasure/web-components/security/attack-path
 */

export type AttackStepType =
  | 'initial_access'
  | 'execution'
  | 'persistence'
  | 'privilege_escalation'
  | 'defense_evasion'
  | 'credential_access'
  | 'discovery'
  | 'lateral_movement'
  | 'collection'
  | 'exfiltration'
  | 'impact'
  | 'command_and_control'

export interface AttackStep {
  /** Unique identifier for the step within the chain. */
  id: string
  /** Short human-readable label rendered on the node. */
  label: string
  /** MITRE ATT&CK tactic category this step belongs to. */
  type: AttackStepType
  /** Long-form description shown in the step detail panel. */
  description?: string
  /**
   * Severity of the step. Drives the node accent color.
   * @default 'medium'
   */
  severity?: 'critical' | 'high' | 'medium' | 'low'
  /**
   * Whether this step has been mitigated by an existing control.
   * @default false
   */
  mitigated?: boolean
  /** MITRE ATT&CK technique IDs (e.g. `T1566.001`) associated with the step. */
  techniques?: string[]
}

export interface AttackPathConfig {
  /** Container element (or selector) the attack path is mounted into. */
  container: HTMLElement | string
  /** Ordered list of attack steps from initial access through impact. */
  steps: AttackStep[]
  /** Optional title rendered above the chain. */
  title?: string
  /**
   * Render the MITRE ATT&CK technique IDs underneath each step.
   * @default false
   */
  showTechniques?: boolean
  /** Callback invoked when a step node is clicked. */
  onStepClick?: (step: AttackStep) => void
  /** Additional CSS class names. */
  className?: string
}
