@league-of-foundry-developers/foundry-vtt-types 9.242.0 → 9.245.0

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 (87) hide show
  1. package/package.json +1 -1
  2. package/src/foundry/common/utils/primitives.mjs.d.ts +7 -0
  3. package/src/foundry/foundry.js/application.d.ts +138 -110
  4. package/src/foundry/foundry.js/applications/basePlaceableHUD.d.ts +2 -2
  5. package/src/foundry/foundry.js/applications/basePlaceableHUDs/drawingHUD.d.ts +2 -2
  6. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tileHUD.d.ts +2 -2
  7. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +3 -3
  8. package/src/foundry/foundry.js/applications/cameraViews.d.ts +2 -2
  9. package/src/foundry/foundry.js/applications/chatPopout.d.ts +3 -3
  10. package/src/foundry/foundry.js/applications/compendium.d.ts +2 -2
  11. package/src/foundry/foundry.js/applications/dialog.d.ts +1 -1
  12. package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
  13. package/src/foundry/foundry.js/applications/formApplication.d.ts +45 -14
  14. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +1 -1
  15. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -2
  16. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +1 -1
  17. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +20 -31
  18. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  19. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
  20. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +3 -3
  21. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +4 -4
  22. package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +3 -3
  23. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +2 -2
  24. package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
  25. package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +1 -1
  26. package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +3 -3
  27. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +3 -3
  28. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +3 -3
  29. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +2 -2
  30. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +3 -3
  31. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +3 -3
  32. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +2 -2
  33. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +4 -4
  34. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +2 -2
  35. package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +7 -7
  36. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
  37. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +3 -3
  38. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  39. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  40. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +2 -2
  41. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +2 -2
  42. package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +2 -2
  43. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +1 -1
  44. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +3 -3
  45. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +3 -3
  46. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +1 -1
  47. package/src/foundry/foundry.js/applications/frameViewer.d.ts +1 -1
  48. package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +2 -2
  49. package/src/foundry/foundry.js/applications/hotbar.d.ts +2 -2
  50. package/src/foundry/foundry.js/applications/mainMenu.d.ts +2 -2
  51. package/src/foundry/foundry.js/applications/notifications.d.ts +7 -4
  52. package/src/foundry/foundry.js/applications/pause.d.ts +2 -2
  53. package/src/foundry/foundry.js/applications/playerList.d.ts +2 -2
  54. package/src/foundry/foundry.js/applications/sceneControls.d.ts +2 -2
  55. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +3 -3
  56. package/src/foundry/foundry.js/applications/sidebar.d.ts +2 -2
  57. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +4 -7
  58. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +1 -1
  59. package/src/foundry/foundry.js/applications/sidebarTabs/combatTracker.d.ts +26 -28
  60. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  61. package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +2 -2
  62. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +1 -1
  63. package/src/foundry/foundry.js/canvas.d.ts +5 -0
  64. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -1
  65. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +8 -4
  66. package/src/foundry/foundry.js/clientDocuments/card.d.ts +2 -1
  67. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +1 -6
  68. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +15 -9
  69. package/src/foundry/foundry.js/clientSettings.d.ts +1 -1
  70. package/src/foundry/foundry.js/collections/documentCollection.d.ts +1 -1
  71. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/folders.d.ts +1 -1
  72. package/src/foundry/foundry.js/config.d.ts +5 -2
  73. package/src/foundry/foundry.js/dragDrop.d.ts +27 -34
  74. package/src/foundry/foundry.js/pixi/index.d.ts +2 -0
  75. package/src/foundry/foundry.js/pixi/meshes/index.d.ts +1 -0
  76. package/src/foundry/foundry.js/pixi/meshes/samplerMesh.d.ts +22 -0
  77. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +8 -0
  78. package/src/foundry/foundry.js/pixi/rectangles/normalizedRectangle.d.ts +7 -0
  79. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +1 -1
  80. package/src/foundry/foundry.js/pixi/transforms/index.d.ts +1 -0
  81. package/src/foundry/foundry.js/pixi/transforms/synchronizedTransform.d.ts +38 -0
  82. package/src/foundry/foundry.js/quadtree.d.ts +2 -2
  83. package/src/foundry/foundry.js/roll.d.ts +13 -11
  84. package/src/foundry/foundry.js/searchFilter.d.ts +37 -33
  85. package/src/foundry/foundry.js/textureLoader.d.ts +28 -18
  86. package/src/foundry/foundry.js/textureUtils.d.ts +5 -8
  87. package/src/foundry/foundry.js/videoHelper.d.ts +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@league-of-foundry-developers/foundry-vtt-types",
3
- "version": "9.242.0",
3
+ "version": "9.245.0",
4
4
  "description": "TypeScript type definitions for Foundry VTT",
5
5
  "exports": {
6
6
  ".": {
@@ -198,6 +198,13 @@ interface NumberConstructor {
198
198
  * @returns Is it a number?
199
199
  */
200
200
  isNumeric(n: unknown): n is number;
201
+
202
+ /**
203
+ * Attempt to create a number from a user-provided string.
204
+ * @param str - The string.
205
+ * @returns The number that the string represents, or NaN if no number could be determined.
206
+ */
207
+ fromString(str: string): number;
201
208
  }
202
209
 
203
210
  interface ArrayConstructor {
@@ -11,11 +11,115 @@ declare let _maxZ: number;
11
11
  declare const MIN_WINDOW_WIDTH: 200;
12
12
  declare const MIN_WINDOW_HEIGHT: 50;
13
13
 
14
+ interface ApplicationOptions {
15
+ /**
16
+ * A named "base application" which generates an additional hook
17
+ * @defaultValue `null`
18
+ */
19
+ baseApplication: string | null;
20
+
21
+ /**
22
+ * The default pixel width for the rendered HTML
23
+ * @defaultValue `null`
24
+ */
25
+ width: number | null;
26
+
27
+ /**
28
+ * The default pixel height for the rendered HTML
29
+ * @defaultValue `null`
30
+ */
31
+ height: number | 'auto' | null;
32
+
33
+ /**
34
+ * The default offset-top position for the rendered HTML
35
+ * @defaultValue `null`
36
+ */
37
+ top: number | null;
38
+
39
+ /**
40
+ * The default offset-left position for the rendered HTML
41
+ * @defaultValue `null`
42
+ */
43
+ left: number | null;
44
+
45
+ /**
46
+ * A transformation scale for the rendered HTML
47
+ * @defaultValue `null`
48
+ */
49
+ scale: number | null;
50
+
51
+ /**
52
+ * Whether to display the application as a pop-out container
53
+ * @defaultValue `true`
54
+ */
55
+ popOut: boolean;
56
+
57
+ /**
58
+ * Whether the rendered application can be minimized (popOut only)
59
+ * @defaultValue `true`
60
+ */
61
+ minimizable: boolean;
62
+
63
+ /**
64
+ * Whether the rendered application can be drag-resized (popOut only)
65
+ * @defaultValue `false`
66
+ */
67
+ resizable: boolean;
68
+
69
+ /**
70
+ * The default CSS id to assign to the rendered HTML
71
+ * @defaultValue `""`
72
+ */
73
+ id: string;
74
+
75
+ /**
76
+ * An array of CSS string classes to apply to the rendered HTML
77
+ * @defaultValue `[]`
78
+ */
79
+ classes: string[];
80
+
81
+ /**
82
+ * A default window title string (popOut only)
83
+ * @defaultValue `""`
84
+ */
85
+ title: string;
86
+
87
+ /**
88
+ * The default HTML template path to render for this Application
89
+ * @defaultValue `null`
90
+ */
91
+ template: string | null;
92
+
93
+ /**
94
+ * A list of unique CSS selectors which target containers that should
95
+ * have their vertical scroll positions preserved during a re-render.
96
+ * @defaultValue `[]`
97
+ */
98
+ scrollY: string[];
99
+
100
+ /**
101
+ * An array of tabbed container configurations which should be enabled
102
+ * for the application.
103
+ * @defaultValue `[]`
104
+ */
105
+ tabs: Omit<TabsConfiguration, 'callback'>[];
106
+
107
+ /**
108
+ * @defaultValue `[]`
109
+ */
110
+ dragDrop: Omit<DragDropConfiguration, 'permissions' | 'callbacks'>[];
111
+
112
+ /**
113
+ * @defaultValue `[]`
114
+ */
115
+ filters: Omit<SearchFilterConfiguration, 'callback'>[];
116
+ }
117
+
14
118
  /**
15
119
  * The standard application window that is rendered for a large variety of UI elements in Foundry VTT.
16
120
  * @typeParam Options - the type of the options object
17
121
  */
18
- declare abstract class Application<Options extends Application.Options = Application.Options> {
122
+ declare abstract class Application<Options extends ApplicationOptions = ApplicationOptions> {
19
123
  /**
20
124
  * @param options - Configuration options which control how the application is rendered.
21
125
  * Application subclasses may add additional supported options, but the
@@ -87,7 +191,7 @@ declare abstract class Application<Options extends Application.Options = Applica
87
191
  * Track the most recent scroll positions for any vertically scrolling containers
88
192
  * @defaultValue `null`
89
193
  */
90
- protected _scrollPositions: Partial<Record<string, number>> | null;
194
+ protected _scrollPositions: Record<string, number> | null;
91
195
 
92
196
  /**
93
197
  * The sequence of rendering states that track the Application life-cycle.
@@ -105,18 +209,21 @@ declare abstract class Application<Options extends Application.Options = Applica
105
209
  /**
106
210
  * Create drag-and-drop workflow handlers for this Application
107
211
  * @returns An array of DragDrop handlers
212
+ * @internal
108
213
  */
109
214
  protected _createDragDropHandlers(): DragDrop[];
110
215
 
111
216
  /**
112
217
  * Create tabbed navigation handlers for this Application
113
218
  * @returns An array of Tabs handlers
219
+ * @internal
114
220
  */
115
221
  protected _createTabHandlers(): Tabs[];
116
222
 
117
223
  /**
118
224
  * Create search filter handlers for this Application
119
225
  * @returns An array of SearchFilter handlers
226
+ * @internal
120
227
  */
121
228
  protected _createSearchFilters(): SearchFilter[];
122
229
 
@@ -125,7 +232,7 @@ declare abstract class Application<Options extends Application.Options = Applica
125
232
  * in this object are merged with any provided option values which are passed to the constructor upon initialization.
126
233
  * Application subclasses may include additional options which are specific to their usage.
127
234
  */
128
- static get defaultOptions(): Application.Options;
235
+ static get defaultOptions(): ApplicationOptions;
129
236
 
130
237
  /**
131
238
  * Return the CSS application ID which uniquely references this UI element
@@ -193,45 +300,52 @@ declare abstract class Application<Options extends Application.Options = Applica
193
300
 
194
301
  /**
195
302
  * Return the inheritance chain for this Application class up to (and including) it's base Application class.
303
+ * @internal
196
304
  */
197
305
  protected static _getInheritanceChain(): typeof Application[];
198
306
 
199
307
  /**
200
308
  * Persist the scroll positions of containers within the app before re-rendering the content
201
309
  * @param html - The HTML object being traversed
310
+ * @internal
202
311
  */
203
312
  protected _saveScrollPositions(html: JQuery): void;
204
313
 
205
314
  /**
206
315
  * Restore the scroll positions of containers within the app after re-rendering the content
207
316
  * @param html - The HTML object being traversed
317
+ * @internal
208
318
  */
209
319
  protected _restoreScrollPositions(html: JQuery): void;
210
320
 
211
321
  /**
212
322
  * Render the outer application wrapper
213
323
  * @returns A promise resolving to the constructed jQuery object
324
+ * @internal
214
325
  */
215
- protected _renderOuter(): Promise<HTMLElement> | Promise<JQuery<JQuery.Node>>;
326
+ protected _renderOuter(): Promise<JQuery>;
216
327
 
217
328
  /**
218
329
  * Render the inner application content
219
330
  * @param data - The data used to render the inner template
220
331
  * @returns A promise resolving to the constructed jQuery object
221
332
  * @remarks Some subclasses do not return a promise but the jQuery object directly.
333
+ * @internal
222
334
  */
223
- protected _renderInner(data: object): Promise<JQuery> | JQuery;
335
+ protected _renderInner(data: object): Promise<JQuery>;
224
336
 
225
337
  /**
226
338
  * Customize how inner HTML is replaced when the application is refreshed
227
339
  * @param element - The original HTML processed as a jQuery object
228
340
  * @param html - New updated HTML as a jQuery object
341
+ * @internal
229
342
  */
230
343
  protected _replaceHTML(element: JQuery, html: JQuery): void;
231
344
 
232
345
  /**
233
346
  * Customize how a new HTML Application is added and first appears in the DOC
234
347
  * @param html - The HTML element which is ready to be added to the DOM
348
+ * @internal
235
349
  */
236
350
  protected _injectHTML(html: JQuery): void;
237
351
 
@@ -239,9 +353,17 @@ declare abstract class Application<Options extends Application.Options = Applica
239
353
  * Specify the set of config buttons which should appear in the Application header.
240
354
  * Buttons should be returned as an Array of objects.
241
355
  * The header buttons which are added to the application can be modified by the getApplicationHeaderButtons hook.
356
+ * @internal
242
357
  */
243
358
  protected _getHeaderButtons(): Application.HeaderButton[];
244
359
 
360
+ /**
361
+ * Create a {@link ContextMenu} for this Application.
362
+ * @param html - The Application's HTML.
363
+ * @internal
364
+ */
365
+ protected _contextMenu(html: JQuery): void;
366
+
245
367
  /**
246
368
  * Activate required listeners which must be enabled on every Application.
247
369
  * These are internal interactions which should not be overridden by downstream subclasses.
@@ -262,6 +384,7 @@ declare abstract class Application<Options extends Application.Options = Applica
262
384
  * (unused)
263
385
  * @param active - The new active tab name
264
386
  * (unused)
387
+ * @internal
265
388
  */
266
389
  protected _onChangeTab(event: MouseEvent | null, tabs: Tabs, active: string): void;
267
390
 
@@ -275,6 +398,7 @@ declare abstract class Application<Options extends Application.Options = Applica
275
398
  * (unused)
276
399
  * @param html - The HTML element which should be filtered
277
400
  * (unused)
401
+ * @internal
278
402
  */
279
403
  protected _onSearchFilter(event: KeyboardEvent, query: string, rgx: RegExp, html: HTMLElement): void;
280
404
 
@@ -283,6 +407,7 @@ declare abstract class Application<Options extends Application.Options = Applica
283
407
  * @param selector - The candidate HTML selector for dragging
284
408
  * (unused)
285
409
  * @returns Can the current user drag this selector?
410
+ * @internal
286
411
  */
287
412
  protected _canDragStart(selector: string): boolean;
288
413
 
@@ -291,6 +416,7 @@ declare abstract class Application<Options extends Application.Options = Applica
291
416
  * @param selector - The candidate HTML selector for the drop target
292
417
  * (unused)
293
418
  * @returns Can the current user drop on this selector?
419
+ * @internal
294
420
  */
295
421
  protected _canDragDrop(selector: string): boolean;
296
422
 
@@ -298,6 +424,7 @@ declare abstract class Application<Options extends Application.Options = Applica
298
424
  * Callback actions which occur at the beginning of a drag start workflow.
299
425
  * @param event - The originating DragEvent
300
426
  * (unused)
427
+ * @internal
301
428
  */
302
429
  protected _onDragStart(event: DragEvent): void;
303
430
 
@@ -305,6 +432,7 @@ declare abstract class Application<Options extends Application.Options = Applica
305
432
  * Callback actions which occur when a dragged element is over a drop target.
306
433
  * @param event - originating DragEvent
307
434
  * (unused)
435
+ * @internal
308
436
  */
309
437
  protected _onDragOver(event: DragEvent): void;
310
438
 
@@ -313,6 +441,7 @@ declare abstract class Application<Options extends Application.Options = Applica
313
441
  * @param event - The originating DragEvent
314
442
  * (unused)
315
443
  * @internal
444
+ * @internal
316
445
  */
317
446
  protected _onDrop(event: DragEvent): void;
318
447
 
@@ -384,118 +513,17 @@ declare namespace Application {
384
513
  onclick: ((ev: JQuery.ClickEvent) => void) | null;
385
514
  }
386
515
 
387
- interface Options {
388
- /**
389
- * A named "base application" which generates an additional hook
390
- * @defaultValue `null`
391
- */
392
- baseApplication: string | null;
393
-
394
- /**
395
- * The default pixel width for the rendered HTML
396
- * @defaultValue `null`
397
- */
398
- width: number | null;
399
-
400
- /**
401
- * The default pixel height for the rendered HTML
402
- * @defaultValue `null`
403
- */
404
- height: number | 'auto' | null;
405
-
406
- /**
407
- * The default offset-top position for the rendered HTML
408
- * @defaultValue `null`
409
- */
410
- top: number | null;
411
-
412
- /**
413
- * The default offset-left position for the rendered HTML
414
- * @defaultValue `null`
415
- */
416
- left: number | null;
417
-
418
- /**
419
- * A transformation scale for the rendered HTML
420
- */
421
- scale?: number | null | undefined;
422
-
423
- /**
424
- * Whether to display the application as a pop-out container
425
- * @defaultValue `true`
426
- */
427
- popOut: boolean;
428
-
429
- /**
430
- * Whether the rendered application can be minimized (popOut only)
431
- * @defaultValue `true`
432
- */
433
- minimizable: boolean;
434
-
435
- /**
436
- * Whether the rendered application can be drag-resized (popOut only)
437
- * @defaultValue `false`
438
- */
439
- resizable: boolean;
440
-
441
- /**
442
- * The default CSS id to assign to the rendered HTML
443
- * @defaultValue `""`
444
- */
445
- id: string;
446
-
447
- /**
448
- * An array of CSS string classes to apply to the rendered HTML
449
- * @defaultValue `[]`
450
- */
451
- classes: string[];
452
-
453
- /**
454
- * A default window title string (popOut only)
455
- * @defaultValue `""`
456
- */
457
- title: string;
458
-
459
- /**
460
- * The default HTML template path to render for this Application
461
- * @defaultValue `null`
462
- */
463
- template: string | null;
464
-
465
- /**
466
- * A list of unique CSS selectors which target containers that should
467
- * have their vertical scroll positions preserved during a re-render.
468
- * @defaultValue `[]`
469
- */
470
- scrollY: string[];
471
-
472
- /**
473
- * An array of tabbed container configurations which should be enabled
474
- * for the application.
475
- * @defaultValue `[]`
476
- */
477
- tabs: Omit<TabsConfiguration, 'callback'>[];
478
-
479
- /**
480
- * @defaultValue `[]`
481
- */
482
- dragDrop: Omit<DragDrop.Options, 'permissions' | 'callbacks'>[];
483
-
484
- /**
485
- * @defaultValue `[]`
486
- */
487
- filters: Omit<SearchFilter.Options, 'callback'>[];
488
- }
489
-
490
516
  interface Position {
491
517
  width: number | null;
492
518
  height: number | null | 'auto';
493
519
  left: number | null;
494
520
  top: number | null;
495
- scale: number | null | undefined;
521
+ scale: number | null;
522
+ /** @defaultValue `0` */
523
+ zIndex: number;
496
524
  }
497
525
 
498
- type RenderOptions<Options extends Application.Options = Application.Options> = Partial<Options> & {
526
+ type RenderOptions<Options extends ApplicationOptions = ApplicationOptions> = Partial<Options> & {
499
527
  /**
500
528
  * The left positioning attribute
501
529
  */
@@ -5,7 +5,7 @@
5
5
  */
6
6
  declare abstract class BasePlaceableHUD<
7
7
  Object extends PlaceableObject<any> = PlaceableObject,
8
- Options extends Application.Options = Application.Options
8
+ Options extends ApplicationOptions = ApplicationOptions
9
9
  > extends Application<Options> {
10
10
  /**
11
11
  * Reference a PlaceableObject this HUD is currently bound to
@@ -23,7 +23,7 @@ declare abstract class BasePlaceableHUD<
23
23
  * })
24
24
  * ```
25
25
  */
26
- static get defaultOptions(): Application.Options;
26
+ static get defaultOptions(): ApplicationOptions;
27
27
 
28
28
  /**
29
29
  * Convenience access for the canvas layer which this HUD modifies
@@ -5,7 +5,7 @@ declare global {
5
5
  * An implementation of the PlaceableHUD base class which renders a heads-up-display interface for Drawing objects.
6
6
  * @typeParam Options - the type of the options object
7
7
  */
8
- class DrawingHUD<Options extends Application.Options = Application.Options> extends BasePlaceableHUD<
8
+ class DrawingHUD<Options extends ApplicationOptions = ApplicationOptions> extends BasePlaceableHUD<
9
9
  ConcreteDrawing,
10
10
  Options
11
11
  > {
@@ -19,7 +19,7 @@ declare global {
19
19
  * })
20
20
  * ```
21
21
  */
22
- static get defaultOptions(): Application.Options;
22
+ static get defaultOptions(): ApplicationOptions;
23
23
 
24
24
  /** @override */
25
25
  getData(options?: Partial<Options>): ReturnType<BasePlaceableHUD<ConcreteDrawing>['getData']> & {
@@ -5,7 +5,7 @@ declare global {
5
5
  * An implementation of the PlaceableHUD base class which renders a heads-up-display interface for Tile objects.
6
6
  * @typeParam Options - the type of the options object
7
7
  */
8
- class TileHUD<Options extends Application.Options = Application.Options> extends BasePlaceableHUD<
8
+ class TileHUD<Options extends ApplicationOptions = ApplicationOptions> extends BasePlaceableHUD<
9
9
  ConcreteTile,
10
10
  Options
11
11
  > {
@@ -19,7 +19,7 @@ declare global {
19
19
  * })
20
20
  * ```
21
21
  */
22
- static get defaultOptions(): Application.Options;
22
+ static get defaultOptions(): ApplicationOptions;
23
23
 
24
24
  /** @override */
25
25
  getData(options?: Partial<Options>): ReturnType<BasePlaceableHUD<ConcreteTile>['getData']> & {
@@ -6,7 +6,7 @@ declare global {
6
6
  * This interface provides controls for visibility, attribute bars, elevation, status effects, and more.
7
7
  * @typeParam Options - the type of the options object
8
8
  */
9
- class TokenHUD<Options extends Application.Options = Application.Options> extends BasePlaceableHUD<
9
+ class TokenHUD<Options extends ApplicationOptions = ApplicationOptions> extends BasePlaceableHUD<
10
10
  ConcreteToken,
11
11
  Options
12
12
  > {
@@ -27,7 +27,7 @@ declare global {
27
27
  * })
28
28
  * ```
29
29
  */
30
- static get defaultOptions(): Application.Options;
30
+ static get defaultOptions(): ApplicationOptions;
31
31
 
32
32
  /** @override */
33
33
  bind(object: ConcreteToken): void;
@@ -44,7 +44,7 @@ declare global {
44
44
  setPosition(_position?: Partial<Application.Position>): void;
45
45
 
46
46
  /** @override */
47
- getData(options?: Partial<Application.Options>): ReturnType<BasePlaceableHUD<ConcreteToken>['getData']> & {
47
+ getData(options?: Partial<ApplicationOptions>): ReturnType<BasePlaceableHUD<ConcreteToken>['getData']> & {
48
48
  canConfigure: boolean;
49
49
  canToggleCombat: boolean;
50
50
  displayBar1: boolean;
@@ -4,7 +4,7 @@
4
4
  * @typeParam Data - The data structure used to render the handlebars template.
5
5
  */
6
6
  declare class CameraViews<
7
- Options extends Application.Options = Application.Options,
7
+ Options extends ApplicationOptions = ApplicationOptions,
8
8
  Data extends object = CameraViews.Data
9
9
  > extends Application<Options> {
10
10
  /**
@@ -18,7 +18,7 @@ declare class CameraViews<
18
18
  * })
19
19
  * ```
20
20
  */
21
- static get defaultOptions(): Application.Options;
21
+ static get defaultOptions(): ApplicationOptions;
22
22
 
23
23
  /**
24
24
  * A reference to the master AV orchestrator instance
@@ -5,7 +5,7 @@ declare global {
5
5
  * A simple application which supports popping a ChatMessage out to a separate UI window.
6
6
  * @typeParam Options - the type of the options object
7
7
  */
8
- class ChatPopout<Options extends Application.Options = Application.Options> extends Application<Options> {
8
+ class ChatPopout<Options extends ApplicationOptions = ApplicationOptions> extends Application<Options> {
9
9
  constructor(message: InstanceType<ConfiguredDocumentClass<typeof ChatMessage>>, options?: Partial<Options>);
10
10
 
11
11
  /**
@@ -24,7 +24,7 @@ declare global {
24
24
  * })
25
25
  * ```
26
26
  */
27
- static get defaultOptions(): Application.Options;
27
+ static get defaultOptions(): ApplicationOptions;
28
28
 
29
29
  /** @override */
30
30
  get id(): string;
@@ -37,6 +37,6 @@ declare global {
37
37
  * @param options - (unused)
38
38
  * @override
39
39
  */
40
- protected _renderInner(data: object, options?: unknown): Promise<JQuery> | JQuery;
40
+ protected _renderInner(data: object, options?: unknown): Promise<JQuery>;
41
41
  }
42
42
  }
@@ -5,7 +5,7 @@
5
5
  */
6
6
  declare class Compendium<
7
7
  Metadata extends CompendiumCollection.Metadata,
8
- Options extends Application.Options = Application.Options
8
+ Options extends ApplicationOptions = ApplicationOptions
9
9
  > extends Application<Options> {
10
10
  constructor(collection: CompendiumCollection<Metadata>, options?: Partial<Options>);
11
11
 
@@ -27,7 +27,7 @@ declare class Compendium<
27
27
  * });
28
28
  * ```
29
29
  */
30
- static get defaultOptions(): Application.Options;
30
+ static get defaultOptions(): ApplicationOptions;
31
31
 
32
32
  /** @override */
33
33
  get title(): string;
@@ -193,7 +193,7 @@ declare namespace Dialog {
193
193
  default: string;
194
194
  }
195
195
 
196
- interface Options extends Application.Options {
196
+ interface Options extends ApplicationOptions {
197
197
  /**
198
198
  * @defaultValue `400`
199
199
  */
@@ -470,7 +470,7 @@ declare namespace FilePicker {
470
470
  /**
471
471
  * Options for configuring FilePicker
472
472
  */
473
- interface Options extends Application.Options {
473
+ interface Options extends ApplicationOptions {
474
474
  /**
475
475
  * A type of file to target, in "audio", "image", "video", "imagevideo" or "folder"
476
476
  */
@@ -1,3 +1,40 @@
1
+ interface FormApplicationOptions extends ApplicationOptions {
2
+ /**
3
+ * Whether to automatically close the application when it's contained
4
+ * form is submitted.
5
+ * @defaultValue `true`
6
+ */
7
+ closeOnSubmit: boolean;
8
+
9
+ /**
10
+ * Whether to automatically submit the contained HTML form when an input
11
+ * or select element is changed.
12
+ * @defaultValue `false`
13
+ */
14
+ submitOnChange: boolean;
15
+
16
+ /**
17
+ * Whether to automatically submit the contained HTML form when the
18
+ * application window is manually closed.
19
+ * @defaultValue `false`
20
+ */
21
+ submitOnClose: boolean;
22
+
23
+ /**
24
+ * Whether the application form is editable - if true, it's fields will
25
+ * be unlocked and the form can be submitted. If false, all form fields
26
+ * will be disabled and the form cannot be submitted.
27
+ * @defaultValue `true`
28
+ */
29
+ editable: boolean;
30
+
31
+ /**
32
+ * Support configuration of the sheet type used for this application.
33
+ * @defaultValue `false`
34
+ */
35
+ sheetConfig: boolean;
36
+ }
37
+
1
38
  /**
2
39
  * An abstract pattern for defining an Application responsible for updating some object using an HTML form
3
40
  *
@@ -11,7 +48,7 @@
11
48
  * @typeParam ConcreteObject - the type of the object or {@link foundry.abstract.Document} which is modified by this form
12
49
  */
13
50
  declare abstract class FormApplication<
14
- Options extends FormApplication.Options = FormApplication.Options,
51
+ Options extends FormApplicationOptions = FormApplicationOptions,
15
52
  Data extends object = FormApplication.Data<{}, Options>,
16
53
  ConcreteObject = Data extends FormApplication.Data<infer T, Options> ? T : {}
17
54
  > extends Application<Options> {
@@ -46,7 +83,7 @@ declare abstract class FormApplication<
46
83
  * The values of this Array are inner-objects with references to the MCE editor and other metadata
47
84
  * @defaultValue `{}`
48
85
  */
49
- editors: Partial<Record<string, FormApplication.FormApplicationEditor>>;
86
+ editors: Record<string, FormApplication.FormApplicationEditor>;
50
87
 
51
88
  /**
52
89
  * Assign the default options which are supported by the entity edit sheet.
@@ -56,15 +93,16 @@ declare abstract class FormApplication<
56
93
  * @defaultValue
57
94
  * ```typescript
58
95
  * foundry.utils.mergeObject(super.defaultOptions, {
59
- * classes: ['form'],
96
+ * classes: ["form"],
60
97
  * closeOnSubmit: true,
98
+ * editable: true,
99
+ * sheetConfig: false,
61
100
  * submitOnChange: false,
62
- * submitOnClose: false,
63
- * editable: true
101
+ * submitOnClose: false
64
102
  * });
65
103
  * ```
66
104
  */
67
- static get defaultOptions(): FormApplication.Options;
105
+ static get defaultOptions(): FormApplicationOptions;
68
106
 
69
107
  /**
70
108
  * Is the Form Application currently editable?
@@ -257,7 +295,7 @@ declare namespace FormApplication {
257
295
  * @typeParam ConcreteObject - the type of the object
258
296
  * @typeParam Options - the type of the options object
259
297
  */
260
- interface Data<ConcreteObject, Options extends FormApplication.Options = FormApplication.Options> {
298
+ interface Data<ConcreteObject, Options extends FormApplicationOptions = FormApplicationOptions> {
261
299
  object: ConcreteObject;
262
300
  options: Options;
263
301
  title: string;
@@ -295,11 +333,4 @@ declare namespace FormApplication {
295
333
  */
296
334
  preventRender?: boolean;
297
335
  }
298
-
299
- interface Options extends Application.Options, ApplicationOptions {
300
- /**
301
- * @defaultValue `['form']`
302
- */
303
- classes: string[];
304
- }
305
336
  }