From e517bc58bf7bab764a07e55a77a8917865884d07 Mon Sep 17 00:00:00 2001 From: Scott Motte Date: Thu, 8 Feb 2024 17:33:26 -0800 Subject: [PATCH] update types --- lib/main.d.ts | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/lib/main.d.ts b/lib/main.d.ts index da1bd17..fb3819c 100644 --- a/lib/main.d.ts +++ b/lib/main.d.ts @@ -1,20 +1,41 @@ // TypeScript Version: 3.0 /// +export interface DotenvPopulateInput { + [name: string]: string; +} + +export interface DotenvParseInput { + [name: string]: string; +} + +export interface DotenvParseOutput { + [name: string]: string; +} + export interface DotenvExpandOptions { - ignoreProcessEnv?: boolean; error?: Error; - parsed?: { - [name: string]: string; - } + + /** + * Default: `process.env` + * + * Specify an object to write your secrets to. Defaults to process.env environment variables. + * + * example: `const processEnv = {}; require('dotenv').config({ processEnv: processEnv })` + */ + processEnv?: DotenvPopulateInput; + + /** + * Default: `object` + * + * Object coming from dotenv's parsed result. + */ + parsed?: DotenvParseInput; } export interface DotenvExpandOutput { - ignoreProcessEnv?: boolean; error?: Error; - parsed?: { - [name: string]: string; - }; + parsed?: DotenvParseOutput; } /** @@ -22,7 +43,7 @@ export interface DotenvExpandOutput { * * See https://docs.dotenv.org * - * @param options - additional options. example: `{ ignoreProcessEnv: false, error: null, parsed: { { KEY: 'value' } }` + * @param options - additional options. example: `{ processEnv: {}, error: null, parsed: { { KEY: 'value' } }` * @returns an object with a `parsed` key if successful or `error` key if an error occurred. example: { parsed: { KEY: 'value' } } * */