Skip to content

Commit e517bc5

Browse files
committed
update types
1 parent d9a452c commit e517bc5

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

lib/main.d.ts

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,49 @@
11
// TypeScript Version: 3.0
22
/// <reference types="node" />
33

4+
export interface DotenvPopulateInput {
5+
[name: string]: string;
6+
}
7+
8+
export interface DotenvParseInput {
9+
[name: string]: string;
10+
}
11+
12+
export interface DotenvParseOutput {
13+
[name: string]: string;
14+
}
15+
416
export interface DotenvExpandOptions {
5-
ignoreProcessEnv?: boolean;
617
error?: Error;
7-
parsed?: {
8-
[name: string]: string;
9-
}
18+
19+
/**
20+
* Default: `process.env`
21+
*
22+
* Specify an object to write your secrets to. Defaults to process.env environment variables.
23+
*
24+
* example: `const processEnv = {}; require('dotenv').config({ processEnv: processEnv })`
25+
*/
26+
processEnv?: DotenvPopulateInput;
27+
28+
/**
29+
* Default: `object`
30+
*
31+
* Object coming from dotenv's parsed result.
32+
*/
33+
parsed?: DotenvParseInput;
1034
}
1135

1236
export interface DotenvExpandOutput {
13-
ignoreProcessEnv?: boolean;
1437
error?: Error;
15-
parsed?: {
16-
[name: string]: string;
17-
};
38+
parsed?: DotenvParseOutput;
1839
}
1940

2041
/**
2142
* Adds variable expansion on top of dotenv.
2243
*
2344
* See https://docs.dotenv.org
2445
*
25-
* @param options - additional options. example: `{ ignoreProcessEnv: false, error: null, parsed: { { KEY: 'value' } }`
46+
* @param options - additional options. example: `{ processEnv: {}, error: null, parsed: { { KEY: 'value' } }`
2647
* @returns an object with a `parsed` key if successful or `error` key if an error occurred. example: { parsed: { KEY: 'value' } }
2748
*
2849
*/

0 commit comments

Comments
 (0)