export declare const SECONDS_PER_HOUR: number; /** * In milliseconds */ export declare const SECONDS = 1000; /** * In milliseconds */ export declare const MINUTES: number; /** * In milliseconds */ export declare const HOURS: number; /** * In milliseconds */ export declare const DAYS: number; /** * Ensure an env var exists and return the contents if it does */ export declare const requiredVar: (varName: string | string[]) => string; /** * Fetches the contents of an env var if it exists and is not empty, otherwise returning the specified default value, * this means that if no default is specified then `''` will be normalized to `undefined` */ export declare function optionalVar(varName: string | string[], defaultValue: R): string | R; export declare function optionalVar(varName: string | string[], defaultValue?: undefined): string | undefined; /** * Checks that a string is a valid int and returns the number if so */ export declare const checkInt: (s: string) => number | undefined; /** * Fetches the contents of an env var, ensuring it is a valid integer if set, * if it is not set then instead it returns the specified default value */ export declare function intVar(varName: string | string[]): number; export declare function intVar(varName: string | string[], defaultValue: R): number | R; /** * Fetches the contents of an env var, ensuring it is a valid boolean (`'true'`/`'false'`) if set, * if it is not set then instead it returns the specified default value */ export declare function boolVar(varName: string | string[]): boolean; export declare function boolVar(varName: string | string[], defaultValue: R): boolean | R; /** * Fetches the contents of an env var, ensuring it is one of the valid values if set, * if it is not set then instead it returns the specified default value */ export declare function enumVar(varName: string | string[], validValues: readonly T[]): T; export declare function enumVar(varName: string | string[], validValues: readonly T[], defaultValue: T): T; /** * Splits an env var using the provided delimiter (defaults to ',') into an array of individual string values. * Optionally accepts an array of allowed values for the array. */ export declare const arrayVar: (name: string, { delimiter, allowedValues, }?: { delimiter?: string | RegExp; allowedValues?: S[]; }) => S[] | undefined; export type HostPort = { host: string; port: number; }; /** * Splits an env var in the format of `${host1}:${port1}, ${host2}:${port2}, ...` * into an array of individual host/port pairings */ export declare const hostPortsVar: (varName: string | string[], defaultHosts?: HostPort[]) => HostPort[]; /** * Parses a "trust proxy" env var designed for use with express' trust proxy setting, * ie it will parse 'true'/'false' into a boolean for express and '123'/etc into a number * so that express will be able to handle those correctly */ export declare const trustProxyVar: (varName: string | string[], defaultValue?: R) => boolean | string | number | R;