Merge pull request #23538 from victormoukhortov/patch-1

Fix stompjs types
This commit is contained in:
Daniel Rosenwasser
2018-02-10 10:31:30 -08:00
committed by GitHub
2 changed files with 17 additions and 11 deletions
+4 -3
View File
@@ -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<string>): Client;
+13 -8
View File
@@ -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');