I have a Typescript/JavaScript hybrid project and I'm creating declaration d.ts files for some of the JavaScript files in order to aid in the management of multiple classes and subclasses.
However the declared types are not being seen by Visual Studio Code. I have the js and corresponding d.ts files in the same directory.
For example:
my-class.js
class MyClass {
constructor(options) {}
action(num) {
return num.toString()
}
}
}
my-class.d.ts
export interface Options {
a: boolean
b: boolean
}
export declare abstract class MyClass {
constructor(options: Options)
action(num: number): string
}
IntelliSense does not pick up the definitions, for instance, when I hover over the action method of my-class.js.
I've tried adding a reference annotation at the top of my-class.js with no effect (///<reference path="./my-class.d.ts" />).
I have the checkJs option set to true in my settings.
I'm using VS Code Version 1.19.1
Are there other actions I need to take in order for this to work?



