I am trying to declare ts type globally. I have sth like this type Nullable<T> = T | null
which is used in project files. I dont want to copy this part in each file. I tried to declare this type in declarations.ts
or declarations.d.ts
like this declare type Nullable<T> = T | null
, my IDE and compiler is OK with this but when I use this project as a module (import) in another project, then I get an error: Cannot find name 'Nullable'
in d.ts files.
Can you help me how can I declare this generic type globally? Do you have any ideas? Thank you for response.