Skip to content

Enable better typescript support #27

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

Open
ArcticKeaton opened this issue Mar 10, 2025 · 0 comments
Open

Enable better typescript support #27

ArcticKeaton opened this issue Mar 10, 2025 · 0 comments

Comments

@ArcticKeaton
Copy link

Currently the items do not use generics to keep the typings available. e.g.

<script lang="ts">
    let data = [ { id: 123, text: "item text" } ]
</script>
<VirtualScroll {data} let:data>
    <div>
        <!-- data is "any", no typings info -->
        {data.text}
    </div>
</VirtualScroll>

My proposal is to configure tighter typings for data, slot data and key:

data: T[]
key: keyof T
slot data: T
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

No branches or pull requests

1 participant