FoxitPDFSDKforWeb
v9.1.0
Foxit PDF SDK for Web
|
Represents a storage driver. More...
Public Member Functions | |
pubic Promise< T|null > | get< T > (context:StorageContext, key:string) |
Retrieves the value associated with the specified key in the storage space. T The type of the value to retrieve. More... | |
Promise< Record< string, any > > | getAll (context:StorageContext) |
Retrieves all the data stored in the specified storage space. More... | |
Function | onChange< T > (callback:(event:StorageDriverChangeEvent< T >)=> void) |
Subscribes to storage change events and invokes the callback function whenever a change occurs. T - The type of value. More... | |
Function | onRemove (callback:(event:StorageDriverRemoveEvent)=> void) |
Subscribes to storage remove events and invokes the callback function whenever a remove event occurs. More... | |
Promise< void > | remove (context:StorageContext, key:string) |
Removes the value associated with the specified key in the storage space. More... | |
Promise< void > | removeAll (context:StorageContext) |
Removes all data stored in the specified storage space. More... | |
Promise< void > | set< T > (context:StorageContext, key:string, value:T) |
Store/Overwrite the value associated with the specified key in the storage space. T - The type of the value to store. More... | |
Represents a storage driver.
pubic Promise<T|null> StorageDriver::get< T > | ( | context:StorageContext | , |
key:string | |||
) |
Retrieves the value associated with the specified key in the storage space. T The type of the value to retrieve.
context | StorageContext - The storage context, partitioning strategies based on the context's content. |
key | string - The key of the value to retrieve. |
Implemented in LocalStorageDriver.
Promise<Record<string,any> > StorageDriver::getAll | ( | context:StorageContext | ) |
Retrieves all the data stored in the specified storage space.
context | StorageContext - The storage context, partitioning strategies based on the context's content. |
Function StorageDriver::onChange< T > | ( | callback:(event:StorageDriverChangeEvent< T >) | , |
void | |||
) |
Subscribes to storage change events and invokes the callback function whenever a change occurs. T - The type of value.
callback | (event:StorageDriverChangeEvent<T>)=>void - The callback function to handle storage change events |
Implemented in LocalStorageDriver.
Function StorageDriver::onRemove | ( | callback:(event:StorageDriverRemoveEvent) | , |
void | |||
) |
Subscribes to storage remove events and invokes the callback function whenever a remove event occurs.
callback | (event:StorageDriverRemoveEvent)=>void - The callback function to handle storage remove events. |
Promise<void> StorageDriver::remove | ( | context:StorageContext | , |
key:string | |||
) |
Removes the value associated with the specified key in the storage space.
context | StorageContext - The storage context, partitioning strategies based on the context's content. |
key | string - The key of the value to remove. |
Implemented in LocalStorageDriver.
Promise<void> StorageDriver::removeAll | ( | context:StorageContext | ) |
Removes all data stored in the specified storage space.
context | StorageContext - The storage context, partitioning strategies based on the context's content. |
Implemented in LocalStorageDriver.
Promise<void> StorageDriver::set< T > | ( | context:StorageContext | , |
key:string | , | ||
value:T | |||
) |
Store/Overwrite the value associated with the specified key in the storage space. T - The type of the value to store.
context | StorageContext - The storage context, partitioning strategies based on the context's content. |
key | string - The key of the value to store. |
value | T - The value to store. |
Implemented in LocalStorageDriver.