Remove LayoutElement, resolve root TS issues (#953)

- Converts type assertions to use inference via discriminated unions
- Removes the LayoutElement class (only used by node slots, and recently
reduced to a single function)
- Splits `boundingRect` property out from `Positionable` interface
- Slots now use the standard `boundingRect` property
- Perf improvements / Removes redundant code
This commit is contained in:
filtered
2025-04-21 22:23:09 +10:00
committed by GitHub
parent f7a0a92f3a
commit 2ad1481f02
6 changed files with 92 additions and 95 deletions

View File

@@ -56,10 +56,10 @@ export interface SerialisableGraph extends BaseExportedGraph {
extra?: Dictionary<unknown>
}
export type ISerialisableNodeInput = Omit<INodeInputSlot, "_layoutElement" | "widget"> & {
export type ISerialisableNodeInput = Omit<INodeInputSlot, "boundingRect" | "widget"> & {
widget?: { name: string }
}
export type ISerialisableNodeOutput = Omit<INodeOutputSlot, "_layoutElement" | "_data"> & {
export type ISerialisableNodeOutput = Omit<INodeOutputSlot, "boundingRect" | "_data"> & {
widget?: { name: string }
}
@@ -135,7 +135,7 @@ export interface ExportedSubgraph extends ISerialisedGraph {
}
/** Properties shared by subgraph and node I/O slots. */
type SubgraphIOShared = Omit<INodeSlot, "nameLocked" | "locked" | "removable" | "_layoutElement" | "_floatingLinks">
type SubgraphIOShared = Omit<INodeSlot, "nameLocked" | "locked" | "removable" | "boundingRect" | "_floatingLinks">
/** Subgraph I/O slots */
export interface SubgraphIO extends SubgraphIOShared {