Class: ConfigBoundService<T>
Defined in: packages/nestjs/src/config-bound.service.ts:17
Injectable service that provides type-safe access to ConfigBound configuration. Wraps a ConfigBound instance and exposes all configuration operations for use in NestJS controllers and services.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends ConfigSchema | ConfigSchema |
Constructors
Constructor
new ConfigBoundService<T>(configBound): ConfigBoundService<T>;Defined in: packages/nestjs/src/config-bound.service.ts:18
Parameters
| Parameter | Type |
|---|---|
configBound | ConfigBound<T> |
Returns
ConfigBoundService<T>
Accessors
binds
Get Signature
get binds(): readonly Bind[];Defined in: packages/nestjs/src/config-bound.service.ts:31
Returns
readonly Bind[]
name
Get Signature
get name(): string;Defined in: packages/nestjs/src/config-bound.service.ts:27
Returns
string
sections
Get Signature
get sections(): readonly Section[];Defined in: packages/nestjs/src/config-bound.service.ts:35
Returns
readonly Section[]
Methods
addBind()
addBind(bind): void;Defined in: packages/nestjs/src/config-bound.service.ts:39
Parameters
| Parameter | Type |
|---|---|
bind | Bind |
Returns
void
addSection()
addSection(section): void;Defined in: packages/nestjs/src/config-bound.service.ts:43
Parameters
| Parameter | Type |
|---|---|
section | Section |
Returns
void
get()
get<K, E>(sectionName, elementName): Promise<
| InferConfigType<T>[K][E]
| undefined>;Defined in: packages/nestjs/src/config-bound.service.ts:51
Type Parameters
| Type Parameter |
|---|
K extends string |
E extends string |
Parameters
| Parameter | Type |
|---|---|
sectionName | K |
elementName | E |
Returns
Promise< | InferConfigType<T>[K][E] | undefined>
getConfigBound()
getConfigBound(): ConfigBound<T>;Defined in: packages/nestjs/src/config-bound.service.ts:23
Returns
ConfigBound<T>
getFromCache()
getFromCache<K, E>(sectionName, elementName):
| InferConfigType<T>[K][E]
| undefined;Defined in: packages/nestjs/src/config-bound.service.ts:72
Reads a configuration value from the in-memory cache only.
Type Parameters
| Type Parameter |
|---|
K extends string |
E extends string |
Parameters
| Parameter | Type | Description |
|---|---|---|
sectionName | K | Section containing the requested element. |
elementName | E | Element name to read from cache. |
Returns
| InferConfigType<T>[K][E] | undefined
Cached value when present; otherwise undefined.
getOrThrow()
getOrThrow<K, E>(sectionName, elementName): Promise<InferConfigType<T>[K][E]>;Defined in: packages/nestjs/src/config-bound.service.ts:58
Type Parameters
| Type Parameter |
|---|
K extends string |
E extends string |
Parameters
| Parameter | Type |
|---|---|
sectionName | K |
elementName | E |
Returns
Promise<InferConfigType<T>[K][E]>
getOrThrowFromCache()
getOrThrowFromCache<K, E>(sectionName, elementName): InferConfigType<T>[K][E];Defined in: packages/nestjs/src/config-bound.service.ts:86
Reads a configuration value from cache and throws when it is undefined.
Type Parameters
| Type Parameter |
|---|
K extends string |
E extends string |
Parameters
| Parameter | Type | Description |
|---|---|---|
sectionName | K | Section containing the requested element. |
elementName | E | Element name to read from cache. |
Returns
InferConfigType<T>[K][E]
Cached value.
getSections()
getSections(): readonly Section[];Defined in: packages/nestjs/src/config-bound.service.ts:47
Returns
readonly Section[]
getValidationErrors()
getValidationErrors(): Promise<object[]>;Defined in: packages/nestjs/src/config-bound.service.ts:115
Returns
Promise<object[]>
isCacheReady()
isCacheReady(): boolean;Defined in: packages/nestjs/src/config-bound.service.ts:107
Indicates whether cached reads are currently available.
Returns
boolean
true when cache population has completed.
populateCache()
populateCache(options?): Promise<void>;Defined in: packages/nestjs/src/config-bound.service.ts:98
Populates the cache for all configured elements.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | CacheRefreshOptions | Cache population behavior options. |
Returns
Promise<void>
validate()
validate(): Promise<void>;Defined in: packages/nestjs/src/config-bound.service.ts:111
Returns
Promise<void>