fix(typings): update the type of RawData

We could also split the declaration of RawData with the "browser"
field:

```
// for Node.js
export type RawData = string | Buffer | ArrayBuffer | ArrayBufferView; // no Blob
// for the browser
export type RawData = string | ArrayBuffer | ArrayBufferView | Blob; // no Buffer
```

But it does not seem supported by the TypeScript compiler, so we'll
revert to just using "any" for now.

Related: https://github.com/socketio/engine.io-parser/issues/128
This commit is contained in:
Damien Arrachequesne
2022-04-30 12:36:57 +02:00
parent 4952193c04
commit 039b45cc65

View File

@@ -26,7 +26,9 @@ export type PacketType =
| "noop"
| "error";
export type RawData = string | Buffer | ArrayBuffer | ArrayBufferView | Blob;
// RawData should be "string | Buffer | ArrayBuffer | ArrayBufferView | Blob", but Blob does not exist in Node.js and
// requires to add the dom lib in tsconfig.json
export type RawData = any;
export interface Packet {
type: PacketType;