@types/config 0.0.34 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
config/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
config/README.md CHANGED
@@ -5,12 +5,12 @@
5
5
  This package contains type definitions for node-config (https://github.com/lorenwest/node-config).
6
6
 
7
7
  # Details
8
- Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/config
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/config.
9
9
 
10
- Additional Details
11
- * Last updated: Thu, 08 Feb 2018 16:09:03 GMT
10
+ ### Additional Details
11
+ * Last updated: Thu, 07 Jan 2021 13:04:47 GMT
12
12
  * Dependencies: none
13
13
  * Global values: none
14
14
 
15
15
  # Credits
16
- These definitions were written by Roman Korneev <https://github.com/RWander>, Forrest Bice <https://github.com/forrestbice>, James Donald <https://github.com/jndonald3>, Alberto Vasquez <https://github.com/albertovasquez>.
16
+ These definitions were written by [Roman Korneev](https://github.com/RWander), [Forrest Bice](https://github.com/forrestbice), [James Donald](https://github.com/jndonald3), [Alberto Vasquez](https://github.com/albertovasquez), and [Christian Vaagland Tellnes](https://github.com/tellnes).
config/async.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { IConfig } from './';
2
+
3
+ type AsyncFunction<T,R> = (this: IConfig, config: string, origValue: T) => Promise<R>;
4
+
5
+ export function asyncConfig<R>(promise: Promise<any>): Promise<R>;
6
+ export function asyncConfig<T, R>(func: AsyncFunction<T, R>): Promise<R>;
7
+ export function resolveAsyncConfigs(config: IConfig): Promise<IConfig>;
8
+
config/defer.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ type DeferFunction<T,R> = (this: any, origValue: T) => R;
2
+
3
+ /*
4
+ * Allows a config value to be deferred for later. The original config object is passed
5
+ * into func as "this".
6
+ * See: https://github.com/lorenwest/node-config/wiki/Special-features-for-JavaScript-configuration-files#deferred-values-in-javascript-configuration-files
7
+ */
8
+ export function deferConfig<T, R>(func: DeferFunction<T,R>): R;
config/index.d.ts CHANGED
@@ -1,68 +1,69 @@
1
- // Type definitions for node-config
2
- // Project: https://github.com/lorenwest/node-config
3
- // Definitions by: Roman Korneev <https://github.com/RWander>
4
- // Forrest Bice <https://github.com/forrestbice>
5
- // James Donald <https://github.com/jndonald3>
6
- // Alberto Vasquez <https://github.com/albertovasquez>
7
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
8
-
9
-
10
-
11
- declare var c: c.IConfig;
12
-
13
- declare namespace c {
14
-
15
- // see https://github.com/lorenwest/node-config/wiki/Using-Config-Utilities
16
- interface IUtil {
17
- // Extend an object (and any object it contains) with one or more objects (and objects contained in them).
18
- extendDeep(mergeInto: any, mergeFrom: any, depth?: number): any;
19
-
20
- // Return a deep copy of the specified object.
21
- cloneDeep(copyFrom: any, depth?: number): any;
22
-
23
- // Return true if two objects have equal contents.
24
- equalsDeep(object1: any, object2: any, dept?: number): boolean;
25
-
26
- // Returns an object containing all elements that differ between two objects.
27
- diffDeep(object1: any, object2: any, depth?: number): any;
28
-
29
- // Make a javascript object property immutable (assuring it cannot be changed from the current value).
30
- makeImmutable(object: any, propertyName?: string, propertyValue?: string): any;
31
-
32
- // Make an object property hidden so it doesn't appear when enumerating elements of the object.
33
- makeHidden(object: any, propertyName: string, propertyValue?: string): any;
34
-
35
- // Get the current value of a config environment variable
36
- getEnv(varName: string): string;
37
-
38
- // Return the config for the project based on directory param if not directory then return default one (config).
39
- loadFileConfigs(configDir: string): any;
40
-
41
- // Return the sources for the configurations
42
- getConfigSources(): IConfigSource[];
43
-
44
- // Returns a new deep copy of the current config object, or any part of the config if provided.
45
- toObject(config?: any): any;
46
-
47
- /**
48
- * This allows module developers to attach their configurations onto
49
- * the 6 years agoInitial 0.4 checkin default configuration object so
50
- * they can be configured by the consumers of the module.
51
- */
52
- setModuleDefaults(moduleName:string, defaults:any): any;
53
- }
54
-
55
- interface IConfig {
56
- get<T>(setting: string): T;
57
- has(setting: string): boolean;
58
- util: IUtil;
59
- }
60
-
61
- interface IConfigSource {
62
- name: string;
63
- original?: string;
64
- parsed: any;
65
- }
66
- }
67
-
68
- export = c;
1
+ // Type definitions for node-config
2
+ // Project: https://github.com/lorenwest/node-config
3
+ // Definitions by: Roman Korneev <https://github.com/RWander>
4
+ // Forrest Bice <https://github.com/forrestbice>
5
+ // James Donald <https://github.com/jndonald3>
6
+ // Alberto Vasquez <https://github.com/albertovasquez>
7
+ // Christian Vaagland Tellnes <https://github.com/tellnes>
8
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9
+
10
+
11
+
12
+ declare var c: c.IConfig;
13
+
14
+ declare namespace c {
15
+
16
+ // see https://github.com/lorenwest/node-config/wiki/Using-Config-Utilities
17
+ interface IUtil {
18
+ // Extend an object (and any object it contains) with one or more objects (and objects contained in them).
19
+ extendDeep(mergeInto: any, mergeFrom: any, depth?: number): any;
20
+
21
+ // Return a deep copy of the specified object.
22
+ cloneDeep(copyFrom: any, depth?: number): any;
23
+
24
+ // Return true if two objects have equal contents.
25
+ equalsDeep(object1: any, object2: any, dept?: number): boolean;
26
+
27
+ // Returns an object containing all elements that differ between two objects.
28
+ diffDeep(object1: any, object2: any, depth?: number): any;
29
+
30
+ // Make a javascript object property immutable (assuring it cannot be changed from the current value).
31
+ makeImmutable(object: any, propertyName?: string, propertyValue?: string): any;
32
+
33
+ // Make an object property hidden so it doesn't appear when enumerating elements of the object.
34
+ makeHidden(object: any, propertyName: string, propertyValue?: string): any;
35
+
36
+ // Get the current value of a config environment variable
37
+ getEnv(varName: string): string;
38
+
39
+ // Return the config for the project based on directory param if not directory then return default one (config).
40
+ loadFileConfigs(configDir?: string): any;
41
+
42
+ // Return the sources for the configurations
43
+ getConfigSources(): IConfigSource[];
44
+
45
+ // Returns a new deep copy of the current config object, or any part of the config if provided.
46
+ toObject(config?: any): any;
47
+
48
+ /**
49
+ * This allows module developers to attach their configurations onto
50
+ * the 6 years agoInitial 0.4 checkin default configuration object so
51
+ * they can be configured by the consumers of the module.
52
+ */
53
+ setModuleDefaults(moduleName:string, defaults:any): any;
54
+ }
55
+
56
+ interface IConfig {
57
+ get<T>(setting: string): T;
58
+ has(setting: string): boolean;
59
+ util: IUtil;
60
+ }
61
+
62
+ interface IConfigSource {
63
+ name: string;
64
+ original?: string;
65
+ parsed: any;
66
+ }
67
+ }
68
+
69
+ export = c;
config/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/config",
3
- "version": "0.0.34",
3
+ "version": "0.0.38",
4
4
  "description": "TypeScript definitions for node-config",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -23,15 +23,22 @@
23
23
  "name": "Alberto Vasquez",
24
24
  "url": "https://github.com/albertovasquez",
25
25
  "githubUsername": "albertovasquez"
26
+ },
27
+ {
28
+ "name": "Christian Vaagland Tellnes",
29
+ "url": "https://github.com/tellnes",
30
+ "githubUsername": "tellnes"
26
31
  }
27
32
  ],
28
33
  "main": "",
34
+ "types": "index.d.ts",
29
35
  "repository": {
30
36
  "type": "git",
31
- "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
37
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
38
+ "directory": "types/config"
32
39
  },
33
40
  "scripts": {},
34
41
  "dependencies": {},
35
- "typesPublisherContentHash": "c0ee2b1980974999ec39f4d3ed2b0c327b20dd3c6f3457a7719f247e101ed68b",
36
- "typeScriptVersion": "2.0"
42
+ "typesPublisherContentHash": "3cb15de0e628a17fd2691bd293ef248cbbe74814c134718e63cce8f3f9e73b71",
43
+ "typeScriptVersion": "3.3"
37
44
  }
config/raw.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /* The raw function returns an object as-is instead of passing it through processes that will make the object immutable.
2
+ * See: https://github.com/lorenwest/node-config/wiki/Special-features-for-JavaScript-configuration-files#using-promises-processstdout-and-other-objects-in-javascript-config-files
3
+ */
4
+
5
+ export class RawConfig<T> {
6
+ constructor(rawObj: T);
7
+ resolve(): T;
8
+ }
9
+
10
+ export function raw<T>(obj: T): RawConfig<T>;