DefinitelyTyped/types/rsocket-flowable/Flowable.d.ts
Adrian Hope-Bailie 8727a4fa0a Add rsocket types (#36076)
* Add rsocket types

* Drop `types` from `tsconfig.json

Use triple-slash references

* Fix linting errors

* Remove private members

* Fix linting errors
2019-06-20 14:05:22 -07:00

16 lines
711 B
TypeScript

import { IPublisher, ISubscriber } from 'rsocket-types';
export type Source<T> = (subscriber: ISubscriber<T>) => void;
/**
* Implements the ReactiveStream `Publisher` interface with Rx-style operators.
*/
export default class Flowable<T> implements IPublisher<T> {
static just<U>(...values: U[]): Flowable<U>;
static error(error: Error): Flowable<{}>;
static never(): Flowable<{}>;
constructor(source: Source<T>, max?: number);
subscribe(subscriberOrCallback?: Partial<ISubscriber<T>> | ((a: T) => void)): void;
lift<R>(onSubscribeLift: (subscriber: ISubscriber<R>) => ISubscriber<T>): Flowable<R>;
map<R>(fn: (data: T) => R): Flowable<R>;
take(toTake: number): Flowable<T>;
}