Skip to content

Commit 985e0d2

Browse files
committed
Add main interface for library
1 parent e874410 commit 985e0d2

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)