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

282
Visualizações
JSDoc how to add any additional properties of an Object?

I have a JSDoc comment of a typedef like below,

/**
 * Lorem ipsum dolor...
 * @typedef {Object} NotificationOptions
 * @property {boolean} foo - Property 1
 * @property {boolean} bar - Property 2
 */

How to add any additional properties to the object besides foo and bar? (the property can be anything with any type, thus the type is flexible)

I had an example on typescript interface definition like below. I wanted my JSDoc to have similar effect with this interface definition on TS.

export interface FooBar {
  foo: boolean;
  bar: boolean;
  [key: string]: any;
}

I know it is optional and the code can run buttery smooth without the typedef. Just curious and wanted to had a clean and good code.

Thank you!

about 4 years ago · Juan Pablo Isaza
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