diff --git a/types/index.d.ts b/types/index.d.ts index a83184cc..23f05f69 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -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; diff --git a/types/test.ts b/types/test.ts index bce09209..84b17601 100644 --- a/types/test.ts +++ b/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 =