DataAdapter
Defined in: store/adapters/DataAdapter.ts:117
A class representing a storage adapter that uses the local storage.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”D
extends DataSchema
= DataSchema
Implements
Section titled “Implements”IDataAdapter
<D
>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DataAdapter<
D
>(id
):DataAdapter
<D
>
Defined in: store/adapters/DataAdapter.ts:127
Parameters
Section titled “Parameters”string
= 'data'
Returns
Section titled “Returns”DataAdapter
<D
>
Overrides
Section titled “Overrides”Properties
Section titled “Properties”__dill_pixel_method_binding_root
Section titled “__dill_pixel_method_binding_root”__dill_pixel_method_binding_root:
boolean
Defined in: plugins/Plugin.ts:39
Inherited from
Section titled “Inherited from”StorageAdapter
.__dill_pixel_method_binding_root
data:
D
Defined in: store/adapters/DataAdapter.ts:118
readonly
id:string
='data'
Defined in: store/adapters/DataAdapter.ts:127
The ID of the adapter. Default is ‘StorageAdapter’.
Inherited from
Section titled “Inherited from”onDataChange
Section titled “onDataChange”onDataChange:
Signal
<(detail
) =>void
>
Defined in: store/adapters/DataAdapter.ts:120
Emits a signal when data changes.
Implementation of
Section titled “Implementation of”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get app():
A
Defined in: plugins/Plugin.ts:53
Returns
Section titled “Returns”A
Inherited from
Section titled “Inherited from”options
Section titled “options”Get Signature
Section titled “Get Signature”get options():
O
Defined in: plugins/Plugin.ts:44
Returns
Section titled “Returns”O
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”addSignalConnection()
Section titled “addSignalConnection()”addSignalConnection(…
args
):void
Defined in: plugins/Plugin.ts:79
Add signal connections to the container.
Parameters
Section titled “Parameters”…SignalConnection
[]
The signal connections to add.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”StorageAdapter
.addSignalConnection
append()
Section titled “append()”append<
K
>(key
,value
,separator
):D
[K
]
Defined in: store/adapters/DataAdapter.ts:257
Appends a string to a string property.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
| symbol
The type of keys in D where the value is a string
Parameters
Section titled “Parameters”K
The key of the string property
string
The string to append
separator
Section titled “separator”string
= ''
Returns
Section titled “Returns”D
[K
]
The new string after concatenation
Implementation of
Section titled “Implementation of”clear()
Section titled “clear()”clear():
void
Defined in: store/adapters/DataAdapter.ts:275
Deletes data from a specified key in the local storage.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”clearSignalConnections()
Section titled “clearSignalConnections()”clearSignalConnections():
void
Defined in: plugins/Plugin.ts:85
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”StorageAdapter
.clearSignalConnections
concat()
Section titled “concat()”concat<
K
>(key
,value
):D
[K
]
Defined in: store/adapters/DataAdapter.ts:240
Concatenates a value or array of values to an array property.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
| symbol
The type of keys in D where the value is an array
Parameters
Section titled “Parameters”K
The key of the array property
D
[K
] extends E
[] ? E
| E
[] : never
The value(s) to concatenate
Returns
Section titled “Returns”D
[K
]
The new array after concatenation
Implementation of
Section titled “Implementation of”destroy()
Section titled “destroy()”destroy():
void
Defined in: store/adapters/DataAdapter.ts:138
Destroys the adapter.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”Call Signature
Section titled “Call Signature”get():
D
Defined in: store/adapters/DataAdapter.ts:207
Loads data from storage. If a key is provided, returns the value for that key. If no key is provided, returns all data.
Returns
Section titled “Returns”D
The loaded data
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”get<
K
>(key?
):undefined
|D
[K
]
Defined in: store/adapters/DataAdapter.ts:208
Loads data from storage. If a key is provided, returns the value for that key. If no key is provided, returns all data.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
| symbol
The type of the key to load
Parameters
Section titled “Parameters”K
Optional key to load specific data
Returns
Section titled “Returns”undefined
| D
[K
]
The loaded data
Implementation of
Section titled “Implementation of”getCoreSignals()
Section titled “getCoreSignals()”getCoreSignals():
string
[]
Defined in: store/adapters/DataAdapter.ts:131
Returns
Section titled “Returns”string
[]
Overrides
Section titled “Overrides”StorageAdapter.getCoreSignals
increment()
Section titled “increment()”increment<
K
>(key
,amount
):D
[K
]
Defined in: store/adapters/DataAdapter.ts:223
Increments a numeric property by a specified amount.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
| symbol
The type of keys in D where the value is a number
Parameters
Section titled “Parameters”K
The key of the property to increment
amount
Section titled “amount”number
= 1
The amount to increment by (default: 1)
Returns
Section titled “Returns”D
[K
]
The new value after incrementing
Implementation of
Section titled “Implementation of”initialize()
Section titled “initialize()”initialize(
options?
):void
Defined in: store/adapters/DataAdapter.ts:147
Initializes the adapter.
Parameters
Section titled “Parameters”options?
Section titled “options?”Partial
<IDataAdapterOptions
<D
>>
The options to initialize the adapter with.
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”load()
Section titled “load()”load<
TExpectedLoadResult
>(_key
):undefined
|TExpectedLoadResult
|Promise
<TExpectedLoadResult
>
Defined in: store/adapters/StorageAdapter.ts:59
Loads data from a specified key.
Type Parameters
Section titled “Type Parameters”TExpectedLoadResult
Section titled “TExpectedLoadResult”TExpectedLoadResult
= any
Parameters
Section titled “Parameters”string
The key from which to load the data.
Returns
Section titled “Returns”undefined
| TExpectedLoadResult
| Promise
<TExpectedLoadResult
>
A promise that resolves with the loaded data, or the loaded data if the load operation is synchronous, or null if no data was found.
Inherited from
Section titled “Inherited from”postInitialize()
Section titled “postInitialize()”postInitialize(
_app
):void
|Promise
<void
>
Defined in: plugins/Plugin.ts:68
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
| Promise
<void
>
Inherited from
Section titled “Inherited from”save()
Section titled “save()”save<
TExpectedSaveResult
>(_key
,_data
, …_rest
):any
Defined in: store/adapters/StorageAdapter.ts:73
Saves data under a specified key.
Type Parameters
Section titled “Type Parameters”TExpectedSaveResult
Section titled “TExpectedSaveResult”TExpectedSaveResult
= any
Parameters
Section titled “Parameters”string
any
…any
[]
Returns
Section titled “Returns”any
A promise that resolves when the data has been saved, or void if the save operation is synchronous.
Inherited from
Section titled “Inherited from”Call Signature
Section titled “Call Signature”set<
K
>(key
,data
):D
Defined in: store/adapters/DataAdapter.ts:162
Sets data for a specific key in storage.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
| symbol
Parameters
Section titled “Parameters”K
The key under which to save the data
D
[K
]
The data to save
Returns
Section titled “Returns”D
The updated data object
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”set(
data
,merge?
):D
Defined in: store/adapters/DataAdapter.ts:163
Merges data into storage.
Parameters
Section titled “Parameters”DeepPartial
<D
>
The data object to set
merge?
Section titled “merge?”boolean
Whether to merge with existing data
Returns
Section titled “Returns”D
The updated data object
Implementation of
Section titled “Implementation of”snapshot()
Section titled “snapshot()”Call Signature
Section titled “Call Signature”snapshot():
D
Defined in: store/adapters/DataAdapter.ts:292
Returns a snapshot of the current data.
Returns
Section titled “Returns”D
A snapshot of the current data
Implementation of
Section titled “Implementation of”Call Signature
Section titled “Call Signature”snapshot<
K
>(key?
):D
[K
]
Defined in: store/adapters/DataAdapter.ts:293
Returns a snapshot of the current data for a specific key.
Type Parameters
Section titled “Type Parameters”K
extends string
| number
| symbol
Parameters
Section titled “Parameters”K
The key of the data to snapshot
Returns
Section titled “Returns”D
[K
]
A snapshot of the current data for the specified key