anux-common
Version:
[](https://travis-ci.com/Anupheaus/anux-common) [](https://www.codacy.com/app/Anuphea
19 lines (18 loc) • 635 B
TypeScript
import { AnyObject } from '../extensions';
interface SettingsFromOptions<T> {
defaultValue?: T;
isRequired?: boolean;
transform?(value: string): T;
}
interface SettingsFrom {
env(key: string): string;
env<T>(key: string): T;
env(key: string): string;
env(key: string, options: SettingsFromOptions<string>): string;
env<T>(key: string, options: SettingsFromOptions<T>): T;
preset: {
readonly mode: 'production' | 'development';
};
}
export declare const createSettings: <TSettings extends AnyObject>(delegate: (from: SettingsFrom) => TSettings) => TSettings;
export {};