openmaic-custom/lib/types/settings.ts
wyuc 843d33e5cc chore: enforce Prettier formatting and fix lint issues
- Add .prettierignore to exclude vendor packages, lock files, markdown, and YAML
- Update .prettierrc: printWidth 100, singleQuote, trailingComma "all"
- Run Prettier across all source files for consistent formatting
- Fix unused imports (UserRequirements, setTTSProvider)
- Fix eslint-disable comment placement after Prettier reformat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 16:09:45 +08:00

50 lines
1.3 KiB
TypeScript

import type { ProviderId, ModelInfo, ProviderType } from '@/lib/types/provider';
export type SettingsSection =
| 'general'
| 'providers'
| 'agents'
| 'tts'
| 'asr'
| 'pdf'
| 'image'
| 'video'
| 'web-search';
/**
* Unified provider configuration stored in JSON format
* Stores all provider-specific settings and metadata in one object
* Both built-in and custom providers use the same structure
*/
export interface ProviderSettings {
// Configuration
apiKey: string;
baseUrl: string;
models: ModelInfo[]; // All models (user can edit/delete any)
// Metadata (same for built-in and custom providers)
name: string;
type: ProviderType;
defaultBaseUrl?: string;
icon?: string;
requiresApiKey: boolean;
isBuiltIn: boolean; // true for built-in providers, false for custom
// Server-side configuration (set by fetchServerProviders)
isServerConfigured?: boolean; // Server has API key for this provider
serverModels?: string[]; // Server-restricted model list (if set)
serverBaseUrl?: string; // Server-provided base URL override
}
/**
* Provider configurations storage format
* Key: providerId, Value: ProviderSettings
*/
export type ProvidersConfig = Record<ProviderId, ProviderSettings>;
export interface EditingModel {
providerId: ProviderId;
modelIndex: number | null; // null for new model
model: ModelInfo;
}