@itwin/core-backend
Version:
iTwin.js backend components
52 lines • 2.29 kB
TypeScript
/** @packageDocumentation
* @module NativeApp
*/
import { StorageValue } from "@itwin/core-common";
/**
* A local file stored in the [[NativeHost.appSettingsCacheDir]] for storing key/value pairs.
* @public
*/
export declare class NativeAppStorage {
private _ecdb;
readonly id: string;
private static readonly _ext;
private static _storages;
private static _init;
private constructor();
/** Set the value for a key */
setData(key: string, value: StorageValue): void;
/** Get the value for a key from this Storage. If key is not present or is null, return undefined. */
getData(key: string): StorageValue;
/** return the type of the value for a key, or undefined if not present. */
getValueType(key: string): "number" | "string" | "boolean" | "Uint8Array" | "null" | undefined;
/** return `true` if the key is present, but has a null value. */
hasNullValue(key: string): boolean;
/** Get the value for a key as a string. If it is not present, or not of type string, return undefined */
getString(key: string): string | undefined;
/** Get the value for a key as a number. If it is not present, or not of type number, return undefined */
getNumber(key: string): number | undefined;
/** Get the value for a key as a boolean. If it is not present, or not of type boolean, return undefined */
getBoolean(key: string): boolean | undefined;
/** Get the value for a key as a Uint8Array. If it is not present, or not of type Uint8Array, return undefined */
getUint8Array(key: string): Uint8Array | undefined;
/** Get all key names in this Storage */
getKeys(): string[];
/** Remove a key/value pair from this Storage */
removeData(key: string): void;
/** Remove all key/value pairs */
removeAll(): void;
/** Close this Storage. */
close(deleteFile?: boolean): void;
private static init;
/** find and open storage by its name. */
static find(name: string): NativeAppStorage;
/** Close all opened Storages.
* @internal
*/
static closeAll(): void;
/** @internal */
static getStorageNames(): string[];
/** Open or find a Storage by name. */
static open(name: string): NativeAppStorage;
}
//# sourceMappingURL=NativeAppStorage.d.ts.map