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?