Sujitha
Sujitha

Reputation: 153

In typescript Callback function

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

Answers (1)

Ashish
Ashish

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 a function which will return void
It will accept three parameters:
1st param user will be of type object or a string
2nd param password will always be a string
3rd param callback will be a function

Upvotes: 3

Related Questions