@league-of-foundry-developers/foundry-vtt-types 0.8.9-6 → 9.238.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 (211) hide show
  1. package/README.md +44 -27
  2. package/index-lenient.d.ts +10 -0
  3. package/index.d.ts +2 -2
  4. package/package.json +43 -15
  5. package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
  6. package/src/foundry/common/abstract/document.mjs.d.ts +30 -12
  7. package/src/foundry/common/config.mjs/index.d.ts +1 -0
  8. package/src/foundry/common/config.mjs/releaseData.d.ts +98 -0
  9. package/src/foundry/common/constants.mjs.d.ts +402 -213
  10. package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +36 -29
  11. package/src/foundry/common/data/data.mjs/actorData.d.ts +32 -21
  12. package/src/foundry/common/data/data.mjs/adventureData.d.ts +165 -0
  13. package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +45 -124
  14. package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +49 -77
  15. package/src/foundry/common/data/data.mjs/animationData.d.ts +17 -9
  16. package/src/foundry/common/data/data.mjs/cardData.d.ts +265 -0
  17. package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +66 -0
  18. package/src/foundry/common/data/data.mjs/cardsData.d.ts +238 -0
  19. package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +51 -39
  20. package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +18 -11
  21. package/src/foundry/common/data/data.mjs/combatData.d.ts +51 -25
  22. package/src/foundry/common/data/data.mjs/combatantData.d.ts +48 -30
  23. package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +8 -7
  24. package/src/foundry/common/data/data.mjs/drawingData.d.ts +72 -66
  25. package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +21 -25
  26. package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +24 -23
  27. package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +23 -16
  28. package/src/foundry/common/data/data.mjs/folderData.d.ts +28 -25
  29. package/src/foundry/common/data/data.mjs/index.d.ts +5 -0
  30. package/src/foundry/common/data/data.mjs/itemData.d.ts +26 -18
  31. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +21 -20
  32. package/src/foundry/common/data/data.mjs/lightData.d.ts +228 -0
  33. package/src/foundry/common/data/data.mjs/macroData.d.ts +52 -35
  34. package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +41 -38
  35. package/src/foundry/common/data/data.mjs/noteData.d.ts +47 -37
  36. package/src/foundry/common/data/data.mjs/playlistData.d.ts +55 -26
  37. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +32 -16
  38. package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +7 -11
  39. package/src/foundry/common/data/data.mjs/rollTableData.d.ts +30 -24
  40. package/src/foundry/common/data/data.mjs/sceneData.d.ts +132 -111
  41. package/src/foundry/common/data/data.mjs/settingData.d.ts +11 -8
  42. package/src/foundry/common/data/data.mjs/tableResultData.d.ts +30 -26
  43. package/src/foundry/common/data/data.mjs/tileData.d.ts +43 -36
  44. package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +10 -9
  45. package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +6 -3
  46. package/src/foundry/common/data/data.mjs/tokenData.d.ts +105 -157
  47. package/src/foundry/common/data/data.mjs/userData.d.ts +111 -33
  48. package/src/foundry/common/data/data.mjs/videoData.d.ts +9 -8
  49. package/src/foundry/common/data/data.mjs/wallData.d.ts +67 -39
  50. package/src/foundry/common/data/fields.mjs.d.ts +180 -83
  51. package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +9 -3
  52. package/src/foundry/common/documents.mjs/baseActor.d.ts +17 -45
  53. package/src/foundry/common/documents.mjs/baseAdventure.d.ts +38 -0
  54. package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +3 -0
  55. package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +3 -1
  56. package/src/foundry/common/documents.mjs/baseCard.d.ts +62 -0
  57. package/src/foundry/common/documents.mjs/baseCards.d.ts +39 -0
  58. package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +3 -0
  59. package/src/foundry/common/documents.mjs/baseCombat.d.ts +5 -2
  60. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +10 -1
  61. package/src/foundry/common/documents.mjs/baseDrawing.d.ts +11 -1
  62. package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +4 -3
  63. package/src/foundry/common/documents.mjs/baseFolder.d.ts +10 -1
  64. package/src/foundry/common/documents.mjs/baseItem.d.ts +11 -29
  65. package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +3 -0
  66. package/src/foundry/common/documents.mjs/baseMacro.d.ts +16 -14
  67. package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +4 -1
  68. package/src/foundry/common/documents.mjs/baseNote.d.ts +2 -2
  69. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +1 -0
  70. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +2 -1
  71. package/src/foundry/common/documents.mjs/baseRollTable.d.ts +3 -0
  72. package/src/foundry/common/documents.mjs/baseScene.d.ts +1 -0
  73. package/src/foundry/common/documents.mjs/baseSetting.d.ts +1 -0
  74. package/src/foundry/common/documents.mjs/baseTableResult.d.ts +10 -3
  75. package/src/foundry/common/documents.mjs/baseTile.d.ts +1 -0
  76. package/src/foundry/common/documents.mjs/baseToken.d.ts +3 -0
  77. package/src/foundry/common/documents.mjs/baseUser.d.ts +7 -1
  78. package/src/foundry/common/documents.mjs/baseWall.d.ts +7 -10
  79. package/src/foundry/common/documents.mjs/index.d.ts +3 -0
  80. package/src/foundry/common/module.mjs.d.ts +3 -0
  81. package/src/foundry/common/packages.mjs/moduleData.d.ts +12 -9
  82. package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +24 -24
  83. package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +27 -21
  84. package/src/foundry/common/packages.mjs/packageData.d.ts +108 -82
  85. package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +18 -11
  86. package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +16 -15
  87. package/src/foundry/common/packages.mjs/systemData.d.ts +21 -20
  88. package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +3 -3
  89. package/src/foundry/common/packages.mjs/worldData.d.ts +29 -18
  90. package/src/foundry/common/types.mjs.d.ts +100 -0
  91. package/src/foundry/common/utils/helpers.mjs.d.ts +27 -2
  92. package/src/foundry/common/utils/primitives.mjs.d.ts +99 -16
  93. package/src/foundry/foundry.js/application.d.ts +4 -7
  94. package/src/foundry/foundry.js/applications/cameraViews.d.ts +36 -31
  95. package/src/foundry/foundry.js/applications/compendium.d.ts +5 -2
  96. package/src/foundry/foundry.js/applications/filePicker.d.ts +116 -116
  97. package/src/foundry/foundry.js/applications/formApplication.d.ts +2 -2
  98. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +20 -27
  99. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +66 -0
  100. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
  101. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  102. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +6 -3
  103. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
  104. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +1 -1
  105. package/src/foundry/foundry.js/applications/formApplications/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +3 -3
  106. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +4 -0
  107. package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
  108. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +60 -0
  109. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +72 -0
  110. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +5 -5
  111. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +1 -1
  112. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +187 -148
  113. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +133 -110
  114. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +1 -1
  115. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +93 -95
  116. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +163 -147
  117. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  118. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  119. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +2 -3
  120. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
  121. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +41 -23
  122. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +95 -86
  123. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +142 -155
  124. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +60 -70
  125. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +25 -17
  126. package/src/foundry/foundry.js/applications/hotbar.d.ts +5 -4
  127. package/src/foundry/foundry.js/applications/sceneControls.d.ts +13 -3
  128. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
  129. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
  130. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
  131. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  132. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
  133. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
  134. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
  135. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/itemDirectory.d.ts +7 -30
  136. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
  137. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
  138. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
  139. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
  140. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +4 -6
  141. package/src/foundry/foundry.js/avSettings.d.ts +7 -7
  142. package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
  143. package/src/foundry/foundry.js/canvas.d.ts +150 -47
  144. package/src/foundry/foundry.js/canvasAnimation.d.ts +1 -1
  145. package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
  146. package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
  147. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
  148. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
  149. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
  150. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
  151. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
  152. package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
  153. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +384 -0
  154. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
  155. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +4 -8
  156. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +1 -1
  157. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
  158. package/src/foundry/foundry.js/clientDocuments/index.d.ts +3 -0
  159. package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
  160. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
  161. package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
  162. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +1 -1
  163. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
  164. package/src/foundry/foundry.js/clientKeybindings.d.ts +299 -0
  165. package/src/foundry/foundry.js/clientSettings.d.ts +21 -6
  166. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +45 -12
  167. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
  168. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
  169. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
  170. package/src/foundry/foundry.js/config.d.ts +494 -902
  171. package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
  172. package/src/foundry/foundry.js/game.d.ts +86 -11
  173. package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
  174. package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
  175. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
  176. package/src/foundry/foundry.js/hooks.d.ts +57 -0
  177. package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
  178. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
  179. package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
  180. package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
  181. package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
  182. package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
  183. package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
  184. package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
  185. package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
  186. package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
  187. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +10 -19
  188. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +6 -2
  189. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +2 -2
  190. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +4 -4
  191. package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
  192. package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
  193. package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
  194. package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
  195. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +4 -1
  196. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
  197. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
  198. package/src/foundry/foundry.js/pointSource.d.ts +174 -86
  199. package/src/foundry/foundry.js/roll.d.ts +25 -36
  200. package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
  201. package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
  202. package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
  203. package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
  204. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
  205. package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
  206. package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
  207. package/src/foundry/foundry.js/textEditor.d.ts +40 -9
  208. package/src/foundry/index.d.ts +5 -0
  209. package/src/types/utils.d.ts +11 -3
  210. package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
  211. package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
@@ -1,112 +1,110 @@
1
- /**
2
- * Configuration sheet for the Drawing object
3
- * @typeParam P - the type of the options object
4
- */
5
- declare class DrawingConfig<P extends DrawingConfig.Options = DrawingConfig.Options> extends FormApplication<
6
- P,
7
- DrawingConfig.Data,
8
- Drawing
9
- > {
10
- /**
11
- * @param drawing - The Drawing object being configured
12
- * @param options - Additional application rendering options
13
- */
14
- constructor(drawing: Drawing, options?: Partial<P>);
1
+ import type { ConfiguredDocumentClassForName } from '../../../../types/helperTypes';
15
2
 
3
+ declare global {
16
4
  /**
17
- * @defaultValue
18
- * ```typescript
19
- * mergeObject(super.defaultOptions, {
20
- * id: "drawing-config",
21
- * classes: ["sheet"],
22
- * template: "templates/scene/drawing-config.html",
23
- * width: 480,
24
- * height: 360,
25
- * configureDefault: false,
26
- * tabs: [{navSelector: ".tabs", contentSelector: "form", initial: "position"}]
27
- * });
28
- * ```
5
+ * The Application responsible for configuring a single Drawing document within a parent Scene.
6
+ * @typeParam Options - the type of the options object
7
+ * @typeParam Data - The data structure used to render the handlebars template.
29
8
  */
30
- static get defaultOptions(): DrawingConfig.Options;
9
+ class DrawingConfig<
10
+ Options extends DrawingConfig.Options = DrawingConfig.Options,
11
+ Data extends object = DrawingConfig.Data<Options>
12
+ > extends FormApplication<Options, Data, InstanceType<ConfiguredDocumentClassForName<'Drawing'>>> {
13
+ /**
14
+ * @defaultValue
15
+ * ```typescript
16
+ * foundry.utils.mergeObject(super.defaultOptions, {
17
+ * id: "drawing-config",
18
+ * classes: ["sheet"],
19
+ * template: "templates/scene/drawing-config.html",
20
+ * width: 480,
21
+ * height: 360,
22
+ * configureDefault: false,
23
+ * tabs: [{ navSelector: ".tabs", contentSelector: "form", initial: "position" }],
24
+ * });
25
+ * ```
26
+ */
27
+ static get defaultOptions(): DrawingConfig.Options;
31
28
 
32
- /** @override */
33
- get title(): string;
29
+ /** @override */
30
+ get title(): string;
34
31
 
35
- /**
36
- * @param options - (unused)
37
- * @override
38
- */
39
- getData(options?: Partial<P>): DrawingConfig.Data;
32
+ /** @override */
33
+ getData(options?: Partial<Options>): Data | Promise<Data>;
40
34
 
41
- /**
42
- * Get the names and labels of fill type choices which can be applied
43
- */
44
- protected static _getFillTypes(): DrawingConfig.FillTypes;
45
-
46
- /**
47
- * @param event - (unused)
48
- * @override
49
- */
50
- protected _updateObject<F extends DrawingConfig.FormData>(
51
- event: Event,
52
- formData: F
53
- ): Promise<this['options']['configureDefault'] extends true ? F : Drawing>;
35
+ /**
36
+ * Get the names and labels of fill type choices which can be applied
37
+ * @internal
38
+ */
39
+ protected static _getFillTypes(): DrawingConfig.FillTypes;
54
40
 
55
- /** @override */
56
- close(options?: FormApplication.CloseOptions): Promise<void>;
41
+ /** @override */
42
+ protected _updateObject(
43
+ event: Event,
44
+ formData: DrawingConfig.FormData
45
+ ): Promise<foundry.data.DrawingData['_source'] | ConfiguredDocumentClassForName<'Drawing'> | undefined>;
57
46
 
58
- /** @override */
59
- activateListeners(html: JQuery): void;
47
+ /** @override */
48
+ close(options?: FormApplication.CloseOptions): Promise<void>;
60
49
 
61
- /**
62
- * Reset the user Drawing configuration settings to their default values
63
- */
64
- protected _onResetDefaults(event: JQuery.ClickEvent): void;
65
- }
50
+ /** @override */
51
+ activateListeners(html: JQuery): void;
66
52
 
67
- declare namespace DrawingConfig {
68
- interface Data {
69
- author: string;
70
- isDefault: Options['configureDefault'];
71
- fillTypes: ReturnType<typeof DrawingConfig['_getFillTypes']>;
72
- fontFamilies: Record<typeof CONFIG['fontFamilies'][number], typeof CONFIG['fontFamilies'][number]>;
73
- object: DrawingConfig['object']['data'];
74
- options: DrawingConfig['options'];
75
- submitText: string;
53
+ /**
54
+ * Reset the user Drawing configuration settings to their default values
55
+ * @param event - The originating mouse-click event
56
+ */
57
+ protected _onResetDefaults(event: JQuery.ClickEvent): void;
76
58
  }
77
59
 
78
- type FillTypes = {
79
- [Key in keyof typeof foundry.CONST['DRAWING_FILL_TYPES'] as typeof foundry.CONST['DRAWING_FILL_TYPES'][Key]]: `DRAWING.FillType${Titlecase<Key>}`;
80
- };
60
+ namespace DrawingConfig {
61
+ interface Data<Options extends DrawingConfig.Options = DrawingConfig.Options> {
62
+ author: string;
63
+ isDefault: boolean;
64
+ fillTypes: DrawingConfig.FillTypes;
65
+ fontFamilies: Record<string, string>;
66
+ object: foundry.data.DrawingData['_source'];
67
+ options: Options;
68
+ submitText: string;
69
+ }
81
70
 
82
- interface FormData {
83
- bezierFactor: foundry.data.DrawingData['_source']['bezierFactor'];
84
- fillAlpha: foundry.data.DrawingData['_source']['fillAlpha'];
85
- fillColor: foundry.data.DrawingData['_source']['fillColor'];
86
- fillType: foundry.data.DrawingData['_source']['fillType'];
87
- fontFamily: foundry.data.DrawingData['_source']['fontFamily'];
88
- fontSize: foundry.data.DrawingData['_source']['fontSize'] | null;
89
- height: foundry.data.DrawingData['_source']['height'] | null;
90
- rotation: foundry.data.DrawingData['_source']['rotation'] | null;
91
- strokeAlpha: foundry.data.DrawingData['_source']['strokeAlpha'];
92
- strokeColor: foundry.data.DrawingData['_source']['strokeColor'];
93
- strokeWidth: foundry.data.DrawingData['_source']['strokeWidth'] | null;
94
- text: string;
95
- textAlpha: foundry.data.DrawingData['_source']['textAlpha'];
96
- textColor: foundry.data.DrawingData['_source']['textColor'];
97
- texture: string;
98
- width: foundry.data.DrawingData['_source']['width'] | null;
99
- x: foundry.data.DrawingData['_source']['x'] | null;
100
- y: foundry.data.DrawingData['_source']['y'] | null;
101
- z: foundry.data.DrawingData['_source']['z'] | null;
102
- }
71
+ type FillTypes = {
72
+ [Key in keyof typeof foundry.CONST['DRAWING_FILL_TYPES'] as typeof foundry.CONST['DRAWING_FILL_TYPES'][Key]]: `DRAWING.FillType${Titlecase<Key>}`;
73
+ };
103
74
 
104
- interface Options extends FormApplication.Options {
105
- configureDefault: boolean;
75
+ interface FormData {
76
+ bezierFactor: number;
77
+ fillAlpha: number;
78
+ fillColor: string;
79
+ fillType: foundry.CONST.DRAWING_FILL_TYPES;
80
+ fontFamily: string;
81
+ fontSize: number | null;
82
+ height: number | null;
83
+ rotation: number | null;
84
+ strokeAlpha: number;
85
+ strokeColor: string;
86
+ strokeWidth: number | null;
87
+ text: string;
88
+ textAlpha: number;
89
+ textColor: string;
90
+ texture: string;
91
+ width: number | null;
92
+ x: number | null;
93
+ y: number | null;
94
+ z: number | null;
95
+ }
106
96
 
107
- /**
108
- * Configure a preview version of the Drawing which is not yet saved
109
- */
110
- preview?: boolean;
97
+ interface Options extends FormApplication.Options {
98
+ /**
99
+ * Configure the default drawing settings, instead of a specific Drawing
100
+ * @defaultValue `false`
101
+ */
102
+ configureDefault: boolean;
103
+
104
+ /**
105
+ * Configure a preview version of the Drawing which is not yet saved
106
+ */
107
+ preview?: boolean;
108
+ }
111
109
  }
112
110
  }
@@ -1,154 +1,170 @@
1
- // TODO: Remove when updating this class!!!
2
- // eslint-disable-next-line
3
- // @ts-nocheck
4
-
5
- /**
6
- * Entity Sheet Configuration Application
7
- * @typeParam P - the type of the options object
8
- * @typeParam E - the type of the Entity, this sheet is used to configure
9
- */
10
- declare class EntitySheetConfig<
11
- P extends FormApplication.Options = FormApplication.Options,
12
- E extends Entity = Entity
13
- > extends FormApplication<P, EntitySheetConfig.Data, E> {
14
- /**
15
- * @param entity - The Entity object for which the sheet is being configured
16
- * @param options - Additional Application options
17
- */
18
- constructor(entity: E, options?: Partial<P>);
19
-
20
- /**
21
- * @defaultValue
22
- * ```typescript
23
- * const options = super.defaultOptions;
24
- * options.id = "sheet-config";
25
- * options.template = "templates/sheets/sheet-config.html";
26
- * options.width = 400;
27
- * ```
28
- */
29
- static get defaultOptions(): typeof FormApplication['defaultOptions'];
30
-
31
- /**
32
- * Add the Entity name into the window title
33
- */
34
- get title(): string;
35
-
36
- /**
37
- * Construct and return the data object used to render the HTML template for this form application.
38
- * @param options - (unused)
39
- */
40
- getData(options?: Partial<P>): EntitySheetConfig.Data<E>;
41
-
42
- /**
43
- * This method is called upon form submission after form data is validated
44
- * @param event - The initial triggering submission event
45
- * @param formData - The object of validated form data with which to update the object
46
- */
47
- protected _updateObject(event: Event, formData: EntitySheetConfig.FormData): Promise<void>;
1
+ import type { DocumentConstructor } from '../../../../types/helperTypes';
48
2
 
3
+ declare global {
49
4
  /**
50
- * Initialize the configured Sheet preferences for Entities which support dynamic Sheet assignment
51
- * Create the configuration structure for supported entities
52
- * Process any pending sheet registrations
53
- * Update the default values from settings data
5
+ * Entity Sheet Configuration Application
6
+ * @typeParam Options - The type of the options object
7
+ * @typeParam Data - The data structure used to render the handlebars template.
8
+ * @typeParam ConcreteDocument - The type of the Document which is being managed
54
9
  */
55
- static initializeSheets(): void;
56
-
57
- /**
58
- * Register a sheet class as a candidate which can be used to display entities of a given type
59
- * @param entityClass - The Entity for which to register a new Sheet option
60
- * @param scope - Provide a unique namespace scope for this sheet
61
- * @param sheetClass - A defined Application class used to render the sheet
62
- * @param label - A human readable label for the sheet name, which will be localized
63
- * @param types - An array of entity types for which this sheet should be used
64
- * (default: `[]`)
65
- * @param makeDefault - Whether to make this sheet the default for provided types
66
- * (default: `false`)
67
- */
68
- static registerSheet(
69
- entityClass: ConstructorOf<Entity>,
70
- scope: string,
71
- sheetClass: ConstructorOf<FormApplication>,
72
- { label, types, makeDefault }?: { label?: string; types?: string[]; makeDefault?: boolean }
73
- ): void;
74
-
75
- protected static _registerSheet({
76
- entityClass,
77
- id,
78
- label,
79
- sheetClass,
80
- types,
81
- makeDefault
82
- }: Exclude<EntitySheetConfig.Config, 'action'>): void;
83
-
84
- /**
85
- * Unregister a sheet class, removing it from the list of available Applications to use for an Entity type
86
- * @param entityClass - The Entity for which to register a new Sheet option
87
- * @param scope - Provide a unique namespace scope for this sheet
88
- * @param sheetClass - A defined Application class used to render the sheet
89
- * @param types - An Array of types for which this sheet should be removed
90
- */
91
- static unregisterSheet(
92
- entityClass: ConstructorOf<Entity>,
93
- scope: string,
94
- sheetClass: ConstructorOf<FormApplication>,
95
- { types }?: { types?: string[] }
96
- ): void;
97
-
98
- protected static _unregisterSheet({
99
- entityClass,
100
- id,
101
- types
102
- }: Pick<EntitySheetConfig.Config, 'entityClass' | 'id' | 'types'>): void;
103
-
104
- /**
105
- * @typeParam T - the string array, passed as the types parameter
106
- */
107
- protected static _getEntityTypes<T extends string[]>(entityClass: any, types: T): T;
108
- protected static _getEntityTypes(entityClass: ConstructorOf<Entity>): string[];
109
-
110
- /**
111
- * Update the currently default Sheets using a new core world setting
112
- */
113
- protected static _updateDefaultSheets(setting?: Record<'Actor' | 'Item', Record<string, string>>): void;
114
-
115
- protected _pending: EntitySheetConfig.Config[];
116
- }
117
-
118
- declare namespace EntitySheetConfig {
119
- interface Config {
120
- action: 'register' | 'unregister';
121
- entityClass: ConstructorOf<Entity>;
122
- id: string;
123
- label: string;
124
- sheetClass: ConstructorOf<FormApplication>;
125
- types: string[];
126
- makeDefault: boolean;
127
- }
128
-
129
- /**
130
- * @typeParam P - the type of the options object
131
- * @typeParam E - the type of the entity
132
- */
133
- interface Data<E extends Entity = Entity, P extends FormApplication.Options = FormApplication.Options> {
134
- entityName: EntitySheetConfig<P, E>['object']['entity'];
135
- isGM: User['isGM'];
136
- object: foundry.utils.Duplicated<EntitySheetConfig<P, E>['object']['data']>;
137
- options: EntitySheetConfig<P, E>['options'];
138
- sheetClass: ReturnType<E['getFlag']> | '';
139
- sheetClasses: Record<SheetClass['id'], SheetClass['label']>;
140
- defaultClass: SheetClass['id'] | null;
141
- blankLabel: ReturnType<Localization['localize']>;
10
+ class EntitySheetConfig<
11
+ Options extends FormApplication.Options = FormApplication.Options,
12
+ Data extends object = EntitySheetConfig.Data<foundry.abstract.Document<any, any>, Options>,
13
+ ConcreteDocument extends foundry.abstract.Document<any, any> = Data extends EntitySheetConfig.Data<infer T>
14
+ ? T
15
+ : foundry.abstract.Document<any, any>
16
+ > extends FormApplication<Options, Data, ConcreteDocument> {
17
+ /**
18
+ * @defaultValue
19
+ * ```typescript
20
+ * foundry.utils.mergeObject(super.defaultOptions, {
21
+ * id: "sheet-config",
22
+ * template: "templates/sheets/sheet-config.html",
23
+ * width: 400,
24
+ * })
25
+ * ```
26
+ */
27
+ static get defaultOptions(): FormApplication.Options;
28
+
29
+ /**
30
+ * An array of pending sheet assignments which are submitted before other elements of the framework are ready.
31
+ * @internal
32
+ */
33
+ static _pending: Array<EntitySheetConfig.SheetAssignment>;
34
+
35
+ /** @override */
36
+ get title(): string;
37
+
38
+ /** @override */
39
+ getData(options?: Partial<Options>): Data | Promise<Data>;
40
+
41
+ /** @override */
42
+ protected _updateObject(event: Event, formData: EntitySheetConfig.FormData): Promise<void>;
43
+
44
+ /**
45
+ * Initialize the configured Sheet preferences for Entities which support dynamic Sheet assignment
46
+ * Create the configuration structure for supported entities
47
+ * Process any pending sheet registrations
48
+ * Update the default values from settings data
49
+ */
50
+ static initializeSheets(): void;
51
+
52
+ /**
53
+ * @internal
54
+ */
55
+ protected static _getDocumentTypes(cls: DocumentConstructor, types?: string[]): string[];
56
+
57
+ /**
58
+ * Register a sheet class as a candidate which can be used to display entities of a given type
59
+ * @param documentClass - The Document class for which to register a new Sheet option
60
+ * @param scope - Provide a unique namespace scope for this sheet
61
+ * @param sheetClass - A defined Application class used to render the sheet
62
+ * @param options - Additional options used for sheet registration
63
+ */
64
+ static registerSheet(
65
+ documentClass: DocumentConstructor,
66
+ scope: string,
67
+ sheetClass: ConstructorOf<Application>,
68
+ { label, types, makeDefault }?: EntitySheetConfig.RegisterSheetOptions
69
+ ): void;
70
+
71
+ /**
72
+ * Perform the sheet registration
73
+ * @internal
74
+ */
75
+ protected static _registerSheet({
76
+ documentClass,
77
+ id,
78
+ label,
79
+ sheetClass,
80
+ types,
81
+ makeDefault
82
+ }: Omit<EntitySheetConfig.SheetRegistration, 'action'>): void;
83
+
84
+ /**
85
+ * Unregister a sheet class, removing it from the list of available Applications to use for a Document type
86
+ * @param documentClass - The Document class for which to register a new Sheet option
87
+ * @param scope - Provide a unique namespace scope for this sheet
88
+ * @param sheetClass - A defined Application class used to render the sheet
89
+ * @param types - An Array of types for which this sheet should be removed
90
+ */
91
+ static unregisterSheet(
92
+ documentClass: DocumentConstructor,
93
+ scope: string,
94
+ sheetClass: ConstructorOf<Application>,
95
+ { types }?: { types?: string[] }
96
+ ): void;
97
+
98
+ /**
99
+ * Perform the sheet de-registration
100
+ * @internal
101
+ */
102
+ protected static _unregisterSheet({
103
+ documentClass,
104
+ id,
105
+ types
106
+ }: Omit<EntitySheetConfig.SheetUnregistration, 'action'>): void;
107
+
108
+ /**
109
+ * Update the currently default Sheets using a new core world setting
110
+ */
111
+ static updateDefaultSheets(setting?: Record<'Actor' | 'Item', Record<string, string>>): void;
142
112
  }
143
113
 
144
- type FormData = Pick<Data, 'defaultClass' | 'sheetClass'>;
145
-
146
- interface SheetClass {
147
- id: string | number;
148
- cls?: ConstructorOf<FormApplication>;
149
- label: string;
150
- default: boolean;
114
+ namespace EntitySheetConfig {
115
+ type SheetRegistration = {
116
+ action: 'register';
117
+ documentClass: DocumentConstructor;
118
+ id: string;
119
+ label: string;
120
+ sheetClass: ConstructorOf<Application>;
121
+ types: string[];
122
+ makeDefault: boolean;
123
+ };
124
+
125
+ type SheetUnregistration = {
126
+ action: 'unregister';
127
+ documentClass: DocumentConstructor;
128
+ id: string;
129
+ types: string[];
130
+ };
131
+
132
+ type SheetAssignment = SheetRegistration | SheetUnregistration;
133
+
134
+ /**
135
+ * @typeParam ConcreteDocument - The type of the Document which is being managed
136
+ * @typeParam Options - The type of the options object
137
+ */
138
+ interface Data<
139
+ ConcreteDocument extends foundry.abstract.Document<any, any>,
140
+ Options extends FormApplication.Options = FormApplication.Options
141
+ > {
142
+ isGM: boolean;
143
+ object: foundry.utils.Duplicated<ConcreteDocument['data']>;
144
+ options: Options;
145
+ sheetClass: string;
146
+ sheetClasses: Record<string, string>;
147
+ defaultClass: string;
148
+ blankLabel: string;
149
+ }
150
+
151
+ interface FormData {
152
+ defaultClass: string;
153
+ sheetClass: string;
154
+ }
155
+
156
+ interface RegisterSheetOptions {
157
+ /** A human readable label for the sheet name, which will be localized */
158
+ label?: string;
159
+
160
+ /** An array of entity types for which this sheet should be used */
161
+ types?: string[];
162
+
163
+ /**
164
+ * Whether to make this sheet the default for provided types
165
+ * @defaultValue `false`
166
+ */
167
+ makeDefault?: boolean;
168
+ }
151
169
  }
152
-
153
- type SheetClasses = Record<string, Record<string, SheetClass>>;
154
170
  }
@@ -156,7 +156,7 @@ declare global {
156
156
  }
157
157
 
158
158
  type FormData = {
159
- gridType: foundry.CONST.GridType;
159
+ gridType: foundry.CONST.GRID_TYPES;
160
160
  grid: number | null;
161
161
  scale: number | null;
162
162
  shiftX: number | null;
@@ -20,7 +20,7 @@
20
20
  * ```
21
21
  */
22
22
  declare class ImagePopout extends FormApplication<ImagePopout.Options, ImagePopout.Data, string> {
23
- constructor(src: string, options?: ImagePopout.Options);
23
+ constructor(src: string, options?: Partial<ImagePopout.Options>);
24
24
 
25
25
  /**
26
26
  * @defaultValue `null`
@@ -1,15 +1,14 @@
1
1
  import './avConfig';
2
2
  import './combatTrackerConfig';
3
+ import './defaultTokenConfig';
3
4
  import './documentSheet';
4
5
  import './documentSheets';
5
6
  import './drawingConfig';
6
7
  import './entitySheetConfig';
7
- import './folderConfig';
8
8
  import './gridConfig';
9
9
  import './imagePopout';
10
- import './measuredTemplateConfig';
10
+ import './keybindingsConfig';
11
11
  import './moduleManagement';
12
- import './noteConfig';
13
12
  import './permissionConfig';
14
13
  import './settingsConfig';
15
14
  import './tokenConfig';