envapt 7.0.0-next.0 → 7.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/browser/index.mjs.map +1 -1
- package/dist/{node → types}/engine/NodeEnvapter.d.mts +0 -2
- package/dist/{node → types}/index.d.mts +0 -2
- package/dist/{node/sources/NodeEnvSource.d.cts → types/sources/NodeEnvSource.d.mts} +2 -2
- package/package.json +23 -19
- package/dist/node/config.d.mts +0 -2
- package/dist/node/converters/Converters.d.cts +0 -93
- package/dist/node/converters/Converters.d.mts +0 -95
- package/dist/node/converters/ValueConverter.d.cts +0 -25
- package/dist/node/converters/ValueConverter.d.mts +0 -27
- package/dist/node/core/AdvancedMethods.d.cts +0 -76
- package/dist/node/core/AdvancedMethods.d.mts +0 -78
- package/dist/node/core/EnvapterBase.d.cts +0 -75
- package/dist/node/core/EnvapterBase.d.mts +0 -77
- package/dist/node/core/EnvironmentMethods.d.cts +0 -115
- package/dist/node/core/EnvironmentMethods.d.mts +0 -117
- package/dist/node/core/PrimitiveMethods.d.cts +0 -70
- package/dist/node/core/PrimitiveMethods.d.mts +0 -72
- package/dist/node/decorators/legacy/Envapt.d.cts +0 -218
- package/dist/node/decorators/legacy/Envapt.d.mts +0 -220
- package/dist/node/decorators/legacy/SugarDecorators.d.cts +0 -40
- package/dist/node/decorators/legacy/SugarDecorators.d.mts +0 -42
- package/dist/node/decorators/modern/Envapt.d.cts +0 -218
- package/dist/node/decorators/modern/Envapt.d.mts +0 -220
- package/dist/node/decorators/modern/SugarDecorators.d.cts +0 -40
- package/dist/node/decorators/modern/SugarDecorators.d.mts +0 -42
- package/dist/node/engine/Envapter.d.cts +0 -70
- package/dist/node/engine/Envapter.d.mts +0 -72
- package/dist/node/engine/NodeEnvapter.d.cts +0 -73
- package/dist/node/engine/TemplateResolver.d.cts +0 -17
- package/dist/node/engine/TemplateResolver.d.mts +0 -19
- package/dist/node/index.d.cts +0 -19
- package/dist/node/infra/Debug.d.cts +0 -13
- package/dist/node/infra/Debug.d.mts +0 -15
- package/dist/node/infra/Dotenv.d.cts +0 -17
- package/dist/node/infra/Dotenv.d.mts +0 -19
- package/dist/node/infra/Error.d.cts +0 -72
- package/dist/node/infra/Error.d.mts +0 -74
- package/dist/node/infra/StandardSchema.d.cts +0 -59
- package/dist/node/infra/StandardSchema.d.mts +0 -61
- package/dist/node/legacy.d.cts +0 -4
- package/dist/node/legacy.d.mts +0 -6
- package/dist/node/sources/ManualEnvSource.d.cts +0 -19
- package/dist/node/sources/ManualEnvSource.d.mts +0 -21
- package/dist/node/sources/NodeEnvSource.d.mts +0 -22
- package/dist/node/sources/WorkerEnvSource.d.cts +0 -19
- package/dist/node/sources/WorkerEnvSource.d.mts +0 -21
- package/dist/node/types/Conversion.d.cts +0 -123
- package/dist/node/types/Conversion.d.mts +0 -125
- package/dist/node/types/Decorator.d.cts +0 -26
- package/dist/node/types/Decorator.d.mts +0 -28
- package/dist/node/types/Env.d.cts +0 -17
- package/dist/node/types/Env.d.mts +0 -19
- package/dist/node/types/Options.d.cts +0 -39
- package/dist/node/types/Options.d.mts +0 -41
- package/dist/node/types/Schema.d.cts +0 -12
- package/dist/node/types/Schema.d.mts +0 -14
- package/dist/node/types/Source.d.cts +0 -44
- package/dist/node/types/Source.d.mts +0 -46
- package/dist/workerd/converters/Converters.d.mts +0 -93
- package/dist/workerd/converters/ValueConverter.d.mts +0 -25
- package/dist/workerd/core/AdvancedMethods.d.mts +0 -76
- package/dist/workerd/core/EnvapterBase.d.mts +0 -75
- package/dist/workerd/core/EnvironmentMethods.d.mts +0 -115
- package/dist/workerd/core/PrimitiveMethods.d.mts +0 -70
- package/dist/workerd/decorators/legacy/Envapt.d.mts +0 -218
- package/dist/workerd/decorators/legacy/SugarDecorators.d.mts +0 -40
- package/dist/workerd/decorators/modern/Envapt.d.mts +0 -218
- package/dist/workerd/decorators/modern/SugarDecorators.d.mts +0 -40
- package/dist/workerd/engine/Envapter.d.mts +0 -70
- package/dist/workerd/engine/TemplateResolver.d.mts +0 -17
- package/dist/workerd/index.d.mts +0 -18
- package/dist/workerd/infra/Debug.d.mts +0 -13
- package/dist/workerd/infra/Dotenv.d.mts +0 -17
- package/dist/workerd/infra/Error.d.mts +0 -72
- package/dist/workerd/infra/StandardSchema.d.mts +0 -59
- package/dist/workerd/legacy.d.mts +0 -4
- package/dist/workerd/sources/ManualEnvSource.d.mts +0 -19
- package/dist/workerd/sources/WorkerEnvSource.d.mts +0 -19
- package/dist/workerd/types/Conversion.d.mts +0 -123
- package/dist/workerd/types/Decorator.d.mts +0 -26
- package/dist/workerd/types/Env.d.mts +0 -17
- package/dist/workerd/types/Options.d.mts +0 -39
- package/dist/workerd/types/Schema.d.mts +0 -12
- package/dist/workerd/types/Source.d.mts +0 -44
- /package/dist/{node/config.d.cts → types/config.d.mts} +0 -0
- /package/dist/{browser → types}/converters/Converters.d.mts +0 -0
- /package/dist/{browser → types}/converters/ValueConverter.d.mts +0 -0
- /package/dist/{browser → types}/core/AdvancedMethods.d.mts +0 -0
- /package/dist/{browser → types}/core/EnvapterBase.d.mts +0 -0
- /package/dist/{browser → types}/core/EnvironmentMethods.d.mts +0 -0
- /package/dist/{browser → types}/core/PrimitiveMethods.d.mts +0 -0
- /package/dist/{browser → types}/decorators/legacy/Envapt.d.mts +0 -0
- /package/dist/{browser → types}/decorators/legacy/SugarDecorators.d.mts +0 -0
- /package/dist/{browser → types}/decorators/modern/Envapt.d.mts +0 -0
- /package/dist/{browser → types}/decorators/modern/SugarDecorators.d.mts +0 -0
- /package/dist/{browser → types}/engine/Envapter.d.mts +0 -0
- /package/dist/{browser → types}/engine/TemplateResolver.d.mts +0 -0
- /package/dist/{browser/index.d.mts → types/index.portable.d.mts} +0 -0
- /package/dist/{browser → types}/infra/Debug.d.mts +0 -0
- /package/dist/{browser → types}/infra/Dotenv.d.mts +0 -0
- /package/dist/{browser → types}/infra/Error.d.mts +0 -0
- /package/dist/{browser → types}/infra/StandardSchema.d.mts +0 -0
- /package/dist/{browser → types}/legacy.d.mts +0 -0
- /package/dist/{browser → types}/sources/ManualEnvSource.d.mts +0 -0
- /package/dist/{browser → types}/sources/WorkerEnvSource.d.mts +0 -0
- /package/dist/{browser → types}/types/Conversion.d.mts +0 -0
- /package/dist/{browser → types}/types/Decorator.d.mts +0 -0
- /package/dist/{browser → types}/types/Env.d.mts +0 -0
- /package/dist/{browser → types}/types/Options.d.mts +0 -0
- /package/dist/{browser → types}/types/Schema.d.mts +0 -0
- /package/dist/{browser → types}/types/Source.d.mts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# envapt
|
|
2
2
|
|
|
3
|
+
## 7.0.0-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0bbcc85: Editor auto-import now suggests each public name once instead of once per runtime build. The published type declarations are emitted as a single shared tree that the Node, Workers, and browser entry points all re-export, so `Envapt`, `Envapter`, the converters, and the rest resolve to one declaration. The Workers and browser entries still expose the portable `Envapter` without the file-only APIs. The package no longer ships the redundant per-runtime declaration trees, so the install is smaller.
|
|
8
|
+
|
|
3
9
|
## 7.0.0-next.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/browser.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/browser.ts"],"sourcesContent":["import { installFileApiStubs } from './engine/installFileApiStubs';\n\nexport * from './index.portable';\n\ninstallFileApiStubs();\n"],"mappings":"6mBAIA,EAAoB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import __tsdown_shims_path from 'node:path';
|
|
2
|
-
import __tsdown_shims_url from 'node:url';
|
|
3
1
|
import { DebugLevel } from "./infra/Debug.mjs";
|
|
4
2
|
import { EnvFileOptions } from "./infra/Dotenv.mjs";
|
|
5
3
|
import { ArrayElement, ArrayOf, ConverterToken, Converters, CustomElementConverter, isArrayOf } from "./converters/Converters.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileEnvSource } from "../types/Source.
|
|
1
|
+
import { FileEnvSource } from "../types/Source.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/sources/NodeEnvSource.d.ts
|
|
4
4
|
/**
|
|
@@ -17,4 +17,4 @@ declare class NodeEnvSource implements FileEnvSource {
|
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
19
|
export { NodeEnvSource };
|
|
20
|
-
//# sourceMappingURL=NodeEnvSource.d.
|
|
20
|
+
//# sourceMappingURL=NodeEnvSource.d.mts.map
|
package/package.json
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "envapt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-next.
|
|
4
|
+
"version": "7.0.0-next.1",
|
|
5
5
|
"description": "Type-safe config for TypeScript. Read typed values from any source, process.env, .env files, Cloudflare Workers bindings, browser bundles, or any object you supply. Zero runtime dependencies, one API across Node, Bun, Deno, Workers, and the browser. TC39 accessor decorators (legacy decorators at envapt/legacy), converters, and Standard Schema (zod/valibot/arktype) validation.",
|
|
6
|
-
"types": "./dist/
|
|
6
|
+
"types": "./dist/types/index.d.mts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"workerd": {
|
|
10
|
-
"types": "./dist/
|
|
10
|
+
"types": "./dist/types/index.portable.d.mts",
|
|
11
11
|
"default": "./dist/workerd/index.mjs"
|
|
12
12
|
},
|
|
13
13
|
"browser": {
|
|
14
|
-
"types": "./dist/
|
|
14
|
+
"types": "./dist/types/index.portable.d.mts",
|
|
15
15
|
"default": "./dist/browser/index.mjs"
|
|
16
16
|
},
|
|
17
17
|
"node": {
|
|
18
18
|
"import": {
|
|
19
|
-
"types": "./dist/
|
|
19
|
+
"types": "./dist/types/index.d.mts",
|
|
20
20
|
"default": "./dist/node/index.mjs"
|
|
21
21
|
},
|
|
22
22
|
"require": {
|
|
23
|
-
"types": "./dist/
|
|
23
|
+
"types": "./dist/types/index.d.mts",
|
|
24
24
|
"default": "./dist/node/index.cjs"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"default": {
|
|
28
28
|
"import": {
|
|
29
|
-
"types": "./dist/
|
|
29
|
+
"types": "./dist/types/index.d.mts",
|
|
30
30
|
"default": "./dist/node/index.mjs"
|
|
31
31
|
},
|
|
32
32
|
"require": {
|
|
33
|
-
"types": "./dist/
|
|
33
|
+
"types": "./dist/types/index.d.mts",
|
|
34
34
|
"default": "./dist/node/index.cjs"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"./workerd": {
|
|
39
|
-
"types": "./dist/
|
|
39
|
+
"types": "./dist/types/index.portable.d.mts",
|
|
40
40
|
"default": "./dist/workerd/index.mjs"
|
|
41
41
|
},
|
|
42
42
|
"./browser": {
|
|
43
|
-
"types": "./dist/
|
|
43
|
+
"types": "./dist/types/index.portable.d.mts",
|
|
44
44
|
"default": "./dist/browser/index.mjs"
|
|
45
45
|
},
|
|
46
46
|
"./config": {
|
|
47
47
|
"import": {
|
|
48
|
-
"types": "./dist/
|
|
48
|
+
"types": "./dist/types/config.d.mts",
|
|
49
49
|
"default": "./dist/node/config.mjs"
|
|
50
50
|
},
|
|
51
51
|
"require": {
|
|
52
|
-
"types": "./dist/
|
|
52
|
+
"types": "./dist/types/config.d.mts",
|
|
53
53
|
"default": "./dist/node/config.cjs"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"./legacy": {
|
|
57
57
|
"workerd": {
|
|
58
|
-
"types": "./dist/
|
|
58
|
+
"types": "./dist/types/legacy.d.mts",
|
|
59
59
|
"default": "./dist/workerd/legacy.mjs"
|
|
60
60
|
},
|
|
61
61
|
"browser": {
|
|
62
|
-
"types": "./dist/
|
|
62
|
+
"types": "./dist/types/legacy.d.mts",
|
|
63
63
|
"default": "./dist/browser/legacy.mjs"
|
|
64
64
|
},
|
|
65
65
|
"node": {
|
|
66
66
|
"import": {
|
|
67
|
-
"types": "./dist/
|
|
67
|
+
"types": "./dist/types/legacy.d.mts",
|
|
68
68
|
"default": "./dist/node/legacy.mjs"
|
|
69
69
|
},
|
|
70
70
|
"require": {
|
|
71
|
-
"types": "./dist/
|
|
71
|
+
"types": "./dist/types/legacy.d.mts",
|
|
72
72
|
"default": "./dist/node/legacy.cjs"
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"default": {
|
|
76
76
|
"import": {
|
|
77
|
-
"types": "./dist/
|
|
77
|
+
"types": "./dist/types/legacy.d.mts",
|
|
78
78
|
"default": "./dist/node/legacy.mjs"
|
|
79
79
|
},
|
|
80
80
|
"require": {
|
|
81
|
-
"types": "./dist/
|
|
81
|
+
"types": "./dist/types/legacy.d.mts",
|
|
82
82
|
"default": "./dist/node/legacy.cjs"
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -91,7 +91,10 @@
|
|
|
91
91
|
"./dist/workerd/index.mjs"
|
|
92
92
|
],
|
|
93
93
|
"files": [
|
|
94
|
-
"dist",
|
|
94
|
+
"dist/**/*.mjs",
|
|
95
|
+
"dist/**/*.cjs",
|
|
96
|
+
"dist/**/*.map",
|
|
97
|
+
"dist/types",
|
|
95
98
|
"NOTICE.md",
|
|
96
99
|
"LICENSE",
|
|
97
100
|
"README.md",
|
|
@@ -168,6 +171,7 @@
|
|
|
168
171
|
"test:workers": "tsc --noEmit -p tests/workers/tsconfig.json && vitest run --config vitest.workers.config.ts",
|
|
169
172
|
"test:browser": "tsc --noEmit -p tests/browser/tsconfig.json && vitest run --config vitest.browser.config.ts",
|
|
170
173
|
"test:consumer-build": "node tests/consumer-build/run.mjs",
|
|
174
|
+
"test:exports-dedup": "node tests/exports-dedup/run.mjs",
|
|
171
175
|
"test:tsc-emit": "node tests/tsc-emit/run.mjs",
|
|
172
176
|
"test:stage3-emit": "node tests/stage3-emit/run.mjs",
|
|
173
177
|
"test:all": "node ../../scripts/test-all.mjs",
|
package/dist/node/config.d.mts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
//#region src/converters/Converters.d.ts
|
|
2
|
-
declare const SCALAR: {
|
|
3
|
-
readonly String: "string";
|
|
4
|
-
readonly Number: "number";
|
|
5
|
-
readonly Boolean: "boolean";
|
|
6
|
-
readonly Bigint: "bigint";
|
|
7
|
-
readonly Symbol: "symbol";
|
|
8
|
-
readonly Integer: "integer";
|
|
9
|
-
readonly Float: "float";
|
|
10
|
-
readonly Json: "json";
|
|
11
|
-
readonly Url: "url";
|
|
12
|
-
readonly Regexp: "regexp";
|
|
13
|
-
readonly Date: "date";
|
|
14
|
-
readonly Time: "time";
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* String tokens for every built-in scalar converter.
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
type ConverterToken = (typeof SCALAR)[keyof typeof SCALAR];
|
|
21
|
-
/**
|
|
22
|
-
* Custom element converter for use inside {@link Converters.array}. Receives the trimmed,
|
|
23
|
-
* non-empty raw string for one array slot and returns the parsed value.
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
type CustomElementConverter<TReturn = unknown> = (raw: string) => TReturn;
|
|
27
|
-
/**
|
|
28
|
-
* Valid element converters for {@link Converters.array}: any scalar token except
|
|
29
|
-
* `json` and `regexp` (those don't compose as array elements), or a custom function.
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
type ArrayElement = Exclude<ConverterToken, 'json' | 'regexp'> | CustomElementConverter;
|
|
33
|
-
/**
|
|
34
|
-
* Phantom-branded token produced by {@link Converters.array}. The `T` type parameter carries
|
|
35
|
-
* the element converter through any variable indirection so inference survives. The
|
|
36
|
-
* `__envaptKind` discriminant is present at runtime for dispatch.
|
|
37
|
-
* @public
|
|
38
|
-
*/
|
|
39
|
-
interface ArrayOf<TElement extends ArrayElement = ArrayElement> {
|
|
40
|
-
readonly __envaptKind: 'array';
|
|
41
|
-
readonly of: TElement;
|
|
42
|
-
readonly delimiter: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Runtime type guard for tokens produced by {@link Converters.array}.
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
declare function isArrayOf(value: unknown): value is ArrayOf;
|
|
49
|
-
type ArrayScalarElement = Exclude<ConverterToken, 'json' | 'regexp'>;
|
|
50
|
-
declare function buildArrayConverter<TReturn>(opts: {
|
|
51
|
-
of: CustomElementConverter<TReturn>;
|
|
52
|
-
delimiter?: string;
|
|
53
|
-
}): ArrayOf<CustomElementConverter<TReturn>>;
|
|
54
|
-
declare function buildArrayConverter<TToken extends ArrayScalarElement>(opts: {
|
|
55
|
-
of: TToken;
|
|
56
|
-
delimiter?: string;
|
|
57
|
-
}): ArrayOf<TToken>;
|
|
58
|
-
declare function buildArrayConverter(opts?: {
|
|
59
|
-
delimiter?: string;
|
|
60
|
-
}): ArrayOf<'string'>;
|
|
61
|
-
/**
|
|
62
|
-
* Built-in converters for environment variables. Use the scalar tokens (e.g. `Converters.Number`)
|
|
63
|
-
* for primitive types and the {@link Converters.array} builder for delimited lists.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* \@Envapt('PORT', { converter: Converters.Number, fallback: 3000 })
|
|
68
|
-
* static readonly port: number;
|
|
69
|
-
*
|
|
70
|
-
* \@Envapt('TAGS', { converter: Converters.array({ of: Converters.String, delimiter: ' ' }) })
|
|
71
|
-
* static readonly tags: string[];
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* @public
|
|
75
|
-
*/
|
|
76
|
-
declare const Converters: {
|
|
77
|
-
readonly array: typeof buildArrayConverter;
|
|
78
|
-
readonly String: "string";
|
|
79
|
-
readonly Number: "number";
|
|
80
|
-
readonly Boolean: "boolean";
|
|
81
|
-
readonly Bigint: "bigint";
|
|
82
|
-
readonly Symbol: "symbol";
|
|
83
|
-
readonly Integer: "integer";
|
|
84
|
-
readonly Float: "float";
|
|
85
|
-
readonly Json: "json";
|
|
86
|
-
readonly Url: "url";
|
|
87
|
-
readonly Regexp: "regexp";
|
|
88
|
-
readonly Date: "date";
|
|
89
|
-
readonly Time: "time";
|
|
90
|
-
};
|
|
91
|
-
//#endregion
|
|
92
|
-
export { ArrayElement, ArrayOf, ConverterToken, Converters, CustomElementConverter, isArrayOf };
|
|
93
|
-
//# sourceMappingURL=Converters.d.cts.map
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import __tsdown_shims_path from 'node:path';
|
|
2
|
-
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
//#region src/converters/Converters.d.ts
|
|
4
|
-
declare const SCALAR: {
|
|
5
|
-
readonly String: "string";
|
|
6
|
-
readonly Number: "number";
|
|
7
|
-
readonly Boolean: "boolean";
|
|
8
|
-
readonly Bigint: "bigint";
|
|
9
|
-
readonly Symbol: "symbol";
|
|
10
|
-
readonly Integer: "integer";
|
|
11
|
-
readonly Float: "float";
|
|
12
|
-
readonly Json: "json";
|
|
13
|
-
readonly Url: "url";
|
|
14
|
-
readonly Regexp: "regexp";
|
|
15
|
-
readonly Date: "date";
|
|
16
|
-
readonly Time: "time";
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* String tokens for every built-in scalar converter.
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
type ConverterToken = (typeof SCALAR)[keyof typeof SCALAR];
|
|
23
|
-
/**
|
|
24
|
-
* Custom element converter for use inside {@link Converters.array}. Receives the trimmed,
|
|
25
|
-
* non-empty raw string for one array slot and returns the parsed value.
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
type CustomElementConverter<TReturn = unknown> = (raw: string) => TReturn;
|
|
29
|
-
/**
|
|
30
|
-
* Valid element converters for {@link Converters.array}: any scalar token except
|
|
31
|
-
* `json` and `regexp` (those don't compose as array elements), or a custom function.
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
34
|
-
type ArrayElement = Exclude<ConverterToken, 'json' | 'regexp'> | CustomElementConverter;
|
|
35
|
-
/**
|
|
36
|
-
* Phantom-branded token produced by {@link Converters.array}. The `T` type parameter carries
|
|
37
|
-
* the element converter through any variable indirection so inference survives. The
|
|
38
|
-
* `__envaptKind` discriminant is present at runtime for dispatch.
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
interface ArrayOf<TElement extends ArrayElement = ArrayElement> {
|
|
42
|
-
readonly __envaptKind: 'array';
|
|
43
|
-
readonly of: TElement;
|
|
44
|
-
readonly delimiter: string;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Runtime type guard for tokens produced by {@link Converters.array}.
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
declare function isArrayOf(value: unknown): value is ArrayOf;
|
|
51
|
-
type ArrayScalarElement = Exclude<ConverterToken, 'json' | 'regexp'>;
|
|
52
|
-
declare function buildArrayConverter<TReturn>(opts: {
|
|
53
|
-
of: CustomElementConverter<TReturn>;
|
|
54
|
-
delimiter?: string;
|
|
55
|
-
}): ArrayOf<CustomElementConverter<TReturn>>;
|
|
56
|
-
declare function buildArrayConverter<TToken extends ArrayScalarElement>(opts: {
|
|
57
|
-
of: TToken;
|
|
58
|
-
delimiter?: string;
|
|
59
|
-
}): ArrayOf<TToken>;
|
|
60
|
-
declare function buildArrayConverter(opts?: {
|
|
61
|
-
delimiter?: string;
|
|
62
|
-
}): ArrayOf<'string'>;
|
|
63
|
-
/**
|
|
64
|
-
* Built-in converters for environment variables. Use the scalar tokens (e.g. `Converters.Number`)
|
|
65
|
-
* for primitive types and the {@link Converters.array} builder for delimited lists.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```ts
|
|
69
|
-
* \@Envapt('PORT', { converter: Converters.Number, fallback: 3000 })
|
|
70
|
-
* static readonly port: number;
|
|
71
|
-
*
|
|
72
|
-
* \@Envapt('TAGS', { converter: Converters.array({ of: Converters.String, delimiter: ' ' }) })
|
|
73
|
-
* static readonly tags: string[];
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* @public
|
|
77
|
-
*/
|
|
78
|
-
declare const Converters: {
|
|
79
|
-
readonly array: typeof buildArrayConverter;
|
|
80
|
-
readonly String: "string";
|
|
81
|
-
readonly Number: "number";
|
|
82
|
-
readonly Boolean: "boolean";
|
|
83
|
-
readonly Bigint: "bigint";
|
|
84
|
-
readonly Symbol: "symbol";
|
|
85
|
-
readonly Integer: "integer";
|
|
86
|
-
readonly Float: "float";
|
|
87
|
-
readonly Json: "json";
|
|
88
|
-
readonly Url: "url";
|
|
89
|
-
readonly Regexp: "regexp";
|
|
90
|
-
readonly Date: "date";
|
|
91
|
-
readonly Time: "time";
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
|
-
export { ArrayElement, ArrayOf, ConverterToken, Converters, CustomElementConverter, isArrayOf };
|
|
95
|
-
//# sourceMappingURL=Converters.d.mts.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { EnvaptConverter } from "../types/Conversion.cjs";
|
|
2
|
-
import { StandardSchemaV1 } from "../infra/StandardSchema.cjs";
|
|
3
|
-
import { EnvKeyInput, EnvapterService } from "../types/Env.cjs";
|
|
4
|
-
|
|
5
|
-
//#region src/converters/ValueConverter.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Convert a resolved environment value to its declared type via built-in, primitive, array,
|
|
8
|
-
* custom, or Standard Schema converters.
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
declare class ValueConverter {
|
|
12
|
-
private readonly envService;
|
|
13
|
-
constructor(envService: EnvapterService);
|
|
14
|
-
convertValue<TFallback>(key: EnvKeyInput, fallback: TFallback | undefined, converter: EnvaptConverter<TFallback> | undefined, hasFallback: boolean): TFallback | null | undefined;
|
|
15
|
-
private processFallbackForConverter;
|
|
16
|
-
private convertPrimitiveToString;
|
|
17
|
-
private processBuiltInConverter;
|
|
18
|
-
private processArrayConverter;
|
|
19
|
-
private processCustomConverter;
|
|
20
|
-
private resolveConverter;
|
|
21
|
-
convertWithSchema(key: EnvKeyInput, schema: StandardSchemaV1, fallback: unknown, hasFallback: boolean): unknown;
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { ValueConverter };
|
|
25
|
-
//# sourceMappingURL=ValueConverter.d.cts.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import __tsdown_shims_path from 'node:path';
|
|
2
|
-
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { EnvaptConverter } from "../types/Conversion.mjs";
|
|
4
|
-
import { StandardSchemaV1 } from "../infra/StandardSchema.mjs";
|
|
5
|
-
import { EnvKeyInput, EnvapterService } from "../types/Env.mjs";
|
|
6
|
-
|
|
7
|
-
//#region src/converters/ValueConverter.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Convert a resolved environment value to its declared type via built-in, primitive, array,
|
|
10
|
-
* custom, or Standard Schema converters.
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
declare class ValueConverter {
|
|
14
|
-
private readonly envService;
|
|
15
|
-
constructor(envService: EnvapterService);
|
|
16
|
-
convertValue<TFallback>(key: EnvKeyInput, fallback: TFallback | undefined, converter: EnvaptConverter<TFallback> | undefined, hasFallback: boolean): TFallback | null | undefined;
|
|
17
|
-
private processFallbackForConverter;
|
|
18
|
-
private convertPrimitiveToString;
|
|
19
|
-
private processBuiltInConverter;
|
|
20
|
-
private processArrayConverter;
|
|
21
|
-
private processCustomConverter;
|
|
22
|
-
private resolveConverter;
|
|
23
|
-
convertWithSchema(key: EnvKeyInput, schema: StandardSchemaV1, fallback: unknown, hasFallback: boolean): unknown;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { ValueConverter };
|
|
27
|
-
//# sourceMappingURL=ValueConverter.d.mts.map
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ArrayOf } from "../converters/Converters.cjs";
|
|
2
|
-
import { AdvancedConverterReturn, BuiltInConverter, ConditionalReturn, ConverterFunction, InferConverterReturnType, TimeFallback } from "../types/Conversion.cjs";
|
|
3
|
-
import { InferSchemaOutput, StandardSchemaV1 } from "../infra/StandardSchema.cjs";
|
|
4
|
-
import { SchemaConstraint } from "../types/Schema.cjs";
|
|
5
|
-
import { EnvKeyInput } from "../types/Env.cjs";
|
|
6
|
-
import { PrimitiveMethods } from "./PrimitiveMethods.cjs";
|
|
7
|
-
|
|
8
|
-
//#region src/core/AdvancedMethods.d.ts
|
|
9
|
-
interface GetUsingRequiredOptions<TConverter> {
|
|
10
|
-
converter: TConverter;
|
|
11
|
-
required: true;
|
|
12
|
-
}
|
|
13
|
-
interface GetWithRequiredOptions<TReturnType> {
|
|
14
|
-
converter: ConverterFunction<TReturnType>;
|
|
15
|
-
required: true;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Mixin for advanced methods for environment variable conversion using built-in and custom converters
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
declare class AdvancedMethods extends PrimitiveMethods {
|
|
22
|
-
/**
|
|
23
|
-
* Get an environment variable using a built-in converter.
|
|
24
|
-
*
|
|
25
|
-
* Supports both scalar tokens (e.g. `Converters.Number`) and `ArrayOf<...>` tokens
|
|
26
|
-
* produced by `Converters.array(...)`. The key can be a single name or an ordered list;
|
|
27
|
-
* the first defined value wins.
|
|
28
|
-
*/
|
|
29
|
-
static getUsing<TFallback extends TimeFallback | undefined = undefined>(key: EnvKeyInput, converter: 'time', fallback?: TFallback): ConditionalReturn<number, TFallback>;
|
|
30
|
-
static getUsing<TConverter extends BuiltInConverter | ArrayOf, TFallback = undefined>(key: EnvKeyInput, converter: TConverter, fallback?: TFallback): AdvancedConverterReturn<TConverter, TFallback>;
|
|
31
|
-
static getUsing<TReturn>(key: EnvKeyInput, converter: BuiltInConverter | ArrayOf, fallback?: TReturn): TReturn;
|
|
32
|
-
static getUsing(key: EnvKeyInput, options: GetUsingRequiredOptions<'time'>): number;
|
|
33
|
-
static getUsing<TConverter extends BuiltInConverter | ArrayOf>(key: EnvKeyInput, options: GetUsingRequiredOptions<TConverter>): InferConverterReturnType<TConverter>;
|
|
34
|
-
/**
|
|
35
|
-
* @see {@link AdvancedMethods.getUsing}
|
|
36
|
-
*/
|
|
37
|
-
getUsing<TFallback extends TimeFallback | undefined = undefined>(key: EnvKeyInput, converter: 'time', fallback?: TFallback): ConditionalReturn<number, TFallback>;
|
|
38
|
-
getUsing<TConverter extends BuiltInConverter | ArrayOf, TFallback = undefined>(key: EnvKeyInput, converter: TConverter, fallback?: TFallback): AdvancedConverterReturn<TConverter, TFallback>;
|
|
39
|
-
getUsing<TReturn>(key: EnvKeyInput, converter: BuiltInConverter | ArrayOf, fallback?: TReturn): TReturn;
|
|
40
|
-
getUsing(key: EnvKeyInput, options: GetUsingRequiredOptions<'time'>): number;
|
|
41
|
-
getUsing<TConverter extends BuiltInConverter | ArrayOf>(key: EnvKeyInput, options: GetUsingRequiredOptions<TConverter>): InferConverterReturnType<TConverter>;
|
|
42
|
-
/**
|
|
43
|
-
* Get an environment variable using a custom converter function.
|
|
44
|
-
* Accepts a single key or an ordered list for automatic fallback.
|
|
45
|
-
*/
|
|
46
|
-
static getWith<TReturnType, TFallback extends TReturnType | undefined = undefined>(key: EnvKeyInput, converter: ConverterFunction<TReturnType>, fallback?: TFallback): ConditionalReturn<TReturnType, TFallback>;
|
|
47
|
-
static getWith<TReturnType>(key: EnvKeyInput, options: GetWithRequiredOptions<TReturnType>): TReturnType;
|
|
48
|
-
/**
|
|
49
|
-
* @see {@link AdvancedMethods.getWith}
|
|
50
|
-
*/
|
|
51
|
-
getWith<TReturnType, TFallback extends TReturnType | undefined = undefined>(key: EnvKeyInput, converter: ConverterFunction<TReturnType>, fallback?: TFallback): ConditionalReturn<TReturnType, TFallback>;
|
|
52
|
-
getWith<TReturnType>(key: EnvKeyInput, options: GetWithRequiredOptions<TReturnType>): TReturnType;
|
|
53
|
-
/**
|
|
54
|
-
* Validate an environment variable through a {@link StandardSchemaV1}-conformant schema
|
|
55
|
-
* (zod, valibot, arktype, etc). Throws `MissingEnvValue` if the env value is absent and
|
|
56
|
-
* no fallback is provided. The fallback, when provided, is returned as-is on missing;
|
|
57
|
-
* it does NOT pass through the schema (mirrors custom-converter behavior).
|
|
58
|
-
*
|
|
59
|
-
* Synchronous schemas only. A Promise-returning `validate` triggers an
|
|
60
|
-
* `InvalidUserDefinedConfig` throw at the call site.
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```ts
|
|
64
|
-
* import { z } from 'zod';
|
|
65
|
-
* const port = Envapter.parse('PORT', z.coerce.number().min(1024).max(65535), 3000);
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
static parse<Schema extends StandardSchemaV1>(key: EnvKeyInput, schema: SchemaConstraint<Schema>, fallback?: InferSchemaOutput<Schema>): InferSchemaOutput<Schema>;
|
|
69
|
-
/**
|
|
70
|
-
* @see {@link AdvancedMethods.parse}
|
|
71
|
-
*/
|
|
72
|
-
parse<Schema extends StandardSchemaV1>(key: EnvKeyInput, schema: SchemaConstraint<Schema>, fallback?: InferSchemaOutput<Schema>): InferSchemaOutput<Schema>;
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
export { AdvancedMethods };
|
|
76
|
-
//# sourceMappingURL=AdvancedMethods.d.cts.map
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import __tsdown_shims_path from 'node:path';
|
|
2
|
-
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import { ArrayOf } from "../converters/Converters.mjs";
|
|
4
|
-
import { AdvancedConverterReturn, BuiltInConverter, ConditionalReturn, ConverterFunction, InferConverterReturnType, TimeFallback } from "../types/Conversion.mjs";
|
|
5
|
-
import { InferSchemaOutput, StandardSchemaV1 } from "../infra/StandardSchema.mjs";
|
|
6
|
-
import { SchemaConstraint } from "../types/Schema.mjs";
|
|
7
|
-
import { EnvKeyInput } from "../types/Env.mjs";
|
|
8
|
-
import { PrimitiveMethods } from "./PrimitiveMethods.mjs";
|
|
9
|
-
|
|
10
|
-
//#region src/core/AdvancedMethods.d.ts
|
|
11
|
-
interface GetUsingRequiredOptions<TConverter> {
|
|
12
|
-
converter: TConverter;
|
|
13
|
-
required: true;
|
|
14
|
-
}
|
|
15
|
-
interface GetWithRequiredOptions<TReturnType> {
|
|
16
|
-
converter: ConverterFunction<TReturnType>;
|
|
17
|
-
required: true;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Mixin for advanced methods for environment variable conversion using built-in and custom converters
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
declare class AdvancedMethods extends PrimitiveMethods {
|
|
24
|
-
/**
|
|
25
|
-
* Get an environment variable using a built-in converter.
|
|
26
|
-
*
|
|
27
|
-
* Supports both scalar tokens (e.g. `Converters.Number`) and `ArrayOf<...>` tokens
|
|
28
|
-
* produced by `Converters.array(...)`. The key can be a single name or an ordered list;
|
|
29
|
-
* the first defined value wins.
|
|
30
|
-
*/
|
|
31
|
-
static getUsing<TFallback extends TimeFallback | undefined = undefined>(key: EnvKeyInput, converter: 'time', fallback?: TFallback): ConditionalReturn<number, TFallback>;
|
|
32
|
-
static getUsing<TConverter extends BuiltInConverter | ArrayOf, TFallback = undefined>(key: EnvKeyInput, converter: TConverter, fallback?: TFallback): AdvancedConverterReturn<TConverter, TFallback>;
|
|
33
|
-
static getUsing<TReturn>(key: EnvKeyInput, converter: BuiltInConverter | ArrayOf, fallback?: TReturn): TReturn;
|
|
34
|
-
static getUsing(key: EnvKeyInput, options: GetUsingRequiredOptions<'time'>): number;
|
|
35
|
-
static getUsing<TConverter extends BuiltInConverter | ArrayOf>(key: EnvKeyInput, options: GetUsingRequiredOptions<TConverter>): InferConverterReturnType<TConverter>;
|
|
36
|
-
/**
|
|
37
|
-
* @see {@link AdvancedMethods.getUsing}
|
|
38
|
-
*/
|
|
39
|
-
getUsing<TFallback extends TimeFallback | undefined = undefined>(key: EnvKeyInput, converter: 'time', fallback?: TFallback): ConditionalReturn<number, TFallback>;
|
|
40
|
-
getUsing<TConverter extends BuiltInConverter | ArrayOf, TFallback = undefined>(key: EnvKeyInput, converter: TConverter, fallback?: TFallback): AdvancedConverterReturn<TConverter, TFallback>;
|
|
41
|
-
getUsing<TReturn>(key: EnvKeyInput, converter: BuiltInConverter | ArrayOf, fallback?: TReturn): TReturn;
|
|
42
|
-
getUsing(key: EnvKeyInput, options: GetUsingRequiredOptions<'time'>): number;
|
|
43
|
-
getUsing<TConverter extends BuiltInConverter | ArrayOf>(key: EnvKeyInput, options: GetUsingRequiredOptions<TConverter>): InferConverterReturnType<TConverter>;
|
|
44
|
-
/**
|
|
45
|
-
* Get an environment variable using a custom converter function.
|
|
46
|
-
* Accepts a single key or an ordered list for automatic fallback.
|
|
47
|
-
*/
|
|
48
|
-
static getWith<TReturnType, TFallback extends TReturnType | undefined = undefined>(key: EnvKeyInput, converter: ConverterFunction<TReturnType>, fallback?: TFallback): ConditionalReturn<TReturnType, TFallback>;
|
|
49
|
-
static getWith<TReturnType>(key: EnvKeyInput, options: GetWithRequiredOptions<TReturnType>): TReturnType;
|
|
50
|
-
/**
|
|
51
|
-
* @see {@link AdvancedMethods.getWith}
|
|
52
|
-
*/
|
|
53
|
-
getWith<TReturnType, TFallback extends TReturnType | undefined = undefined>(key: EnvKeyInput, converter: ConverterFunction<TReturnType>, fallback?: TFallback): ConditionalReturn<TReturnType, TFallback>;
|
|
54
|
-
getWith<TReturnType>(key: EnvKeyInput, options: GetWithRequiredOptions<TReturnType>): TReturnType;
|
|
55
|
-
/**
|
|
56
|
-
* Validate an environment variable through a {@link StandardSchemaV1}-conformant schema
|
|
57
|
-
* (zod, valibot, arktype, etc). Throws `MissingEnvValue` if the env value is absent and
|
|
58
|
-
* no fallback is provided. The fallback, when provided, is returned as-is on missing;
|
|
59
|
-
* it does NOT pass through the schema (mirrors custom-converter behavior).
|
|
60
|
-
*
|
|
61
|
-
* Synchronous schemas only. A Promise-returning `validate` triggers an
|
|
62
|
-
* `InvalidUserDefinedConfig` throw at the call site.
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```ts
|
|
66
|
-
* import { z } from 'zod';
|
|
67
|
-
* const port = Envapter.parse('PORT', z.coerce.number().min(1024).max(65535), 3000);
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
static parse<Schema extends StandardSchemaV1>(key: EnvKeyInput, schema: SchemaConstraint<Schema>, fallback?: InferSchemaOutput<Schema>): InferSchemaOutput<Schema>;
|
|
71
|
-
/**
|
|
72
|
-
* @see {@link AdvancedMethods.parse}
|
|
73
|
-
*/
|
|
74
|
-
parse<Schema extends StandardSchemaV1>(key: EnvKeyInput, schema: SchemaConstraint<Schema>, fallback?: InferSchemaOutput<Schema>): InferSchemaOutput<Schema>;
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
export { AdvancedMethods };
|
|
78
|
-
//# sourceMappingURL=AdvancedMethods.d.mts.map
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { DebugLevel } from "../infra/Debug.cjs";
|
|
2
|
-
import { EnvFileOptions } from "../infra/Dotenv.cjs";
|
|
3
|
-
import { EnvKeyInput } from "../types/Env.cjs";
|
|
4
|
-
import { EnvSource, FileEnvSource } from "../types/Source.cjs";
|
|
5
|
-
|
|
6
|
-
//#region src/core/EnvapterBase.d.ts
|
|
7
|
-
/** @internal */
|
|
8
|
-
declare abstract class EnvapterBase {
|
|
9
|
-
protected static _envPaths: string[];
|
|
10
|
-
protected static _envPathsExplicitlySet: boolean;
|
|
11
|
-
protected static _baseDir: string | undefined;
|
|
12
|
-
protected static _userDefinedEnvFileOptions: EnvFileOptions;
|
|
13
|
-
protected static _strict: boolean;
|
|
14
|
-
protected static _syncProcessEnv: boolean;
|
|
15
|
-
protected static _dotenvAddedKeys: Set<string>;
|
|
16
|
-
protected static _source: EnvSource;
|
|
17
|
-
/**
|
|
18
|
-
* Enable or disable strict mode. Default `false`. Setting refreshes the cache so
|
|
19
|
-
* previously-cached converted values get re-evaluated under the new rule.
|
|
20
|
-
*/
|
|
21
|
-
static set strict(value: boolean);
|
|
22
|
-
static get strict(): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Set the debug log level. Defaults to `silent`. When unset, reads `ENVAPT_DEBUG` from the
|
|
25
|
-
* bound source on first access; the setter overrides any env-var value. Output goes to stderr
|
|
26
|
-
* on Node (the console elsewhere), prefixed with `[envapt]`.
|
|
27
|
-
*/
|
|
28
|
-
static set debug(level: DebugLevel);
|
|
29
|
-
static get debug(): DebugLevel;
|
|
30
|
-
/**
|
|
31
|
-
* Opt-in mirror of dotenv-loaded keys back to `process.env`. Default `false`.
|
|
32
|
-
*
|
|
33
|
-
* Only keys the loader actually wrote are mirrored, so collision behavior follows
|
|
34
|
-
* `envFileOptions.override`: with the default `false`, pre-existing `process.env` values
|
|
35
|
-
* are preserved; with `true`, the file value wins in both the cache and the mirror.
|
|
36
|
-
*
|
|
37
|
-
* Flipping `false → true` mirrors the existing tracked delta immediately (no cache
|
|
38
|
-
* refresh). Flipping `true → false` is one-way: previously mirrored keys remain in
|
|
39
|
-
* `process.env` until the process exits.
|
|
40
|
-
*/
|
|
41
|
-
static set syncProcessEnv(value: boolean);
|
|
42
|
-
static get syncProcessEnv(): boolean;
|
|
43
|
-
protected static treatAsMissing(value: string | undefined): boolean;
|
|
44
|
-
protected static resolveAgainstBase(candidate: string): string;
|
|
45
|
-
protected static assertFileApiSupported(api: string, source: EnvSource): asserts source is FileEnvSource;
|
|
46
|
-
protected static sourceFileExists(path: string): boolean;
|
|
47
|
-
protected static refreshCache(): void;
|
|
48
|
-
protected static mirrorToProcessEnv(): void;
|
|
49
|
-
protected static resolveEffectivePaths(): string[];
|
|
50
|
-
protected static resolveKeyInput(keyInput: EnvKeyInput): {
|
|
51
|
-
key: string;
|
|
52
|
-
value: string | undefined;
|
|
53
|
-
};
|
|
54
|
-
protected static get config(): Map<string, unknown>;
|
|
55
|
-
/**
|
|
56
|
-
* Eagerly load the `.env` cascade now instead of lazily on the first read. Idempotent: a no-op
|
|
57
|
-
* once the cache is built. Useful before mirroring to `process.env` (see {@link syncProcessEnv}),
|
|
58
|
-
* which is what the `envapt/config` side-effect entry does.
|
|
59
|
-
*/
|
|
60
|
-
static load(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Bind the environment {@link EnvSource}. On Node the entry binds {@link NodeEnvSource} for you
|
|
63
|
-
* (a `process.env` snapshot plus the `.env` cascade); on the browser or Workers, pass a
|
|
64
|
-
* `ManualEnvSource` / `WorkerEnvSource` (or any `EnvSource`) before reading. Clears and rebuilds
|
|
65
|
-
* the cache.
|
|
66
|
-
*/
|
|
67
|
-
static useSource(source: EnvSource): void;
|
|
68
|
-
/**
|
|
69
|
-
* Read an environment variable as its raw string, skipping parsing and conversion.
|
|
70
|
-
*/
|
|
71
|
-
getRaw(key: EnvKeyInput): string | undefined;
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
export { EnvapterBase };
|
|
75
|
-
//# sourceMappingURL=EnvapterBase.d.cts.map
|