Skip to content

Commit 9c02bea

Browse files
committed
Bump 0.9.2
1 parent 54ef0cf commit 9c02bea

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

angular2-websocket.d.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export declare class $WebSocket {
44
private url;
55
private protocols;
66
private config;
7+
private binaryType;
78
private static Helpers;
89
private reconnectAttempts;
910
private sendQueue;
@@ -17,31 +18,31 @@ export declare class $WebSocket {
1718
private socket;
1819
private dataStream;
1920
private internalConnectionState;
20-
constructor(url: string, protocols?: Array<string>, config?: WebSocketConfig);
21+
constructor(url: string, protocols?: Array<string>, config?: WebSocketConfig, binaryType?: BinaryType);
2122
connect(force?: boolean): void;
2223
/**
2324
* Run in Block Mode
2425
* Return true when can send and false in socket closed
2526
* @param data
2627
* @returns {boolean}
2728
*/
28-
send4Direct(data: any): boolean;
29+
send4Direct(data: any, binary?: boolean): boolean;
2930
/**
3031
* Return Promise
3132
* When can Send will resolve Promise
3233
* When Socket closed will reject Promise
3334
* @param data
3435
* @returns {Promise<any>}
3536
*/
36-
send4Promise(data: any): Promise<any>;
37+
send4Promise(data: any, binary?: boolean): Promise<any>;
3738
/**
3839
* Return cold Observable
3940
* When can Send will complete observer
4041
* When Socket closed will error observer
4142
* @param data
4243
* @returns {Observable<any>}
4344
*/
44-
send4Observable(data: any): Observable<any>;
45+
send4Observable(data: any, binary?: boolean): Observable<any>;
4546
private send4Mode;
4647
/**
4748
* Set send(data) function return mode
@@ -53,9 +54,10 @@ export declare class $WebSocket {
5354
* If no specify, Default SendMode is Observable mode
5455
* @param data
5556
* @param mode
57+
* @param binary
5658
* @returns {any}
5759
*/
58-
send(data: any, mode?: WebSocketSendMode): any;
60+
send(data: any, mode?: WebSocketSendMode, binary?: boolean): any;
5961
getDataStream(): Subject<any>;
6062
onOpenHandler(event: Event): void;
6163
notifyOpenCallbacks(event: any): void;
@@ -89,3 +91,4 @@ export declare enum WebSocketSendMode {
8991
Promise = 1,
9092
Observable = 2,
9193
}
94+
export declare type BinaryType = "blob" | "arraybuffer";

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular2-websocket",
33
"main": "angular2-websocket",
4-
"version": "0.9.1",
4+
"version": "0.9.2",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1",
77
"compile": "tsc",

0 commit comments

Comments
 (0)