In the svelte component
<script lang="ts">
export let multiple: boolean = false;
export let value: string|string[];
// ...
</script>
<!-- ... -->
the type of the value property should be string if multiple == false and string[] otherwise. How can this be achieved?
Edit: The idea is to get a Discriminated Union effect for components.