Type Alias ComponentEvents<Component>

ComponentEvents<Component>: Component extends SvelteComponent<any, infer Events>
    ? Events
    : never

Convenience type to get the events the given component expects. Example:

<script lang="ts">
import type { ComponentEvents } from 'svelte';
import Component from './Component.svelte';

function handleCloseEvent(event: ComponentEvents<Component>['close']) {
console.log(event.detail);
}
</script>

<Component on:close={handleCloseEvent} />

Type Parameters