mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-05 21:20:12 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user