Skip to content

Enable better typescript support #27

@ArcticKeaton

Description

@ArcticKeaton

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 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions