mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Add types for dotenv-parse-variables (#41657)
* add dotenv-parse-variables * minimum ts version
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import dotenvParseVariables = require('dotenv-parse-variables');
|
||||
|
||||
dotenvParseVariables({ a: 'b' });
|
||||
|
||||
dotenvParseVariables({ c: 'd', e: 'f' }, { assignToProcessEnv: true });
|
||||
|
||||
dotenvParseVariables({ g: 'h' }, { overrideProcessEnv: false });
|
||||
|
||||
dotenvParseVariables({ i: 'j' }, { assignToProcessEnv: false, overrideProcessEnv: true });
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for dotenv-parse-variables 0.2
|
||||
// Project: https://github.com/niftylettuce/dotenv-parse-variables
|
||||
// Definitions by: Gary King <https://github.com/garyking>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Minimum TypeScript Version: 3.0
|
||||
|
||||
declare namespace dotenvParseVariables {
|
||||
type Parsed = Record<string, string>;
|
||||
|
||||
interface Options {
|
||||
assignToProcessEnv?: boolean;
|
||||
overrideProcessEnv?: boolean;
|
||||
}
|
||||
|
||||
type ParsedVariables = Record<string, unknown>;
|
||||
}
|
||||
|
||||
declare function dotenvParseVariables(
|
||||
parsed: dotenvParseVariables.Parsed,
|
||||
options?: dotenvParseVariables.Options,
|
||||
): dotenvParseVariables.ParsedVariables;
|
||||
|
||||
export = dotenvParseVariables;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dotenv-parse-variables-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user