FoxitPDFSDKforWeb
v10.0.0
Foxit PDF SDK for Web
|
Represents a storage driver. More...
Public Member Functions | |
Promise< void > | close () |
Closes the storage driver. More... | |
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... | |
Public Attributes | |
boolean | isClosed |
Gets the current status of the storage driver, indicating whether it is closed or not. More... | |
Represents a storage driver.
Promise<void> StorageDriver::close | ( | ) |
Closes the storage driver.
This method is used to perform cleanup operations, such as closing database connections associated with the storage driver. After calling this method, further operations on the storage driver may not be possible until it is reinitialized or recreated. It's important to note that this method does not clear any data stored in the storage system.
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 IndexedDBStorageDriver, and 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. |
Implemented in IndexedDBStorageDriver.
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 IndexedDBStorageDriver, and 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. |
Implemented in IndexedDBStorageDriver.
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 IndexedDBStorageDriver, and 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 IndexedDBStorageDriver, and LocalStorageDriver.
boolean StorageDriver::isClosed |
Gets the current status of the storage driver, indicating whether it is closed or not.