work.suroh.tk/node_modules/rxjs/operators/groupBy.d.ts

31 lines
1.8 KiB
TypeScript
Raw Normal View History

2019-12-02 12:22:45 +00:00
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
import { Observable } from '../Observable';
import { Subject } from '../Subject';
import { OperatorFunction } from '../interfaces';
export declare function groupBy<T, K>(keySelector: (value: T) => K): OperatorFunction<T, GroupedObservable<K, T>>;
export declare function groupBy<T, K>(keySelector: (value: T) => K, elementSelector: void, durationSelector: (grouped: GroupedObservable<K, T>) => Observable<any>): OperatorFunction<T, GroupedObservable<K, T>>;
export declare function groupBy<T, K, R>(keySelector: (value: T) => K, elementSelector?: (value: T) => R, durationSelector?: (grouped: GroupedObservable<K, R>) => Observable<any>): OperatorFunction<T, GroupedObservable<K, R>>;
export declare function groupBy<T, K, R>(keySelector: (value: T) => K, elementSelector?: (value: T) => R, durationSelector?: (grouped: GroupedObservable<K, R>) => Observable<any>, subjectSelector?: () => Subject<R>): OperatorFunction<T, GroupedObservable<K, R>>;
export interface RefCountSubscription {
count: number;
unsubscribe: () => void;
closed: boolean;
attemptedToUnsubscribe: boolean;
}
/**
* An Observable representing values belonging to the same group represented by
* a common key. The values emitted by a GroupedObservable come from the source
* Observable. The common key is available as the field `key` on a
* GroupedObservable instance.
*
* @class GroupedObservable<K, T>
*/
export declare class GroupedObservable<K, T> extends Observable<T> {
key: K;
private groupSubject;
private refCountSubscription;
constructor(key: K, groupSubject: Subject<T>, refCountSubscription?: RefCountSubscription);
/** @deprecated internal use only */ _subscribe(subscriber: Subscriber<T>): Subscription;
}