Skip to content

TypeMatchValidatorOptions

Defined in: src/components/editor/NodeGraph/createTypeMatchValidator.ts:6

Properties

allowSameNode?

optional allowSameNode: boolean

Defined in: src/components/editor/NodeGraph/createTypeMatchValidator.ts:21

Allow connecting two ports on the same node.

Default

false

anyType?

optional anyType: string

Defined in: src/components/editor/NodeGraph/createTypeMatchValidator.ts:17

dataType token that connects to anything.

Default

'any'

directions?

optional directions: readonly string[]

Defined in: src/components/editor/NodeGraph/createTypeMatchValidator.ts:13

Allowed info.sideCombo values (e.g. 'right->left'). Defaults to both horizontal directions so the user can start the drag from either end of a wire. Pass ['right->left'] to force output→input only.

Default

['right->left', 'left->right']

match()?

optional match: (sourceDataType, targetDataType) => boolean

Defined in: src/components/editor/NodeGraph/createTypeMatchValidator.ts:27

Custom type comparison, replacing the default (equality + anyType + “untyped ports accept anything”). Receives the resolved dataTypes, either of which may be undefined when the port declared none.

Parameters

sourceDataType

string | undefined

targetDataType

string | undefined

Returns

boolean