[API] Add improved slot locator functions (#716)

- Returns object with slot, index, and pos
- Locate-by-type returns object with slot & index
- Uses standard `undefined` return for concise chaining & validation
- Free 10x perf increase over getConnectionPos (used basic random data
to test, out of curiosity)
This commit is contained in:
filtered
2025-03-08 00:18:06 +11:00
committed by GitHub
parent 84fad5b8a5
commit 3e44f6a0c1
6 changed files with 221 additions and 69 deletions

View File

@@ -217,6 +217,11 @@ export interface IOptionalSlotData<TSlot extends INodeInputSlot | INodeOutputSlo
className?: string
}
/**
* A string that represents a specific data / slot type, e.g. `STRING`.
*
* Can be comma-delimited to specify multiple allowed types, e.g. `STRING,INT`.
*/
export type ISlotType = number | string
export interface INodeSlot {