millicast / millicast-sdk

SDK for building a realtime broadcaster using the Millicast platform.
Other
37 stars 28 forks source link

TypeScript Error TS1016: A Required Parameter Cannot Follow an Optional Parameter in createRTCPeer Function 0.2.1 #435

Open vasylynkar opened 6 days ago

vasylynkar commented 6 days ago

https://github.com/millicast/millicast-sdk/blob/8072bf86823439f83e92fcb4ee601c0a043d2a04/packages/millicast-sdk/src/types/index.d.ts#L795

Error: TS1016: A required parameter cannot follow an optional parameter.

createRTCPeer(config?: PeerConnectionConfig, mode: "Publisher" | "Viewer"): Promise<void>;

Steps to Reproduce:

  1. Install the milicast SDK package using npm or yarn.
  2. Run tsc to compile the TypeScript code.

Expected Behavior: The TypeScript code should compile without any errors.

Actual Behavior: The TypeScript compiler throws the error

FabienLavocat commented 6 days ago

Thank you for reporting this error. We are working on switching the SDK into pure TypeScript instead of JavaScript with some TypeScript definitions, which should fix this problem. In the meantime, are you able to use the skipLibCheck flag to remove this error when you compile your project?

vasylynkar commented 6 days ago

Thanks for the fast answer!