mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
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:
6
types/autobahn/index.d.ts
vendored
6
types/autobahn/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user