Skip to content

Commit

Permalink
Merge pull request #33 from JimiC/improve-types
Browse files Browse the repository at this point in the history
Adjusting types to v4
  • Loading branch information
kum-deepak authored May 9, 2018
2 parents 545ee6c + 4cd69f1 commit aca20a1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Type definitions for stompjs 2.3
// Project: https://github.com/jmesnil/stomp-websocket
// Type definitions for @stomp/stompjs 4.x
// Project: https://github.com/stomp-js/stomp-websocket
// Definitions by: Jimi Charalampidis <https://github.com/jimic>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Deepak Kumar <https://github.com/kum-deepak>
// Definitions: https://github.com/stomp-js/stomp-websocket/blob/master/index.d.ts

export const VERSIONS: {
V1_0: string,
Expand Down Expand Up @@ -31,7 +32,7 @@ export class Client {
subscribe(destination: string, callback?: (message: Message) => any, headers?: StompHeaders): StompSubscription;
onreceive: (message: Message) => void;
onreceipt: (frame: Frame) => void;
unsubscribe(id: string, headers?: StompHeaders): any;
unsubscribe(id: string, headers?: StompHeaders): void;

begin(transaction: string): any;
commit(transaction: string): any;
Expand All @@ -48,7 +49,7 @@ export interface StompSubscription {

export class StompHeaders { [key: string]: string }

export class Message extends Frame {
export interface Message extends Frame {
ack(headers?: StompHeaders): any;
nack(headers?: StompHeaders): any;
}
Expand All @@ -61,9 +62,9 @@ export class Frame {
body: string;

toString(): string;
sizeOfUTF8(s: string): number;
unmarshall(datas: any): any;
marshall(command: string, headers?: StompHeaders, body?: string): any;
static sizeOfUTF8(s: string): number;
static unmarshall(datas: any): any;
static marshall(command: string, headers?: StompHeaders, body?: string): any;
}

export function client(url: string, protocols?: string | Array<string>): Client;
Expand Down

0 comments on commit aca20a1

Please sign in to comment.