React Flow | Svelte Flow - Powerful open source libraries for building node-based UIs with React (https://reactflow.dev) or Svelte (https://svelteflow.dev). Ready out-of-the-box and infinitely customizable.
Some events on SvelteFlow are strongly typed, while others are not. For example, "edgeclick" is strongly typed, while "nodedragstop" is not:
"edgeclick"
"nodedragstop"
Digging down into the types shipped with the package in node_modules/@xyflow/svelte/dist/lib/container/SvelteFlow/SvelteFlow.svelte.d.ts, you can see why:
Attempt to get proper types for the "nodedragstop" event using ComponentEvents<SvelteFlow>["nodedragstop"]. You'll get (property) nodedragstop: CustomEvent<any>
Expected behavior
As a developer, I expected to be able to get strongly typed events for all events emitted by SvelteFlow by using Svelte's ComponentEvents<SvelteFlow> utility.
Describe the Bug
Some events on
SvelteFlow
are strongly typed, while others are not. For example,"edgeclick"
is strongly typed, while"nodedragstop"
is not:"edgeclick"
"nodedragstop"
Digging down into the types shipped with the package in
node_modules/@xyflow/svelte/dist/lib/container/SvelteFlow/SvelteFlow.svelte.d.ts
, you can see why:Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Attempt to get proper types for the
"nodedragstop"
event usingComponentEvents<SvelteFlow>["nodedragstop"]
. You'll get(property) nodedragstop: CustomEvent<any>
Expected behavior
As a developer, I expected to be able to get strongly typed
event
s for all events emitted bySvelteFlow
by using Svelte'sComponentEvents<SvelteFlow>
utility.Screenshots or Videos
No response
Platform
Additional context
No response