import type { ModelConfig } from './model'

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

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

export type SettingsFile = {
  modelConfig?: StoredModelConfig
}

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

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