fixed some type mismatches with default values

This commit is contained in:
peterkogo
2024-06-04 14:46:53 +02:00
parent 68f7d6c9a3
commit a22154b9ae
3 changed files with 8 additions and 8 deletions

View File

@@ -7,13 +7,13 @@
interface $$Props extends NodeProps {}
export let data: $$Props['data'] = { label: 'Node' };
export let targetPosition: $$Props['targetPosition'] = Position.Top;
export let sourcePosition: $$Props['sourcePosition'] = Position.Bottom;
export let targetPosition: $$Props['targetPosition'] = undefined;
export let sourcePosition: $$Props['sourcePosition'] = undefined;
// this is a workaround for suppressing the warning about unused props
$$restProps;
</script>
<Handle type="target" position={targetPosition} />
<Handle type="target" position={targetPosition ?? Position.Top} />
{data?.label}
<Handle type="source" position={sourcePosition} />
<Handle type="source" position={sourcePosition ?? Position.Bottom} />

View File

@@ -7,11 +7,11 @@
interface $$Props extends NodeProps {}
export let data: $$Props['data'] = { label: 'Node' };
export let sourcePosition: $$Props['sourcePosition'] = Position.Bottom;
export let sourcePosition: $$Props['sourcePosition'] = undefined;
// this is a workaround for suppressing the warning about unused props
$$restProps;
</script>
{data?.label}
<Handle type="source" position={sourcePosition} />
<Handle type="source" position={sourcePosition ?? Position.Bottom} />

View File

@@ -7,11 +7,11 @@
interface $$Props extends NodeProps {}
export let data: $$Props['data'] = { label: 'Node' };
export let targetPosition: $$Props['targetPosition'] = Position.Top;
export let targetPosition: $$Props['targetPosition'] = undefined;
// this is a workaround for suppressing the warning about unused props
$$restProps;
</script>
{data?.label}
<Handle type="target" position={targetPosition} />
<Handle type="target" position={targetPosition ?? Position.Top} />