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

199
Views
Merge two typedef files jsdoc

I have two separate typedef files.

typedefFirst.js

/**
 * ControllerResponse
 * @typedef {Object} ControllerResponse
 * @property {Number} statusCode
 * @property {{ data: (Object | Array )}} body
 */

/**
 * ExpressRouter
 * @typedef {import('express').Router} ExpressRouter
 */

typedefSecond.js

/**
 * Context
 * @typedef {Object} Context
 * @property {String} userId
 * @property {String} role
 * @property {String} accessToken
 */

/**
 * ExpressRequest
 * @typedef {import('express').Request} ExpressRequest
 */

I want to aggregate all types and define all the types in one file i.e. typedefFirst.js.

I tried export.unused = {} in typedefSecond.js and tried below in typedefFirst.js,

/**
 * @typedef {import('./typedefSecond.js')}
 */

But it is not working.

How can I merge both typedef files?

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!