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

Unofficial type declarations for the Foundry Virtual Tabletop API
MIT License
116 stars 56 forks source link

ClientDocumentMixin strips restrictions on constructor data #2562

Closed JPMeehan closed 4 months ago

JPMeehan commented 4 months ago

This tests correctly

// @ts-expect-error name is a required field
new foundry.documents.BaseRollTable();
// @ts-expect-error name is a required field
new foundry.documents.BaseRollTable({});

This does not

// @ts-expect-error - A RollTable requires data.
new RollTable();

// @ts-expect-error - A RollTable requires a name.
new RollTable({});
JPMeehan commented 4 months ago

This is only an issue for temp doc creation - RollTable.create still works properly

LukeAbby commented 4 months ago

Fixed as of 88da04e4c5ade6beaf7db386393d8e77e9abe714