Defining ConfigJS setModuleDefaults Types

Adding missing type definition for `setModuleDefaults` found here
083a783daa/lib/config.js (L358)
This commit is contained in:
Forrest Bice
2017-09-08 12:17:13 -07:00
parent 2bb7adf1ce
commit ca01ce404a
2 changed files with 12 additions and 1 deletions

View File

@@ -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", {});

View File

@@ -1,6 +1,8 @@
// Type definitions for node-config
// Project: https://github.com/lorenwest/node-config
// Definitions by: Roman Korneev <https://github.com/RWander>
// Forrest Bice <https://github.com/forrestbice>
// James Donald <https://github.com/jndonald3>
// 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 {