Skip to content

Commit

Permalink
Add main interface for library
Browse files Browse the repository at this point in the history
  • Loading branch information
metcoder95 committed Jan 30, 2020
1 parent e874410 commit 985e0d2
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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 985e0d2

Please sign in to comment.