-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve typings for event emitters #200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
75e7b86
to
2785898
Compare
Will review soon, sorry for the delay. |
…DataProducer, DataConsumer
2785898
to
ebac282
Compare
@ibc sure no hurry ;) |
We don't forget about this. It's just that we are too busy. |
I probably will close this PR soon and just fork this repo to move forward. |
Please don't. Will manage this PR this week. Promise. |
@@ -148,9 +149,41 @@ export type PlainRtpParameters = | |||
port: number; | |||
}; | |||
|
|||
export type TransportProduceParameters<AppData = unknown> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AppData
default value should not be unkown
but Record<string, unknown>
(everywhere).
@unao I've made some changes that improve |
Closed in favour of #209 |
As a logical continuation of versatica/mediasoup#764 would like to add analogous types for mediasoup client.
I introduced some implicit assumption around
safeEmitAsPromise
: if corresponding type is not specified it allows to pass any arguments otherwise it must be a single argument conforming to the first declared type.There is still some room left for improvements around
AppData
(for preventing unsafe cast) - if you were interested I could add it once this is merged in.