-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update typings for combineLatest #871
Closed
david-driscoll
wants to merge
6
commits into
ReactiveX:master
from
david-driscoll:types/operator/combineLatest
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4627e3d
style(typings): Use typeof to capture typings for all static Observab…
david-driscoll ad583eb
chore(typings): Adding plumbing to allow the types added to Observabl…
david-driscoll b007210
style(typings): Added `ObservableInput` type
david-driscoll 065cd5c
chore(tsconfig): Remove codeFormatOptions, moving to separate PR
david-driscoll 5fd05a2
style(typings): Added the ability to compute typings
david-driscoll b766a66
style(typings): Added enhanced typings for combineLatest
david-driscoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* tslint:disable:class-name */ /* tslint:disable:no-unused-variable */ /* tslint:disable:max-line-length */ | ||
import {Observable} from './Observable'; | ||
import {ConnectableObservable} from './observable/ConnectableObservable'; | ||
import {Scheduler} from './Scheduler'; | ||
import {Notification} from './Notification'; | ||
import {Subject} from './Subject'; | ||
import {Observer} from './Observer'; | ||
import {GroupedObservable} from './operator/groupBy-support'; | ||
import {GroupByObservable} from './operator/groupBy'; | ||
import {TimeInterval} from './operator/extended/timeInterval'; | ||
import {ObservableInput, ObservableOrPromise, ArrayOrIterator, _Selector, _IndexSelector, _SwitchMapResultSelector, _ObservableMergeMapProjector, _IteratorMergeMapProjector, _Predicate, _PredicateObservable, _Comparer, _Accumulator, _MergeAccumulator} from './types'; | ||
|
||
/* ||| MARKER ||| */ | ||
export interface operator_proto_combineLatest<T> { | ||
<TResult>(project: (v1: T) => TResult): Observable<TResult>; | ||
<TResult>(project: (v1: T) => TResult): Observable<TResult>; | ||
<T2>(v2: ObservableInput<T2>): Observable<[T, T2]>; | ||
<T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<[T, T2, T3]>; | ||
<T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<[T, T2, T3, T4]>; | ||
<T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<[T, T2, T3, T4, T5]>; | ||
<T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<[T, T2, T3, T4, T5, T6]>; | ||
<T2>(array: [ObservableInput<T2>]): Observable<[T, T2]>; | ||
<T2, T3>(array: [ObservableInput<T2>, ObservableInput<T3>]): Observable<[T, T2, T3]>; | ||
<T2, T3, T4>(array: [ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>]): Observable<[T, T2, T3, T4]>; | ||
<T2, T3, T4, T5>(array: [ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>, ObservableInput<T5>]): Observable<[T, T2, T3, T4, T5]>; | ||
<T2, T3, T4, T5, T6>(array: [ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>, ObservableInput<T5>, ObservableInput<T6>]): Observable<[T, T2, T3, T4, T5, T6]>; | ||
<T2, TResult>(v2: ObservableInput<T2>, project: (v1: T, v2: T2) => TResult): Observable<TResult>; | ||
<T2, T3, TResult>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, project: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>; | ||
<T2, T3, T4, TResult>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, project: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>; | ||
<T2, T3, T4, T5, TResult>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>; | ||
<T2, T3, T4, T5, T6, TResult>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => TResult): Observable<TResult>; | ||
<T2, TResult>(array: [ObservableInput<T2>], project: (v1: T, v2: T2) => TResult): Observable<TResult>; | ||
<T2, T3, TResult>(array: [ObservableInput<T2>, ObservableInput<T3>], project: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>; | ||
<T2, T3, T4, TResult>(array: [ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>], project: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>; | ||
<T2, T3, T4, T5, TResult>(array: [ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>, ObservableInput<T5>], project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>; | ||
<T2, T3, T4, T5, T6, TResult>(array: [ObservableInput<T2>, ObservableInput<T3>, ObservableInput<T4>, ObservableInput<T5>, ObservableInput<T6>], project: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6) => TResult): Observable<TResult>; | ||
<TResult>(array: ObservableInput<any>[], project?: Function): Observable<TResult[]>; | ||
(...observables: Array<ObservableInput<T>>): Observable<T[]>; | ||
<R>(...observables: Array<ObservableInput<T> | ((...values: Array<T>) => R)>): Observable<R>; | ||
} | ||
/* ||| MARKER ||| */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {Observable} from './Observable'; | ||
export type ObservableOrPromise<T> = Observable<T> | Promise<T>; | ||
export type ArrayOrIterator<T> = Iterator<T> | ArrayLike<T> | Array<T>; | ||
export type ObservableInput<T> = Observable<T> | Promise<T> | Iterator<T> | ArrayLike<T>; | ||
|
||
export type _Selector<T, TResult> = (value: T) => TResult; | ||
export type _IndexSelector<T, TResult> = (value: T, index: number) => TResult; | ||
export type _SwitchMapResultSelector<T1, T2, TResult> = (outerValue: T1, innerValue: T2, outerIndex: number, innerIndex: number) => TResult; | ||
export type _ObservableMergeMapProjector<T, R> = (value: T, index: number) => ObservableOrPromise<R>; | ||
export type _IteratorMergeMapProjector<T, R> = (value: T, index: number) => ArrayOrIterator<R>; | ||
|
||
export type _Predicate<T> = _Selector<T, boolean>; | ||
export type _PredicateObservable<T> = (value: T, index: number, observable: Observable<T>) => boolean; | ||
|
||
export type _Comparer<T, TResult> = (value1: T, value2: T) => TResult; | ||
export type _Accumulator<T, TAcc> = (acc: TAcc, value: T) => TAcc; | ||
export type _MergeAccumulator<T, TAcc> = (acc: TAcc, value: T) => Observable<TAcc>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,9 @@ | |
"indentSize": 2, | ||
"tabSize": 2 | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's this for? |
||
"files": [ | ||
"src/Rx.ts", | ||
"src/Rx.KitchenSink.ts" | ||
] | ||
"files": [ | ||
"typings/es6-build-shim.d.ts", | ||
"src/Rx.ts", | ||
"src/Rx.KitchenSink.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare type IterableShim<T> = Iterable<T>; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
typeof
trick is pretty cool. I didn't know that one. I'm a little concerned about the implications of importing all of the other Observable types in this file, though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the imports are just use for types, they dissolve when TypeScript is emitting the results.
For example the
cjs
output forObservable.ts
starts with