@types/config 3.3.5 → 4.4.0

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/README.md CHANGED
@@ -1,15 +1,3 @@
1
- # Installation
2
- > `npm install --save @types/config`
3
-
4
- # Summary
5
- This package contains type definitions for config (https://github.com/lorenwest/node-config).
6
-
7
- # Details
8
- Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/config.
9
-
10
- ### Additional Details
11
- * Last updated: Tue, 03 Sep 2024 23:36:04 GMT
12
- * Dependencies: none
13
-
14
- # Credits
15
- 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), [Christian Vaagland Tellnes](https://github.com/tellnes), and [Paritosh Bhatia](https://github.com/ParitoshBh).
1
+ This is a stub types definition for @types/config (http://github.com/node-config/node-config.git).
2
+
3
+ config provides its own type definitions, so you don't need @types/config installed!
config/package.json CHANGED
@@ -1,50 +1,12 @@
1
1
  {
2
2
  "name": "@types/config",
3
- "version": "3.3.5",
4
- "description": "TypeScript definitions for config",
5
- "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/config",
6
- "license": "MIT",
7
- "contributors": [
8
- {
9
- "name": "Roman Korneev",
10
- "githubUsername": "RWander",
11
- "url": "https://github.com/RWander"
12
- },
13
- {
14
- "name": "Forrest Bice",
15
- "githubUsername": "forrestbice",
16
- "url": "https://github.com/forrestbice"
17
- },
18
- {
19
- "name": "James Donald",
20
- "githubUsername": "jndonald3",
21
- "url": "https://github.com/jndonald3"
22
- },
23
- {
24
- "name": "Alberto Vasquez",
25
- "githubUsername": "albertovasquez",
26
- "url": "https://github.com/albertovasquez"
27
- },
28
- {
29
- "name": "Christian Vaagland Tellnes",
30
- "githubUsername": "tellnes",
31
- "url": "https://github.com/tellnes"
32
- },
33
- {
34
- "name": "Paritosh Bhatia",
35
- "githubUsername": "ParitoshBh",
36
- "url": "https://github.com/ParitoshBh"
37
- }
38
- ],
3
+ "version": "4.4.0",
4
+ "description": "Stub TypeScript definitions entry for config, which provides its own types definitions",
39
5
  "main": "",
40
- "types": "index.d.ts",
41
- "repository": {
42
- "type": "git",
43
- "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
44
- "directory": "types/config"
45
- },
46
6
  "scripts": {},
47
- "dependencies": {},
48
- "typesPublisherContentHash": "6b0a351b5b0630d58f027161bcf83523c39ecda3d5c25865e3fd51d5ae3b1789",
49
- "typeScriptVersion": "4.8"
7
+ "license": "MIT",
8
+ "dependencies": {
9
+ "config": "*"
10
+ },
11
+ "deprecated": "This is a stub types definition. config provides its own type definitions, so you do not need this installed."
50
12
  }
config/async.d.ts DELETED
@@ -1,7 +0,0 @@
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>;
config/defer.d.ts DELETED
@@ -1,8 +0,0 @@
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 DELETED
@@ -1,89 +0,0 @@
1
- import { ConfigPaths, ConfigPathValues, HasBeenAugmented } from "./utils";
2
-
3
- declare var c: c.IConfig;
4
-
5
- declare namespace c {
6
- // see https://github.com/lorenwest/node-config/wiki/Using-Config-Utilities
7
- interface IUtil {
8
- // Extend an object (and any object it contains) with one or more objects (and objects contained in them).
9
- extendDeep(mergeInto: any, mergeFrom: any, depth?: number): any;
10
- extendDeep(mergeInto: any, mergeFrom1: any, mergeFrom2: any, depth?: number): any;
11
- extendDeep(mergeInto: any, ...mergeFrom: any): any;
12
-
13
- // Return a deep copy of the specified object.
14
- cloneDeep(copyFrom: any, depth?: number): any;
15
-
16
- // Set objects given a path as a string list
17
- setPath(object: object, path: string[], value?: any): void;
18
-
19
- // Return true if two objects have equal contents.
20
- equalsDeep(object1: any, object2: any, dept?: number): boolean;
21
-
22
- // Returns an object containing all elements that differ between two objects.
23
- diffDeep(object1: any, object2: any, depth?: number): any;
24
-
25
- // Make a javascript object property immutable (assuring it cannot be changed from the current value).
26
- makeImmutable(object: any, propertyName?: string, propertyValue?: string): any;
27
-
28
- // Make an object property hidden so it doesn't appear when enumerating elements of the object.
29
- makeHidden(object: any, propertyName: string, propertyValue?: string): any;
30
-
31
- // Get the current value of a config environment variable
32
- getEnv(varName: string): string;
33
-
34
- // Return the config for the project based on directory param if not directory then return default one (config).
35
- loadFileConfigs(configDir?: string): any;
36
-
37
- // Return the sources for the configurations
38
- getConfigSources(): IConfigSource[];
39
-
40
- // Returns a new deep copy of the current config object, or any part of the config if provided.
41
- toObject(config?: any): any;
42
-
43
- /**
44
- * This allows module developers to attach their configurations onto the default configuration object
45
- * so they can be configured by the consumers of the module.
46
- */
47
- setModuleDefaults(moduleName: string, defaults: any): any;
48
- }
49
-
50
- /**
51
- * By augmenting this interface with your own config, you can greatly improve the IntelliSense for the `get` method:
52
- * - Dot notation paths for the `setting` parameter
53
- * - Correctly typed return values
54
- *
55
- * @example
56
- * declare module 'config' {
57
- * interface IConfig extends MyConfig {}
58
- * }
59
- *
60
- * @example
61
- * declare module 'config' {
62
- * interface IConfig {
63
- * myConfig: {
64
- * myString: string;
65
- * myNumber: number;
66
- * };
67
- * }
68
- * }
69
- *
70
- * @example
71
- * const knownToBeStringTyped = config.get('myConfig.myString');
72
- */
73
- interface IConfig {
74
- get: HasBeenAugmented<IConfig> extends true
75
- ? <T extends ConfigPaths<IConfig>>(setting: T) => ConfigPathValues<IConfig, T>
76
- : <T>(setting: string) => T;
77
- has(setting: ConfigPaths<IConfig>): boolean;
78
- has(setting: string): boolean;
79
- util: IUtil;
80
- }
81
-
82
- interface IConfigSource {
83
- name: string;
84
- original?: string | undefined;
85
- parsed: any;
86
- }
87
- }
88
-
89
- export = c;
config/raw.d.ts DELETED
@@ -1,10 +0,0 @@
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>;
config/utils.d.ts DELETED
@@ -1,20 +0,0 @@
1
- type Join<K, P> = K extends string | number ? P extends string | number ? `${K}${"" extends P ? "" : "."}${P}`
2
- : never
3
- : never;
4
-
5
- export type ConfigPaths<T> = T extends object ? {
6
- [K in keyof T]-?: K extends string | number ? `${K}` | Join<K, ConfigPaths<T[K]>>
7
- : never;
8
- }[keyof T]
9
- : "";
10
-
11
- export type ConfigPathValues<O, P extends string> = P extends `${infer K}.${infer Rest}`
12
- ? K extends keyof O ? ConfigPathValues<O[K], Rest>
13
- : never
14
- : P extends keyof O ? O[P]
15
- : never;
16
-
17
- type IsSubsetOf<T, U> = T extends U ? true : false;
18
-
19
- export type HasBeenAugmented<T> = IsSubsetOf<Exclude<keyof T, "get" | "has" | "util">, never> extends true ? false
20
- : true;