mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user