Skip to content

Instantly share code, notes, and snippets.

@bryanmylee
Created January 16, 2022 17:36
Show Gist options
  • Save bryanmylee/8e6bff00e920bbaa72d66cce4c758a34 to your computer and use it in GitHub Desktop.
Save bryanmylee/8e6bff00e920bbaa72d66cce4c758a34 to your computer and use it in GitHub Desktop.
Generic type definitions for Svelte components
<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