diff --git a/src/compat/firestore/interfaces.ts b/src/compat/firestore/interfaces.ts index e865b16fd..6ee3405aa 100644 --- a/src/compat/firestore/interfaces.ts +++ b/src/compat/firestore/interfaces.ts @@ -1,63 +1,47 @@ import { Subscriber } from 'rxjs'; import firebase from 'firebase/compat/app'; - -export type Settings = firebase.firestore.Settings; -export type CollectionReference = firebase.firestore.CollectionReference; -export type DocumentReference = firebase.firestore.DocumentReference; -export type PersistenceSettings = firebase.firestore.PersistenceSettings; -export type DocumentChangeType = firebase.firestore.DocumentChangeType; -export type SnapshotOptions = firebase.firestore.SnapshotOptions; -export type FieldPath = firebase.firestore.FieldPath; -export type Query = firebase.firestore.Query; - -export type SetOptions = firebase.firestore.SetOptions; -export type DocumentData = firebase.firestore.DocumentData; - -export interface DocumentSnapshotExists extends firebase.firestore.DocumentSnapshot { - readonly exists: true; - data(options?: SnapshotOptions): T; +export declare type Settings = firebase.firestore.Settings; +export declare type CollectionReference = firebase.firestore.CollectionReference; +export declare type DocumentReference = firebase.firestore.DocumentReference; +export declare type PersistenceSettings = firebase.firestore.PersistenceSettings; +export declare type DocumentChangeType = firebase.firestore.DocumentChangeType; +export declare type SnapshotOptions = firebase.firestore.SnapshotOptions; +export declare type FieldPath = firebase.firestore.FieldPath; +export declare type Query = firebase.firestore.Query; +export declare type SetOptions = firebase.firestore.SetOptions; +export declare type DocumentData = firebase.firestore.DocumentData; +export interface DocumentSnapshotExists extends firebase.firestore.DocumentSnapshot { + readonly exists: true; + data(options?: SnapshotOptions): T; } - export interface DocumentSnapshotDoesNotExist extends firebase.firestore.DocumentSnapshot { - readonly exists: false; - data(options?: SnapshotOptions): undefined; - get(fieldPath: string | FieldPath, options?: SnapshotOptions): undefined; + readonly exists: false; + data(options?: SnapshotOptions): undefined; + get(fieldPath: string | FieldPath, options?: SnapshotOptions): undefined; } - -export type DocumentSnapshot = DocumentSnapshotExists | DocumentSnapshotDoesNotExist; - -export interface QueryDocumentSnapshot extends firebase.firestore.QueryDocumentSnapshot { - data(options?: SnapshotOptions): T; +export declare type DocumentSnapshot = DocumentSnapshotExists | DocumentSnapshotDoesNotExist; +export interface QueryDocumentSnapshot extends firebase.firestore.QueryDocumentSnapshot { + data(options?: SnapshotOptions): T; } - -export interface QuerySnapshot extends firebase.firestore.QuerySnapshot { - readonly docs: QueryDocumentSnapshot[]; +export interface QuerySnapshot extends firebase.firestore.QuerySnapshot { + readonly docs: QueryDocumentSnapshot[]; } - -export interface DocumentChange extends firebase.firestore.DocumentChange { - readonly doc: QueryDocumentSnapshot; +export interface DocumentChange extends firebase.firestore.DocumentChange { + readonly doc: QueryDocumentSnapshot; } - export interface DocumentChangeAction { - type: DocumentChangeType; - payload: DocumentChange; + type: DocumentChangeType; + payload: DocumentChange; } - export interface Action { - type: string; - payload: T; + type: string; + payload: T; } - export interface Reference { - onSnapshot: (options: firebase.firestore.SnapshotListenOptions, sub: Subscriber) => any; + onSnapshot: (options: firebase.firestore.SnapshotListenOptions, sub: Subscriber) => any; } - -// A convience type for making a query. -// Example: const query = (ref) => ref.where('name', == 'david'); -export type QueryFn = (ref: CollectionReference) => Query; - -export type QueryGroupFn = (query: Query) => Query; - +export declare type QueryFn = (ref: CollectionReference) => Query; +export declare type QueryGroupFn = (query: Query) => Query; /** * A structure that provides an association between a reference * and a query on that reference. Note: Performing operations @@ -81,6 +65,7 @@ export type QueryGroupFn = (query: Query) => Query; * }); */ export interface AssociatedReference { - ref: CollectionReference; - query: Query; + ref: CollectionReference; + query: Query; } +