export type Landmark2D = { x: number; y: number; visibility?: number }
export type Landmark3D = { x: number; y: number; z: number; visibility?: number }
export type Point2D = { x: number; z: number }

export type GestureSignal =
  | 'arms-out'
  | 'step-left' | 'step-right' | 'step-forward' | 'step-back'
  | null

export type StepDirection = 'left' | 'right' | 'forward' | 'back'

export type CalibrationStatus = 'framing' | 'waiting' | 'calibrating' | 'pos-center' | 'ready' | 'paused'

export interface StepConfig {
  thresholdX: number
  thresholdZ: number
  reset: number
}

export interface GestureCallbacks {
  onGesture?: (signal: GestureSignal) => void
  onStep?: (direction: StepDirection, foot: 'left' | 'right') => void
  onArmsOut?: () => void
  onCalibrationChange?: (status: CalibrationStatus) => void
  onPause?: () => void
  onResume?: () => void
  onCrossedArmsStart?: () => void
  onCrossedArmsEnd?: () => void
}

/** Baselines produced by calibration */
export interface CalibratedBaselines {
  leftY: number
  rightY: number
  heelBaseL: Point2D
  heelBaseR: Point2D
  footSpread: number
}

export interface StepGraphSample {
  time: number
  leftX: number
  rightX: number
  leftZ: number
  rightZ: number
  activeStep: GestureSignal
}

export interface StepLogEntry {
  t: number
  ltX: number; ltZ: number
  rtX: number; rtZ: number
  blX: number; blZ: number
  brX: number; brZ: number
  dlX: number; dlZ: number
  drX: number; drZ: number
  step: GestureSignal
}
