Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
Unable to use enums that are generated by --declaration from a Javascript module

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!