Memory interface
Represents a memory.
Remarks
A memory is a key-value store that can be used to store and retrieve values.
Methods
delete |
Deletes a value from the memory. |
get |
Retrieves a value from the memory. |
has |
Checks if a value exists in the memory. |
set |
Assigns a value to the memory. |
Method Details
deleteValue(string)
Deletes a value from the memory.
function deleteValue(path: string)
Parameters
- path
-
string
Path to the value to delete in the form of [scope].property
. If scope is omitted, the value is deleted from the temporary scope.
getValue<TValue>(string)
Retrieves a value from the memory.
function getValue<TValue>(path: string): TValue
Parameters
- path
-
string
Path to the value to retrieve in the form of [scope].property
. If scope is omitted, the value is retrieved from the temporary scope.
Returns
TValue
The value or undefined if not found.
hasValue(string)
Checks if a value exists in the memory.
function hasValue(path: string): boolean
Parameters
- path
-
string
Path to the value to check in the form of [scope].property
. If scope is omitted, the value is checked in the temporary scope.
Returns
boolean
True if the value exists, false otherwise.
setValue(string, unknown)
Assigns a value to the memory.
function setValue(path: string, value: unknown)
Parameters
- path
-
string
Path to the value to assign in the form of [scope].property
. If scope is omitted, the value is assigned to the temporary scope.
- value
-
unknown
Value to assign.