diff --git a/src/core/types.ts b/src/core/types.ts new file mode 100644 index 0000000..d74cecc --- /dev/null +++ b/src/core/types.ts @@ -0,0 +1,63 @@ +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' + | 'enum' + | 'port' + | 'url' + | 'email' + | 'json' + | 'int' + | 'host'; + +export interface EnvSchema { + variables: Record; +} + +export interface EnvVariableSchema { + type: EnvType; + required?: boolean; + default?: string | number | boolean; + choices?: string[]; + desc?: string; + name?: string; +} + +export interface ParsedEnv { + flat: Record; + nested: Record; +} + +export interface ValidationResult { + valid: boolean; + errors: ValidationError[]; + output: Record; +} + +export interface ValidationError { + field: string; + message: string; + value?: unknown; +} + +export interface GenerateOptions { + envPath?: string; + schemaPath?: string; + outputPath?: string; + interfaceName?: string; +} + +export interface MigrateOptions { + envPath?: string; + outputPath?: string; +}