Skip to content

Commit

Permalink
fix(typings): do not expose browser-specific types
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Feb 4, 2023
1 parent c36883d commit 37d7a0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/transport.ts
Expand Up @@ -21,7 +21,7 @@ class TransportError extends Error {

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

interface TransportReservedEvents {
Expand Down
2 changes: 1 addition & 1 deletion lib/transports/polling.ts
Expand Up @@ -292,7 +292,7 @@ export class Polling extends Transport {
interface RequestReservedEvents {
success: () => void;
data: (data: RawData) => void;
error: (err: number | Error, context: XMLHttpRequest) => void;
error: (err: number | Error, context: unknown) => void; // context should be typed as XMLHttpRequest, but this type is not available on non-browser platforms
}

export class Request extends Emitter<{}, {}, RequestReservedEvents> {
Expand Down

0 comments on commit 37d7a0a

Please sign in to comment.