import { DatabaseSchema } from '../shared/types'; import { FakeServerDatabaseClient } from './fake-database'; /** * Fake table implementation for server-side development mode * Mimics ServerTable API but uses in-memory storage instead of Appwrite */ export declare class FakeServerTable { private fakeDb; private collectionId; private schema; private listeners; private lastSnapshot; private pollInterval?; private updated; private messages; constructor(fakeDb: FakeServerDatabaseClient, 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, options?: any): Promise; /** * Get all documents */ all(options?: any): Promise; /** * Find documents with Appwrite-like queries (simplified for development) */ 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; /** * Bulk create documents */ bulkCreate(documents: Partial>[]): Promise; /** * Bulk update documents */ bulkUpdate(updates: { id: string; data: Partial>; }[]): Promise; /** * Bulk delete documents */ bulkDelete(ids: string[]): Promise; /** * Create collection (no-op in fake mode) */ createCollection(name?: string, permissions?: string[]): Promise; /** * Delete collection (no-op in fake mode) */ deleteCollection(): Promise; /** * Create index (no-op in fake mode) */ createIndex(index: any): Promise; /** * Delete index (no-op in fake mode) */ deleteIndex(key: string): Promise; /** * List indexes (returns empty array in fake mode) */ listIndexes(): Promise; /** * Export all documents in this table to JSON */ exportToJSON(): Promise; /** * Export all documents in this table as an array */ exportToArray(): 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; } //# sourceMappingURL=fake-table.d.ts.map