import { StorageKey, Storage, StorageKeyReturnType } from '@tezos-x/octez.connect-types'; /** Type workaround for https://github.com/Microsoft/TypeScript/issues/7294#issuecomment-465794460 */ export type ArrayElem = A extends (infer Elem)[] ? Elem : never; /** * @internalapi * * The StorageManager provides CRUD functionality for specific entities and persists them to the provided storage. */ export declare class StorageManager { private readonly storage; private readonly storageKey; constructor(storage: Storage, storageKey: T); getAll(): Promise; getOne(predicate: (element: ArrayElem) => boolean): Promise | undefined>; addOne(element: ArrayElem, predicate: (element: ArrayElem) => boolean, overwrite?: boolean): Promise; /** * Insert or update many elements in a single read-modify-write cycle. * * Equivalent to calling {@link addOne} for each element, but reads and writes * storage once instead of once per element. Elements are reconciled against * the store AND against earlier elements in the same batch (so a duplicate * within `elements` collapses to one), using `match(stored, incoming)` to * decide identity. Used for the v4 multi-network fanout, which persists one * account per requested network from a single permission response. */ addMany(elements: ArrayElem[], match: (stored: ArrayElem, incoming: ArrayElem) => boolean, overwrite?: boolean): Promise; remove(predicate: (element: ArrayElem) => boolean): Promise; removeAll(): Promise; }