Skip to content

Commit 039b45c

Browse files
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: #128
1 parent 4952193 commit 039b45c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/commons.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export type PacketType =
2626
| "noop"
2727
| "error";
2828

29-
export type RawData = string | Buffer | ArrayBuffer | ArrayBufferView | Blob;
29+
// RawData should be "string | Buffer | ArrayBuffer | ArrayBufferView | Blob", but Blob does not exist in Node.js and
30+
// requires to add the dom lib in tsconfig.json
31+
export type RawData = any;
3032

3133
export interface Packet {
3234
type: PacketType;

0 commit comments

Comments
 (0)