Skip to content

Commit 7301ac9

Browse files
authored
Merge pull request #450 from MetCoder95/dotenv-interface
Add main interface for library
2 parents c4573fc + 6e17670 commit 7301ac9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

types/index.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,12 @@ export interface DotenvConfigOutput {
5555
*
5656
*/
5757
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
58+
59+
/** dotenv library interface */
60+
export interface DotEnv {
61+
config: typeof config;
62+
parse: typeof parse;
63+
}
64+
5865
/** @deprecated since v7.0.0 Use config instead. */
5966
export const load: typeof config;

types/test.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { config, parse } from "dotenv";
1+
import * as dotenv from "dotenv";
2+
3+
const { config, parse }: dotenv.DotEnv = {
4+
config: dotenv.config,
5+
parse: dotenv.parse
6+
};
27

38
const env = config();
49
const dbUrl: string | null =

0 commit comments

Comments
 (0)