forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.d.ts
34 lines (26 loc) · 1.42 KB
/
config.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Type definitions for node-config
// Project: https://github.com/lorenwest/node-config
// Definitions by: Roman Korneev <https://github.com/RWander>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "config" {
// see https://github.com/lorenwest/node-config/wiki/Using-Config-Utilities
interface IUtil {
// Extend an object (and any object it contains) with one or more objects (and objects contained in them).
extendDeep(mergeInto: any, mergeFrom: any, depth?: number): any;
// Return a deep copy of the specified object.
cloneDeep(copyFrom: any, depth?: number): any;
// Return true if two objects have equal contents.
equalsDeep(object1: any, object2: any, dept?: number): boolean;
// Returns an object containing all elements that differ between two objects.
diffDeep(object1: any, object2: any, depth?: number): any;
// Make a javascript object property immutable (assuring it cannot be changed from the current value).
makeImmutable(object: any, propertyName?: string, propertyValue?: string): any;
// Make an object property hidden so it doesn't appear when enumerating elements of the object.
makeHidden(object: any, propertyName: string, propertyValue?: string): any;
// Get the current value of a config environment variable
getEnv(varName: string): string;
}
export function get<T>(setting: string): T;
export function has(setting: string): boolean;
export var util: IUtil;
}