diff --git a/types/stompjs/index.d.ts b/types/stompjs/index.d.ts index 7d819f4352..91d5277fba 100644 --- a/types/stompjs/index.d.ts +++ b/types/stompjs/index.d.ts @@ -26,6 +26,7 @@ export class Client { debug(...args: string[]): any; connect(headers: { login: string, passcode: string, host?: string }, connectCallback: (frame?: Frame) => any, errorCallback?: (error: string) => any): any; + connect(headers: { }, connectCallback: (frame?: Frame) => any, errorCallback?: (error: string) => any): any; connect(login: string, passcode: string, connectCallback: (frame?: Frame) => any, errorCallback?: (error: string) => any, host?: string): any; disconnect(disconnectCallback: () => any, headers?: {}): any; @@ -59,9 +60,9 @@ export class Frame implements Message { ack(headers?: {}): any; nack(headers?: {}): any; toString(): string; - sizeOfUTF8(s: string): number; - unmarshall(datas: any): any; - marshall(command: string, headers?: {}, body?: string): any; + static sizeOfUTF8(s: string): number; + static unmarshall(datas: any): any; + static marshall(command: string, headers?: {}, body?: string): any; } export function client(url: string, protocols?: string | Array): Client; diff --git a/types/stompjs/stompjs-tests.ts b/types/stompjs/stompjs-tests.ts index 5d6eb1d0a5..fcc0c46ff5 100644 --- a/types/stompjs/stompjs-tests.ts +++ b/types/stompjs/stompjs-tests.ts @@ -49,6 +49,11 @@ client.connect('user', 'pass', (frame) => { } }, (error) => { }, 'host'); +client.connect({}, () => { }); +client.connect({}, () => { }, () => { }); +client.connect({}, () => { }, (error) => { }); +client.connect({}, (frame) => { }, (error) => { }); + client.disconnect(() => { }); client.disconnect(() => { }, {}); @@ -93,13 +98,13 @@ frame = new Stomp.Frame('command', {}, 'body'); frame.toString(); -frame.sizeOfUTF8('abc'); +Stomp.Frame.sizeOfUTF8('abc'); -frame.unmarshall(0); -frame.unmarshall('data'); -frame.unmarshall({}); -frame.unmarshall([{}, {}]); +Stomp.Frame.unmarshall(0); +Stomp.Frame.unmarshall('data'); +Stomp.Frame.unmarshall({}); +Stomp.Frame.unmarshall([{}, {}]); -frame.marshall('command'); -frame.marshall('command', {}); -frame.marshall('command', {}, 'body'); +Stomp.Frame.marshall('command'); +Stomp.Frame.marshall('command', {}); +Stomp.Frame.marshall('command', {}, 'body');