League-of-Foundry-Developers / foundry-vtt-types

Unofficial type declarations for the Foundry Virtual Tabletop API
MIT License
115 stars 55 forks source link

Adjust TypeDataField to allow data models for core types #2730

Open JPMeehan opened 3 months ago

JPMeehan commented 3 months ago

After some testing, you can absolutely provide data models for the base type and any other core-provided types. Our implementation of TypeDataField should reflect that.

We should also make sure that the typing for non-data model entries is Record<string, unknown> as any data can be saved back - the purpose of the system data models is to provide client side validation/filtering, the server treats TypeDataField as an open-ended ObjectField.