Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it be similar to mediasoup-client repo. - [x] Update NPM deps. - [x] Update TypeScript. - [x] Update ESLint. - [x] Remove `lib` from the repo. - [x] Move test to TypeScript. - [ ] Make `FakeRTCDataChannel` properly implement `RTCDataChannel` (see below). - [ ] Add event listener TS types. - [ ] Probably add a `types.ts` and export it. - [ ] Update Python deps?. - [ ] Add CI. ### TODO 1: TypeScript error in `FakeRTCDataChannel` It doesn't implement properly the official `RTCDataChannel` interface. Probably related to its events: ``` 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 ```
- Loading branch information