@vttforge/core / fields
Function: fields()
fields():
FieldsApi
Resolve globalThis.foundry.data.fields and return it typed as FieldsApi.
Call this inside defineSchema() (or any code that runs after Foundry's init hook). Calling at module scope will throw when imported from Node tests; the global only exists inside the Foundry runtime.
Returns
Throws
VttfError with code VTTF-0002 when foundry.data.fields is missing.