@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
32 lines • 1.74 kB
TypeScript
/** @packageDocumentation
* @module UiStateStorage
*/
import type { UiStateStorage, UiStateStorageResult } from "./UiStateStorage.js";
/** A single UI State entry that is identified by namespace and setting name.
* @public
* @deprecated in 4.16.0. Use {@link UiStateStorage} APIs instead.
*/
export declare class UiStateEntry<T> {
settingNamespace: string;
settingName: string;
getValue: () => T;
applyValue?: ((v: T) => void) | undefined;
defaultValue?: T | undefined;
/** Constructor
* @param settingNamespace Namespace for the setting, passed to UiStateStorage.
* @param settingName Name for the setting, passed to UiStateStorage.
* @param getValue Function for getting the value from the application.
* @param applyValue Function for applying the setting value to the application.
* @param defaultValue Optional default value if not already stored.
*/
constructor(settingNamespace: string, settingName: string, getValue: () => T, applyValue?: ((v: T) => void) | undefined, defaultValue?: T | undefined);
/** Gets the setting from [[UiStateStorage]] */
getSetting(storage: UiStateStorage): Promise<UiStateStorageResult>;
/** Saves the setting value from the `getValue` function to UiStateStorage */
saveSetting(storage: UiStateStorage): Promise<UiStateStorageResult>;
/** Deletes the setting from UiStateStorage */
deleteSetting(storage: UiStateStorage): Promise<UiStateStorageResult>;
/** Gets the setting from UiStateStorage and applies the value using the `applyValue` function */
getSettingAndApplyValue(storage: UiStateStorage): Promise<UiStateStorageResult>;
}
//# sourceMappingURL=UiStateEntry.d.ts.map