0

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

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

3 Comments

But my login functionality is happening here only......... that means this function only refer the database for the given parameters
@Sujitha what you see is only the type definition, or in other term, the signature of a function. It defines the type of inputs this function takes, and the type of output it returns. However, nothing really "happens" in this line of code, that part sits in the implementation of this type definition, which you did not show in OP.
Hi Ashish....Thanks for ur rply actually loginWithPassword() is the inbuilt function in meteor.....Thanks for ur explanation..

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.