Skip to content

Global Types In Typescript

  1. make a global.d.ts file
export {};
declare global {
interface someInterface{}
}
2. Include the path of you global.d.ts in tsconfig.json
```json
{
"compilerOptions": {
"paths": {
"@/*": [
"./src/*"
]
},
"include": [
"src/types/**/*.d.ts",
"path_to_global.d.ts"
],
"exclude": [
"node_modules"
]
}
}