import { AxiosInstance } from 'axios'; import { NexaConfig, DatabaseReference, StorageReference, UploadOptions, OfflineJob } from '../types/index'; import { HttpClient } from '../transport/HttpClient'; import { SSEClient, WebSocketClient } from '../transport/SSEClient'; import { Auth } from '../auth/Auth'; import { User as AuthUser, AuthSession } from '../auth/authTypes'; import { IndexedDB } from '../persistence/IndexedDB'; import { LocalStore } from '../persistence/LocalStore'; import { MutationQueue } from '../persistence/MutationQueue'; import { SyncEngine } from '../sync/SyncEngine'; import { RealtimeDatabase } from '../realtime/RealtimeDatabase'; import { Storage } from '../storage/Storage'; export declare class NexaApp { projectId: string; token: string | null; endpoint: string; enablePersistence: boolean; cacheStrategy: 'network-first' | 'cache-first'; _queryCacheMetadata: Record; httpClient: HttpClient; client: AxiosInstance; wsClient: WebSocketClient; sseClient: SSEClient; authService: Auth; indexedDB: IndexedDB; localStore: LocalStore; mutationQueue: MutationQueue; syncEngine: SyncEngine; realtimeDatabase: RealtimeDatabase; storage: Storage; _snapshotCallbacks: Record void>; _firestoreListening: boolean; _firestoreUnsubscribes: (() => void)[]; _initPromise: Promise | null; _initialized: boolean; _activeQueryTimestamps: Map; constructor(config: NexaConfig); get _firestoreCache(): Record; private _setupVisibilityResync; private _setupCrossTabSync; _broadcastLocalMutation(path: string, action: string, data?: any): void; getPendingWritesCount(): number; hasPendingWrites(path: string): boolean; markInflight(path: string, mutationId: string): void; unmarkInflight(path: string, mutationId: string): void; _initFirestoreState(): Promise; _setCache(path: string, data: any): Promise; _deleteCache(path: string): Promise; _addOfflineJob(job: OfflineJob): Promise; _calculateLocalView(path: string): { data: any | null; hasPendingWrites: boolean; }; _commitAtomicMutation(path: string, action: 'set' | 'patch' | 'delete', job: OfflineJob): Promise<{ data: any | null; hasPendingWrites: boolean; }>; _commitMutationAck(options: { mutationId: string; path: string; action: 'set' | 'patch' | 'delete'; serverDocument?: any; updateTime?: string; mutationData?: any; merge?: boolean; }): Promise<{ data: any | null; hasPendingWrites: boolean; }>; _rejectMutationAtomically(options: { mutationId: string; path: string; error: any; }): Promise<{ data: any | null; hasPendingWrites: boolean; }>; _commitAtomicQueryResults(options: { queryKey: string; collectionPath: string; serverDocs: { id: string; fields: any; }[]; isComplete: boolean; constraints?: any[]; readTime?: string; revision?: string; }): Promise; _syncOfflineQueue(): Promise; _handleServerFirestoreChange(payload: any): void; _ensureFirestoreSSE(): void; _ensureFirestoreWebSocket(): void; _closeFirestoreSSEIfIdle(): void; _closeFirestoreWebSocketIfIdle(): void; _notifySnapshotCallbacks(path: string, actionType: string, payload?: any): void; signInWithEmailAndPassword(email: string, password: string): Promise; createUserWithEmailAndPassword(email: string, password: string, name?: string): Promise; sendOtp(email: string): Promise<{ success: boolean; message: string; }>; signInWithOtp(email: string, otp: string): Promise; signOut(): void; getCurrentUser(): AuthUser | null; ref(path: string): DatabaseReference; storageRef(path: string): StorageReference; uploadFile(path: string, file: File | Blob, options?: UploadOptions): Promise<{ url: string; path: string; }>; getDownloadURL(path: string): Promise; isConnected(): boolean; onConnectionStateChanged(callback: (isConnected: boolean) => void): () => void; }