I am currently working on a project with some inherited javascript code. The application does not include the module loader, it just puts everything as global in the window object. Touching outdated code and enabling the module loader, unfortunately, is not a viable option for me.
I want to use typescript for my own code, so I set the typescript parameter to the compiler
module : "none"
in my tsconfig.json, and I used namespaces to organize my own code. Works well so far.
.. still:
import * as Rx from 'rxjs';
..
Rx.Observable.from(['foo',bar']);
...
// Results in TypeScript-Error:
// TS1148:Cannot use imports, exports, or module augmentations when '--module' is 'none'.
"module-none", typescript.
typescript?
?
, ( Rx RxJs)
///<reference path="../node_modules/rxjs/Rx.d.ts" />
..
Rx.Observable.from(['foo',bar']);
...
// Results in TypeScript-Error -> TS2304:Cannot find name 'Rx'.
Related Question , , .
.
declare const Rx: any;
, intellisense: (