Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

unao
Copy link

@unao unao commented Feb 23, 2022

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.

Copy link
Member

@jmillan jmillan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@unao
Copy link
Author

unao commented Apr 11, 2022

@jmillan @ibc I resolved some conflicts in generated types. Any chance to merge this in?

@ibc
Copy link
Member

ibc commented Apr 13, 2022

Will review soon, sorry for the delay.

@unao
Copy link
Author

unao commented May 20, 2022

@ibc sure no hurry ;)
btw. I resolved some other conflicts that popped up since then

@unao unao mentioned this pull request May 25, 2022
@ibc
Copy link
Member

ibc commented May 25, 2022

We don't forget about this. It's just that we are too busy.

@unao
Copy link
Author

unao commented Jun 13, 2022

I probably will close this PR soon and just fork this repo to move forward.

@ibc
Copy link
Member

ibc commented Jun 13, 2022

Please don't. Will manage this PR this week. Promise.

@@ -148,9 +149,41 @@ export type PlainRtpParameters =
port: number;
};

export type TransportProduceParameters<AppData = unknown> =
Copy link
Member

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).

@ibc
Copy link
Member

ibc commented Jun 18, 2022

@unao I've made some changes that improve EnhancedEventEmitter and I assume we should use the same in mediasoup-client:

versatica/mediasoup#836

@ibc
Copy link
Member

ibc commented Jul 1, 2022

Closed in favour of #209

@ibc ibc closed this Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants