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

256
Vistas
How to get knexjs type definitions in migration files?

KnexJS type definitions work fine in all JS files where I import/require it. But in migrations there is no import/require due to no need of knex initializaion. Type definitions help avoiding error in properties and methods. How can I get type definitions in migration files for KnexJS then?

exports.up = function(knex) {
  // type definitions dont work here
};

exports.down = function(knex) {
  
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Well. AlhamduLILLAH. I found the answer myself.

/** @typedef {import('knex/types').Knex} knex */

/**
 * 
 * @param {knex} knex 
 */
export const up = async knex => {

  // Start here.. types work here!!

}

/**
 * 
 * @param {knex} knex 
 */
export const down = async knex => {

  // Start here.. types work here!!

}
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