Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed Feb 9, 2024
1 parent d9a452c commit e517bc5
Showing 1 changed file with 30 additions and 9 deletions.
39 changes: 30 additions & 9 deletions lib/main.d.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,49 @@
// TypeScript Version: 3.0
/// <reference types="node" />

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;
}

/**
* Adds variable expansion on top of dotenv.
*
* 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' } }
*
*/
Expand Down

0 comments on commit e517bc5

Please sign in to comment.