/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import { EventEmitter } from "@workglow/util"; import { JsonSchema } from "@workglow/util/schema"; import { JSONValue } from "../tabular/ITabularStorage"; import { IKvStorage, KvEventListener, KvEventListeners, KvEventName, KvEventParameters } from "./IKvStorage"; export declare const KV_REPOSITORY: import("@workglow/util").ServiceToken>; /** * Abstract base class for key-value storage repositories. * Emits {@link KvEventListeners} events for all mutations and reads. */ export declare abstract class KvStorage implements IKvStorage { keySchema: JsonSchema; valueSchema: JsonSchema; protected events: EventEmitter>; constructor(keySchema?: JsonSchema, valueSchema?: JsonSchema); abstract put(key: Key, value: Value): Promise; abstract putBulk(items: Array<{ key: Key; value: Value; }>): Promise; abstract get(key: Key): Promise; /** * Retrieves multiple values by their keys in a single bulk operation. * Returns only the found records; missing keys produce no entry. The * returned `Combined` records carry both key and value so callers can * re-align by key. */ abstract getBulk(keys: readonly Key[]): Promise; abstract delete(key: Key): Promise; abstract getAll(): Promise; abstract deleteAll(): Promise; abstract size(): Promise; getObjectAsIdString(object: JSONValue): Promise; on(name: Event, fn: KvEventListener): void; off(name: Event, fn: KvEventListener): void; once(name: Event, fn: KvEventListener): void; emit(name: Event, ...args: KvEventParameters): void; waitOn(name: Event): Promise>; } //# sourceMappingURL=KvStorage.d.ts.map