@forklaunch/core 0.3.1 → 0.3.2
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/lib/services/index.d.mts
CHANGED
@@ -22,10 +22,10 @@ type ConfigValidator<SV extends AnySchemaValidator> = Record<string, Function |
|
|
22
22
|
type ResolvedConfigValidator<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>> = {
|
23
23
|
[M in keyof CV]: CV[M] extends SchemaConstructor<SV> ? Schema<InstanceType<CV[M]>, SV> : CV[M] extends SchemaFunction<SV> ? Schema<ReturnType<CV[M]>, SV> : CV[M] extends Function ? ReturnType<CV[M]> : CV[M] extends Constructor ? InstanceType<CV[M]> : Schema<CV[M], SV>;
|
24
24
|
};
|
25
|
-
type
|
25
|
+
type ScopedDependencyFactory<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>, M extends keyof CV> = (scope?: ConfigInjector<SV, CV>) => ResolvedConfigValidator<SV, CV>[M];
|
26
|
+
type ValidConfigInjector<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>> = ConfigInjector<SV, CV> & {
|
26
27
|
validResolvedConfigValidator: void;
|
27
28
|
};
|
28
|
-
type ScopedDependencyFactory<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>, M extends keyof CV> = (scope?: ConfigInjector<SV, CV>) => ResolvedConfigValidator<SV, CV>[M];
|
29
29
|
|
30
30
|
declare class ConfigInjector<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>> {
|
31
31
|
private schemaValidator;
|
@@ -39,7 +39,7 @@ declare class ConfigInjector<SV extends AnySchemaValidator, CV extends ConfigVal
|
|
39
39
|
constructor(schemaValidator: SV, configShapes: CV, dependenciesDefinition: {
|
40
40
|
[K in keyof CV]: Singleton<ResolvedConfigValidator<SV, CV>[K]> | Constructed<Omit<ResolvedConfigValidator<SV, CV>, K>, ResolvedConfigValidator<SV, CV>[K]>;
|
41
41
|
});
|
42
|
-
validateConfigSingletons(): ParseResult<
|
42
|
+
validateConfigSingletons(): ParseResult<ValidConfigInjector<SV, CV>>;
|
43
43
|
resolve<T extends keyof CV>(token: T, context?: Record<string, unknown>, resolutionPath?: (keyof CV)[]): ResolvedConfigValidator<SV, CV>[T];
|
44
44
|
scopedResolver<T extends keyof CV>(token: T, context?: Record<string, unknown>, resolutionPath?: (keyof CV)[]): (scope?: ConfigInjector<SV, CV>) => ResolvedConfigValidator<SV, CV>[T];
|
45
45
|
createScope(): ConfigInjector<SV, CV>;
|
@@ -66,4 +66,4 @@ type EntityManager = {
|
|
66
66
|
fork: <Options>(options?: Options) => EntityManager;
|
67
67
|
};
|
68
68
|
|
69
|
-
export { type BaseService, ConfigInjector, type ConfigValidator, type Constructed, type Constructor, type EntityManager, type Function, Lifetime, type ResolvedConfigValidator, type SchemaConstructor, type SchemaFunction, type ScopedDependencyFactory, type Singleton, type
|
69
|
+
export { type BaseService, ConfigInjector, type ConfigValidator, type Constructed, type Constructor, type EntityManager, type Function, Lifetime, type ResolvedConfigValidator, type SchemaConstructor, type SchemaFunction, type ScopedDependencyFactory, type Singleton, type ValidConfigInjector, getEnvVar };
|
package/lib/services/index.d.ts
CHANGED
@@ -22,10 +22,10 @@ type ConfigValidator<SV extends AnySchemaValidator> = Record<string, Function |
|
|
22
22
|
type ResolvedConfigValidator<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>> = {
|
23
23
|
[M in keyof CV]: CV[M] extends SchemaConstructor<SV> ? Schema<InstanceType<CV[M]>, SV> : CV[M] extends SchemaFunction<SV> ? Schema<ReturnType<CV[M]>, SV> : CV[M] extends Function ? ReturnType<CV[M]> : CV[M] extends Constructor ? InstanceType<CV[M]> : Schema<CV[M], SV>;
|
24
24
|
};
|
25
|
-
type
|
25
|
+
type ScopedDependencyFactory<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>, M extends keyof CV> = (scope?: ConfigInjector<SV, CV>) => ResolvedConfigValidator<SV, CV>[M];
|
26
|
+
type ValidConfigInjector<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>> = ConfigInjector<SV, CV> & {
|
26
27
|
validResolvedConfigValidator: void;
|
27
28
|
};
|
28
|
-
type ScopedDependencyFactory<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>, M extends keyof CV> = (scope?: ConfigInjector<SV, CV>) => ResolvedConfigValidator<SV, CV>[M];
|
29
29
|
|
30
30
|
declare class ConfigInjector<SV extends AnySchemaValidator, CV extends ConfigValidator<SV>> {
|
31
31
|
private schemaValidator;
|
@@ -39,7 +39,7 @@ declare class ConfigInjector<SV extends AnySchemaValidator, CV extends ConfigVal
|
|
39
39
|
constructor(schemaValidator: SV, configShapes: CV, dependenciesDefinition: {
|
40
40
|
[K in keyof CV]: Singleton<ResolvedConfigValidator<SV, CV>[K]> | Constructed<Omit<ResolvedConfigValidator<SV, CV>, K>, ResolvedConfigValidator<SV, CV>[K]>;
|
41
41
|
});
|
42
|
-
validateConfigSingletons(): ParseResult<
|
42
|
+
validateConfigSingletons(): ParseResult<ValidConfigInjector<SV, CV>>;
|
43
43
|
resolve<T extends keyof CV>(token: T, context?: Record<string, unknown>, resolutionPath?: (keyof CV)[]): ResolvedConfigValidator<SV, CV>[T];
|
44
44
|
scopedResolver<T extends keyof CV>(token: T, context?: Record<string, unknown>, resolutionPath?: (keyof CV)[]): (scope?: ConfigInjector<SV, CV>) => ResolvedConfigValidator<SV, CV>[T];
|
45
45
|
createScope(): ConfigInjector<SV, CV>;
|
@@ -66,4 +66,4 @@ type EntityManager = {
|
|
66
66
|
fork: <Options>(options?: Options) => EntityManager;
|
67
67
|
};
|
68
68
|
|
69
|
-
export { type BaseService, ConfigInjector, type ConfigValidator, type Constructed, type Constructor, type EntityManager, type Function, Lifetime, type ResolvedConfigValidator, type SchemaConstructor, type SchemaFunction, type ScopedDependencyFactory, type Singleton, type
|
69
|
+
export { type BaseService, ConfigInjector, type ConfigValidator, type Constructed, type Constructor, type EntityManager, type Function, Lifetime, type ResolvedConfigValidator, type SchemaConstructor, type SchemaFunction, type ScopedDependencyFactory, type Singleton, type ValidConfigInjector, getEnvVar };
|
package/lib/services/index.js
CHANGED
package/lib/services/index.mjs
CHANGED