Skip to content

Commit 4e3a61e

Browse files
committed
fix(auth): improve typings for onAuthStateChanged
1 parent bc94aae commit 4e3a61e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

typings/app.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ declare namespace firebase.auth {
123123
currentUser : firebase.User | null ;
124124
fetchProvidersForEmail (email : string ) : firebase.Promise < any > ;
125125
getRedirectResult ( ) : firebase.Promise < any > ;
126-
onAuthStateChanged (nextOrObserver : Object , error ? : (a : firebase.auth.Error ) => any , completed ? : ( ) => any ) : ( ) => any ;
126+
onAuthStateChanged (nextOrObserver : Object | ((user: firebase.User | null) => any), error ? : (a : firebase.auth.Error ) => any , completed ? : ( ) => any ) : ( ) => any ;
127127
onIdTokenChanged (nextOrObserver : Object , error ? : (a : firebase.auth.Error ) => any , completed ? : ( ) => any ) : ( ) => any ;
128128
sendPasswordResetEmail (email : string ) : firebase.Promise < any > ;
129129
signInAndRetrieveDataWithCredential (credential : firebase.auth.AuthCredential ) : firebase.Promise < any > ;

typings/firebase.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ declare namespace firebase.auth {
123123
currentUser : firebase.User | null ;
124124
fetchProvidersForEmail (email : string ) : firebase.Promise < any > ;
125125
getRedirectResult ( ) : firebase.Promise < any > ;
126-
onAuthStateChanged (nextOrObserver : Object , error ? : (a : firebase.auth.Error ) => any , completed ? : ( ) => any ) : ( ) => any ;
126+
onAuthStateChanged (nextOrObserver : Object | ((user: firebase.User | null) => any), error ? : (a : firebase.auth.Error ) => any , completed ? : ( ) => any ) : ( ) => any ;
127127
onIdTokenChanged (nextOrObserver : Object , error ? : (a : firebase.auth.Error ) => any , completed ? : ( ) => any ) : ( ) => any ;
128128
sendPasswordResetEmail (email : string ) : firebase.Promise < any > ;
129129
signInAndRetrieveDataWithCredential (credential : firebase.auth.AuthCredential ) : firebase.Promise < any > ;

0 commit comments

Comments
 (0)