Skip to content

Commit

Permalink
Merge pull request #450 from MetCoder95/dotenv-interface
Browse files Browse the repository at this point in the history
Add main interface for library
  • Loading branch information
jcblw committed Feb 8, 2020
2 parents c4573fc + 6e17670 commit 7301ac9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions types/index.d.ts
Expand Up @@ -55,5 +55,12 @@ export interface DotenvConfigOutput {
*
*/
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;

/** dotenv library interface */
export interface DotEnv {
config: typeof config;
parse: typeof parse;
}

/** @deprecated since v7.0.0 Use config instead. */
export const load: typeof config;
7 changes: 6 additions & 1 deletion types/test.ts
@@ -1,4 +1,9 @@
import { config, parse } from "dotenv";
import * as dotenv from "dotenv";

const { config, parse }: dotenv.DotEnv = {
config: dotenv.config,
parse: dotenv.parse
};

const env = config();
const dbUrl: string | null =
Expand Down

0 comments on commit 7301ac9

Please sign in to comment.