Skip to content

Commit 404a3b8

Browse files
refactor(typings): Updated typings with generation tool
1 parent 472b9a2 commit 404a3b8

29 files changed

+519
-315
lines changed

src/CoreOperators.ts

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,78 @@
1-
/// <reference path="../typings/operators.d.ts" />
1+
import * as operators from "./operator-typings";
22
export interface CoreOperators<T> {
3-
buffer: operator_proto_buffer;
4-
bufferCount: operator_proto_bufferCount;
5-
bufferTime: operator_proto_bufferTime;
6-
bufferToggle: operator_proto_bufferToggle;
7-
bufferWhen: operator_proto_bufferWhen;
8-
catch: operator_proto_catch;
9-
combineAll: operator_proto_combineAll;
10-
combineLatest: operator_proto_combineLatest;
11-
concat: operator_proto_concat;
12-
concatAll: operator_proto_concatAll;
13-
concatMap: operator_proto_concatMap;
14-
concatMapTo: operator_proto_concatMapTo;
15-
count: operator_proto_count;
16-
dematerialize: operator_proto_dematerialize;
17-
debounce: operator_proto_debounce;
18-
debounceTime: operator_proto_debounceTime;
19-
defaultIfEmpty: operator_proto_defaultIfEmpty;
20-
delay: operator_proto_delay;
21-
distinctUntilChanged: operator_proto_distinctUntilChanged;
22-
do: operator_proto_do;
23-
expand: operator_proto_expand;
24-
filter: operator_proto_filter;
25-
finally: operator_proto_finally;
26-
first: operator_proto_first;
27-
flatMap: operator_proto_mergeMap;
28-
flatMapTo: operator_proto_mergeMapTo;
29-
groupBy: operator_proto_groupBy;
30-
ignoreElements: operator_proto_ignoreElements;
31-
last: operator_proto_last;
32-
every: operator_proto_every;
33-
map: operator_proto_map;
34-
mapTo: operator_proto_mapTo;
35-
materialize: operator_proto_materialize;
36-
merge: operator_proto_merge;
37-
mergeAll: operator_proto_mergeAll;
38-
mergeMap: operator_proto_mergeMap;
39-
mergeMapTo: operator_proto_mergeMapTo;
40-
multicast: operator_proto_multicast;
41-
observeOn: operator_proto_observeOn;
42-
partition: operator_proto_partition;
43-
publish: operator_proto_publish;
44-
publishBehavior: operator_proto_publishBehavior;
45-
publishReplay: operator_proto_publishReplay;
46-
reduce: operator_proto_reduce;
47-
repeat: operator_proto_repeat;
48-
retry: operator_proto_retry;
49-
retryWhen: operator_proto_retryWhen;
50-
sample: operator_proto_sample;
51-
sampleTime: operator_proto_sampleTime;
52-
scan: operator_proto_scan;
53-
share: operator_proto_share;
54-
single: operator_proto_single;
55-
skip: operator_proto_skip;
56-
skipUntil: operator_proto_skipUntil;
57-
startWith: operator_proto_startWith;
58-
subscribeOn: operator_proto_subscribeOn;
59-
switch: operator_proto_switch;
60-
switchMap: operator_proto_switchMap;
61-
switchMapTo: operator_proto_switchMapTo;
62-
take: operator_proto_take;
63-
takeUntil: operator_proto_takeUntil;
64-
throttle: operator_proto_throttle;
65-
throttleTime: operator_proto_throttleTime;
66-
timeout: operator_proto_timeout;
67-
timeoutWith: operator_proto_timeoutWith;
68-
toArray: operator_proto_toArray;
69-
toPromise: operator_proto_toPromise;
70-
window: operator_proto_window;
71-
windowCount: operator_proto_windowCount;
72-
windowTime: operator_proto_windowTime;
73-
windowToggle: operator_proto_windowToggle;
74-
windowWhen: operator_proto_windowWhen;
75-
withLatestFrom: operator_proto_withLatestFrom;
76-
zip: operator_proto_zip;
77-
zipAll: operator_proto_zipAll;
3+
buffer: operators.operator_proto_buffer<T>;
4+
bufferCount: operators.operator_proto_bufferCount<T>;
5+
bufferTime: operators.operator_proto_bufferTime<T>;
6+
bufferToggle: operators.operator_proto_bufferToggle<T>;
7+
bufferWhen: operators.operator_proto_bufferWhen<T>;
8+
catch: operators.operator_proto_catch<T>;
9+
combineAll: operators.operator_proto_combineAll<T>;
10+
combineLatest: operators.operator_proto_combineLatest<T>;
11+
concat: operators.operator_proto_concat<T>;
12+
concatAll: operators.operator_proto_concatAll<T>;
13+
concatMap: operators.operator_proto_concatMap<T>;
14+
concatMapTo: operators.operator_proto_concatMapTo<T>;
15+
count: operators.operator_proto_count<T>;
16+
dematerialize: operators.operator_proto_dematerialize<T>;
17+
debounce: operators.operator_proto_debounce<T>;
18+
debounceTime: operators.operator_proto_debounceTime<T>;
19+
defaultIfEmpty: operators.operator_proto_defaultIfEmpty<T>;
20+
delay: operators.operator_proto_delay<T>;
21+
distinctUntilChanged: operators.operator_proto_distinctUntilChanged<T>;
22+
do: operators.operator_proto_do<T>;
23+
expand: operators.operator_proto_expand<T>;
24+
filter: operators.operator_proto_filter<T>;
25+
finally: operators.operator_proto_finally<T>;
26+
first: operators.operator_proto_first<T>;
27+
flatMap: operators.operator_proto_mergeMap<T>;
28+
flatMapTo: operators.operator_proto_mergeMapTo<T>;
29+
groupBy: operators.operator_proto_groupBy<T>;
30+
ignoreElements: operators.operator_proto_ignoreElements<T>;
31+
last: operators.operator_proto_last<T>;
32+
every: operators.operator_proto_every<T>;
33+
map: operators.operator_proto_map<T>;
34+
mapTo: operators.operator_proto_mapTo<T>;
35+
materialize: operators.operator_proto_materialize<T>;
36+
merge: operators.operator_proto_merge<T>;
37+
mergeAll: operators.operator_proto_mergeAll<T>;
38+
mergeMap: operators.operator_proto_mergeMap<T>;
39+
mergeMapTo: operators.operator_proto_mergeMapTo<T>;
40+
multicast: operators.operator_proto_multicast<T>;
41+
observeOn: operators.operator_proto_observeOn<T>;
42+
partition: operators.operator_proto_partition<T>;
43+
publish: operators.operator_proto_publish<T>;
44+
publishBehavior: operators.operator_proto_publishBehavior<T>;
45+
publishReplay: operators.operator_proto_publishReplay<T>;
46+
reduce: operators.operator_proto_reduce<T>;
47+
repeat: operators.operator_proto_repeat<T>;
48+
retry: operators.operator_proto_retry<T>;
49+
retryWhen: operators.operator_proto_retryWhen<T>;
50+
sample: operators.operator_proto_sample<T>;
51+
sampleTime: operators.operator_proto_sampleTime<T>;
52+
scan: operators.operator_proto_scan<T>;
53+
share: operators.operator_proto_share<T>;
54+
single: operators.operator_proto_single<T>;
55+
skip: operators.operator_proto_skip<T>;
56+
skipUntil: operators.operator_proto_skipUntil<T>;
57+
startWith: operators.operator_proto_startWith<T>;
58+
subscribeOn: operators.operator_proto_subscribeOn<T>;
59+
switch: operators.operator_proto_switch<T>;
60+
switchMap: operators.operator_proto_switchMap<T>;
61+
switchMapTo: operators.operator_proto_switchMapTo<T>;
62+
take: operators.operator_proto_take<T>;
63+
takeUntil: operators.operator_proto_takeUntil<T>;
64+
throttle: operators.operator_proto_throttle<T>;
65+
throttleTime: operators.operator_proto_throttleTime<T>;
66+
timeout: operators.operator_proto_timeout<T>;
67+
timeoutWith: operators.operator_proto_timeoutWith<T>;
68+
toArray: operators.operator_proto_toArray<T>;
69+
toPromise: operators.operator_proto_toPromise<T>;
70+
window: operators.operator_proto_window<T>;
71+
windowCount: operators.operator_proto_windowCount<T>;
72+
windowTime: operators.operator_proto_windowTime<T>;
73+
windowToggle: operators.operator_proto_windowToggle<T>;
74+
windowWhen: operators.operator_proto_windowWhen<T>;
75+
withLatestFrom: operators.operator_proto_withLatestFrom<T>;
76+
zip: operators.operator_proto_zip<T>;
77+
zipAll: operators.operator_proto_zipAll<T>;
7878
}

src/Notification.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class Notification<T> {
4747
case 'E':
4848
return Observable.throw(this.exception);
4949
case 'C':
50-
return Observable.empty();
50+
return Observable.empty<T>();
5151
}
5252
}
5353

src/Observable.ts

Lines changed: 79 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference path="../typings/operators.d.ts" />
2-
31
import {Observer} from './Observer';
42
import {Operator} from './Operator';
53
import {Scheduler} from './Scheduler';
@@ -16,11 +14,12 @@ import {Notification} from './Notification';
1614
export type ObservableOrPromise<T> = Observable<T> | PromiseLike<T>;
1715
export type ArrayOrIterable<T> = IterableShim<T> | ArrayLike<T> | Array<T>;
1816
export type ObservableOrIterable<T> = ObservableOrPromise<T> | ArrayOrIterable<T>;
17+
import * as operators from "./operator-typings";
1918

2019
import {combineLatest as combineLatestStatic} from "./operators/combineLatest-static";
2120
import {concat as concatStatic} from "./operators/concat-static";
2221
import {merge as mergeStatic} from "./operators/merge-static";
23-
import {zip as zipStatic} from "./operators/merge-static";
22+
import {zip as zipStatic} from "./operators/zip-static";
2423
import {DeferObservable} from './observables/DeferObservable';
2524
import {EmptyObservable} from './observables/EmptyObservable';
2625
import {ForkJoinObservable} from './observables/ForkJoinObservable';
@@ -31,6 +30,7 @@ import {FromEventPatternObservable} from './observables/FromEventPatternObservab
3130
import {PromiseObservable} from './observables/PromiseObservable';
3231
import {IntervalObservable} from './observables/IntervalObservable';
3332
import {InfiniteObservable} from './observables/InfiniteObservable';
33+
import {TimerObservable} from './observables/TimerObservable';
3434
import {RangeObservable} from './observables/RangeObservable';
3535
import {ErrorObservable} from './observables/ErrorObservable';
3636

@@ -79,7 +79,7 @@ export class Observable<T> implements CoreOperators<T> {
7979
* operator defined as the new observable's operator.
8080
*/
8181
lift<T, R>(operator: Operator<T, R>): Observable<T> {
82-
const observable = new Observable();
82+
const observable = new Observable<T>();
8383
observable.source = this;
8484
observable.operator = operator;
8585
return observable;
@@ -177,80 +177,79 @@ export class Observable<T> implements CoreOperators<T> {
177177
static zip: typeof zipStatic;
178178

179179
// core operators
180-
buffer: operator_proto_buffer;
181-
bufferCount: operator_proto_bufferCount;
182-
bufferTime: operator_proto_bufferTime;
183-
bufferToggle: operator_proto_bufferToggle;
184-
bufferWhen: operator_proto_bufferWhen;
185-
catch: operator_proto_catch;
186-
combineAll: operator_proto_combineAll;
187-
combineLatest: operator_proto_combineLatest;
188-
concat: operator_proto_concat;
189-
concatAll: operator_proto_concatAll;
190-
concatMap: operator_proto_concatMap;
191-
concatMapTo: operator_proto_concatMapTo;
192-
count: operator_proto_count;
193-
dematerialize: operator_proto_dematerialize;
194-
debounce: operator_proto_debounce;
195-
debounceTime: operator_proto_debounceTime;
196-
defaultIfEmpty: operator_proto_defaultIfEmpty;
197-
delay: operator_proto_delay;
198-
distinctUntilChanged: operator_proto_distinctUntilChanged;
199-
do: operator_proto_do;
200-
expand: operator_proto_expand;
201-
filter: operator_proto_filter;
202-
finally: operator_proto_finally;
203-
first: operator_proto_first;
204-
flatMap: operator_proto_mergeMap;
205-
flatMapTo: operator_proto_mergeMapTo;
206-
groupBy: operator_proto_groupBy;
207-
ignoreElements: operator_proto_ignoreElements;
208-
last: operator_proto_last;
209-
every: operator_proto_every;
210-
map: operator_proto_map;
211-
mapTo: operator_proto_mapTo;
212-
materialize: operator_proto_materialize;
213-
merge: operator_proto_merge;
214-
mergeAll: operator_proto_mergeAll;
215-
mergeMap: operator_proto_mergeMap;
216-
mergeMapTo: operator_proto_mergeMapTo;
217-
multicast: operator_proto_multicast;
218-
observeOn: operator_proto_observeOn;
219-
partition: operator_proto_partition;
220-
publish: operator_proto_publish;
221-
publishBehavior: operator_proto_publishBehavior;
222-
publishReplay: operator_proto_publishReplay;
223-
reduce: operator_proto_reduce;
224-
repeat: operator_proto_repeat;
225-
retry: operator_proto_retry;
226-
retryWhen: operator_proto_retryWhen;
227-
sample: operator_proto_sample;
228-
sampleTime: operator_proto_sampleTime;
229-
scan: operator_proto_scan;
230-
share: operator_proto_share;
231-
single: operator_proto_single;
232-
skip: operator_proto_skip;
233-
skipUntil: operator_proto_skipUntil;
234-
startWith: operator_proto_startWith;
235-
subscribeOn: operator_proto_subscribeOn;
236-
switch: operator_proto_switch;
237-
switchMap: operator_proto_switchMap;
238-
switchMapTo: operator_proto_switchMapTo;
239-
take: operator_proto_take;
240-
takeUntil: operator_proto_takeUntil;
241-
throttle: operator_proto_throttle;
242-
throttleTime: operator_proto_throttleTime;
243-
timeout: operator_proto_timeout;
244-
timeoutWith: operator_proto_timeoutWith;
245-
toArray: operator_proto_toArray;
246-
toPromise: operator_proto_toPromise;
247-
window: operator_proto_window;
248-
windowCount: operator_proto_windowCount;
249-
windowTime: operator_proto_windowTime;
250-
windowToggle: operator_proto_windowToggle;
251-
windowWhen: operator_proto_windowWhen;
252-
withLatestFrom: operator_proto_withLatestFrom;
253-
zip: operator_proto_zip;
254-
zipAll: operator_proto_zipAll;
180+
buffer: operators.operator_proto_buffer<T>;
181+
bufferCount: operators.operator_proto_bufferCount<T>;
182+
bufferTime: operators.operator_proto_bufferTime<T>;
183+
bufferToggle: operators.operator_proto_bufferToggle<T>;
184+
bufferWhen: operators.operator_proto_bufferWhen<T>;
185+
catch: operators.operator_proto_catch<T>;
186+
combineAll: operators.operator_proto_combineAll<T>;
187+
combineLatest: operators.operator_proto_combineLatest<T>;
188+
concat: operators.operator_proto_concat<T>;
189+
concatAll: operators.operator_proto_concatAll<T>;
190+
concatMap: operators.operator_proto_concatMap<T>;
191+
concatMapTo: operators.operator_proto_concatMapTo<T>;
192+
count: operators.operator_proto_count<T>;
193+
dematerialize: operators.operator_proto_dematerialize<T>;
194+
debounce: operators.operator_proto_debounce<T>;
195+
debounceTime: operators.operator_proto_debounceTime<T>;
196+
defaultIfEmpty: operators.operator_proto_defaultIfEmpty<T>;
197+
delay: operators.operator_proto_delay<T>;
198+
distinctUntilChanged: operators.operator_proto_distinctUntilChanged<T>;
199+
do: operators.operator_proto_do<T>;
200+
expand: operators.operator_proto_expand<T>;
201+
filter: operators.operator_proto_filter<T>;
202+
finally: operators.operator_proto_finally<T>;
203+
first: operators.operator_proto_first<T>;
204+
flatMap: operators.operator_proto_mergeMap<T>;
205+
flatMapTo: operators.operator_proto_mergeMapTo<T>;
206+
groupBy: operators.operator_proto_groupBy<T>;
207+
ignoreElements: operators.operator_proto_ignoreElements<T>;
208+
last: operators.operator_proto_last<T>;
209+
every: operators.operator_proto_every<T>;
210+
map: operators.operator_proto_map<T>;
211+
mapTo: operators.operator_proto_mapTo<T>;
212+
materialize: operators.operator_proto_materialize<T>;
213+
merge: operators.operator_proto_merge<T>;
214+
mergeAll: operators.operator_proto_mergeAll<T>;
215+
mergeMap: operators.operator_proto_mergeMap<T>;
216+
mergeMapTo: operators.operator_proto_mergeMapTo<T>;
217+
multicast: operators.operator_proto_multicast<T>;
218+
observeOn: operators.operator_proto_observeOn<T>;
219+
partition: operators.operator_proto_partition<T>;
220+
publish: operators.operator_proto_publish<T>;
221+
publishBehavior: operators.operator_proto_publishBehavior<T>;
222+
publishReplay: operators.operator_proto_publishReplay<T>;
223+
reduce: operators.operator_proto_reduce<T>;
224+
repeat: operators.operator_proto_repeat<T>;
225+
retry: operators.operator_proto_retry<T>;
226+
retryWhen: operators.operator_proto_retryWhen<T>;
227+
sample: operators.operator_proto_sample<T>;
228+
sampleTime: operators.operator_proto_sampleTime<T>;
229+
scan: operators.operator_proto_scan<T>;
230+
share: operators.operator_proto_share<T>;
231+
single: operators.operator_proto_single<T>;
232+
skip: operators.operator_proto_skip<T>;
233+
skipUntil: operators.operator_proto_skipUntil<T>;
234+
startWith: operators.operator_proto_startWith<T>;
235+
subscribeOn: operators.operator_proto_subscribeOn<T>;
236+
switch: operators.operator_proto_switch<T>;
237+
switchMap: operators.operator_proto_switchMap<T>;
238+
switchMapTo: operators.operator_proto_switchMapTo<T>;
239+
take: operators.operator_proto_take<T>;
240+
takeUntil: operators.operator_proto_takeUntil<T>;
241+
throttle: operators.operator_proto_throttle<T>;
242+
throttleTime: operators.operator_proto_throttleTime<T>;
243+
timeout: operators.operator_proto_timeout<T>;
244+
timeoutWith: operators.operator_proto_timeoutWith<T>;
245+
toArray: operators.operator_proto_toArray<T>;
246+
toPromise: operators.operator_proto_toPromise<T>;
247+
window: operators.operator_proto_window<T>;
248+
windowCount: operators.operator_proto_windowCount<T>;
249+
windowTime: operators.operator_proto_windowTime<T>;
250+
windowToggle: operators.operator_proto_windowToggle<T>;
251+
windowWhen: operators.operator_proto_windowWhen<T>;
252+
withLatestFrom: operators.operator_proto_withLatestFrom<T>;
253+
zip: operators.operator_proto_zip<T>;
254+
zipAll: operators.operator_proto_zipAll<T>;
255255
}
256-

src/Rx.KitchenSink.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ import {withLatestFrom} from './operators/withLatestFrom';
331331
observableProto.withLatestFrom = withLatestFrom;
332332

333333
import {zipProto} from './operators/zip';
334-
observableProto.zip = zipProto;
334+
observableProto.zip = <any>zipProto;
335335

336336
import {zipAll} from './operators/zipAll';
337337
observableProto.zipAll = zipAll;

src/Rx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ import {withLatestFrom} from './operators/withLatestFrom';
282282
observableProto.withLatestFrom = withLatestFrom;
283283

284284
import {zipProto} from './operators/zip';
285-
observableProto.zip = zipProto;
285+
observableProto.zip = <any>zipProto;
286286

287287
import {zipAll} from './operators/zipAll';
288288
observableProto.zipAll = zipAll;

src/Subject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class Subject<T> extends Observable<T> implements Observer<T>, Subscripti
3535
completeSignal: boolean = false;
3636

3737
lift<T, R>(operator: Operator<T, R>): Observable<T> {
38-
const subject = new BidirectionalSubject(this, this.destination || this);
38+
const subject: Subject<T> = <any>new BidirectionalSubject(this, this.destination || this);
3939
subject.operator = operator;
4040
return subject;
4141
}
@@ -162,7 +162,7 @@ export class Subject<T> extends Observable<T> implements Observer<T>, Subscripti
162162
}
163163

164164
class BidirectionalSubject<T> extends Subject<T> {
165-
constructor(public source: Observable<any>, protected destination: Observer<any>) {
165+
constructor(public source: Observable<T>, protected destination: Observer<T>) {
166166
super();
167167
}
168168

0 commit comments

Comments
 (0)