Skip to content

feat: add type inference for the options prop #189

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

Merged
merged 7 commits into from
Dec 29, 2022

Conversation

joelmukuthu
Copy link
Contributor

Closes #78.

Summary of major changes

  1. adds type inference for the options prop
  2. updates documentation for the same

Checklist

[ ] has tests for any new functionality or bug fixes
[ ] has examples/docs for any new functionality

@@ -441,21 +441,8 @@ The above list of events are [Svelte `dispatch` events](https://svelte.dev/tutor

## 🦺   TypeScript

TypeScript users can import the types used for internal type safety:

```svelte
Copy link
Contributor Author

@joelmukuthu joelmukuthu Dec 29, 2022

Choose a reason for hiding this comment

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

I didn't put an example here because demonstrating type-safety would probably require a screenshot. These can be used if needed:
Screenshot from 2022-12-29 10-51-08
Screenshot from 2022-12-29 10-51-16
Screenshot from 2022-12-29 10-51-23

Note that the import line doesn't say import MultiSelect from 'svelte-multiselect'; since this was a test I did locally.

@janosh janosh enabled auto-merge (squash) December 29, 2022 18:02
@janosh janosh merged commit f507870 into janosh:main Dec 29, 2022
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.

Infer more precise types for bind:selected and let:option
2 participants