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

240
Views
How to declare global types in typescript

I want to have a global type in my simple typescript project. The program just run a simple calculation in src/index.ts and have other typescript helpers in src/utils. The goal is to declare a global type so that the type is available in any source files.

I made a global.d.ts file in the project root.

import { Readable } from "stream";

declare global {
    type MyFile = {
        readonly name: string;
        readonly stream: Readable;
    }
}

But MyFile is not recognized in src files.

How can I fix it?

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