This splits indexing into two phases: * preindex (where only pages, space lua, space styles are indexed) * index (where everything else is indexed) The goal is to get to more-or-less operational state quicker this way, because probably most functionality can already be enabled after the pre-index phase.
26 lines
580 B
TypeScript
26 lines
580 B
TypeScript
import type { KV, KvKey } from "../../plug-api/types/datastore.ts";
|
|
|
|
export type KvQueryOptions = {
|
|
prefix?: KvKey;
|
|
};
|
|
|
|
export interface KvPrimitives {
|
|
batchGet(keys: KvKey[]): Promise<(any | undefined)[]>;
|
|
|
|
batchSet(entries: KV[]): Promise<void>;
|
|
|
|
batchDelete(keys: KvKey[]): Promise<void>;
|
|
|
|
query<T = any>(options: KvQueryOptions): AsyncIterableIterator<KV<T>>;
|
|
|
|
/**
|
|
* A more efficient way to do counts
|
|
*/
|
|
countQuery(options: KvQueryOptions): Promise<number>;
|
|
|
|
// Completely clear all data from this datastore
|
|
clear(): Promise<void>;
|
|
|
|
close(): void;
|
|
}
|