Fixes types for args and OnChallangeHandler

Fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24408

The Subscribe Handler and the call may use send an `any` if args only contain one element.
This commit is contained in:
Richard
2018-04-05 15:11:00 +02:00
committed by GitHub
parent 0afd9936a8
commit 85d38719e6

View File

@@ -25,7 +25,7 @@ declare namespace autobahn {
leave(reason: string, message: string): void;
call<TResult>(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise<TResult>;
call<TResult>(procedure: string, args?: any[] | any, kwargs?: any, options?: ICallOptions): When.Promise<TResult>;
publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise<IPublication>;
@@ -96,7 +96,7 @@ declare namespace autobahn {
kwargs: any;
}
type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void;
type SubscribeHandler = (args?: any[] | any, kwargs?: any, details?: IEvent) => void;
interface ISubscription {
topic: string;
@@ -206,7 +206,7 @@ declare namespace autobahn {
type DeferFactory = () => When.Promise<any>;
type OnChallengeHandler = (session: Session, method: string, extra: any) => string;
type OnChallengeHandler = (session: Session, method: string, extra: any) => string | When.Promise<string>;
interface IConnectionOptions {
use_es6_promises?: boolean;