/** * Collection storage mode configuration. * * Determines whether each collection is served from local RxDB (IndexedDB) * or remote D1 REST API. Community tier routes 19 collections to remote; * premium tier keeps all 32 local. */ type CollectionMode = 'local' | 'remote'; interface CollectionModeConfig { /** Base URL for D1 REST API (remote collections) */ apiBaseUrl: string; /** Auth token getter for remote requests */ getAuthToken: () => Promise; /** Default mode when collection not explicitly listed */ defaultMode: CollectionMode; /** Per-collection mode overrides */ collections: Record; /** react-query defaults for remote collections */ remoteDefaults?: { staleTime?: number; refetchInterval?: number; gcTime?: number; }; } /** * Resolve the storage mode for a given collection. * * Checks explicit per-collection overrides first, then falls back to defaultMode. */ declare function getCollectionMode(config: CollectionModeConfig, name: string): CollectionMode; /** * D1 REST API client for remote collection access. * * Provides typed query/get/set methods matching the D1 REST endpoint * conventions. Used by remote hooks to fetch and mutate collection data * when a collection is in 'remote' mode (community tier). */ interface D1QueryParams { selector?: Record; sort?: Array>; limit?: number; skip?: number; } declare class D1Client { private readonly config; constructor(config: CollectionModeConfig); query>(collection: string, params?: D1QueryParams): Promise; get>(collection: string, ids: string[]): Promise; set>(collection: string, doc: Partial): Promise; private fetch; } declare class D1ClientError extends Error { readonly status: number; readonly body: string; readonly path: string; constructor(status: number, body: string, path: string); } export { type CollectionModeConfig as C, D1Client as D, type CollectionMode as a, type D1QueryParams as b, D1ClientError as c, getCollectionMode as g };