I am currently trying to autogenerate .d.ts files for my JavaScript API using --declaration and I am running into problems. All of the enums produced by --declaration gets converted to a type and namespace instead of an actual enum. This confuses Intellisense and results in an incorrect type suggestion. For example:
/**
* Sample enum
* @enum {number}
*/
export var Foo = { A: 0, B: 1 }
gets converted to
/**
* Sample enum
*/
export type Foo = number;
export namespace Foo {
const A: number;
const B: number;
}
which causes in suggestions like
Too(input: number): number
for functions as follows
/**
* @param {Foo} input Example
* @return {Foo} Example
*/
export function Too(input: Foo): Foo;
Not exactly sure what is causing this issue and how to get about solving it. Any help would be much appreciated.