silverbullet/lib/data/kv_primitives.ts

14 lines
368 B
TypeScript
Raw Permalink Normal View History

2024-07-30 23:33:33 +08:00
import type { KV, KvKey } from "../../plug-api/types.ts";
2023-09-04 03:15:17 +08:00
export type KvQueryOptions = {
prefix?: KvKey;
};
export interface KvPrimitives {
batchGet(keys: KvKey[]): Promise<(any | undefined)[]>;
2023-09-04 03:15:17 +08:00
batchSet(entries: KV[]): Promise<void>;
batchDelete(keys: KvKey[]): Promise<void>;
query(options: KvQueryOptions): AsyncIterableIterator<KV>;
close(): void;
}