UNPKG

954 BTypeScriptView Raw
1// Type definitions for rc 1.1
2// Project: https://github.com/dominictarr/rc
3// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
4// BendingBender <https://github.com/BendingBender>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6// TypeScript Version: 2.2
7
8declare function rc(
9 name: string,
10 defaults?: { [key: string]: any },
11 /**
12 * Parsed argv object. For example, if args is `--foo bar`, then this value should be `{foo: 'bar'}`
13 * If `argv` is `null` or `undefined`, then `rc`'s default parser will parse `process.argv`.
14 */
15 argv?: { [key: string]: any } | null,
16 /**
17 * Custom config file parser.
18 * This function will be passed the string contents of each
19 * discovered configuration file should return a parsed object dictionary.
20 */
21 parse?: ((content: string) => { [key: string]: any }) | null
22): { [key: string]: any };
23
24export = rc;