Hi there! I found a minor DX issue in the generated Typescript definitions (which are incredibly cool, by the way).
I’ve got a rating field in my base:
![54496ef71664e904faca92b4c771608354093615.png 54496ef71664e904faca92b4c771608354093615.png](/t5/image/serverpage/image-id/8701i2C2777BCC02A7BEA/image-size/large?v=v2&px=999)
When writing scripting to update it, I’ve got an await input.buttonsAsync
where each item is has a value and label: { label: "⭐⭐⭐⭐", value: 4 }
, etc.
The selected button goes into a payload object that’s eventually passed to table.updateRecordAsync
. The actual script works flawlessly, but there’s a TS error:
Type "number" is not assignable to type '0 | 1 | 2 | 3 | 4'
![3102799ce95fd1de68f1e44e5836867751cc134d.png 3102799ce95fd1de68f1e44e5836867751cc134d.png](/t5/image/serverpage/image-id/8703i3A1113452879CF0E/image-size/large?v=v2&px=999)
I tried to add a type assertion, but apparently the script input isn’t a TS file. I think the fix is as simple as demoting the Rating
type to accept numbers instead of a specific set of numbers.
Not a big deal, since the error doesn’t affect execution, but I figured I’d flag. Thanks!