Skip to content

Commit 1ddb382

Browse files
jsayolJosep Sayol
authored and
Josep Sayol
committed
fix(auth): improve typings for Auth methods
1 parent bc94aae commit 1ddb382

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

typings/app.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ 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 ;
127-
onIdTokenChanged (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 ;
127+
onIdTokenChanged (nextOrObserver : Object | ((user: firebase.User | null) => any), 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 > ;
130130
signInAnonymously ( ) : firebase.Promise < any > ;

typings/firebase.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ 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 ;
127-
onIdTokenChanged (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 ;
127+
onIdTokenChanged (nextOrObserver : Object | ((user: firebase.User | null) => any), 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 > ;
130130
signInAnonymously ( ) : firebase.Promise < any > ;

0 commit comments

Comments
 (0)