Reputation: 714
I am new to nodejs and started using vscode recently but pretty good with Javascript and its wonderful features. I am having some trouble understanding the parameters that the intellisense is showing.
What exactly does this line mean, this intellisense is so confusing!. Is there some extension that I can install which will give the boiler plate code if I want to use for eg: watch method.
Thanks and please dont down vote, this is a genuine question as to how to make sense of the intellisence.
Thanks
Upvotes: 1
Views: 158
Reputation: 17486
listener?: (event: string, filename: string) => any
From left to right:
fs.watch
accepts an optional argument listener
(the ?
indicates this)listener
should be a function
accepting two parameters: event
and filename
. (Technically you could write a function that doesn't accept any, but you'd lose information)listener
doesn't need to return anything (=> any
)There's more information here, including how VS Code actually generates this annotations.
Upvotes: 1