UNPKG

firesage

Version:

🔥 Extremely High Precision Typescript Wrapper for Firestore Web, Providing Unparalleled Type Safe and Dev Experience

27 lines (26 loc) • 1.31 kB
import { MetaType, Query, QuerySnapshot } from '../types'; /** * Executes the query and returns the results as a `QuerySnapshot`. * * Note: `getDocs()` attempts to provide up-to-date data when possible by * waiting for data from the server, but it may return cached data or fail if * you are offline and the server cannot be reached. To specify this behavior, * invoke {@link getDocsFromCache} or {@link getDocsFromServer}. * * @returns A `Promise` that will be resolved with the results of the query. */ export declare const getDocs: <T extends MetaType>(query: Query<T>) => Promise<QuerySnapshot<T>>; /** * Executes the query and returns the results as a `QuerySnapshot` from cache. * Returns an error if the document is not currently cached. * * @returns A `Promise` that will be resolved with the results of the query. */ export declare const getDocsFromCache: <T extends MetaType>(query: Query<T>) => Promise<QuerySnapshot<T>>; /** * Executes the query and returns the results as a `QuerySnapshot` from the * server. Returns an error if the network is not available. * * @returns A `Promise` that will be resolved with the results of the query. */ export declare const getDocsFromServer: <T extends MetaType>(query: Query<T>) => Promise<QuerySnapshot<T>>;