import { DBEntity, EntityStore, KVStoreOrTransaction, PreparedQuery, PreparedOrder } from './types.js'; export interface ViewEntity { data: DBEntity; subqueries: Record; } export declare function createViewEntity(ent: DBEntity): ViewEntity; export declare function flattenViewEntity(viewEnt: ViewEntity | null): any; export declare function flattenViews(views: Record): { [k: string]: any; }; export declare class EntityStoreQueryEngine { private storage; private store; constructor(storage: KVStoreOrTransaction, store: EntityStore); /** * A top-level fetch method that compiles a query and executes it. */ fetch(query: PreparedQuery, vars?: any): Promise; private executeSteps; getCollectionCandidates(query: PreparedQuery): AsyncIterable; getCollectionCandidatesById(collectionName: string, ids: string[] | Set): AsyncIterable; } export declare function sortViewEntities(entities: ViewEntity[], order: PreparedOrder): void;