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

249
Vistas
How to make 4.X Typescript project compatible with older version of Typescript 3.X?

How to make package built on top of TS 4.X compatible with 3.X? Like, if you have newer version -> use new features, else -> use any or unknown or whatever is supported in older version.

Is there any possibility to use directives for that purpose?

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

0

There is no way to switch between supported and unsupported features in TypeScript.

For instance, if you have a library which is built on top of TS 4.0 with variadic tuple types there is no way to use it in a package where TS 3.0 is used.

However, you can maintain two versions of your typings: before TS4 and after TS4. For instance, take a look how lodash or react maintaince several versions of typings.

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can just use an install an older version (whatever you want it to be, example: `npm i --dev typescript@3.5.2) of typescript in your npm and try to fix the errors. Then revert the typescript version to v4 or whatever it was already.

Now your code is compatible with the designated older typescript version (just make sure the functionality of your code doesn't change while updating it).

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