@@ -2,13 +2,29 @@ import { Observable } from '../Observable';
2
2
import { Operator } from '../Operator' ;
3
3
import { Subscriber } from '../Subscriber' ;
4
4
import { EmptyError } from '../util/EmptyError' ;
5
- import { MonoTypeOperatorFunction } from '../../internal/types' ;
5
+ import { MonoTypeOperatorFunction , OperatorFunction } from '../../internal/types' ;
6
6
import { filter } from './filter' ;
7
7
import { take } from './take' ;
8
8
import { defaultIfEmpty } from './defaultIfEmpty' ;
9
9
import { throwIfEmpty } from './throwIfEmpty' ;
10
10
import { identity } from '../util/identity' ;
11
11
12
+ /* tslint:disable:max-line-length */
13
+ export function first < T > ( ) : MonoTypeOperatorFunction < T > ;
14
+ export function first < T > (
15
+ predicate : null | undefined ,
16
+ defaultValue : T
17
+ ) : MonoTypeOperatorFunction < T > ;
18
+ export function first < T , S extends T > (
19
+ predicate ?: ( value : T , index : number , source : Observable < T > ) => value is S ,
20
+ defaultValue ?: T
21
+ ) : OperatorFunction < T , S > ;
22
+ export function first < T > (
23
+ predicate ?: ( value : T , index : number , source : Observable < T > ) => boolean ,
24
+ defaultValue ?: T
25
+ ) : MonoTypeOperatorFunction < T > ;
26
+ /* tslint:enable:max-line-length */
27
+
12
28
/**
13
29
* Emits only the first value (or the first value that meets some condition)
14
30
* emitted by the source Observable.
0 commit comments