Created
January 16, 2022 17:36
-
-
Save bryanmylee/8e6bff00e920bbaa72d66cce4c758a34 to your computer and use it in GitHub Desktop.
Generic type definitions for Svelte components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
type T = $$Generic | |
interface $$Slots { | |
default: { // slot name | |
item: T | |
index: number | |
} | |
} | |
export let items: T[] = [] | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment