If I declare the namespace globally for an application, I can use it (it works without compilation errors), but I won't have suggestion/autocompletion for the namespace specifically. However types from this namespace do appear in the intellisense suggestions.
In other words, while I type the namespace (for example libTypes) there are no suggestions for it, but after I finish typing the namespace and add a dot after it (libTypes.) intellisense starts suggesting me all the available types in this namespace.
Example of global.d.ts
import * as _libTypes from 'library/types';
declare global {
const libTypes: typeof _libTypes;
}
export as namespace libTypes;
export = _libTypes;
tsconfig.json
{
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
}
Change the tsconfig.json like this
tsconfig.json