I\'m currently working on a project with some legacy javascript. The application does not include a module loader, it just puts everything as a global into the window object. To
You need to export rxjs to the global namespace. There are two ways to do it, depends on the shape of rxjs.
If rxjs export only one thing, e.g. Rx.*, then you can do this:
// custom-typings/rxjs.d.ts
import * from 'rxjs'
export as namespace Rx
// tsconfig.json
{
"include": [
"custom-typings"
]
}
If it export more than one thing, then you need to do global augmentation:
// custom-typings/rxjs.d.ts
import * as Rx from 'rxjs'
declare global {
type Rx = Rx
...
}
// same change to tsconfig.json
Here are some info on global augmentation. https://www.typescriptlang.org/docs/handbook/declaration-merging.html