I have a Protractor project which contains such a file:
var FriendCard = function (card) {
var webElement = card;
var menuButton;
var serialNumber
I'm currently taking some legacy codebases and introducing minimal TypeScript changes to see if it helps our team. Depending on how strict you want to be with TypeScript, this may or may not be an option for you.
The most helpful way for us to get started was to extend our tsconfig.json file with this property:
// tsconfig.json excerpt:
{
...
"allowJs": true,
...
}
This change lets our JS files that have JSDoc type hints get compiled. Also our IDEs (JetBrains IDEs and VS Code) can provide code-completion and Intellisense.
References: