Skip to content

Class: Section

Defined in: packages/config-bound/src/section/section.ts:15

A grouping of Elements

Constructors

Constructor

ts
new Section(
   name, 
   elements, 
   description?, 
   logger?, 
   valueProvider?): Section;

Defined in: packages/config-bound/src/section/section.ts:37

Parameters

ParameterType
namestring
elementsElement<unknown>[]
description?string
logger?Logger
valueProvider?ConfigValueProvider

Returns

Section

Properties

PropertyTypeDescriptionDefined in
description?stringAn optional description of the Sectionpackages/config-bound/src/section/section.ts:23
namestringThe name of the Sectionpackages/config-bound/src/section/section.ts:19

Methods

addElement()

ts
addElement(element): void;

Defined in: packages/config-bound/src/section/section.ts:128

Adds a Element to the Section

Parameters

ParameterTypeDescription
elementElement<unknown>The Element to add

Returns

void


getConfigValueProvider()

ts
getConfigValueProvider(): 
  | ConfigValueProvider
  | undefined;

Defined in: packages/config-bound/src/section/section.ts:120

Gets the current value provider

Returns

| ConfigValueProvider | undefined

The current ConfigValueProvider or undefined if not set


getElement()

ts
getElement(elementName): 
  | Element<unknown>
  | undefined;

Defined in: packages/config-bound/src/section/section.ts:163

Gets a specific element by name

Parameters

ParameterTypeDescription
elementNamestringThe name of the element to get

Returns

| Element<unknown> | undefined

The element or undefined if not found


getElements()

ts
getElements(): Element<unknown>[];

Defined in: packages/config-bound/src/section/section.ts:154

Gets the Elements of the Section

Returns

Element<unknown>[]

The array of Elements


getValue()

ts
getValue<T>(elementName): Promise<T | undefined>;

Defined in: packages/config-bound/src/section/section.ts:172

Gets the value of a specific element using the current value provider

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
elementNamestringThe name of the element to get the value for

Returns

Promise<T | undefined>

The value or undefined if not found or no value provider set


setConfigValueProvider()

ts
setConfigValueProvider(valueProvider): void;

Defined in: packages/config-bound/src/section/section.ts:111

Sets the value provider

Parameters

ParameterTypeDescription
valueProviderConfigValueProviderThe ConfigValueProvider to use

Returns

void


setElements()

ts
setElements(elements): void;

Defined in: packages/config-bound/src/section/section.ts:84

Sets the Elements of the Section

Parameters

ParameterTypeDescription
elementsElement<unknown>[]The array of Elements to set

Returns

void


setLogger()

ts
setLogger(logger): void;

Defined in: packages/config-bound/src/section/section.ts:99

Sets the logger instance

Parameters

ParameterTypeDescription
loggerLoggerThe logger to use

Returns

void


findDuplicateElements()

ts
static findDuplicateElements(elements): Element<unknown>[];

Defined in: packages/config-bound/src/section/section.ts:59

Finds duplicate Elements in a given array.

Parameters

ParameterTypeDescription
elementsElement<unknown>[]The array of Elements to search

Returns

Element<unknown>[]

An array of Elements that have duplicate names