diff --git a/package.json b/package.json index 82130f5e40..8a6491fee7 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "systemjs": "^0.19.6", "systemjs-builder": "^0.10.6", "tslint": "3.3.0-dev.2", - "typescript": "1.9.0-dev.20160128", + "typescript": "1.9.0-dev.20160202", "validate-commit-msg": "1.1.1", "watch": "0.16.0", "watchify": "3.7.0", diff --git a/src/Observable.ts b/src/Observable.ts index c28ad16cc8..9aa66ee89a 100644 --- a/src/Observable.ts +++ b/src/Observable.ts @@ -14,28 +14,7 @@ import {toSubscriber} from './util/toSubscriber'; import {tryCatch} from './util/tryCatch'; import {errorObject} from './util/errorObject'; -import {combineLatestStatic} from './operator/combineLatest'; -import {concatStatic} from './operator/concat'; -import {mergeStatic} from './operator/merge'; -import {zipStatic} from './operator/zip'; -import {BoundCallbackObservable} from './observable/BoundCallbackObservable'; -import {BoundNodeCallbackObservable} from './observable/BoundNodeCallbackObservable'; -import {DeferObservable} from './observable/DeferObservable'; -import {EmptyObservable} from './observable/EmptyObservable'; -import {ForkJoinObservable} from './observable/ForkJoinObservable'; -import {FromObservable} from './observable/FromObservable'; -import {ArrayObservable} from './observable/ArrayObservable'; -import {FromEventObservable} from './observable/FromEventObservable'; -import {FromEventPatternObservable} from './observable/FromEventPatternObservable'; -import {PromiseObservable} from './observable/PromiseObservable'; -import {IntervalObservable} from './observable/IntervalObservable'; -import {TimerObservable} from './observable/TimerObservable'; -import {raceStatic} from './operator/race'; -import {RangeObservable} from './observable/RangeObservable'; -import {NeverObservable} from './observable/NeverObservable'; import {ErrorObservable} from './observable/ErrorObservable'; -import {AjaxCreationMethod} from './observable/dom/AjaxObservable'; -import {WebSocketSubject} from './observable/dom/WebSocketSubject'; import {CombineLatestSignature} from './operator/combineLatest'; @@ -167,30 +146,8 @@ export class Observable implements CoreOperators { return this.source.subscribe(subscriber); } - // static method stubs - static ajax: AjaxCreationMethod; - static bindCallback: typeof BoundCallbackObservable.create; - static bindNodeCallback: typeof BoundNodeCallbackObservable.create; - static combineLatest: typeof combineLatestStatic; - static concat: typeof concatStatic; - static defer: typeof DeferObservable.create; - static empty: typeof EmptyObservable.create; - static forkJoin: typeof ForkJoinObservable.create; - static from: typeof FromObservable.create; - static fromArray: typeof ArrayObservable.create; - static fromEvent: typeof FromEventObservable.create; - static fromEventPattern: typeof FromEventPatternObservable.create; - static fromPromise: typeof PromiseObservable.create; - static interval: typeof IntervalObservable.create; - static merge: typeof mergeStatic; - static never: typeof NeverObservable.create; - static of: typeof ArrayObservable.of; - static race: typeof raceStatic; - static range: typeof RangeObservable.create; + // Throw is the special snow flake, the compiler sees it as a reserved word static throw: typeof ErrorObservable.create; - static timer: typeof TimerObservable.create; - static webSocket: typeof WebSocketSubject.create; - static zip: typeof zipStatic; // core operators buffer: (closingNotifier: Observable) => Observable; diff --git a/src/add/observable/bindCallback.ts b/src/add/observable/bindCallback.ts index 3d5f99244a..1877c470b1 100644 --- a/src/add/observable/bindCallback.ts +++ b/src/add/observable/bindCallback.ts @@ -3,4 +3,8 @@ import {BoundCallbackObservable} from '../../observable/BoundCallbackObservable' Observable.bindCallback = BoundCallbackObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let bindCallback: typeof BoundCallbackObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/bindNodeCallback.ts b/src/add/observable/bindNodeCallback.ts index 0c3767d92b..37697f293a 100644 --- a/src/add/observable/bindNodeCallback.ts +++ b/src/add/observable/bindNodeCallback.ts @@ -3,4 +3,8 @@ import {BoundNodeCallbackObservable} from '../../observable/BoundNodeCallbackObs Observable.bindNodeCallback = BoundNodeCallbackObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let bindNodeCallback: typeof BoundNodeCallbackObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/combineLatest.ts b/src/add/observable/combineLatest.ts index 353988356c..5524e03fc4 100644 --- a/src/add/observable/combineLatest.ts +++ b/src/add/observable/combineLatest.ts @@ -3,4 +3,8 @@ import {combineLatestStatic} from '../../operator/combineLatest'; Observable.combineLatest = combineLatestStatic; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let combineLatest: typeof combineLatestStatic; + } +} \ No newline at end of file diff --git a/src/add/observable/concat.ts b/src/add/observable/concat.ts index d6e1a736f2..b33ebf208b 100644 --- a/src/add/observable/concat.ts +++ b/src/add/observable/concat.ts @@ -4,4 +4,8 @@ import {concatStatic} from '../../operator/concat'; Observable.concat = concatStatic; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let concat: typeof concatStatic; + } +} \ No newline at end of file diff --git a/src/add/observable/defer.ts b/src/add/observable/defer.ts index 906b48745e..1d4bad605b 100644 --- a/src/add/observable/defer.ts +++ b/src/add/observable/defer.ts @@ -3,4 +3,8 @@ import {DeferObservable} from '../../observable/DeferObservable'; Observable.defer = DeferObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let defer: typeof DeferObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/dom/ajax.ts b/src/add/observable/dom/ajax.ts index fc8598953c..8c41467f2e 100644 --- a/src/add/observable/dom/ajax.ts +++ b/src/add/observable/dom/ajax.ts @@ -4,4 +4,8 @@ import {AjaxObservable} from '../../../observable/dom/AjaxObservable'; Observable.ajax = AjaxObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../../Observable' { + namespace Observable { + export let ajax: typeof AjaxObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/dom/webSocket.ts b/src/add/observable/dom/webSocket.ts index af863c2ace..3936852c3c 100644 --- a/src/add/observable/dom/webSocket.ts +++ b/src/add/observable/dom/webSocket.ts @@ -4,4 +4,8 @@ import {WebSocketSubject} from '../../../observable/dom/WebSocketSubject'; Observable.webSocket = WebSocketSubject.create; -export var _void: void; \ No newline at end of file +declare module '../../../Observable' { + namespace Observable { + export let webSocket: typeof WebSocketSubject.create; + } +} \ No newline at end of file diff --git a/src/add/observable/empty.ts b/src/add/observable/empty.ts index 92a2713007..82dbbc9df4 100644 --- a/src/add/observable/empty.ts +++ b/src/add/observable/empty.ts @@ -3,4 +3,8 @@ import {EmptyObservable} from '../../observable/EmptyObservable'; Observable.empty = EmptyObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let empty: typeof EmptyObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/forkJoin.ts b/src/add/observable/forkJoin.ts index 8c0e73b560..8beb5f92c5 100644 --- a/src/add/observable/forkJoin.ts +++ b/src/add/observable/forkJoin.ts @@ -3,4 +3,8 @@ import {ForkJoinObservable} from '../../observable/ForkJoinObservable'; Observable.forkJoin = ForkJoinObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let forkJoin: typeof ForkJoinObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/from.ts b/src/add/observable/from.ts index 0fdf53af7f..8fa6978aa7 100644 --- a/src/add/observable/from.ts +++ b/src/add/observable/from.ts @@ -3,4 +3,8 @@ import {FromObservable} from '../../observable/FromObservable'; Observable.from = FromObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let from: typeof FromObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/fromArray.ts b/src/add/observable/fromArray.ts index 676f17388a..848cf82d7b 100644 --- a/src/add/observable/fromArray.ts +++ b/src/add/observable/fromArray.ts @@ -1,7 +1,11 @@ import {Observable} from '../../Observable'; import {ArrayObservable} from '../../observable/ArrayObservable'; +import './of'; Observable.fromArray = ArrayObservable.create; -Observable.of = ArrayObservable.of; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let fromArray: typeof ArrayObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/fromEvent.ts b/src/add/observable/fromEvent.ts index 676f6754a6..49dc5d44ac 100644 --- a/src/add/observable/fromEvent.ts +++ b/src/add/observable/fromEvent.ts @@ -3,4 +3,8 @@ import {FromEventObservable} from '../../observable/FromEventObservable'; Observable.fromEvent = FromEventObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let fromEvent: typeof FromEventObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/fromEventPattern.ts b/src/add/observable/fromEventPattern.ts index 22285dbc78..b69af51518 100644 --- a/src/add/observable/fromEventPattern.ts +++ b/src/add/observable/fromEventPattern.ts @@ -3,4 +3,8 @@ import {FromEventPatternObservable} from '../../observable/FromEventPatternObser Observable.fromEventPattern = FromEventPatternObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let fromEventPattern: typeof FromEventPatternObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/fromPromise.ts b/src/add/observable/fromPromise.ts index 27329debad..70daeb53bd 100644 --- a/src/add/observable/fromPromise.ts +++ b/src/add/observable/fromPromise.ts @@ -3,4 +3,8 @@ import {PromiseObservable} from '../../observable/PromiseObservable'; Observable.fromPromise = PromiseObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let fromPromise: typeof PromiseObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/interval.ts b/src/add/observable/interval.ts index b27dc4f3fe..8aebb1ef57 100644 --- a/src/add/observable/interval.ts +++ b/src/add/observable/interval.ts @@ -3,4 +3,8 @@ import {IntervalObservable} from '../../observable/IntervalObservable'; Observable.interval = IntervalObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let interval: typeof IntervalObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/merge.ts b/src/add/observable/merge.ts index de8507cf60..d528fae178 100644 --- a/src/add/observable/merge.ts +++ b/src/add/observable/merge.ts @@ -4,4 +4,8 @@ import {mergeStatic} from '../../operator/merge'; Observable.merge = mergeStatic; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let merge: typeof mergeStatic; + } +} \ No newline at end of file diff --git a/src/add/observable/never.ts b/src/add/observable/never.ts index 2b343961c4..f47b5468e3 100644 --- a/src/add/observable/never.ts +++ b/src/add/observable/never.ts @@ -3,4 +3,8 @@ import {NeverObservable} from '../../observable/NeverObservable'; Observable.never = NeverObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let never: typeof NeverObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/of.ts b/src/add/observable/of.ts index 8d090f9be9..f6c260ba8b 100644 --- a/src/add/observable/of.ts +++ b/src/add/observable/of.ts @@ -3,4 +3,8 @@ import {ArrayObservable} from '../../observable/ArrayObservable'; Observable.of = ArrayObservable.of; -export var _void: void; +declare module '../../Observable' { + namespace Observable { + export let of: typeof ArrayObservable.of; + } +} diff --git a/src/add/observable/race.ts b/src/add/observable/race.ts index 1b2af56ca3..eae4ecd7f4 100644 --- a/src/add/observable/race.ts +++ b/src/add/observable/race.ts @@ -3,4 +3,8 @@ import {raceStatic} from '../../operator/race'; Observable.race = raceStatic; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let race: typeof raceStatic; + } +} \ No newline at end of file diff --git a/src/add/observable/range.ts b/src/add/observable/range.ts index eb3a46f86c..fe0c1635be 100644 --- a/src/add/observable/range.ts +++ b/src/add/observable/range.ts @@ -3,4 +3,8 @@ import {RangeObservable} from '../../observable/RangeObservable'; Observable.range = RangeObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let range: typeof RangeObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/timer.ts b/src/add/observable/timer.ts index 782fc2a7c2..e970bd38a3 100644 --- a/src/add/observable/timer.ts +++ b/src/add/observable/timer.ts @@ -3,4 +3,8 @@ import {TimerObservable} from '../../observable/TimerObservable'; Observable.timer = TimerObservable.create; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let timer: typeof TimerObservable.create; + } +} \ No newline at end of file diff --git a/src/add/observable/zip.ts b/src/add/observable/zip.ts index abbe83baef..f98970dd09 100644 --- a/src/add/observable/zip.ts +++ b/src/add/observable/zip.ts @@ -3,4 +3,8 @@ import {zipStatic} from '../../operator/zip'; Observable.zip = zipStatic; -export var _void: void; \ No newline at end of file +declare module '../../Observable' { + namespace Observable { + export let zip: typeof zipStatic; + } +} \ No newline at end of file