11import * as Diff from "diff" ;
22
3+ import type { AnyObject } from "fvtt-types/utils" ;
4+
35import type { Quench , QuenchBatchKey } from "../quench" ;
46import { type RUNNABLE_STATE , getBatchKey } from "../utils/quench-utils" ;
57
@@ -20,14 +22,13 @@ import { pause } from "../utils/user-utils";
2022
2123import ApplicationV2 = foundry . applications . api . ApplicationV2 ;
2224import HandlebarsApplicationMixin = foundry . applications . api . HandlebarsApplicationMixin ;
23- // const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
2425
2526/**
2627 * The visual UI for representing Quench test batches and the tests results thereof.
2728 *
2829 * @internal
2930 */
30- export class QuenchResults extends HandlebarsApplicationMixin ( ApplicationV2 ) {
31+ export class QuenchResults extends HandlebarsApplicationMixin ( ApplicationV2 < QuenchResultData > ) {
3132 /** The `Quench` instance this `Application` is used by */
3233 quench : Quench ;
3334
@@ -97,9 +98,11 @@ export class QuenchResults extends HandlebarsApplicationMixin(ApplicationV2) {
9798 /* -------------------------------------------- */
9899
99100 /** @inheritDoc */
100- override async _prepareContext ( ) : Promise < QuenchResultData > {
101+ override async _prepareContext ( _options : ApplicationV2 . RenderOptions ) : Promise < QuenchResultData > {
101102 const filterSetting = getFilterSetting ( ) ;
102- const preselected = this . quench . _filterBatches ( filterSetting , { preSelectedOnly : true } ) ;
103+ const preselected = this . quench . _filterBatches ( filterSetting , {
104+ preSelectedOnly : true ,
105+ } ) ;
103106 return {
104107 anyBatches : this . quench . _testBatches . size > 0 ,
105108 batches : this . quench . _testBatches . map ( ( batchData ) => {
@@ -113,10 +116,7 @@ export class QuenchResults extends HandlebarsApplicationMixin(ApplicationV2) {
113116 }
114117
115118 /** @inheritDoc */
116- override _onRender (
117- context : QuenchResultData ,
118- options : foundry . applications . types . ApplicationRenderOptions ,
119- ) {
119+ override _onRender ( context : QuenchResultData , options : ApplicationV2 . RenderOptions ) {
120120 super . _onRender ( context , options ) ;
121121 this . #searchFilter. bind ( this . element ) ;
122122 }
@@ -449,7 +449,10 @@ export class QuenchResults extends HandlebarsApplicationMixin(ApplicationV2) {
449449 }
450450 }
451451
452- private static _getErrorDiff ( error : { actual : unknown ; expected : unknown } ) : HTMLElement {
452+ private static _getErrorDiff ( error : {
453+ actual : unknown ;
454+ expected : unknown ;
455+ } ) : HTMLElement {
453456 const diffNode = createNode ( "div" , { attr : { class : "diff" } } ) ;
454457
455458 const expected =
@@ -511,7 +514,9 @@ export class QuenchResults extends HandlebarsApplicationMixin(ApplicationV2) {
511514 }
512515
513516 return createNode ( "span" , {
514- attr : { class : part . removed ? "expected" : part . added ? "actual" : "unchanged" } ,
517+ attr : {
518+ class : part . removed ? "expected" : part . added ? "actual" : "unchanged" ,
519+ } ,
515520 children : part . value ,
516521 } ) ;
517522 } )
@@ -671,7 +676,9 @@ export class QuenchResults extends HandlebarsApplicationMixin(ApplicationV2) {
671676
672677 if ( ! batchKey || ! isBatchRoot ) return ;
673678
674- const errorTitle = localize ( "ERROR.Hook" , { hook : hook . title . replace ( "_root" , "" ) } ) ;
679+ const errorTitle = localize ( "ERROR.Hook" , {
680+ hook : hook . title . replace ( "_root" , "" ) ,
681+ } ) ;
675682 const hookId = hook . id as string ;
676683
677684 const batchLi = this . element . querySelector ( `li.test-batch[data-batch="${ batchKey } "]` ) ;
@@ -739,7 +746,7 @@ export class QuenchResults extends HandlebarsApplicationMixin(ApplicationV2) {
739746 }
740747}
741748
742- interface QuenchResultData extends foundry . applications . api . ApplicationV2 . RenderContext {
749+ interface QuenchResultData extends AnyObject {
743750 anyBatches : boolean ;
744751 batches : { name : string ; displayName : string ; selected : boolean } [ ] ;
745752}
0 commit comments