|
1 | 1 | // TypeScript Version: 3.0
|
2 | 2 | /// <reference types="node" />
|
3 | 3 |
|
| 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 | + |
4 | 16 | export interface DotenvExpandOptions {
|
5 |
| - ignoreProcessEnv?: boolean; |
6 | 17 | 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; |
10 | 34 | }
|
11 | 35 |
|
12 | 36 | export interface DotenvExpandOutput {
|
13 |
| - ignoreProcessEnv?: boolean; |
14 | 37 | error?: Error;
|
15 |
| - parsed?: { |
16 |
| - [name: string]: string; |
17 |
| - }; |
| 38 | + parsed?: DotenvParseOutput; |
18 | 39 | }
|
19 | 40 |
|
20 | 41 | /**
|
21 | 42 | * Adds variable expansion on top of dotenv.
|
22 | 43 | *
|
23 | 44 | * See https://docs.dotenv.org
|
24 | 45 | *
|
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' } }` |
26 | 47 | * @returns an object with a `parsed` key if successful or `error` key if an error occurred. example: { parsed: { KEY: 'value' } }
|
27 | 48 | *
|
28 | 49 | */
|
|
0 commit comments