foundry-vtt-types icon indicating copy to clipboard operation
foundry-vtt-types copied to clipboard

Add choices handling to `NumberField`

Open JPMeehan opened this issue 8 months ago • 0 comments

The choices parameter in NumberFieldOptions should constrain the resulting type, but it does not currently.

Options for implementation

  1. Replicate the handling from StringField (easier solution)
  2. 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"]

JPMeehan avatar Jun 23 '24 21:06 JPMeehan