What is the feature?
Right now, getValues
is a method on which the records
parameter is TRow<S, N>[]
.
It’s pretty fine (autocompletion yay!), but misleading: the contents of the records
are actually partial records as defined in the dependencies
property.
records
’ type should ideally depend on the dependencies
array.
Similarly, the return type of getValues
is Promise<unknown[]> | unknown[]
. Ideally, this should be set by the columnType
property.
What problem does this solve for you?
This clears up a discrepancy between types expression and actual runtime values.
As properties which are not listed in dependencies
do not appear in the records
content whatsoever, accessing them can cause crashes or other undesirable behaviours.
I’m… not sure what can go wrong if the wrong type is returned from the function (an array for a Number
type for example). I don’t want to know
Who else would be using this feature?
Anyone adding smart fields with a type-aware code editor on the Node agent.