Skip to content

Commit

Permalink
chore: add @dotenvx/dotenvx TS declaration file
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Jun 25, 2024
1 parent 876e639 commit a448b55
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-expect-error - Type definitions for the @dotenvx/dotenvx package are not available.
import * as dotenvX from '@dotenvx/dotenvx';
import type { ClassConstructor } from 'class-transformer';
import { dump, load } from 'js-yaml';
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@
"@cat-fostering/ory-config-generators": [
"libs/ory-config-generators/src/index.ts"
]
}
},
"typeRoots": [
"node_modules/@types",
"types"
],
"types": [
"@dotenvx/dotenvx"
],
},
"exclude": ["node_modules", "tmp"]
}
17 changes: 17 additions & 0 deletions types/@dotenvx/dotenvx/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
declare module '@dotenvx/dotenvx' {
type DotenvxConfig = {
DOTENV_KEY?: string;
overload?: boolean;
override?: boolean;
convention?: boolean;
path?: string;
processEnv?: Record<string, string>;
};

type DotenvxResult = {
parsed: Record<string, string>;
error?: Error & { message?: string; code?: string; help?: string };
};

export function config(options?: DotenvxConfig): DotenvxResult;
}

0 comments on commit a448b55

Please sign in to comment.