HandlebarsApplicationMixin Usage from the foundry-vtt-types node package

I have recently started to use foundry to dm my games and as a programmer myself I have been building macros and simple module stuff for the last few weeks. I am newish to type script since I use C++ mostly for my work, so I am a bit lost here. How am I supposed to use HandlebarsApplicationMixin? Every time I try to extend my custom class with HandlebarsApplicationMixin(DocumentSheetV2), I get an error that says no base constructor has the specified number of type arguments. I know C++ knowledge doesn’t transfer directly, but it seems to just be a generic type definition so why would it have a constructor error?
Solution
You can see the generic parameters for DocumentSheetV2 at its definition:
declare class DocumentSheetV2<
  Document extends foundry.abstract.Document.Any,
  RenderContext extends AnyObject = EmptyObject,
  Configuration extends DocumentSheetV2.Configuration<Document> = DocumentSheetV2.Configuration<Document>,
  RenderOptions extends DocumentSheetV2.RenderOptions = DocumentSheetV2.RenderOptions,
> extends ApplicationV2<RenderContext, Configuration, RenderOptions> {
Was this page helpful?