I have my interface definitions of the result of several database queries in a global.d.ts file. As I moved the various project folders using those interfaces into a single monorepo, I am still using a copy of the same global.d.ts in each package as it was before, and it works fine, except for the duplication, which makes little sense in the monorepo.
I have a shared tsconfig.json file at the root, which is extended by the tsconfig.json in each package.
How can I move the global.d.ts file to the root of the monorepo and have all the packages use it without importing it into each source file?
I tried changing in the tsconfig of each package:
"include": ["./src/**/*"],
// into
"include": ["./src/**/*", "../../types/**/*"],
I tried adding the typeRoots in the root tsconfig:
"typeRoots": ["./node_modules/@types", ".types"]
All to no avail.
Summary: I just want to move the two identical copies of the currently working global.d.ts files in each package, to a single file in a common location and make tsc find it just as it does when there is one copy in each package.
Thanks