Skip to content

Commit 37d7a0a

Browse files
fix(typings): do not expose browser-specific types
Related: - socketio/socket.io-client#1561 - b9252e2
1 parent c36883d commit 37d7a0a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/transport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TransportError extends Error {
2121

2222
export interface CloseDetails {
2323
description: string;
24-
context?: CloseEvent | XMLHttpRequest;
24+
context?: unknown; // context should be typed as CloseEvent | XMLHttpRequest, but these types are not available on non-browser platforms
2525
}
2626

2727
interface TransportReservedEvents {

lib/transports/polling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export class Polling extends Transport {
292292
interface RequestReservedEvents {
293293
success: () => void;
294294
data: (data: RawData) => void;
295-
error: (err: number | Error, context: XMLHttpRequest) => void;
295+
error: (err: number | Error, context: unknown) => void; // context should be typed as XMLHttpRequest, but this type is not available on non-browser platforms
296296
}
297297

298298
export class Request extends Emitter<{}, {}, RequestReservedEvents> {

0 commit comments

Comments
 (0)