Browse Source

Update type for msgpack-lite BufferOptions

Danilo Bargen 8 years ago
parent
commit
abcda8d6f0
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/services/webclient.ts

+ 6 - 3
src/services/webclient.ts

@@ -187,7 +187,10 @@ export class WebClientService {
     public receiverListener: threema.ReceiverListener[] = [];
 
     // Msgpack
-    private msgpackOptions: msgpack.BufferOptions = {
+    private msgpackEncoderOptions: msgpack.EncoderOptions = {
+        codec: msgpack.createCodec({binarraybuffer: true}),
+    };
+    private msgpackDecoderOptions: msgpack.DecoderOptions = {
         codec: msgpack.createCodec({binarraybuffer: true}),
     };
 
@@ -2406,14 +2409,14 @@ export class WebClientService {
      * Encode an object using the msgpack format.
      */
     private msgpackEncode(data: any): Uint8Array {
-        return msgpack.encode(data, this.msgpackOptions);
+        return msgpack.encode(data, this.msgpackEncoderOptions);
     }
 
     /**
      * Decode an object using the msgpack format.
      */
     private msgpackDecode(bytes: Uint8Array): any {
-        return msgpack.decode(bytes, this.msgpackOptions);
+        return msgpack.decode(bytes, this.msgpackDecoderOptions);
     }
 
     /**