@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250710065228 → 13.346.0-beta.20250711091515

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/package.json +1 -1
  2. package/src/foundry/client/applications/api/application.d.mts +23 -11
  3. package/src/foundry/client/applications/api/category-browser.d.mts +11 -2
  4. package/src/foundry/client/applications/api/dialog.d.mts +6 -2
  5. package/src/foundry/client/applications/api/document-sheet.d.mts +16 -9
  6. package/src/foundry/client/applications/apps/av/camera-popout.d.mts +14 -3
  7. package/src/foundry/client/applications/apps/av/cameras.d.mts +14 -3
  8. package/src/foundry/client/applications/apps/combat-tracker-config.d.mts +15 -3
  9. package/src/foundry/client/applications/apps/compendium-art-config.d.mts +12 -2
  10. package/src/foundry/client/applications/apps/file-picker.d.mts +11 -1
  11. package/src/foundry/client/applications/apps/image-popout.d.mts +11 -1
  12. package/src/foundry/client/applications/apps/permission-config.d.mts +12 -2
  13. package/src/foundry/client/applications/dice/roll-resolver.d.mts +14 -1
  14. package/src/foundry/client/applications/handlebars.d.mts +87 -58
  15. package/src/foundry/client/applications/hud/container.d.mts +11 -2
  16. package/src/foundry/client/applications/hud/placeable-hud.d.mts +14 -2
  17. package/src/foundry/client/applications/settings/dependency-resolution.d.mts +17 -3
  18. package/src/foundry/client/applications/settings/menus/av-config.d.mts +12 -3
  19. package/src/foundry/client/applications/settings/menus/dice-config.d.mts +15 -3
  20. package/src/foundry/client/applications/settings/menus/font-config.d.mts +14 -2
  21. package/src/foundry/client/applications/settings/menus/prototype-overrides.d.mts +14 -3
  22. package/src/foundry/client/applications/settings/menus/ui-config.d.mts +15 -4
  23. package/src/foundry/client/applications/sheets/token/prototype-config.d.mts +17 -3
  24. package/src/foundry/client/applications/sidebar/apps/chat-popout.d.mts +12 -3
  25. package/src/foundry/client/applications/sidebar/apps/frame-viewer.d.mts +12 -3
  26. package/src/foundry/client/applications/sidebar/apps/invitation-links.d.mts +17 -3
  27. package/src/foundry/client/applications/sidebar/apps/module-management.d.mts +17 -3
  28. package/src/foundry/client/applications/sidebar/apps/support-details.d.mts +16 -3
  29. package/src/foundry/client/applications/sidebar/apps/world-config.d.mts +15 -3
  30. package/src/foundry/client/applications/sidebar/document-directory.d.mts +14 -2
  31. package/src/foundry/client/applications/sidebar/sidebar-tab.d.mts +14 -1
  32. package/src/foundry/client/applications/sidebar/sidebar.d.mts +11 -3
  33. package/src/foundry/client/applications/ui/game-pause.d.mts +12 -3
  34. package/src/foundry/client/applications/ui/hotbar.d.mts +15 -5
  35. package/src/foundry/client/applications/ui/main-menu.d.mts +13 -3
  36. package/src/foundry/client/applications/ui/players.d.mts +13 -3
  37. package/src/foundry/client/applications/ui/region-legend.d.mts +11 -2
  38. package/src/foundry/client/applications/ui/scene-controls.d.mts +15 -3
  39. package/src/foundry/client/applications/ui/scene-navigation.d.mts +12 -2
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from "../../../utils/index.d.mts";
1
+ import type { AnyObject, InexactPartial } from "../../../utils/index.d.mts";
2
2
  import type { FormInputConfig, NumberInputConfig, SelectInputConfig } from "#client/applications/forms/fields.d.mts";
3
3
 
4
4
  /**
@@ -51,8 +51,14 @@ export function loadTemplates(paths: string[] | Record<string, string>): Promise
51
51
  // TODO(LukeAbby): Create a registry for templates or some abstraction to make this type safe.
52
52
  export function renderTemplate(path: string, data: AnyObject): Promise<string>;
53
53
 
54
+ /**
55
+ * Initialize Handlebars extensions and helpers.
56
+ */
57
+ export function initialize(): void;
58
+
54
59
  /**
55
60
  * For checkboxes, if the value of the checkbox is true, add the "checked" property, otherwise add nothing.
61
+ * @param value - A value with a truthiness indicative of whether the checkbox is checked
56
62
  *
57
63
  * @example
58
64
  * ```hbs
@@ -64,6 +70,7 @@ export function checked(value: unknown): string;
64
70
 
65
71
  /**
66
72
  * For use in form inputs. If the supplied value is truthy, add the "disabled" property, otherwise add nothing.
73
+ * @param value - A value with a truthiness indicative of whether the input is disabled
67
74
  *
68
75
  * @example
69
76
  * ```hbs
@@ -97,7 +104,9 @@ export function editor(content: string, options: TextEditorOptions): Handlebars.
97
104
 
98
105
  /**
99
106
  * A ternary expression that allows inserting A or B depending on the value of C.
100
- * @param options - Helper options
107
+ * @param criteria - The test criteria
108
+ * @param ifTrue - The string to output if true
109
+ * @param ifFalse - The string to output if false
101
110
  * @returns The ternary result
102
111
  *
103
112
  * @example Ternary if-then template usage
@@ -105,10 +114,11 @@ export function editor(content: string, options: TextEditorOptions): Handlebars.
105
114
  * {{ifThen true "It is true" "It is false"}}
106
115
  * ```
107
116
  */
108
- export function ifThen(options: IfThenOptions): string;
117
+ export function ifThen(criteria: boolean, ifTrue: string, ifFalse: string): string;
109
118
 
110
119
  /**
111
120
  * Translate a provided string key by using the loaded dictionary of localization strings.
121
+ * @param value - value The path to a localized string
112
122
  *
113
123
  * @example Translate a provided localization string, optionally including formatting parameters
114
124
  * ```handlebars
@@ -145,6 +155,11 @@ export function numberFormat(value: string | number, options: NumberFormatOption
145
155
  */
146
156
  export function numberInput(value: string, options: NumberInputOptions): Handlebars.SafeString;
147
157
 
158
+ /**
159
+ * Create an object from a sequence of `key=value` pairs.
160
+ */
161
+ export function object(options: Handlebars.HelperOptions): Record<string, unknown>;
162
+
148
163
  /**
149
164
  * A helper to create a set of radio checkbox input elements in a named set.
150
165
  * The provided keys are the possible radio values while the provided values are human readable labels.
@@ -295,7 +310,10 @@ export function select(selected: string, options: SelectOptions): string;
295
310
  */
296
311
  export function rangePicker(options: RangePickerOptions): Handlebars.SafeString;
297
312
 
298
- interface ColorPickerOptions extends Partial<Handlebars.HelperOptions> {
313
+ /**
314
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
315
+ */
316
+ export interface ColorPickerOptions extends InexactPartial<Handlebars.HelperOptions> {
299
317
  hash: {
300
318
  /**
301
319
  * The name of the field to create
@@ -314,7 +332,10 @@ interface ColorPickerOptions extends Partial<Handlebars.HelperOptions> {
314
332
  };
315
333
  }
316
334
 
317
- interface TextEditorOptions extends Partial<Handlebars.HelperOptions> {
335
+ /**
336
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
337
+ */
338
+ export interface TextEditorOptions extends InexactPartial<Handlebars.HelperOptions> {
318
339
  hash: {
319
340
  /**
320
341
  * The named target data element
@@ -351,12 +372,15 @@ interface TextEditorOptions extends Partial<Handlebars.HelperOptions> {
351
372
  };
352
373
  }
353
374
 
354
- interface FilePickerOptions extends Partial<Handlebars.HelperOptions> {
375
+ /**
376
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
377
+ */
378
+ export interface FilePickerOptions extends InexactPartial<Handlebars.HelperOptions> {
355
379
  hash: {
356
380
  /**
357
381
  * The type of FilePicker instance to display
358
382
  */
359
- type?: foundry.applications.apps.FilePicker.Type;
383
+ type?: foundry.applications.apps.FilePicker.Type | undefined;
360
384
 
361
385
  /**
362
386
  * The field name in the target data
@@ -365,30 +389,18 @@ interface FilePickerOptions extends Partial<Handlebars.HelperOptions> {
365
389
  };
366
390
  }
367
391
 
368
- interface IfThenOptions extends Partial<Handlebars.HelperOptions> {
369
- hash: {
370
- /**
371
- * The test criteria
372
- */
373
- criteria: boolean;
374
-
375
- /**
376
- * The string to output if true
377
- */
378
- ifTrue: string;
379
-
380
- /**
381
- * The string to output if false
382
- */
383
- ifFalse: string;
384
- };
385
- }
386
-
387
- interface LocalizeOptions extends Partial<Handlebars.HelperOptions> {
392
+ /**
393
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
394
+ */
395
+ export interface LocalizeOptions extends InexactPartial<Handlebars.HelperOptions> {
396
+ /** Interpolation data passed to Localization#format */
388
397
  hash: Record<string, unknown>;
389
398
  }
390
399
 
391
- interface NumberFormatOptions extends Partial<Handlebars.HelperOptions> {
400
+ /**
401
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
402
+ */
403
+ export interface NumberFormatOptions extends InexactPartial<Handlebars.HelperOptions> {
392
404
  hash: {
393
405
  /**
394
406
  * The number of decimal places to include in the resulting string
@@ -404,7 +416,10 @@ interface NumberFormatOptions extends Partial<Handlebars.HelperOptions> {
404
416
  };
405
417
  }
406
418
 
407
- interface NumberInputOptions extends Partial<Handlebars.HelperOptions> {
419
+ /**
420
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
421
+ */
422
+ export interface NumberInputOptions extends InexactPartial<Handlebars.HelperOptions> {
408
423
  hash: FormInputConfig<number> &
409
424
  NumberInputConfig & {
410
425
  /**
@@ -414,7 +429,10 @@ interface NumberInputOptions extends Partial<Handlebars.HelperOptions> {
414
429
  };
415
430
  }
416
431
 
417
- interface RadioBoxesOptions extends Partial<Handlebars.HelperOptions> {
432
+ /**
433
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
434
+ */
435
+ export interface RadioBoxesOptions extends InexactPartial<Handlebars.HelperOptions> {
418
436
  hash: {
419
437
  /**
420
438
  * Which key is currently checked?
@@ -430,37 +448,48 @@ interface RadioBoxesOptions extends Partial<Handlebars.HelperOptions> {
430
448
  };
431
449
  }
432
450
 
433
- interface RangePickerOptions extends Partial<Handlebars.HelperOptions> {
434
- /**
435
- * The name of the field to create
436
- * @defaultValue `"range"`
437
- */
438
- name?: string;
439
-
440
- /**
441
- * The current range value
442
- */
443
- value?: number;
444
-
445
- /**
446
- * The minimum allowed value
447
- */
448
- min?: number;
449
-
450
- /**
451
- * The maximum allowed value
452
- */
453
- max?: number;
454
-
455
- /**
456
- * The allowed step size
457
- */
458
- step?: number;
451
+ /**
452
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
453
+ */
454
+ export interface RangePickerOptions extends InexactPartial<Handlebars.HelperOptions> {
455
+ hash?: {
456
+ /**
457
+ * The name of the field to create
458
+ * @defaultValue `"range"`
459
+ */
460
+ name?: string | undefined;
461
+
462
+ /**
463
+ * The current range value
464
+ */
465
+ value?: number | undefined;
466
+
467
+ /**
468
+ * The minimum allowed value
469
+ */
470
+ min?: number | undefined;
471
+
472
+ /**
473
+ * The maximum allowed value
474
+ */
475
+ max?: number | undefined;
476
+
477
+ /**
478
+ * The allowed step size
479
+ */
480
+ step?: number | undefined;
481
+ };
459
482
  }
460
483
 
461
- interface SelectOptions extends Handlebars.HelperOptions {}
484
+ /**
485
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
486
+ */
487
+ export interface SelectOptions extends InexactPartial<Handlebars.HelperOptions> {}
462
488
 
463
- interface SelectOptionsOptions extends Partial<Handlebars.HelperOptions> {
489
+ /**
490
+ * Despite extending Handlebars.HelperOptions, the function does not use the non-hash options
491
+ */
492
+ export interface SelectOptionsOptions extends InexactPartial<Handlebars.HelperOptions> {
464
493
  hash: SelectInputConfig & {
465
494
  /**
466
495
  * The currently selected value or values
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../api/application.d.mts";
3
3
  import type DrawingHUD from "./drawing-hud.d.mts";
4
4
  import type TileHUD from "./tile-hud.d.mts";
@@ -21,6 +21,9 @@ declare class HeadsUpDisplayContainer<
21
21
  Configuration extends HeadsUpDisplayContainer.Configuration = HeadsUpDisplayContainer.Configuration,
22
22
  RenderOptions extends HeadsUpDisplayContainer.RenderOptions = HeadsUpDisplayContainer.RenderOptions,
23
23
  > extends ApplicationV2<RenderContext, Configuration, RenderOptions> {
24
+ // Fake override.
25
+ static override DEFAULT_OPTIONS: HeadsUpDisplayContainer.DefaultOptions;
26
+
24
27
  token: TokenHUD;
25
28
 
26
29
  tile: TileHUD;
@@ -34,7 +37,13 @@ declare namespace HeadsUpDisplayContainer {
34
37
 
35
38
  interface RenderContext extends ApplicationV2.RenderContext {}
36
39
 
37
- interface Configuration extends ApplicationV2.Configuration {}
40
+ interface Configuration<HeadsUpDisplayContainer extends HeadsUpDisplayContainer.Any = HeadsUpDisplayContainer.Any>
41
+ extends ApplicationV2.Configuration<HeadsUpDisplayContainer> {}
42
+
43
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
44
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
45
+ type DefaultOptions<HeadsUpDisplayContainer extends HeadsUpDisplayContainer.Any = HeadsUpDisplayContainer.Any> =
46
+ DeepPartial<Configuration<HeadsUpDisplayContainer>> & object;
38
47
 
39
48
  interface RenderOptions extends ApplicationV2.RenderOptions {}
40
49
  }
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../api/application.d.mts";
3
3
  import type { PlaceableObject } from "#client/canvas/placeables/_module.d.mts";
4
4
 
@@ -20,6 +20,9 @@ declare class BasePlaceableHUD<
20
20
  Configuration extends BasePlaceableHUD.Configuration = BasePlaceableHUD.Configuration,
21
21
  RenderOptions extends BasePlaceableHUD.RenderOptions = BasePlaceableHUD.RenderOptions,
22
22
  > extends ApplicationV2<RenderContext, Configuration, RenderOptions> {
23
+ // Fake override.
24
+ static override DEFAULT_OPTIONS: BasePlaceableHUD.DefaultOptions;
25
+
23
26
  /**
24
27
  * Reference a PlaceableObject this HUD is currently bound to.
25
28
  */
@@ -50,7 +53,16 @@ declare namespace BasePlaceableHUD {
50
53
  // TODO: Remaining properties
51
54
  }
52
55
 
53
- interface Configuration extends ApplicationV2.Configuration {}
56
+ interface Configuration<BasePlaceableHUD extends BasePlaceableHUD.Any = BasePlaceableHUD.Any>
57
+ extends ApplicationV2.Configuration<BasePlaceableHUD> {}
58
+
59
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
60
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
61
+ type DefaultOptions<BasePlaceableHUD extends BasePlaceableHUD.Any = BasePlaceableHUD.Any> = DeepPartial<
62
+ Configuration<BasePlaceableHUD>
63
+ > &
64
+ object;
65
+
54
66
  interface RenderOptions extends ApplicationV2.RenderOptions {}
55
67
  }
56
68
 
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../api/application.d.mts";
3
3
  import type HandlebarsApplicationMixin from "../api/handlebars-application.d.mts";
4
4
 
@@ -18,14 +18,28 @@ declare class DependencyResolution<
18
18
  RenderContext extends DependencyResolution.RenderContext = DependencyResolution.RenderContext,
19
19
  Configuration extends DependencyResolution.Configuration = DependencyResolution.Configuration,
20
20
  RenderOptions extends DependencyResolution.RenderOptions = DependencyResolution.RenderOptions,
21
- > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {}
21
+ > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {
22
+ // Fake override.
23
+ static override DEFAULT_OPTIONS: DependencyResolution.DefaultOptions;
24
+ }
22
25
 
23
26
  declare namespace DependencyResolution {
24
27
  interface Any extends AnyRollResolver {}
25
28
  interface AnyConstructor extends Identity<typeof AnyRollResolver> {}
26
29
 
27
30
  interface RenderContext extends HandlebarsApplicationMixin.RenderContext, ApplicationV2.RenderContext {}
28
- interface Configuration extends HandlebarsApplicationMixin.Configuration, ApplicationV2.Configuration {}
31
+
32
+ interface Configuration<DependencyResolution extends DependencyResolution.Any = DependencyResolution.Any>
33
+ extends HandlebarsApplicationMixin.Configuration,
34
+ ApplicationV2.Configuration<DependencyResolution> {}
35
+
36
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
37
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
38
+ type DefaultOptions<DependencyResolution extends DependencyResolution.Any = DependencyResolution.Any> = DeepPartial<
39
+ Configuration<DependencyResolution>
40
+ > &
41
+ object;
42
+
29
43
  interface RenderOptions extends HandlebarsApplicationMixin.RenderOptions, ApplicationV2.RenderOptions {}
30
44
  }
31
45
 
@@ -1,6 +1,6 @@
1
1
  import type ApplicationV2 from "../../api/application.d.mts";
2
2
  import type HandlebarsApplicationMixin from "../../api/handlebars-application.d.mts";
3
- import type { Identity } from "#utils";
3
+ import type { DeepPartial, Identity } from "#utils";
4
4
 
5
5
  import AVMaster = foundry.av.AVMaster;
6
6
 
@@ -20,7 +20,10 @@ declare class AVConfig<
20
20
  RenderContext extends AVConfig.RenderContext = AVConfig.RenderContext,
21
21
  Configuration extends AVConfig.Configuration = AVConfig.Configuration,
22
22
  RenderOptions extends AVConfig.RenderOptions = AVConfig.RenderOptions,
23
- > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {}
23
+ > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {
24
+ // Fake override.
25
+ static override DEFAULT_OPTIONS: AVConfig.DefaultOptions;
26
+ }
24
27
 
25
28
  declare namespace AVConfig {
26
29
  interface Any extends AnyAVConfig {}
@@ -28,7 +31,9 @@ declare namespace AVConfig {
28
31
 
29
32
  interface RenderContext extends HandlebarsApplicationMixin.RenderContext, ApplicationV2.RenderContext {}
30
33
 
31
- interface Configuration extends HandlebarsApplicationMixin.Configuration, ApplicationV2.Configuration {
34
+ interface Configuration<AVConfig extends AVConfig.Any = AVConfig.Any>
35
+ extends HandlebarsApplicationMixin.Configuration,
36
+ ApplicationV2.Configuration<AVConfig> {
32
37
  /**
33
38
  * The AVMaster instance being configured
34
39
  * @defaultValue `game.webrtc`
@@ -36,6 +41,10 @@ declare namespace AVConfig {
36
41
  webrtc?: AVMaster;
37
42
  }
38
43
 
44
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
45
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
46
+ type DefaultOptions<AVConfig extends AVConfig.Any = AVConfig.Any> = DeepPartial<Configuration<AVConfig>> & object;
47
+
39
48
  interface RenderOptions extends HandlebarsApplicationMixin.RenderOptions, ApplicationV2.RenderOptions {}
40
49
  }
41
50
 
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../../api/application.d.mts";
3
3
  import type HandlebarsApplicationMixin from "../../api/handlebars-application.d.mts";
4
4
 
@@ -17,14 +17,26 @@ declare class DiceConfig<
17
17
  RenderContext extends DiceConfig.RenderContext = DiceConfig.RenderContext,
18
18
  Configuration extends DiceConfig.Configuration = DiceConfig.Configuration,
19
19
  RenderOptions extends DiceConfig.RenderOptions = DiceConfig.RenderOptions,
20
- > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {}
20
+ > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {
21
+ // Fake override.
22
+ static override DEFAULT_OPTIONS: DiceConfig.DefaultOptions;
23
+ }
21
24
 
22
25
  declare namespace DiceConfig {
23
26
  interface Any extends AnyDiceConfig {}
24
27
  interface AnyConstructor extends Identity<typeof AnyDiceConfig> {}
25
28
 
26
29
  interface RenderContext extends HandlebarsApplicationMixin.RenderContext, ApplicationV2.RenderContext {}
27
- interface Configuration extends HandlebarsApplicationMixin.Configuration, ApplicationV2.Configuration {}
30
+
31
+ interface Configuration<DiceConfig extends DiceConfig.Any = DiceConfig.Any>
32
+ extends HandlebarsApplicationMixin.Configuration,
33
+ ApplicationV2.Configuration<DiceConfig> {}
34
+
35
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
36
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
37
+ type DefaultOptions<DiceConfig extends DiceConfig.Any = DiceConfig.Any> = DeepPartial<Configuration<DiceConfig>> &
38
+ object;
39
+
28
40
  interface RenderOptions extends HandlebarsApplicationMixin.RenderOptions, ApplicationV2.RenderOptions {}
29
41
  }
30
42
 
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../../api/application.d.mts";
3
3
  import type HandlebarsApplicationMixin from "../../api/handlebars-application.d.mts";
4
4
 
@@ -19,6 +19,9 @@ declare class FontConfig<
19
19
  Configuration extends FontConfig.Configuration = FontConfig.Configuration,
20
20
  RenderOptions extends FontConfig.RenderOptions = FontConfig.RenderOptions,
21
21
  > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {
22
+ // Fake override.
23
+ static override DEFAULT_OPTIONS: FontConfig.DefaultOptions;
24
+
22
25
  /** Font types */
23
26
  static FONT_TYPES: Readonly<{
24
27
  /** Font is a file */
@@ -34,7 +37,16 @@ declare namespace FontConfig {
34
37
  interface AnyConstructor extends Identity<typeof AnyFontConfig> {}
35
38
 
36
39
  interface RenderContext extends HandlebarsApplicationMixin.RenderContext, ApplicationV2.RenderContext {}
37
- interface Configuration extends HandlebarsApplicationMixin.Configuration, ApplicationV2.Configuration {}
40
+
41
+ interface Configuration<FontConfig extends FontConfig.Any = FontConfig.Any>
42
+ extends HandlebarsApplicationMixin.Configuration,
43
+ ApplicationV2.Configuration<FontConfig> {}
44
+
45
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
46
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
47
+ type DefaultOptions<FontConfig extends FontConfig.Any = FontConfig.Any> = DeepPartial<Configuration<FontConfig>> &
48
+ object;
49
+
38
50
  interface RenderOptions extends HandlebarsApplicationMixin.RenderOptions, ApplicationV2.RenderOptions {}
39
51
 
40
52
  interface NewFontDefinition {
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../../api/application.d.mts";
3
3
  import type HandlebarsApplicationMixin from "../../api/handlebars-application.d.mts";
4
4
 
@@ -18,7 +18,10 @@ declare class PrototypeOverridesConfig<
18
18
  RenderContext extends PrototypeOverridesConfig.RenderContext = PrototypeOverridesConfig.RenderContext,
19
19
  Configuration extends PrototypeOverridesConfig.Configuration = PrototypeOverridesConfig.Configuration,
20
20
  RenderOptions extends PrototypeOverridesConfig.RenderOptions = PrototypeOverridesConfig.RenderOptions,
21
- > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {}
21
+ > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {
22
+ // Fake override.
23
+ static override DEFAULT_OPTIONS: PrototypeOverridesConfig.DefaultOptions;
24
+ }
22
25
 
23
26
  declare namespace PrototypeOverridesConfig {
24
27
  interface Any extends AnyPrototypeOverridesConfig {}
@@ -32,7 +35,15 @@ declare namespace PrototypeOverridesConfig {
32
35
  rootId: string;
33
36
  }
34
37
 
35
- interface Configuration extends HandlebarsApplicationMixin.Configuration, ApplicationV2.Configuration {}
38
+ interface Configuration<PrototypeOverridesConfig extends PrototypeOverridesConfig.Any = PrototypeOverridesConfig.Any>
39
+ extends HandlebarsApplicationMixin.Configuration,
40
+ ApplicationV2.Configuration<PrototypeOverridesConfig> {}
41
+
42
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
43
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
44
+ type DefaultOptions<PrototypeOverridesConfig extends PrototypeOverridesConfig.Any = PrototypeOverridesConfig.Any> =
45
+ DeepPartial<Configuration<PrototypeOverridesConfig>> & object;
46
+
36
47
  interface RenderOptions extends HandlebarsApplicationMixin.RenderOptions, ApplicationV2.RenderOptions {}
37
48
  }
38
49
 
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../../api/application.d.mts";
3
3
  import type HandlebarsApplicationMixin from "../../api/handlebars-application.d.mts";
4
4
 
@@ -16,16 +16,27 @@ declare module "#configuration" {
16
16
  */
17
17
  declare class UIConfig<
18
18
  RenderContext extends UIConfig.RenderContext = UIConfig.RenderContext,
19
- Configuration extends UIConfig.Configuration = ApplicationV2.Configuration,
19
+ Configuration extends UIConfig.Configuration = UIConfig.Configuration,
20
20
  RenderOptions extends UIConfig.RenderOptions = UIConfig.RenderOptions,
21
- > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {}
21
+ > extends HandlebarsApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {
22
+ // Fake override.
23
+ static override DEFAULT_OPTIONS: UIConfig.DefaultOptions;
24
+ }
22
25
 
23
26
  declare namespace UIConfig {
24
27
  interface Any extends AnyUIConfig {}
25
28
  interface AnyConstructor extends Identity<typeof AnyUIConfig> {}
26
29
 
27
30
  interface RenderContext extends HandlebarsApplicationMixin.RenderContext, ApplicationV2.RenderContext {}
28
- interface Configuration extends HandlebarsApplicationMixin.Configuration, ApplicationV2.Configuration {}
31
+
32
+ interface Configuration<UIConfig extends UIConfig.Any = UIConfig.Any>
33
+ extends HandlebarsApplicationMixin.Configuration,
34
+ ApplicationV2.Configuration<UIConfig> {}
35
+
36
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
37
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
38
+ type DefaultOptions<UIConfig extends UIConfig.Any = UIConfig.Any> = DeepPartial<Configuration<UIConfig>> & object;
39
+
29
40
  interface RenderOptions extends HandlebarsApplicationMixin.RenderOptions, ApplicationV2.RenderOptions {}
30
41
 
31
42
  interface GameUIConfiguration {
@@ -1,5 +1,5 @@
1
1
  import type { PrototypeToken } from "#common/data/data.mjs";
2
- import type { Identity } from "#utils";
2
+ import type { DeepPartial, Identity } from "#utils";
3
3
  import type ApplicationV2 from "../../api/application.d.mts";
4
4
  import type TokenApplicationMixin from "./mixin.d.mts";
5
5
 
@@ -19,14 +19,28 @@ declare class PrototypeTokenConfig<
19
19
  RenderContext extends PrototypeTokenConfig.RenderContext = PrototypeTokenConfig.RenderContext,
20
20
  Configuration extends PrototypeTokenConfig.Configuration = PrototypeTokenConfig.Configuration,
21
21
  RenderOptions extends PrototypeTokenConfig.RenderOptions = PrototypeTokenConfig.RenderOptions,
22
- > extends TokenApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {}
22
+ > extends TokenApplicationMixin(ApplicationV2)<RenderContext, Configuration, RenderOptions> {
23
+ // Fake override.
24
+ static override DEFAULT_OPTIONS: PrototypeTokenConfig.DefaultOptions;
25
+ }
23
26
 
24
27
  declare namespace PrototypeTokenConfig {
25
28
  interface Any extends AnyPrototypeTokenConfig {}
26
29
  interface AnyConstructor extends Identity<typeof AnyPrototypeTokenConfig> {}
27
30
 
28
31
  interface RenderContext extends TokenApplicationMixin.RenderContext<PrototypeToken>, ApplicationV2.RenderContext {}
29
- interface Configuration extends TokenApplicationMixin.Configuration, ApplicationV2.Configuration {}
32
+
33
+ interface Configuration<PrototypeTokenConfig extends PrototypeTokenConfig.Any = PrototypeTokenConfig.Any>
34
+ extends TokenApplicationMixin.Configuration,
35
+ ApplicationV2.Configuration<PrototypeTokenConfig> {}
36
+
37
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
38
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
39
+ type DefaultOptions<PrototypeTokenConfig extends PrototypeTokenConfig.Any = PrototypeTokenConfig.Any> = DeepPartial<
40
+ Configuration<PrototypeTokenConfig>
41
+ > &
42
+ object;
43
+
30
44
  interface RenderOptions extends TokenApplicationMixin.RenderOptions, ApplicationV2.RenderOptions {}
31
45
  }
32
46
 
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../../api/application.mjs";
3
3
 
4
4
  declare module "#configuration" {
@@ -17,7 +17,10 @@ declare class ChatPopout<
17
17
  RenderContext extends ChatPopout.RenderContext = ChatPopout.RenderContext,
18
18
  Configuration extends ChatPopout.Configuration = ChatPopout.Configuration,
19
19
  RenderOptions extends ChatPopout.RenderOptions = ChatPopout.RenderOptions,
20
- > extends ApplicationV2<RenderContext, Configuration, RenderOptions> {}
20
+ > extends ApplicationV2<RenderContext, Configuration, RenderOptions> {
21
+ // Fake override.
22
+ static override DEFAULT_OPTIONS: ChatPopout.DefaultOptions;
23
+ }
21
24
 
22
25
  declare namespace ChatPopout {
23
26
  interface Any extends AnyChatPopout {}
@@ -25,11 +28,17 @@ declare namespace ChatPopout {
25
28
 
26
29
  interface RenderContext extends ApplicationV2.RenderContext {}
27
30
 
28
- interface Configuration extends ApplicationV2.Configuration {
31
+ interface Configuration<ChatPopout extends ChatPopout.Any = ChatPopout.Any>
32
+ extends ApplicationV2.Configuration<ChatPopout> {
29
33
  /** The message being rendered. */
30
34
  message: ChatMessage.Implementation;
31
35
  }
32
36
 
37
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
38
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
39
+ type DefaultOptions<ChatPopout extends ChatPopout.Any = ChatPopout.Any> = DeepPartial<Configuration<ChatPopout>> &
40
+ object;
41
+
33
42
  interface RenderOptions extends ApplicationV2.RenderOptions {}
34
43
  }
35
44
 
@@ -1,4 +1,4 @@
1
- import type { Identity } from "#utils";
1
+ import type { DeepPartial, Identity } from "#utils";
2
2
  import type ApplicationV2 from "../../api/application.mjs";
3
3
 
4
4
  declare module "#configuration" {
@@ -17,7 +17,10 @@ declare class FrameViewer<
17
17
  RenderContext extends FrameViewer.RenderContext = FrameViewer.RenderContext,
18
18
  Configuration extends FrameViewer.Configuration = FrameViewer.Configuration,
19
19
  RenderOptions extends FrameViewer.RenderOptions = FrameViewer.RenderOptions,
20
- > extends ApplicationV2<RenderContext, Configuration, RenderOptions> {}
20
+ > extends ApplicationV2<RenderContext, Configuration, RenderOptions> {
21
+ // Fake override.
22
+ static override DEFAULT_OPTIONS: FrameViewer.DefaultOptions;
23
+ }
21
24
 
22
25
  declare namespace FrameViewer {
23
26
  interface Any extends AnyFrameViewer {}
@@ -25,11 +28,17 @@ declare namespace FrameViewer {
25
28
 
26
29
  interface RenderContext extends ApplicationV2.RenderContext {}
27
30
 
28
- interface Configuration extends ApplicationV2.Configuration {
31
+ interface Configuration<FrameViewer extends FrameViewer.Any = FrameViewer.Any>
32
+ extends ApplicationV2.Configuration<FrameViewer> {
29
33
  /** The initial URL to navigate to */
30
34
  url: string;
31
35
  }
32
36
 
37
+ // Note(LukeAbby): This `& object` is so that the `DEFAULT_OPTIONS` can be overridden more easily
38
+ // Without it then `static override DEFAULT_OPTIONS = { unrelatedProp: 123 }` would error.
39
+ type DefaultOptions<FrameViewer extends FrameViewer.Any = FrameViewer.Any> = DeepPartial<Configuration<FrameViewer>> &
40
+ object;
41
+
33
42
  interface RenderOptions extends ApplicationV2.RenderOptions {}
34
43
  }
35
44