11import * as React from 'react'
2- import { FirebaseNamespace } from " @firebase/app-types" ;
2+ import { FirebaseNamespace } from ' @firebase/app-types'
33import * as FirestoreTypes from '@firebase/firestore-types'
44import * as DatabaseTypes from '@firebase/database-types'
55import * as StorageTypes from '@firebase/storage-types'
@@ -189,7 +189,7 @@ interface BaseExtendedFirebaseInstance
189189 /**
190190 * Sets data to Firebase along with meta data. Currently,
191191 * this includes createdAt and createdBy. *Warning* using this function
192- * may have unintented consequences (setting createdAt even if data already
192+ * may have unintended consequences (setting createdAt even if data already
193193 * exists)
194194 * @param path - Path to location on Firebase which to set
195195 * @param value - Value to write to Firebase
@@ -343,7 +343,7 @@ interface BaseExtendedFirebaseInstance
343343 * OptionalOverride is left here in the event that any of the optional properties below need to be extended in the future.
344344 * Example: OptionalOverride<FirebaseNamespace, 'messaging', { messaging: ExtendedMessagingInstance }>
345345 */
346- type OptionalOverride < T , b extends string , P > = b extends keyof T ? P : { } ;
346+ type OptionalOverride < T , b extends string , P > = b extends keyof T ? P : { }
347347type OptionalPick < T , b extends string > = Pick < T , b & keyof T >
348348
349349type ExtendedFirebaseInstance = BaseExtendedFirebaseInstance & OptionalPick < FirebaseNamespace , 'messaging' | 'performance' | 'functions' | 'analytics' | 'remoteConfig' >
@@ -360,8 +360,7 @@ export function createFirebaseInstance(
360360 firebase : any ,
361361 configs : Partial < ReduxFirestoreConfig > ,
362362 dispatch : Dispatch
363- ) : ExtendedFirebaseInstance ;
364-
363+ ) : ExtendedFirebaseInstance
365364
366365export type QueryParamOption =
367366 | 'orderByKey'
@@ -389,6 +388,7 @@ export interface ReactReduxFirebaseQuerySetting {
389388 | 'child_moved'
390389 queryParams ?: QueryParamOptions
391390 storeAs ?: string
391+ populates ?: { child : string ; root : string } [ ]
392392}
393393
394394/**
@@ -443,20 +443,39 @@ export interface ReduxFirestoreQuerySetting {
443443 * @see https://github.com/prescottprue/redux-firestore#where
444444 */
445445 where ?: WhereOptions | WhereOptions [ ]
446- // https://github.com/prescottprue/redux-firestore#orderby
446+ endBefore ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
447+ /**
448+ * @see https://github.com/prescottprue/redux-firestore#orderby
449+ */
447450 orderBy ?: OrderByOptions | OrderByOptions [ ]
448- // https://github.com/prescottprue/redux-firestore#limit
451+ /**
452+ * @see https://github.com/prescottprue/redux-firestore#limit
453+ */
449454 limit ?: number
450- // https://github.com/prescottprue/redux-firestore#storeas
455+ /**
456+ * @see https://github.com/prescottprue/redux-firestore#storeas
457+ */
451458 storeAs ?: string
452- // https://github.com/prescottprue/redux-firestore#startat
459+ /**
460+ * @see https://github.com/prescottprue/redux-firestore#startat
461+ */
453462 startAt ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
454- // https://github.com/prescottprue/redux-firestore#startafter
463+ /**
464+ * @see https://github.com/prescottprue/redux-firestore#startafter
465+ */
455466 startAfter ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
456- // https://github.com/prescottprue/redux-firestore#endat
467+ /**
468+ * @see https://github.com/prescottprue/redux-firestore#endat
469+ */
457470 endAt ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
458- // https://github.com/prescottprue/redux-firestore#endbefore
471+ /**
472+ * @see https://github.com/prescottprue/redux-firestore#endbefore
473+ */
459474 endBefore ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
475+ /**
476+ * @see https://github.com/prescottprue/redux-firestore#population
477+ */
478+ populates ?: { child : string ; root : string } [ ]
460479}
461480
462481/**
@@ -467,7 +486,7 @@ export type ReduxFirestoreQueries =
467486 | ( ReduxFirestoreQuerySetting | string )
468487
469488/**
470- * Function that recieves component props and returns
489+ * Function that receives component props and returns
471490 * a list of query configuration objects for redux-firestore
472491 */
473492export type ReduxFirestoreQueriesFunction = (
@@ -737,6 +756,29 @@ interface ExtendedAuthInstance {
737756 * @see https://react-redux-firebase.com/docs/recipes/profile.html#update-profile
738757 */
739758 updateProfile : ( profile : Partial < ProfileType > , options ?: Object ) => Promise < void >
759+
760+ /**
761+ * Logs user into Firebase using external.
762+ * @param authData - Auth data from Firebase's getRedirectResult
763+ * @returns Resolves with user's profile
764+ * @see https://react-redux-firebase.com/docs/recipes/auth.html
765+ */
766+ handleRedirectResult : ( authData : any ) => Promise < any >
767+
768+ /**
769+ * Re-authenticate user into Firebase. For examples, visit the
770+ * [auth section of the docs](https://react-redux-firebase.com/docs/auth.html) or the
771+ * [auth recipes section](https://react-redux-firebase.com/docs/recipes/auth.html).
772+ * @param credentials - Credentials for authenticating
773+ * @param credentials.provider - External provider (google |
774+ * facebook | twitter)
775+ * @param credentials.type - Type of external authentication
776+ * (popup | redirect) (only used with provider)
777+ * @returns Resolves with user's auth data
778+ * @see https://react-redux-firebase.com/docs/auth.html#logincredentials
779+ * @see https://react-redux-firebase.com/docs/api/firebaseInstance.html#login
780+ */
781+ reauthenticate : ( credentials : any ) => Promise < any >
740782}
741783
742784/**
@@ -1089,35 +1131,53 @@ export interface ReduxFirestoreConfig {
10891131
10901132 helpersNamespace : string | null
10911133
1092- // https://github.com/prescottprue/redux-firestore#loglistenererror
1134+ /**
1135+ * @see https://github.com/prescottprue/redux-firestore#loglistenererror
1136+ */
10931137 logListenerError : boolean
10941138
1095- // https://github.com/prescottprue/redux-firestore#enhancernamespace
1139+ /**
1140+ * @see https://github.com/prescottprue/redux-firestore#enhancernamespace
1141+ */
10961142 enhancerNamespace : string
10971143
1098- // https://github.com/prescottprue/redux-firestore#allowmultiplelisteners
1144+ /**
1145+ * @see https://github.com/prescottprue/redux-firestore#allowmultiplelisteners
1146+ */
10991147 allowMultipleListeners :
11001148 | ( ( listenerToAttach : any , currentListeners : any ) => boolean )
11011149 | boolean
11021150
1103- // https://github.com/prescottprue/redux-firestore#preserveondelete
1151+ /**
1152+ * @see https://github.com/prescottprue/redux-firestore#preserveondelete
1153+ */
11041154 preserveOnDelete : null | object
11051155
1106- // https://github.com/prescottprue/redux-firestore#preserveonlistenererror
1156+ /**
1157+ * @see https://github.com/prescottprue/redux-firestore#preserveonlistenererror
1158+ */
11071159 preserveOnListenerError : null | object
11081160
1109- // https://github.com/prescottprue/redux-firestore#onattemptcollectiondelete
1161+ /**
1162+ * @see https://github.com/prescottprue/redux-firestore#onattemptcollectiondelete
1163+ */
11101164 onAttemptCollectionDelete :
11111165 | null
11121166 | ( ( queryOption : any , dispatch : any , firebase : any ) => void )
11131167
1114- // https://github.com/prescottprue/redux-firestore#mergeordered
1168+ /**
1169+ * @see https://github.com/prescottprue/redux-firestore#mergeordered
1170+ */
11151171 mergeOrdered : boolean
11161172
1117- // https://github.com/prescottprue/redux-firestore#mergeordereddocupdate
1173+ /**
1174+ * @see https://github.com/prescottprue/redux-firestore#mergeordereddocupdate
1175+ */
11181176 mergeOrderedDocUpdate : boolean
11191177
1120- // https://github.com/prescottprue/redux-firestore#mergeorderedcollectionupdates
1178+ /**
1179+ * @see https://github.com/prescottprue/redux-firestore#mergeorderedcollectionupdates
1180+ */
11211181 mergeOrderedCollectionUpdates : boolean
11221182}
11231183
0 commit comments