import type { Auth } from './auth.js'; export interface GeoBBox { latMin: number; latMax: number; lonMin: number; lonMax: number; latField?: string; lonField?: string; } export interface QueryOptions { owner?: string; limit?: number; offset?: number; orderBy?: string; order?: 'asc' | 'desc'; /** Filter documents by geo bounding box on JSON fields (default: lat/lon). */ bbox?: GeoBBox; } export interface QueryResult { documents: (T & { id: string; })[]; total: number; } /** Document database — organize data into named collections. */ export declare class Collections { private readonly appId; private readonly apiBase; private readonly auth; constructor(appId: string, apiBase: string, auth: Auth); /** Get a collection handle for the given name. */ collection(name: string): Collection; } /** A named collection of JSON documents. */ export declare class Collection { private readonly appId; private readonly name; private readonly apiBase; private readonly auth; constructor(appId: string, name: string, apiBase: string, auth: Auth); /** Create a new document. Auth required. Returns the document with its generated `id`. */ create>(doc: T): Promise; /** Get a document by ID. Returns null if not found. Public read. */ get>(id: string): Promise<(T & { id: string; }) | null>; /** Query documents with optional filtering and pagination. Public read. */ query>(opts?: QueryOptions): Promise>; /** Update a document by merging the patch into the existing data. Auth required, owner only. */ update>(id: string, patch: Partial): Promise; /** Delete a document. Auth required, owner only. */ delete(id: string): Promise; } //# sourceMappingURL=db.d.ts.map