Reputation: 153
This is my code in typescript
function loginWithPassword(user: Object | string, password: string, callback?: Function): void;
I did not know what's happening on this code in typescript
Upvotes: 0
Views: 87
Reputation: 4330
this is the signature definition of function loginWithPassword
.
Let's break down this code:
function loginWithPassword(
user: Object | string,
password: string,
callback?: Function): void;
defining that
loginWithPassword
is afunction
which will returnvoid
It will acceptthree parameters
:
1st paramuser
will be of typeobject or a string
2nd parampassword
will always be astring
3rd paramcallback
will be afunction
Upvotes: 3