1
1
import * as React from 'react'
2
- import { FirebaseNamespace } from " @firebase/app-types" ;
2
+ import { FirebaseNamespace } from ' @firebase/app-types'
3
3
import * as FirestoreTypes from '@firebase/firestore-types'
4
4
import * as DatabaseTypes from '@firebase/database-types'
5
5
import * as StorageTypes from '@firebase/storage-types'
@@ -189,7 +189,7 @@ interface BaseExtendedFirebaseInstance
189
189
/**
190
190
* Sets data to Firebase along with meta data. Currently,
191
191
* 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
193
193
* exists)
194
194
* @param path - Path to location on Firebase which to set
195
195
* @param value - Value to write to Firebase
@@ -343,7 +343,7 @@ interface BaseExtendedFirebaseInstance
343
343
* OptionalOverride is left here in the event that any of the optional properties below need to be extended in the future.
344
344
* Example: OptionalOverride<FirebaseNamespace, 'messaging', { messaging: ExtendedMessagingInstance }>
345
345
*/
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 : { }
347
347
type OptionalPick < T , b extends string > = Pick < T , b & keyof T >
348
348
349
349
type ExtendedFirebaseInstance = BaseExtendedFirebaseInstance & OptionalPick < FirebaseNamespace , 'messaging' | 'performance' | 'functions' | 'analytics' | 'remoteConfig' >
@@ -360,8 +360,7 @@ export function createFirebaseInstance(
360
360
firebase : any ,
361
361
configs : Partial < ReduxFirestoreConfig > ,
362
362
dispatch : Dispatch
363
- ) : ExtendedFirebaseInstance ;
364
-
363
+ ) : ExtendedFirebaseInstance
365
364
366
365
export type QueryParamOption =
367
366
| 'orderByKey'
@@ -389,6 +388,7 @@ export interface ReactReduxFirebaseQuerySetting {
389
388
| 'child_moved'
390
389
queryParams ?: QueryParamOptions
391
390
storeAs ?: string
391
+ populates ?: { child : string ; root : string } [ ]
392
392
}
393
393
394
394
/**
@@ -443,20 +443,39 @@ export interface ReduxFirestoreQuerySetting {
443
443
* @see https://github.com/prescottprue/redux-firestore#where
444
444
*/
445
445
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
+ */
447
450
orderBy ?: OrderByOptions | OrderByOptions [ ]
448
- // https://github.com/prescottprue/redux-firestore#limit
451
+ /**
452
+ * @see https://github.com/prescottprue/redux-firestore#limit
453
+ */
449
454
limit ?: number
450
- // https://github.com/prescottprue/redux-firestore#storeas
455
+ /**
456
+ * @see https://github.com/prescottprue/redux-firestore#storeas
457
+ */
451
458
storeAs ?: string
452
- // https://github.com/prescottprue/redux-firestore#startat
459
+ /**
460
+ * @see https://github.com/prescottprue/redux-firestore#startat
461
+ */
453
462
startAt ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
454
- // https://github.com/prescottprue/redux-firestore#startafter
463
+ /**
464
+ * @see https://github.com/prescottprue/redux-firestore#startafter
465
+ */
455
466
startAfter ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
456
- // https://github.com/prescottprue/redux-firestore#endat
467
+ /**
468
+ * @see https://github.com/prescottprue/redux-firestore#endat
469
+ */
457
470
endAt ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
458
- // https://github.com/prescottprue/redux-firestore#endbefore
471
+ /**
472
+ * @see https://github.com/prescottprue/redux-firestore#endbefore
473
+ */
459
474
endBefore ?: FirestoreTypes . DocumentSnapshot | any | any [ ]
475
+ /**
476
+ * @see https://github.com/prescottprue/redux-firestore#population
477
+ */
478
+ populates ?: { child : string ; root : string } [ ]
460
479
}
461
480
462
481
/**
@@ -467,7 +486,7 @@ export type ReduxFirestoreQueries =
467
486
| ( ReduxFirestoreQuerySetting | string )
468
487
469
488
/**
470
- * Function that recieves component props and returns
489
+ * Function that receives component props and returns
471
490
* a list of query configuration objects for redux-firestore
472
491
*/
473
492
export type ReduxFirestoreQueriesFunction = (
@@ -737,6 +756,29 @@ interface ExtendedAuthInstance {
737
756
* @see https://react-redux-firebase.com/docs/recipes/profile.html#update-profile
738
757
*/
739
758
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 >
740
782
}
741
783
742
784
/**
@@ -1089,35 +1131,53 @@ export interface ReduxFirestoreConfig {
1089
1131
1090
1132
helpersNamespace : string | null
1091
1133
1092
- // https://github.com/prescottprue/redux-firestore#loglistenererror
1134
+ /**
1135
+ * @see https://github.com/prescottprue/redux-firestore#loglistenererror
1136
+ */
1093
1137
logListenerError : boolean
1094
1138
1095
- // https://github.com/prescottprue/redux-firestore#enhancernamespace
1139
+ /**
1140
+ * @see https://github.com/prescottprue/redux-firestore#enhancernamespace
1141
+ */
1096
1142
enhancerNamespace : string
1097
1143
1098
- // https://github.com/prescottprue/redux-firestore#allowmultiplelisteners
1144
+ /**
1145
+ * @see https://github.com/prescottprue/redux-firestore#allowmultiplelisteners
1146
+ */
1099
1147
allowMultipleListeners :
1100
1148
| ( ( listenerToAttach : any , currentListeners : any ) => boolean )
1101
1149
| boolean
1102
1150
1103
- // https://github.com/prescottprue/redux-firestore#preserveondelete
1151
+ /**
1152
+ * @see https://github.com/prescottprue/redux-firestore#preserveondelete
1153
+ */
1104
1154
preserveOnDelete : null | object
1105
1155
1106
- // https://github.com/prescottprue/redux-firestore#preserveonlistenererror
1156
+ /**
1157
+ * @see https://github.com/prescottprue/redux-firestore#preserveonlistenererror
1158
+ */
1107
1159
preserveOnListenerError : null | object
1108
1160
1109
- // https://github.com/prescottprue/redux-firestore#onattemptcollectiondelete
1161
+ /**
1162
+ * @see https://github.com/prescottprue/redux-firestore#onattemptcollectiondelete
1163
+ */
1110
1164
onAttemptCollectionDelete :
1111
1165
| null
1112
1166
| ( ( queryOption : any , dispatch : any , firebase : any ) => void )
1113
1167
1114
- // https://github.com/prescottprue/redux-firestore#mergeordered
1168
+ /**
1169
+ * @see https://github.com/prescottprue/redux-firestore#mergeordered
1170
+ */
1115
1171
mergeOrdered : boolean
1116
1172
1117
- // https://github.com/prescottprue/redux-firestore#mergeordereddocupdate
1173
+ /**
1174
+ * @see https://github.com/prescottprue/redux-firestore#mergeordereddocupdate
1175
+ */
1118
1176
mergeOrderedDocUpdate : boolean
1119
1177
1120
- // https://github.com/prescottprue/redux-firestore#mergeorderedcollectionupdates
1178
+ /**
1179
+ * @see https://github.com/prescottprue/redux-firestore#mergeorderedcollectionupdates
1180
+ */
1121
1181
mergeOrderedCollectionUpdates : boolean
1122
1182
}
1123
1183
0 commit comments