UNPKG

@dataql/react-native

Version:

DataQL React Native SDK with offline-first capabilities and clean API

66 lines (61 loc) 1.65 kB
// Main client export { DataQLClient } from "./DataQLClient"; // Types (explicitly export to avoid conflicts) export type { SyncStatus, SyncConfig, DataQLReactNativeConfig, QueryResult, MutationResult, SyncEventType, SyncEvent, CustomRequestConnection, WorkerBinding, ConnectionOptions, OfflineOperation, InternalConnectionConfig, DatabaseConfig, } from "./types"; // React hooks - clean DataQL API export { useQuery, useLiveQuery, useMutation, useSync, useNetworkStatus, } from "./hooks/useDataQL"; // Core classes (for advanced usage) export { OfflineCacheManager } from "./cache/OfflineCacheManager"; export { SyncManager } from "./sync/SyncManager"; // Helper functions export function createDefaultConfig( workerUrl: string, databaseName = "dataql.db", options?: { database?: import("./types").DatabaseConfig; customConnection?: import("./types").CustomRequestConnection; workerBinding?: import("./types").WorkerBinding; syncInterval?: number; retryCount?: number; batchSize?: number; autoSync?: boolean; enableChangeListener?: boolean; debug?: boolean; } ) { return { databaseName, database: options?.database, syncConfig: { workerUrl, syncInterval: options?.syncInterval ?? 30000, // 30 seconds retryCount: options?.retryCount ?? 3, batchSize: options?.batchSize ?? 50, autoSync: options?.autoSync ?? true, customConnection: options?.customConnection, workerBinding: options?.workerBinding, }, enableChangeListener: options?.enableChangeListener ?? true, debug: options?.debug ?? false, }; }