Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

357
Visualizações
How to make intellisense work in Visual Code, when using a globally exposed library?

I'm using some library within my React object, that is globally exposed on the window object. It's loaded from index.html in the public directory(had to do this for complicated reasons, like usage of a Webworker and Web Assembly).

Within my React app, I simply access the object like this:

const myInstance = new window.MyClass() 

It all works fine, except for one problem: Visual Code has no idea what this object is, and therefore no intellisense is available. It just appears as "any". The library is documented with JsDoc, which I would like to utilize.

Any idea how this can be done? Is there a way to somehow tell the IDE: "this object I'm referring to, actually comes from here"?

I'll point out that this library is under my control(not some NPM module), so I can make any change there that is needed. Currently, it exposes itself both via window and export default.

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda