OptionsProvider
Utility that wraps the raw options provider data in a more convenient structure
This provider represents a snapshot of the options in time and should be fairly short-lived.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get name():
string
Returns
Section titled “Returns”string
Methods
Section titled “Methods”has(
key):boolean
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”boolean
lookup()
Section titled “lookup()”lookup<
T>(key):T
Lookup makes the assumption that the key request IS in the options. To make code less convoluted. If an option is optionally present the caller should check if the key is present first
The caller can optionally provide an expected type parameter to make usage more convenient
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
|
|
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
the key |
Returns
Section titled “Returns”T
refresh()
Section titled “refresh()”refresh():
Promise<OptionsProvider>
Returns a new snapshot of this options provider
Returns
Section titled “Returns”Promise<OptionsProvider>
the new snapshot
SDK 1.18.0
toArray()
Section titled “toArray()”toArray(): [
string,AttributeValue][]
Converts the options provider to an array (mainly for debugging purposes)
Returns
Section titled “Returns”[string, AttributeValue][]
toString()
Section titled “toString()”toString():
string
Returns
Section titled “Returns”string
update()
Section titled “update()”update(
updates):Promise<string[]>
Applies updates for the given option keys to this options provider and returns a list of any invalid updates performed
NOTE: This does not modify this “snapshot” in place
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
the updates to apply |
Returns
Section titled “Returns”Promise<string[]>
an updated
SDK 1.18.0 protocol 1.15.0