Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

243
Views
TypeScript: ¿Importando un módulo en un proyecto de Typescript?

Tengo algunos datos estáticos para los que intento crear una tabla de búsqueda, así que tengo un objeto en un archivo TS:

nuevoTSFile.ts

 export declare module FontList { export DEFAULT_DATA: { 'james': { 'age': '23' }, 'jack': { 'age': '22' } } }

luego, en mi archivo TS principal, estoy importando como

 import { FontList } from './newTSFile'; // console.log("font list: ", FontList)

sin embargo, aún no puede encontrar el archivo cuando se compila con el error: Error [ERR_MODULE_NOT_FOUND]: Cannot find module .../FontList . No estoy seguro de lo que estoy haciendo mal aquí con respecto a la importación

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Prueba esto:-

newTSFile.ts export const FontList: { 'james': { 'age': '23' }, 'jack': { 'age': '22' } }

Importación principal del archivo TS import { FontList } from './newTSFile';

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!