import { DatabaseSchema } from '../shared/types'; import { FakeDatabaseClient } from './fake-database'; /** * Fake table implementation for development mode * Mimics WebTable API but uses cookies instead of Appwrite */ export declare class FakeTable { private fakeDb; private collectionId; private schema; private listeners; private lastSnapshot; private pollInterval?; private updated; private messages; constructor(fakeDb: FakeDatabaseClient, collectionId: string, schema: T); /** * Create a new document */ create(data: Partial>): Promise; /** * Get a document by ID */ get(id: string): Promise; /** * Get a document by ID or throw error */ getOrFail(id: string): Promise; /** * Update a document */ update(id: string, data: Partial>): Promise; /** * Delete a document */ delete(id: string): Promise; /** * Query documents with filters */ query(filters?: Record): Promise; /** * Get all documents */ all(): Promise; /** * Find documents with Appwrite-like queries (simplified for development) * Note: In development mode, only basic equality filters work through query() */ find(queries: string[]): Promise; /** * Find first document matching filter */ first(filters?: Record): Promise; /** * Find first document or throw error */ firstOrFail(filters?: Record): Promise; /** * Find one document with Appwrite-like queries */ findOne(queries: string[]): Promise; /** * Count documents */ count(filters?: Record): Promise; /** * Start polling for changes to simulate realtime */ private startPolling; /** * Update the current snapshot of data */ private updateSnapshot; /** * Check for changes and trigger events */ private checkForChanges; /** * Trigger an event for listeners */ private triggerEvent; /** * Add a listener to a channel */ private addListener; /** * Realtime methods (functional in development mode with mock data) */ listen(channel: string, onEvent: (event: any) => void): () => void; listenToDocuments(onEvent: (event: any) => void): () => void; listenToDocument(documentId: string, onEvent: (event: any) => void): () => void; listenToCollection(onEvent: (event: any) => void): () => void; listenToDatabase(onEvent: (event: any) => void): () => void; /** * Cache management methods */ isUpdated(): boolean; setUpdated(updated: boolean): void; /** * Close all listeners (for cleanup in tests) */ closeListeners(): void; destroy(): void; /** * Return collected internal messages (warnings, listener errors, actions) */ getMessages(): string[]; /** * Validate data against schema */ private validateData; /** * Export all documents in this table to JSON */ exportToJSON(): Promise; /** * Export all documents in this table as an array */ exportToArray(): Promise; } //# sourceMappingURL=fake-table.d.ts.map