This commit is contained in:
@@ -1,13 +1,31 @@
|
||||
export type EnvType = 'string' | 'number' | 'boolean' | 'port' | 'email' | 'url' | 'json' | 'enum';
|
||||
export type EnvType =
|
||||
| 'string'
|
||||
| 'number'
|
||||
| 'int'
|
||||
| 'boolean'
|
||||
| 'email'
|
||||
| 'url'
|
||||
| 'port'
|
||||
| 'json'
|
||||
| 'enum'
|
||||
| 'host';
|
||||
|
||||
export interface EnvVariableConfig {
|
||||
type: EnvType;
|
||||
required?: boolean;
|
||||
required: boolean;
|
||||
desc?: string;
|
||||
default?: string | number | boolean;
|
||||
options?: string[];
|
||||
choices?: string[];
|
||||
}
|
||||
|
||||
export type EnvVariableSchema = Record<string, EnvVariableConfig>;
|
||||
export interface EnvSchema {
|
||||
variables: Record<string, EnvVariableConfig>;
|
||||
}
|
||||
|
||||
export interface ParsedEnv {
|
||||
flat: Record<string, string>;
|
||||
nested: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface ValidationError {
|
||||
field: string;
|
||||
@@ -16,7 +34,7 @@ export interface ValidationError {
|
||||
}
|
||||
|
||||
export interface ValidationResult {
|
||||
isValid: boolean;
|
||||
valid: boolean;
|
||||
errors: ValidationError[];
|
||||
cleanedEnv: Record<string, string | number | boolean>;
|
||||
output: Record<string, unknown>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user