diff --git a/src/core/types.ts b/src/core/types.ts index d74cecc..699955e 100644 --- a/src/core/types.ts +++ b/src/core/types.ts @@ -1,63 +1,22 @@ -export interface EnvVariable { - name: string; - value: string; - required: boolean; - type: EnvType; - description?: string; - default?: string | number | boolean; - choices?: string[]; -} +export type EnvType = 'string' | 'number' | 'boolean' | 'port' | 'email' | 'url' | 'json' | 'enum'; -export type EnvType = - | 'string' - | 'number' - | 'boolean' - | 'enum' - | 'port' - | 'url' - | 'email' - | 'json' - | 'int' - | 'host'; - -export interface EnvSchema { - variables: Record; -} - -export interface EnvVariableSchema { +export interface EnvVariableConfig { type: EnvType; required?: boolean; default?: string | number | boolean; - choices?: string[]; - desc?: string; - name?: string; + options?: string[]; } -export interface ParsedEnv { - flat: Record; - nested: Record; -} - -export interface ValidationResult { - valid: boolean; - errors: ValidationError[]; - output: Record; -} +export type EnvVariableSchema = Record; export interface ValidationError { field: string; message: string; - value?: unknown; + value?: string; } -export interface GenerateOptions { - envPath?: string; - schemaPath?: string; - outputPath?: string; - interfaceName?: string; -} - -export interface MigrateOptions { - envPath?: string; - outputPath?: string; +export interface ValidationResult { + isValid: boolean; + errors: ValidationError[]; + cleanedEnv: Record; }