@@ -21,7 +21,7 @@ type FileOrBlob<T> = T extends File ? File : Blob
21
21
export interface InferableComponentEnhancerWithProps <
22
22
TInjectedProps ,
23
23
TNeedsProps
24
- > {
24
+ > {
25
25
< P extends TInjectedProps > (
26
26
component : React . ComponentType < P >
27
27
) : React . ComponentType < Omit < P , keyof TInjectedProps > & TNeedsProps >
@@ -163,12 +163,12 @@ interface FirebaseDatabaseService {
163
163
*/
164
164
interface BaseExtendedFirebaseInstance
165
165
extends DatabaseTypes . FirebaseDatabase ,
166
- FirebaseDatabaseService ,
167
- ExtendedAuthInstance ,
168
- ExtendedStorageInstance {
166
+ FirebaseDatabaseService ,
167
+ ExtendedAuthInstance ,
168
+ ExtendedStorageInstance {
169
169
initializeAuth : VoidFunction
170
170
171
- firestore : ( ) => ExtendedFirestoreInstance
171
+ firestore : ( ( ) => ExtendedFirestoreInstance ) & FirestoreStatics
172
172
173
173
dispatch : Dispatch
174
174
@@ -347,7 +347,7 @@ 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' >
350
-
350
+
351
351
/**
352
352
* Create an extended firebase instance that has methods attached
353
353
* which dispatch redux actions.
@@ -381,12 +381,12 @@ export type QueryParamOptions = QueryParamOption | string[]
381
381
export interface ReactReduxFirebaseQuerySetting {
382
382
path : string
383
383
type ?:
384
- | 'value'
385
- | 'once'
386
- | 'child_added'
387
- | 'child_removed'
388
- | 'child_changed'
389
- | 'child_moved'
384
+ | 'value'
385
+ | 'once'
386
+ | 'child_added'
387
+ | 'child_removed'
388
+ | 'child_changed'
389
+ | 'child_moved'
390
390
queryParams ?: QueryParamOptions
391
391
storeAs ?: string
392
392
}
@@ -479,8 +479,7 @@ export type ReduxFirestoreQueriesFunction = (
479
479
* @see https://github.com/prescottprue/redux-firestore#api
480
480
*/
481
481
interface ExtendedFirestoreInstance
482
- extends FirestoreTypes . FirebaseFirestore ,
483
- FirestoreStatics {
482
+ extends FirestoreTypes . FirebaseFirestore {
484
483
/**
485
484
* Get data from firestore.
486
485
* @see https://github.com/prescottprue/redux-firestore#get
@@ -596,19 +595,19 @@ interface CreateUserCredentials {
596
595
type Credentials =
597
596
| CreateUserCredentials
598
597
| {
599
- provider : 'facebook' | 'google' | 'twitter' | 'github' | 'microsoft.com' | 'apple.com' | 'yahoo.com'
600
- type : 'popup' | 'redirect'
601
- scopes ?: string [ ]
602
- }
598
+ provider : 'facebook' | 'google' | 'twitter' | 'github' | 'microsoft.com' | 'apple.com' | 'yahoo.com'
599
+ type : 'popup' | 'redirect'
600
+ scopes ?: string [ ]
601
+ }
603
602
| AuthTypes . AuthCredential
604
603
| {
605
- token : string
606
- profile : Object
607
- }
604
+ token : string
605
+ profile : Object
606
+ }
608
607
| {
609
- phoneNumber : string
610
- applicationVerifier : AuthTypes . ApplicationVerifier
611
- }
608
+ phoneNumber : string
609
+ applicationVerifier : AuthTypes . ApplicationVerifier
610
+ }
612
611
613
612
type UserProfile < P extends object = { } > = P
614
613
@@ -670,6 +669,9 @@ interface ExtendedAuthInstance {
670
669
// https://react-redux-firebase.com/docs/auth.html#verifypasswordresetcodecode
671
670
verifyPasswordResetCode : AuthTypes . FirebaseAuth [ 'verifyPasswordResetCode' ]
672
671
672
+ // https://react-redux-firebase.com/docs/auth.html#applyactioncode
673
+ applyActionCode : AuthTypes . FirebaseAuth [ 'applyActionCode' ]
674
+
673
675
/**
674
676
* Signs in using a phone number in an async pattern (i.e. requires calling a second method).
675
677
* @param phoneNumber - Update to be auth object
@@ -802,25 +804,25 @@ interface ExtendedStorageInstance {
802
804
*/
803
805
export interface UploadFileOptions < T extends File | Blob > {
804
806
name ?:
805
- | string
806
- | ( (
807
- file : FileOrBlob < T > ,
808
- internalFirebase : WithFirebaseProps < ProfileType > [ 'firebase' ] ,
809
- uploadConfig : {
810
- path : string
811
- file : FileOrBlob < T >
812
- dbPath ?: string
813
- options ?: UploadFileOptions < T >
814
- }
815
- ) => string )
807
+ | string
808
+ | ( (
809
+ file : FileOrBlob < T > ,
810
+ internalFirebase : WithFirebaseProps < ProfileType > [ 'firebase' ] ,
811
+ uploadConfig : {
812
+ path : string
813
+ file : FileOrBlob < T >
814
+ dbPath ?: string
815
+ options ?: UploadFileOptions < T >
816
+ }
817
+ ) => string )
816
818
documentId ?:
817
- | string
818
- | ( (
819
- uploadRes : StorageTypes . UploadTaskSnapshot ,
820
- firebase : WithFirebaseProps < ProfileType > [ 'firebase' ] ,
821
- metadata : StorageTypes . UploadTaskSnapshot [ 'metadata' ] ,
822
- downloadURL : string
823
- ) => string )
819
+ | string
820
+ | ( (
821
+ uploadRes : StorageTypes . UploadTaskSnapshot ,
822
+ firebase : WithFirebaseProps < ProfileType > [ 'firebase' ] ,
823
+ metadata : StorageTypes . UploadTaskSnapshot [ 'metadata' ] ,
824
+ downloadURL : string
825
+ ) => string )
824
826
useSetForMetadata ?: boolean
825
827
metadata ?: StorageTypes . UploadMetadata
826
828
metadataFactory ?: (
@@ -1046,7 +1048,7 @@ interface ReactReduxFirebaseConfig {
1046
1048
enableRedirectHandling : boolean
1047
1049
firebaseStateName : string
1048
1050
logErrors : boolean
1049
- onAuthStateChanged : ( user : AuthTypes . User | null ) => void
1051
+ onAuthStateChanged : ( user : AuthTypes . User | null , _firebase : any , dispatch : Dispatch ) => void
1050
1052
presence : any
1051
1053
preserveOnEmptyAuthChange : any
1052
1054
preserveOnLogout : any
@@ -1095,8 +1097,8 @@ export interface ReduxFirestoreConfig {
1095
1097
1096
1098
// https://github.com/prescottprue/redux-firestore#allowmultiplelisteners
1097
1099
allowMultipleListeners :
1098
- | ( ( listenerToAttach : any , currentListeners : any ) => boolean )
1099
- | boolean
1100
+ | ( ( listenerToAttach : any , currentListeners : any ) => boolean )
1101
+ | boolean
1100
1102
1101
1103
// https://github.com/prescottprue/redux-firestore#preserveondelete
1102
1104
preserveOnDelete : null | object
@@ -1106,8 +1108,8 @@ export interface ReduxFirestoreConfig {
1106
1108
1107
1109
// https://github.com/prescottprue/redux-firestore#onattemptcollectiondelete
1108
1110
onAttemptCollectionDelete :
1109
- | null
1110
- | ( ( queryOption : any , dispatch : any , firebase : any ) => void )
1111
+ | null
1112
+ | ( ( queryOption : any , dispatch : any , firebase : any ) => void )
1111
1113
1112
1114
// https://github.com/prescottprue/redux-firestore#mergeordered
1113
1115
mergeOrdered : boolean
@@ -1200,7 +1202,7 @@ export namespace FirebaseReducer {
1200
1202
export interface Reducer <
1201
1203
ProfileType extends Record < string , any > = { } ,
1202
1204
Schema extends Record < string , any > = { }
1203
- > {
1205
+ > {
1204
1206
auth : AuthState
1205
1207
profile : Profile < ProfileType >
1206
1208
authError : any
@@ -1240,6 +1242,28 @@ export namespace FirebaseReducer {
1240
1242
export type Profile < ProfileType > = {
1241
1243
isLoaded : boolean
1242
1244
isEmpty : boolean
1245
+ token ?: {
1246
+ token : string
1247
+ expirationTime : string
1248
+ authTime : string
1249
+ issuedAtTime : string
1250
+ signInProvider : string
1251
+ signInSecondFactor : any
1252
+ claims : {
1253
+ name : string
1254
+ picture : string
1255
+ iss : string
1256
+ aud : string
1257
+ auth_time : number
1258
+ user_id : string
1259
+ sub : string
1260
+ iat : number
1261
+ exp : number
1262
+ email : string
1263
+ email_verified : boolean
1264
+ [ key : string ] : any
1265
+ } ;
1266
+ }
1243
1267
} & ProfileType
1244
1268
1245
1269
export namespace firebaseStateReducer {
0 commit comments