/**
 * Types for HSK JSON and CSV import formats
 */

export interface HSKJsonForm {
  traditional: string
  transcriptions: {
    pinyin: string
    numeric?: string
    wadegiles?: string
    [key: string]: string | undefined
  }
  meanings: string[]
  classifiers?: string[]
}

export interface HSKJsonEntry {
  simplified: string
  radical?: string
  level?: string[]
  frequency?: number
  pos?: string[]
  forms: HSKJsonForm[]
}

export interface CSVRow {
  simplified: string
  traditional: string
  pinyin: string
  meaning: string
  hsk_level?: string
  radical?: string
  frequency?: string
  pos?: string
  classifiers?: string
}

export interface ParsedHanzi {
  simplified: string
  radical?: string
  frequency?: number
  forms: ParsedHanziForm[]
  hskLevels: string[]
  partsOfSpeech: string[]
}

export interface ParsedHanziForm {
  traditional: string
  isDefault: boolean
  transcriptions: ParsedTranscription[]
  meanings: ParsedMeaning[]
  classifiers: string[]
}

export interface ParsedTranscription {
  type: string
  value: string
}

export interface ParsedMeaning {
  languageCode: string
  meaning: string
  orderIndex: number
}

export interface ImportResult {
  success: boolean
  imported: number
  failed: number
  errors: ImportError[]
}

export interface ImportError {
  line?: number
  character?: string
  error: string
}
