import type { DataEntry, ImmutableDataStore } from './data-store.js'; /** * A read-only, async view over content collection data, used at runtime by * `getCollection()` and `getEntry()`. It lets the runtime read from different * data sources (an in-memory snapshot today, potentially a database or remote * source in the future) through one interface, without depending on Node.js * APIs. * * The query methods are async so a source can perform I/O when resolving data. * The default {@link InMemorySource} resolves synchronously. */ export interface DataStoreSource { hasCollection(collection: string): Promise | boolean; get(collection: string, key: string): Promise | T | undefined; entries(collection: string): Promise> | Array<[id: string, T]>; values(collection: string): Promise> | Array; keys(collection: string): Promise> | Array; has(collection: string, key: string): Promise | boolean; collections(): Promise>> | Map>; } /** * A {@link DataStoreSource} backed by an in-memory {@link ImmutableDataStore}. * All queries resolve synchronously; the async signatures exist to satisfy the * {@link DataStoreSource} contract. */ export declare class InMemorySource implements DataStoreSource { #private; constructor(store: ImmutableDataStore); hasCollection(collection: string): boolean; get(collection: string, key: string): T | undefined; entries(collection: string): Array<[id: string, T]>; values(collection: string): Array; keys(collection: string): Array; has(collection: string, key: string): boolean; collections(): Map>; }