foundry-vtt-types
foundry-vtt-types copied to clipboard
Add choices handling to `NumberField`
The choices
parameter in NumberFieldOptions should constrain the resulting type, but it does not currently.
Options for implementation
- Replicate the handling from StringField (easier solution)
- Find a way to share the type constraints with StringField (more DRY, possibly harder to implement)
Note that the choices
parameter is implemented separately in the Foundry code.
Current example of the choices
parameter for a NumberField is foundry.documents.BaseNote["textAnchor"]