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

Typed SvelteComponent interface #5431

Merged
merged 5 commits into from
Nov 24, 2020

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Sep 20, 2020

Implementation for RFC sveltejs/rfcs#37

I tested this locally with the language-tools and it works.

I also noticed that the current type definition is wrong: When you forward an event like <button on:click ... and you listen to the event through $on('click', ..., the type according to the current type definition would be CustomEvent<MouseEvent>, but it's MouseEvent.

Simon Holthausen added 2 commits September 20, 2020 12:12
You need to type it like CustomEvent<...> because when forwarding events it could also be MouseEvent or sth like that
@TheComputerM
Copy link

Is this ready to use in component libraries?

@dummdidumm dummdidumm marked this pull request as ready for review October 27, 2020 10:25
@dummdidumm
Copy link
Member Author

dummdidumm commented Oct 27, 2020

@Conduitry this is ready to merge. I'll open a separate PR for docs.

Simon Holthausen and others added 3 commits November 8, 2020 13:48
let people type it loose themselves if they want to
@Conduitry Conduitry merged commit 99000ef into sveltejs:master Nov 24, 2020
@Conduitry
Copy link
Member

The has been released in 3.30.0 🎉

@dummdidumm dummdidumm deleted the typed-sveltecomponent-interface branch November 25, 2020 07:54
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants