Class: ConfigParser
A parser for FmsConfig elements.
Constructors
constructor
• new ConfigParser(): ConfigParser
Returns
Properties
configName
▪ Static
configName: string
= 'ConfigParser'
Defined in
src/sdk/utils/config/ConfigUtils.ts:5
Methods
getChildElement
▸ getChildElement(parentElement
, tagName
): Element
Gets the first occurrence of a given child element.
Parameters
Name | Type | Description |
---|---|---|
parentElement | Element | The element to search on. |
tagName | string | The tag name to find. |
Returns
Element
An element.
Throws
If no element is found.
Defined in
src/sdk/utils/config/ConfigUtils.ts:32
getChildElements
▸ getChildElements(parentElement
, tagName
): Element
[]
Gets all occurrences of a given child element type.
Parameters
Name | Type | Description |
---|---|---|
parentElement | Element | The element to search on. |
tagName | string | The tag name to find. |
Returns
Element
[]
All child elements that match.
Defined in
src/sdk/utils/config/ConfigUtils.ts:49
getChildLerpLookupTable
▸ getChildLerpLookupTable(parentElement
, tagName
): LerpLookupTable
Gets a LookupTable child of an element
Parameters
Name | Type | Description |
---|---|---|
parentElement | Element | The element to search on. |
tagName | string | The tag name to find. |
Returns
LerpLookupTable
Throws
If a lookup table cannot be parsed
Defined in
src/sdk/utils/config/ConfigUtils.ts:62
getIntegerAttrValue
▸ getIntegerAttrValue<T
>(element
, attributeName
, allowZero?
, allowNegative?
): T
Gets an integer attribute value of an element.
Type parameters
Name | Type |
---|---|
T | extends number |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
element | Element | undefined | The element to search on. |
attributeName | string | undefined | The attribute to find on the element. |
allowZero | boolean | false | Whether zero should be allowed as a value. |
allowNegative | boolean | false | Whether negative numbers should be allowed as a value. |
Returns
T
The attribute's value.
Throws
If the attribute is not present.
Defined in
src/sdk/utils/config/ConfigUtils.ts:167
getStringAttrValue
▸ getStringAttrValue<T
>(element
, attributeName
): T
Gets a string attribute value of an element.
Type parameters
Name | Type |
---|---|
T | extends string |
Parameters
Name | Type | Description |
---|---|---|
element | Element | The element to search on. |
attributeName | string | The attribute to find on the element. |
Returns
T
The attribute's value.
Throws
If the attribute is not present.
Defined in
src/sdk/utils/config/ConfigUtils.ts:154
getTextContent
▸ getTextContent(element
): string
Gets the text content of an element.
Parameters
Name | Type | Description |
---|---|---|
element | Element | The element to search on. |
Returns
string
The element's text content.
Throws
If no text content is present.
Defined in
src/sdk/utils/config/ConfigUtils.ts:120
optional
▸ optional<T
>(executor
, defaultValue
): T
Returns a value computed by an executor, with a fallback value if the executor throws
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
executor | () => T | the executor which returns the value |
defaultValue | T | a fallback value in case the executor throws |
Returns
T
T
Defined in
src/sdk/utils/config/ConfigUtils.ts:15