Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

499
Vistas
JS - Do I need to explicitly import JSDoc typedefs in VS Code to have intellisense support?

I have a module

camera.d.js

that only contains the following definition:

/**
 * @typedef {object} CropperConfiguration
 * @property {Dimension} dimensions - Dimensions.
 */

and imports the module

global.d.js

that contains the following definition:

/**
 * @typedef {object} Dimension
 * @property {number} width - Width.
 * @property {number} height - Height.
 */

So... if camera.d.js imports global.d.js... in my module CameraUtils.js, that imports camera.d.js, do I need to import global.d.js to access the Dimension definition?

I thought that yes, but... for some reason I don't understand, I can perfectly access this definition only importing camera.d.js and ignoring global.d.js.

Why?

--

Update

Full content of camera.d.js

/**
 * @file Camera type definitions.
 * @license MIT
 * @version 1.0.0
 * @since 1.0.0
 * @category utils
 * @subcategory camera
 * @module CameraTypes
 */

import "../global/global.d";

/**
 * @typedef {object} CropperConfiguration
 * @property {Dimension} dimensions - Dimensions.
 * @property {string} name - Cropper's vector icon name.
 * @property {string} type - Cropper's vector icon type.
 */

And... for importing the types in CameraUtils.js I just do:

import "./camera.d"; // global scope

...
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I've been using JSDocs with VSCode IntelliSence for a few years now. By default, it's disabled, so you have to enable it first:

https://code.visualstudio.com/docs/languages/jsconfig

I have a public project you can reference from here:

https://github.com/clshortfuse/webhoster/blob/master/jsconfig.json

But basically, you need:

{
  "compilerOptions": {
    "checkJs": true,
  }
}

You don't need a.d.js file. You can inline them. You can also use a .d.ts file for complex types and then import the .js equivalent inline.

See: https://github.com/clshortfuse/webhoster/tree/master/types

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda