confmgr
Version:
Env. Configuration Manager
53 lines (52 loc) • 1.5 kB
TypeScript
import { ConfigItemOptions } from './types';
import { ConfigValue } from './baseTypes';
/** This type describes our main config specs */
export type ConfigSpecs = {
container: FactoryCtorInitParams;
config: ModuleDictionnary | {};
};
export type FactoryCtorInitParams = {
prefix: string;
};
export interface ConfigObject {
Validate(): boolean;
Get(Module: any, Key: any): ConfigValue;
Print(PrintOptions?: any): void;
ValidateField(Module: any, string: any): boolean;
GenEnv(): string[];
values: ModuleDictionnary;
}
export type ModuleDictionnary = {
[module: string]: ConfigDictionnaryRaw | ConfigDictionnarySimple;
};
/** Currently not used */
export type ConfigDictionnary = {
[key: string]: ConfigItem | ConfigValue;
};
/**
* This is a spec item: key: Specs
*/
export type ConfigDictionnaryRaw = {
[key: string]: ConfigItem;
};
/**
* This is the simple form of your config: bascically `key: value`.
*/
export type ConfigDictionnarySimple = {
[key: string]: ConfigValue; /** Some test */
};
export interface ConfigItem {
name: string;
description: string;
options?: ConfigItemOptions;
value?: ConfigValue;
}
/**
* The FullConfig type is a wrapper around the raw config itself and some params
*/
export type FullConfig = {
factoryParams: FactoryCtorInitParams;
config: ConfigDictionnaryRaw;
};
export { ConfigItemOptions, PrintOptions } from './optionTypes';
export { ConfigValue, Module, Type } from './baseTypes';