mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Defining ConfigJS setModuleDefaults Types
Adding missing type definition for `setModuleDefaults` found here
083a783daa/lib/config.js (L358)
This commit is contained in:
@@ -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", {});
|
||||
|
||||
11
types/config/index.d.ts
vendored
11
types/config/index.d.ts
vendored
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user