import { SuspenseSubject } from './SuspenseSubject' ; import type { Query as FirestoreQuery } from 'firebase/firestore' ; import type { Query as DatabaseQuery } from 'firebase/database' ; export type ReactFireGlobals = { _reactFireDatabaseCachedQueries : Array < DatabaseQuery > ; _reactFireFirestoreQueryCache : Array < FirestoreQuery > ; _reactFirePreloadedObservables : Map < string , SuspenseSubject < any > > ; } ; export class ReactFireError extends Error { readonly name = 'ReactFireError' ; constructor ( readonly code , message , public customData ? ) { super ( message ) ; Object . setPrototypeOf ( this , ReactFireError . prototype ) ; } } export interface ReactFireOptions < T = unknown > { idField ? : string ; initialData ? : T | any ; deprecated startWithValue ? : T | any ; suspense ? : boolean ; } export function checkOptions ( options , field ) { if ( field === 'idField' || field === 'initialData' || field === 'suspense' ) { return options ? ( options [ field ] as ReactFireOptions [ 'idField' ] | ReactFireOptions [ 'initialData' ] | ReactFireOptions [ 'suspense' ] ) : undefined ; } throw new Error ( `Field "${ field }" is not a valid key in ReactFireOptions` ) ; } export function checkinitialData ( options ) { return checkOptions ( options , 'initialData' ) ; } export function checkIdField ( options ) { return checkOptions ( options , 'idField' ) ; } export * from './auth' ; export * from './database' ; export * from './firebaseApp' ; export * from './firestore' ; export * from './functions' ; export * from './performance' ; export * from './remote-config' ; export * from './storage' ; export * from './useObservable' ; export * from './sdk' ;