import type { ModelConfig } from './model'

export type ClassTypeConfig = {
  id: string
  label: string
  courseContent: string
}

export type StoredApiKey = {
  encoding: 'safeStorage' | 'plain'
  value: string
}

export type StoredModelConfig = Omit<ModelConfig, 'apiKey'> & {
  apiKey?: StoredApiKey
}

export type SettingsFile = {
  modelConfig?: StoredModelConfig
  classTypeConfigs?: ClassTypeConfig[]
}

export type SaveSettingsResponse =
  | {
      ok: true
    }
  | {
      ok: false
      message: string
    }

export type LoadSettingsResponse =
  | {
      ok: true
      modelConfig: ModelConfig | null
      classTypeConfigs: ClassTypeConfig[]
    }
  | {
      ok: false
      message: string
    }
