UNPKG

react-firehooks

Version:

Lightweight dependency-free collection of React hooks for Firebase

33 lines (32 loc) 1.65 kB
import { AggregateSpec, DocumentData, DocumentReference, DocumentSnapshot, Query, QuerySnapshot, SnapshotListenOptions } from "firebase/firestore"; import type { Source } from "./types.js"; /** * @since 10.9.0 */ export type ListenSource = "default" | "cache"; /** * This library currently supports firebase@10.5.0 which is missing the `source` property in `SnapshotListenOptions`. */ export type SnapshotListenOptionsInternal = SnapshotListenOptions & { readonly source?: "default" | "cache"; }; /** * @internal */ export declare function getDocFromSource<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>(reference: DocumentReference<AppModelType, DbModelType>, source: Source): Promise<DocumentSnapshot<AppModelType, DbModelType>>; /** * @internal */ export declare function getDocsFromSource<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>(query: Query<AppModelType, DbModelType>, source: Source): Promise<QuerySnapshot<AppModelType, DbModelType>>; /** * @internal */ export declare function isDocRefEqual<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>(a: DocumentReference<AppModelType, DbModelType> | undefined, b: DocumentReference<AppModelType, DbModelType> | undefined): boolean; /** * @internal */ export declare function isQueryEqual<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>(a: Query<AppModelType, DbModelType> | undefined, b: Query<AppModelType, DbModelType> | undefined): boolean; /** * @internal */ export declare function isAggregateSpecEqual<T extends AggregateSpec>(a: T, b: T): boolean;