diff --git a/types/config/config-tests.ts b/types/config/config-tests.ts index 507ecc463c..7952705265 100644 --- a/types/config/config-tests.ts +++ b/types/config/config-tests.ts @@ -34,3 +34,5 @@ var configSources: config.IConfigSource[] = config.util.getConfigSources(); var configSource: config.IConfigSource = configSources[0]; var configSourceName: string = configSource.name; var configSourceOriginal: string | undefined = configSource.original; + +var moduleDefaults: any = config.util.setModuleDefaults("moduleName", {}); diff --git a/types/config/index.d.ts b/types/config/index.d.ts index 2f7ee3eaf1..ea5e5a940a 100644 --- a/types/config/index.d.ts +++ b/types/config/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for node-config // Project: https://github.com/lorenwest/node-config // Definitions by: Roman Korneev +// Forrest Bice +// James Donald // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -31,12 +33,19 @@ declare namespace c { // Get the current value of a config environment variable getEnv(varName: string): string; - + // Return the config for the project based on directory param if not directory then return default one (config). loadFileConfigs(configDir: string): any; // Return the sources for the configurations getConfigSources(): IConfigSource[]; + + /** + * This allows module developers to attach their configurations onto + * the 6 years agoInitial 0.4 checkin default configuration object so + * they can be configured by the consumers of the module. + */ + setModuleDefaults(moduleName:string, defaults:any): any; } interface IConfig {