You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I've noticed an oddity when using Interface Types with allowMultipleConnections.
So let's say I'd like my custom interface to receive strings, so I use new NodeInterfaceType<string>("custom").
Then I set this type and allow multiple connections: new NodeInterface<string[]>("Input", []).use(allowMultipleConnections).use(setType, customType)
Then I'll have a typescript error about the mismatch between 'string' and 'string[]': Argument of type 'NodeInterfaceType<string>' is not assignable to parameter of type 'NodeInterfaceType<string[]>'.ts(2345)
I could change my type to NodeInterfaceType<string[]>, but then, if I wanted an output node of the same 'custom' type, that will also be 'string[]' instead of 'string' which seems wrong.
What's the recommended way to do this? Am I supposed to put the [] into the interface definition?
Hi,
I've noticed an oddity when using Interface Types with allowMultipleConnections.
So let's say I'd like my custom interface to receive strings, so I use
new NodeInterfaceType<string>("custom")
.Then I set this type and allow multiple connections:
new NodeInterface<string[]>("Input", []).use(allowMultipleConnections).use(setType, customType)
Then I'll have a typescript error about the mismatch between 'string' and 'string[]':
Argument of type 'NodeInterfaceType<string>' is not assignable to parameter of type 'NodeInterfaceType<string[]>'.ts(2345)
I could change my type to
NodeInterfaceType<string[]>
, but then, if I wanted an output node of the same 'custom' type, that will also be 'string[]' instead of 'string' which seems wrong.What's the recommended way to do this? Am I supposed to put the [] into the interface definition?
Originally posted by @hthomas92 in #219 (comment)
The text was updated successfully, but these errors were encountered: