// Copyright © 2022-2026 Partium, Inc. DBA Partium import { ServiceProvider } from "../services/service-provider"; import { KeyPrefixParams, LocalStorageService } from "../services/local-storage.service.interface"; /** * Implementation of the LocalStorageService for Web-based applications with LocalStorage API. */ export declare class WebLocalStorageService extends LocalStorageService { constructor(serviceProvider: ServiceProvider); /** * Sets the value of the pair identified by key to value, creating a new * key/value pair if none existed for key previously. * * @param key the key to identify the pair * @param value the value as string * @param keyPrefixParams optional parameters to prefix the key with different prefix-options * @returns promise that resolves as soon as the value is stored */ setItem(key: string, value: string, keyPrefixParams?: KeyPrefixParams): Promise; /** * Sets the value of the pair identified by key to value, creating a new * key/value pair if none existed for key previously. * * @param key the key to identify the pair * @param value the value as string * @param keyPrefixParams optional parameters to prefix the key with different prefix-options */ setItemSync(key: string, value: string, keyPrefixParams?: KeyPrefixParams): void; /** * Sets a series of key-value pairs * * @param keyValuePairs the array of key-value-pairs [['k1', 'val1'], ['k2', 'val2']] * @param keyPrefixParams optional parameters to prefix the key with different prefix-options * @returns promise that resolves as soon as all pairs are stored */ setItems(keyValuePairs: string[][], keyPrefixParams?: KeyPrefixParams): Promise; /** * Sets a series of key-value pairs * * @param keyValuePairs the array of key-value-pairs [['k1', 'val1'], ['k2', 'val2']] * @param keyPrefixParams optional parameters to prefix the key with different prefix-options */ setItemsSync(keyValuePairs: string[][], keyPrefixParams?: KeyPrefixParams): void; /** * Returns the current value associated with the given key, or null if the given * key does not exist in the list associated with the object. * * @param key the key to identify the pair * @param keyPrefixParams optional parameters to prefix the key with different prefix-options * @returns string-value of the item stored by the given key, or null if not found */ getItem(key: string, keyPrefixParams?: KeyPrefixParams): Promise; /** * Returns the current value associated with the given key, or null if the given * key does not exist in the list associated with the object. * * @param key the key to identify the pair * @param keyPrefixParams optional parameters to prefix the key with different prefix-options * @returns string-value of the item stored by the given key, or null if not found */ getItemSync(key: string, keyPrefixParams?: KeyPrefixParams): string; /** * Returns the current value for each of the given keys, or null if the given * keys does not exist in the list associated with the object. * * @param keys array of keys to retrieve * @param keyPrefixParams optional parameters to prefix the key with different prefix-options * @returns array of string-values of the items stored by the given keys, or null if not found */ getItems(keys: string[], keyPrefixParams?: KeyPrefixParams): Promise; /** * Returns the current value for each of the given keys, or null if the given * keys does not exist in the list associated with the object. * * This method should not be used inside the SDK. It's purpose is only for integrators from outside. * The reason is, that using it internally would restrict the use of the SDK for some platforms, as some platforms don't provide support for synchronous * interaction with the local storage. * * @param keys array of keys to retrieve * @param keyPrefixParams optional parameters to prefix the key with different prefix-options * @returns array of string-values of the items stored by the given keys, or null if not found */ getItemsSync(keys: string[], keyPrefixParams?: KeyPrefixParams): string[] | undefined; /** * Returns all key-value pairs * * @returns array of string-value of all the stored items */ getAll(): Promise<[string, string][]>; /** * Returns all key-value pairs * * This method should not be used inside the SDK. It's purpose is only for integrators from outside. * The reason is, that using it internally would restrict the use of the SDK for some platforms, as some platforms don't provide support for synchronous * interaction with the local storage. * * @returns array of string-value of all the stored items */ getAllSync(): [string, string][]; /** * Delete a key-value pair * * @param key the key to identify the pair * @param keyPrefixParams optional parameters to prefix the key with different prefix-options */ deleteItem(key: string, keyPrefixParams?: KeyPrefixParams): Promise; /** * Delete a key-value pair * * This method should not be used inside the SDK. It's purpose is only for integrators from outside. * The reason is, that using it internally would restrict the use of the SDK for some platforms, as some platforms don't provide support for synchronous * interaction with the local storage. * * @param key the key to identify the pair * @param keyPrefixParams optional parameters to prefix the key with different prefix-options */ deleteItemSync(key: string, keyPrefixParams?: KeyPrefixParams): void; /** * Delete a series of key-value pairs * * @param keys the keys to identify the pairs * @param keyPrefixParams optional parameters to prefix the key with different prefix-options */ deleteItems(keys: string[], keyPrefixParams?: KeyPrefixParams): Promise; /** * Delete a series of key-value pairs * * This method should not be used inside the SDK. It's purpose is only for integrators from outside. * The reason is, that using it internally would restrict the use of the SDK for some platforms, as some platforms don't provide support for synchronous * interaction with the local storage. * * @param keys the keys to identify the pairs * @param keyPrefixParams optional parameters to prefix the key with different prefix-options */ deleteItemsSync(keys: string[], keyPrefixParams?: KeyPrefixParams): void; /** * Returns true if an item with the given key exists. * Returns false, otherwise. * * @param key the key to identify the item * @param keyPrefixParams optional parameters to prefix the key with different prefix-options * @returns true if the item exists, false otherwise */ hasItem(key: string, keyPrefixParams?: KeyPrefixParams): Promise; /** * Returns true if an item with the given key exists. * Returns false, otherwise. * * This method should not be used inside the SDK. It's purpose is only for integrators from outside. * The reason is, that using it internally would restrict the use of the SDK for some platforms, as some platforms don't provide support for synchronous * interaction with the local storage. * * @param key the key to identify the item * @param keyPrefixParams optional parameters to prefix the key with different prefix-options * @returns true if the item exists, false otherwise */ hasItemSync(key: string, keyPrefixParams?: KeyPrefixParams): boolean; }