Skip to content

Commit

Permalink
Use SimpleMerge in DocumentSheetV2's constructor to avoid a RangeErro…
Browse files Browse the repository at this point in the history
…r crash reported at microsoft/TypeScript#60927
  • Loading branch information
LukeAbby committed Jan 9, 2025
1 parent 285ac9f commit 166228a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/foundry/client-esm/applications/api/document-sheet.d.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AnyObject, DeepPartial, EmptyObject } from "../../../../utils/index.d.mts";
import type { AnyObject, DeepPartial, EmptyObject, SimpleMerge } from "../../../../utils/index.d.mts";
import type ApplicationV2 from "./application.d.mts";

declare namespace DocumentSheetV2 {
Expand Down Expand Up @@ -47,7 +47,8 @@ declare class DocumentSheetV2<
Configuration extends DocumentSheetV2.Configuration<Document> = DocumentSheetV2.Configuration<Document>,
RenderOptions extends DocumentSheetV2.RenderOptions = DocumentSheetV2.RenderOptions,
> extends ApplicationV2<RenderContext, Configuration, RenderOptions> {
constructor(options: DeepPartial<Configuration> & { document: Document });
// Note(LukeAbby): This is a fix for https://github.com/microsoft/TypeScript/issues/60927
constructor(options: SimpleMerge<DeepPartial<Configuration>, { document: Document }>);

// Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
// Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
Expand Down

0 comments on commit 166228a

Please sign in to comment.