src/FakeRTCDataChannel.ts:23:14 - error TS2420: Class 'FakeRTCDataChannel' incorrectly implements interface 'RTCDataChannel'.
Types of property 'addEventListener' are incompatible.
Type '{ <T extends string>(type: T, callback?: EventListener<this, Event<string>> | null | undefined, options?: AddOptions | undefined): void; (type: string, callback?: EventListener<...> | ... 1 more ... | undefined, options?: AddOptions | undefined): void; <T extends string>(type: T, callback: EventListener<...> | ... 1...' is not assignable to type '{ <K extends keyof RTCDataChannelEventMap>(type: K, listener: (this: RTCDataChannel, ev: RTCDataChannelEventMap[K]) => any, options?: boolean | ... 1 more ... | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }'.
Types of parameters 'callback' and 'listener' are incompatible.
Type '(this: RTCDataChannel, ev: any) => any' is not assignable to type 'EventListener<this, Event<string>> | null | undefined'.
Type '(this: RTCDataChannel, ev: any) => any' is not assignable to type 'CallbackFunction<this, Event<string>>'.
The 'this' types of each signature are incompatible.
Type 'this' is not assignable to type 'RTCDataChannel'.
Type 'FakeRTCDataChannel' is not assignable to type 'RTCDataChannel'.
Types of property 'addEventListener' are incompatible.
Type '{ <T extends string>(type: T, callback?: EventListener<this, Event<string>> | null | undefined, options?: AddOptions | undefined): void; (type: string, callback?: EventListener<...> | ... 1 more ... | undefined, options?: AddOptions | undefined): void; <T extends string>(type: T, callback: EventListener<...> | ... 1...' is not assignable to type '{ <K extends keyof RTCDataChannelEventMap>(type: K, listener: (this: RTCDataChannel, ev: RTCDataChannelEventMap[K]) => any, options?: boolean | ... 1 more ... | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }'.
Types of parameters 'callback' and 'listener' are incompatible.
Type '(this: RTCDataChannel, ev: any) => any' is not assignable to type 'EventListener<this, Event<string>> | null | undefined'.
23 export class FakeRTCDataChannel extends EventTarget implements RTCDataChannel
This is currently "workarounded" with a @ts-ignore above FakeRTCDataChannel class definition and also another 2 @ts-ignore in Handler.ts, which is hell ofc.
Problem is that mediasoup-client relies on "dom" TS library, and here we are defining FakeRTCDataChannel which uses event-target-shim dep to mimics DOM's EventTarget. Related task in mediasoup-client: https://github.com/versatica/mediasoup-client/issues/279
This is currently "workarounded" with a
@ts-ignore
aboveFakeRTCDataChannel
class definition and also another 2@ts-ignore
inHandler.ts
, which is hell ofc.Problem is that mediasoup-client relies on "dom" TS library, and here we are defining
FakeRTCDataChannel
which uses event-target-shim dep to mimics DOM'sEventTarget
. Related task in mediasoup-client: https://github.com/versatica/mediasoup-client/issues/279