From 050e3f81d7225fc7a83d0c8fe551a9b0ebf23124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 17 Feb 2024 17:06:47 +0100 Subject: [PATCH] refactor(webui): add types to some components' event dispatchers --- webui/src/lib/components/EntitySetEditor.svelte | 7 ++++++- webui/src/lib/components/InspectGroups.svelte | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/webui/src/lib/components/EntitySetEditor.svelte b/webui/src/lib/components/EntitySetEditor.svelte index af3a72a..5d183ec 100644 --- a/webui/src/lib/components/EntitySetEditor.svelte +++ b/webui/src/lib/components/EntitySetEditor.svelte @@ -5,7 +5,12 @@ import { i18n } from '../i18n'; import LabelBorder from './utils/LabelBorder.svelte'; import { createEventDispatcher } from 'svelte'; - const dispatch = createEventDispatcher(); + import { type Address } from '@upnd/upend/types'; + const dispatch = createEventDispatcher<{ + highlighted: string | undefined; + add: Address; + remove: Address; + }>(); export let entities: string[]; export let hide = false; diff --git a/webui/src/lib/components/InspectGroups.svelte b/webui/src/lib/components/InspectGroups.svelte index 300556d..8d6b11b 100644 --- a/webui/src/lib/components/InspectGroups.svelte +++ b/webui/src/lib/components/InspectGroups.svelte @@ -6,7 +6,7 @@ import type { Readable } from 'svelte/store'; import EntitySetEditor from './EntitySetEditor.svelte'; import { i18n } from '../i18n'; - const dispatch = createEventDispatcher(); + const dispatch = createEventDispatcher<{ change: void }>(); export let entity: Readable;