/** * Converts a value to the target nestable type. * @param type The type that {@link value} should be converted to. * @param value The value to be converted. * @returns The value after being converted to the target type. * @throws {UnsupportedTypeError} Error thrown if the target type isn't one of the nestable types. */ declare function convertToNestableType(type: string, value: string): T; /** * Converts a string into a number. * @param value The input value to convert into a number. * @returns The value after being converted to a number. * @throws {TypeConversionError} Error thrown if the environment variable's value cannot be converted to the target type (number in this case). */ declare function convertToNumber(value: string): number; /** * Converts a string into a boolean. * @param value The input value to convert into a boolean. * @returns The value after being converted to a boolean. * @throws {TypeConversionError} Error thrown if the environment variable's value cannot be converted to the target type (boolean in this case). */ declare function convertToBoolean(value: string): boolean; /** * Converts a string into a Date. * @param value The input value to convert into a Date. * @returns The value after being converted to a Date. * @throws {TypeConversionError} Error thrown if the environment variable's value cannot be converted to the target type (Date in this case). */ declare function convertToDate(value: string): Date; /** * Converts a string into a RegExp. * @param value The input value to convert into a RegExp. * @returns The value after being converted to a RegExp. * @throws {TypeConversionError} Error thrown if the environment variable's value cannot be converted to the target type (RegExp in this case). */ declare function convertToRegExp(value: string): RegExp; /** * Converts a JSON string into an object. * @param value The input value to convert into an object. * @returns The value after being converted to an object. * @throws {TypeConversionError} Error thrown if the environment variable's value cannot be converted to the target type (object in this case). */ declare function convertToObject(value: string): object; /** * Converts a string into an Array. If {@type} is not set, it will default to string. * @param value The input value to convert into an Array. * @param type The type that each element in the Array will be converted to. * @returns The value after being converted to an Array. * @throws {TypeConversionError} Error thrown if the environment variable's value cannot be converted to the target type (Array in this case). */ declare function convertToArray(value: string, type?: string): Array; /** * Converts a string into an Set. If {@type} is not set, it will default to string. * @param value The input value to convert into a Set. * @param type: The type that each element in the Set will be converted to. * @returns The value after being converted to an Set. * @throws {TypeConversionError} Error thrown if the environment variable's value cannot be converted to the target type (Set in this case). */ declare function convertToSet(value: string, type?: string): Set; /** * Converts a string into a Map. If {@link keyType} or {@link valueType} are not set, they will default to string. * @param value The input value to convert into a Map. * @param keyType: The type that each key in the Map will be converted to. * @param valueType: The type that each value in the Map will be converted to. * @returns The value after being converted to an Map. * @throws {TypeConversionError} Error thrown if the environment variable's value cannot be converted to the target type (Map in this case). */ declare function convertToMap(value: string, keyType?: string, valueType?: string): Map; export declare const TypeConverter: { convertToNumber: typeof convertToNumber; convertToBoolean: typeof convertToBoolean; convertToDate: typeof convertToDate; convertToRegExp: typeof convertToRegExp; convertToObject: typeof convertToObject; convertToArray: typeof convertToArray; convertToSet: typeof convertToSet; convertToMap: typeof convertToMap; convertToNestableType: typeof convertToNestableType; }; export default TypeConverter;