Skip to content

@vttforge/core / BaseHandlebarsApplication

Function: BaseHandlebarsApplication() ​

BaseHandlebarsApplication(): (...args) => BaseHandlebarsApplicationMembers & ApplicationV2Members

Build the BaseHandlebarsApplication for the current Foundry runtime.

ts
class ReportWindow extends BaseHandlebarsApplication() {
  static DEFAULT_OPTIONS = {
    id: 'my-report',
    window: { title: 'MY_MODULE.Report.title' },
    position: { width: 560, height: 'auto' },
    actions: { refresh: ReportWindow.onRefresh },
  };

  static PARTS = {
    body: { template: 'modules/my-module/templates/report.hbs' },
  };

  override async _prepareContext() {
    return { rows: collectRows() };
  }
}

override on _prepareContext is required, not merely allowed: the factory reports what it adds, so TypeScript sees the member being replaced, and a scaffolded project sets noImplicitOverride.

Omitting PARTS throws when the class is constructed, rather than opening an empty window.

Returns ​

(...args) => BaseHandlebarsApplicationMembers & ApplicationV2Members

MIT licensed.