RSocket - Fix incorrect return types (#36723)

This commit is contained in:
Adrian Hope-Bailie 2019-07-08 23:09:33 +02:00 committed by Armando Aguirre
parent f1fe339b6e
commit bdb71cddca
3 changed files with 14 additions and 14 deletions

View File

@ -27,17 +27,17 @@ export interface ClientConfig<D, M> {
*/
export default class RSocketClient<D, M> {
constructor(config: ClientConfig<D, M>);
close(): undefined;
close(): void;
connect(): Single<ReactiveSocket<D, M>>;
}
export class RSocketClientSocket<D, M> implements ReactiveSocket<D, M> {
constructor(config: ClientConfig<D, M>, connection: DuplexConnection);
fireAndForget(payload: Payload<D, M>): undefined;
fireAndForget(payload: Payload<D, M>): void;
requestResponse(payload: Payload<D, M>): Single<Payload<D, M>>;
requestStream(payload: Payload<D, M>): Flowable<Payload<D, M>>;
requestChannel(payloads: Flowable<Payload<D, M>>): Flowable<Payload<D, M>>;
metadataPush(payload: Payload<D, M>): Single<undefined>;
close(): undefined;
metadataPush(payload: Payload<D, M>): Single<void>;
close(): void;
connectionStatus(): Flowable<ConnectionStatus>;
}

View File

@ -1,15 +1,15 @@
export type Source<T> = (subject: IFutureSubject<T>) => undefined;
export type CancelCallback = () => undefined;
export type Source<T> = (subject: IFutureSubject<T>) => void;
export type CancelCallback = () => void;
export interface IFutureSubscriber<T> {
onComplete: (value: T) => undefined;
onError: (error: Error) => undefined;
onSubscribe: (cancel: CancelCallback) => undefined;
onComplete: (value: T) => void;
onError: (error: Error) => void;
onSubscribe: (cancel: CancelCallback) => void;
}
export interface IFutureSubject<T> {
onComplete: (value: T) => undefined;
onError: (error: Error) => undefined;
onSubscribe: (cancel: CancelCallback | null | undefined) => undefined;
onComplete: (value: T) => void;
onError: (error: Error) => void;
onSubscribe: (cancel: CancelCallback | null | undefined) => void;
}
/**
* Represents a lazy computation that will either produce a value of type T

View File

@ -8,7 +8,7 @@ import { Flowable } from 'rsocket-flowable';
export interface ServerOptions {
host?: string;
port: number;
serverFactory?: (onConnect: (socket: net.Socket) => undefined) => net.Server;
serverFactory?: (onConnect: (socket: net.Socket) => void) => net.Server;
}
/**
@ -19,5 +19,5 @@ export interface ServerOptions {
export default class RSocketTCPServer implements TransportServer {
constructor(options: ServerOptions, encoders?: Encoders<any>);
start(): Flowable<DuplexConnection>;
stop(): undefined;
stop(): void;
}