Skip to content

Class: ConfigBoundService<T>

Defined in: packages/nestjs/src/config-bound.service.ts:16

Injectable service that provides type-safe access to ConfigBound configuration. Wraps a TypedConfigBound instance and exposes all configuration operations for use in NestJS controllers and services.

Type Parameters

Type ParameterDefault type
T extends ConfigSchemaConfigSchema

Constructors

Constructor

ts
new ConfigBoundService<T>(configBound): ConfigBoundService<T>;

Defined in: packages/nestjs/src/config-bound.service.ts:17

Parameters

ParameterType
configBoundTypedConfigBound<T>

Returns

ConfigBoundService<T>

Accessors

binds

Get Signature

ts
get binds(): Bind[];

Defined in: packages/nestjs/src/config-bound.service.ts:31

Returns

Bind[]


name

Get Signature

ts
get name(): string;

Defined in: packages/nestjs/src/config-bound.service.ts:27

Returns

string


sections

Get Signature

ts
get sections(): Section[];

Defined in: packages/nestjs/src/config-bound.service.ts:35

Returns

Section[]

Methods

addBind()

ts
addBind(bind): void;

Defined in: packages/nestjs/src/config-bound.service.ts:39

Parameters

ParameterType
bindBind

Returns

void


addSection()

ts
addSection(section): void;

Defined in: packages/nestjs/src/config-bound.service.ts:43

Parameters

ParameterType
sectionSection

Returns

void


get()

ts
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 | number | symbol
E extends string | number | symbol

Parameters

ParameterType
sectionNameK
elementNameE

Returns

Promise< | InferConfigType<T>[K][E] | undefined>


getOrThrow()

ts
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 | number | symbol
E extends string | number | symbol

Parameters

ParameterType
sectionNameK
elementNameE

Returns

Promise<InferConfigType<T>[K][E]>


getSections()

ts
getSections(): Section[];

Defined in: packages/nestjs/src/config-bound.service.ts:47

Returns

Section[]


getTypedConfigBound()

ts
getTypedConfigBound(): TypedConfigBound<T>;

Defined in: packages/nestjs/src/config-bound.service.ts:23

Returns

TypedConfigBound<T>


getValidationErrors()

ts
getValidationErrors(): Promise<object[]>;

Defined in: packages/nestjs/src/config-bound.service.ts:69

Returns

Promise<object[]>


validate()

ts
validate(): Promise<void>;

Defined in: packages/nestjs/src/config-bound.service.ts:65

Returns

Promise<void>