Closed
Description
TypeScript Version: 2.0.3
Code
// A *self-contained* demonstration of the problem follows...
// rxjs installed via npm
// seems to expose everything via its .d.ts file:
export { Observable } from './Observable';
// attempting to augment the Observable class exposed by the rxjs module
// observable.operators.ts
import {Observable} from 'rxjs'
declare module 'rxjs' {
interface Observable<T> {
doStuff():void;
}
}
// consumer.ts
import { Observable, Subscription } from 'rxjs'
export class Consumer{
private _sub:Subscription;
constructor(){
this._sub = Observable.from([1,2,3]).subscribe();
}
}
Expected behavior:
The doStuff
to appear available in the rxjs module on the Observable
class.
Actual behavior:
Attempting to use import {Observable} from 'rxjs'
in another file (consumer.ts) causes compilation errors.
Export declaration conflicts with exported declaration of 'Observable'
Property 'subscribe' does not exist on type 'Observable'
etc.