@league-of-foundry-developers/foundry-vtt-types 0.8.9-7 → 9.238.1

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 (207) 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 +68 -67
  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/sceneNavigation.d.ts +90 -71
  128. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
  129. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
  130. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  131. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
  132. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
  133. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
  134. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/itemDirectory.d.ts +7 -30
  135. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
  136. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
  137. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
  138. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
  139. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +4 -6
  140. package/src/foundry/foundry.js/avSettings.d.ts +7 -7
  141. package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
  142. package/src/foundry/foundry.js/canvas.d.ts +150 -47
  143. package/src/foundry/foundry.js/canvasAnimation.d.ts +1 -1
  144. package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
  145. package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
  146. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
  147. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
  148. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
  149. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
  150. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
  151. package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
  152. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +384 -0
  153. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
  154. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +4 -8
  155. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +1 -1
  156. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
  157. package/src/foundry/foundry.js/clientDocuments/index.d.ts +3 -0
  158. package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
  159. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
  160. package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
  161. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +1 -1
  162. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
  163. package/src/foundry/foundry.js/clientKeybindings.d.ts +299 -0
  164. package/src/foundry/foundry.js/clientSettings.d.ts +21 -6
  165. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +45 -12
  166. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
  167. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
  168. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
  169. package/src/foundry/foundry.js/config.d.ts +467 -881
  170. package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
  171. package/src/foundry/foundry.js/game.d.ts +171 -50
  172. package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
  173. package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
  174. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
  175. package/src/foundry/foundry.js/hooks.d.ts +57 -0
  176. package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
  177. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
  178. package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
  179. package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
  180. package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
  181. package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
  182. package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
  183. package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
  184. package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
  185. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +5 -17
  186. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +4 -4
  187. package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
  188. package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
  189. package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
  190. package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
  191. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +4 -1
  192. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
  193. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
  194. package/src/foundry/foundry.js/pointSource.d.ts +174 -86
  195. package/src/foundry/foundry.js/roll.d.ts +25 -36
  196. package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
  197. package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
  198. package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
  199. package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
  200. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
  201. package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
  202. package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
  203. package/src/foundry/foundry.js/textEditor.d.ts +40 -9
  204. package/src/foundry/index.d.ts +5 -0
  205. package/src/types/utils.d.ts +11 -3
  206. package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
  207. package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
@@ -1,152 +1,191 @@
1
- // TODO: Remove when updating this class!!!
2
- // eslint-disable-next-line
3
- // @ts-nocheck
4
-
5
- /**
6
- * The RollTable configuration sheet
7
- * @typeParam P - the type of the options object
8
- */
9
- declare class RollTableConfig<P extends DocumentSheet.Options = DocumentSheet.Options> extends DocumentSheet<
10
- P,
11
- RollTableConfig.Data,
12
- RollTable
13
- > {
14
- /**
15
- * @param table - The rollable table entity being configured
16
- * @param options - Additional application rendering options
17
- */
18
- constructor(table: RollTable, options?: Partial<P>);
19
-
20
- /**
21
- * @defaultValue
22
- * ```typescript
23
- * mergeObject(super.defaultOptions, {
24
- * classes: ["sheet", "roll-table-config"],
25
- * template: "templates/sheets/roll-table-config.html",
26
- * width: 720,
27
- * height: "auto",
28
- * closeOnSubmit: false,
29
- * viewPermission: ENTITY_PERMISSIONS.OBSERVER,
30
- * scrollY: ["ol.table-results"],
31
- * dragDrop: [{dragSelector: null, dropSelector: null}]
32
- * })
33
- * ```
34
- */
35
- static get defaultOptions(): typeof DocumentSheet['defaultOptions'];
36
-
37
- /**
38
- * @override
39
- */
40
- get title(): string;
41
-
42
- /**
43
- * @param options - (unused)
44
- * @override
45
- */
46
- getData(options?: Partial<P>): RollTableConfig.Data;
47
-
48
- /**
49
- * @override
50
- */
51
- activateListeners(html: JQuery): void;
52
-
53
- /**
54
- * Handle creating a TableResult in the RollTable entity
55
- * @param event - The originating mouse event
56
- * @param resultData - An optional object of result data to use
57
- */
58
- protected _onCreateResult(event: JQuery.ClickEvent | DragEvent, resultData?: object): Promise<RollTable.Result>;
59
-
60
- /**
61
- * Submit the entire form when a table result type is changed, in case there are other active changes
62
- */
63
- protected _onChangeResultType(event: JQuery.ClickEvent): ReturnType<RollTableConfig['_onSubmit']>;
64
-
65
- /**
66
- * Handle deleting a TableResult from the RollTable entity
67
- */
68
- protected _onDeleteResult(event: JQuery.ClickEvent): Promise<RollTable.Result>;
69
-
70
- /**
71
- * @override
72
- */
73
- protected _onDrop(event: DragEvent): ReturnType<RollTableConfig['_onCreateResult']>;
74
-
75
- /**
76
- * Handle changing the actor profile image by opening a FilePicker
77
- */
78
- protected _onEditImage(event: JQuery.ClickEvent): ReturnType<FilePicker['browse']>;
79
-
80
- /**
81
- * Handle a button click to re-normalize dice result ranges across all RollTable results
82
- */
83
- protected _onNormalizeResults(event: JQuery.ClickEvent): Promise<RollTable>;
84
-
85
- /**
86
- * Handle toggling the drawn status of the result in the table
87
- */
88
- protected _onLockResult(event: JQuery.ClickEvent): Promise<RollTable.Result>;
89
-
90
- /**
91
- * Reset the Table to it's original composition with all options unlocked
92
- */
93
- protected _onResetTable(event: JQuery.ClickEvent): Promise<RollTable.Result>;
94
-
95
- /**
96
- * Handle drawing a result from the RollTable
97
- */
98
- protected _onRollTable(event: JQuery.ClickEvent): Promise<void>;
99
-
100
- /**
101
- * Configure the update object workflow for the Roll Table configuration sheet
102
- * Additional logic is needed here to reconstruct the results array from the editable fields on the sheet
103
- * @param event - The form submission event
104
- * @param formData - The validated FormData translated into an Object for submission
105
- */
106
- protected _updateObject(event: Event, formData: RollTableConfig.FormData): Promise<RollTable>;
107
-
108
- /**
109
- * Display a roulette style animation when a Roll Table result is drawn from the sheet
110
- * @param results - An Array of drawn table results to highlight
111
- */
112
- protected _animateRoll(results: RollTable.Result[]): Promise<void>;
113
-
114
- /**
115
- * Animate a "roulette" through the table until arriving at the final loop and a drawn result
116
- */
117
- protected _animateRoulette(
118
- ol: HTMLOListElement,
119
- drawnIds: string[],
120
- nLoops: number,
121
- animTime: number,
122
- animOffset: number
123
- ): Promise<void>;
124
-
125
- /**
126
- * Display a flashing animation on the selected result to emphasize the draw
127
- * @param item - The HTML <li> item of the winning result
128
- */
129
- protected _flashResult(item: HTMLElement): Promise<void>;
130
- }
131
-
132
- declare namespace RollTableConfig {
133
- interface Data extends DocumentSheet.Data<RollTable> {
134
- results: RollTable.Result;
135
- resultTypes: {
136
- [Key in keyof typeof foundry.CONST['TABLE_RESULT_TYPES'] as typeof foundry.CONST['TABLE_RESULT_TYPES'][Key]]: Key;
137
- };
138
- entityTypes: typeof foundry.CONST['COMPENDIUM_ENTITY_TYPES'];
139
- compendiumPacks: string[];
1
+ import type { ConfiguredDocumentClassForName, ToObjectFalseType } from '../../../../../types/helperTypes';
2
+ import type { TableResultDataConstructorData } from '../../../../common/data/data.mjs/tableResultData.js';
3
+
4
+ declare global {
5
+ /**
6
+ * The Application responsible for displaying and editing a single RollTable document.
7
+ * @typeParam Options - the type of the options object
8
+ * @typeParam Data - The data structure used to render the handlebars template.
9
+ */
10
+ class RollTableConfig<
11
+ Options extends DocumentSheet.Options = DocumentSheet.Options,
12
+ Data extends object = RollTableConfig.Data
13
+ > extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'RollTable'>>> {
14
+ /**
15
+ * @defaultValue
16
+ * ```typescript
17
+ * foundry.utils.mergeObject(super.defaultOptions, {
18
+ * classes: ["sheet", "roll-table-config"],
19
+ * template: "templates/sheets/roll-table-config.html",
20
+ * width: 720,
21
+ * height: "auto",
22
+ * closeOnSubmit: false,
23
+ * viewPermission: CONST.ENTITY_PERMISSIONS.OBSERVER,
24
+ * scrollY: ["ol.table-results"],
25
+ * dragDrop: [{ dragSelector: null, dropSelector: null }],
26
+ * })
27
+ * ```
28
+ */
29
+ static get defaultOptions(): DocumentSheet.Options;
30
+
31
+ /**
32
+ * @override
33
+ */
34
+ get title(): string;
35
+
36
+ /**
37
+ * @param options - (unused)
38
+ * @override
39
+ */
40
+ getData(options?: Partial<Options>): Data | Promise<Data>;
41
+
42
+ /**
43
+ * @override
44
+ */
45
+ activateListeners(html: JQuery): void;
46
+
47
+ /**
48
+ * Handle creating a TableResult in the RollTable entity
49
+ * @param event - The originating mouse event
50
+ * @param resultData - An optional object of result data to use
51
+ * @internal
52
+ */
53
+ protected _onCreateResult(
54
+ event: JQuery.ClickEvent | DragEvent,
55
+ resultData?: TableResultDataConstructorData
56
+ ): Promise<ConfiguredDocumentClassForName<'TableResult'>[]>;
57
+
58
+ /**
59
+ * Submit the entire form when a table result type is changed, in case there are other active changes
60
+ * @internal
61
+ */
62
+ protected _onChangeResultType(event: JQuery.ChangeEvent): void;
63
+
64
+ /**
65
+ * Handle deleting a TableResult from the RollTable entity
66
+ * @param event - The originating click event
67
+ * @returns The deleted TableResult document
68
+ * @internal
69
+ */
70
+ protected _onDeleteResult(
71
+ event: JQuery.ClickEvent
72
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'TableResult'>> | undefined>;
73
+
74
+ /**
75
+ * @override
76
+ * @internal
77
+ */
78
+ protected _onDrop(event: DragEvent): void;
79
+
80
+ /**
81
+ * Handle changing the actor profile image by opening a FilePicker
82
+ * @internal
83
+ */
84
+ protected _onEditImage(event: JQuery.ClickEvent): void;
85
+
86
+ /**
87
+ * Handle a button click to re-normalize dice result ranges across all RollTable results
88
+ * @internal
89
+ */
90
+ protected _onNormalizeResults(event: JQuery.ClickEvent): void;
91
+
92
+ /**
93
+ * Handle toggling the drawn status of the result in the table
94
+ * @internal
95
+ */
96
+ protected _onLockResult(event: JQuery.ClickEvent): void;
97
+
98
+ /**
99
+ * Reset the Table to it's original composition with all options unlocked
100
+ * @internal
101
+ */
102
+ protected _onResetTable(event: JQuery.ClickEvent): void;
103
+
104
+ /**
105
+ * Handle drawing a result from the RollTable
106
+ * @internal
107
+ */
108
+ protected _onRollTable(event: JQuery.ClickEvent): void;
109
+
110
+ /**
111
+ * Configure the update object workflow for the Roll Table configuration sheet
112
+ * Additional logic is needed here to reconstruct the results array from the editable fields on the sheet
113
+ * @param event - The form submission event
114
+ * @param formData - The validated FormData translated into an Object for submission
115
+ * @internal
116
+ */
117
+ protected _updateObject(
118
+ event: Event,
119
+ formData: RollTableConfig.FormData
120
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'RollTable'>> | undefined>;
121
+
122
+ /**
123
+ * Display a roulette style animation when a Roll Table result is drawn from the sheet
124
+ * @param results - An Array of drawn table results to highlight
125
+ * @returns A Promise which resolves once the animation is complete
126
+ */
127
+ protected _animateRoll(results: InstanceType<ConfiguredDocumentClassForName<'TableResult'>>[]): Promise<void[]>;
128
+
129
+ /**
130
+ * Animate a "roulette" through the table until arriving at the final loop and a drawn result
131
+ */
132
+ protected _animateRoulette(
133
+ ol: HTMLOListElement,
134
+ drawnIds: Set<string>,
135
+ nLoops: number,
136
+ animTime: number,
137
+ animOffset: number
138
+ ): Promise<void>;
139
+
140
+ /**
141
+ * Display a flashing animation on the selected result to emphasize the draw
142
+ * @param item - The HTML \<li\> item of the winning result
143
+ * @returns A Promise that resolves once the animation is complete
144
+ */
145
+ protected _flashResult(item: HTMLElement): Promise<void>;
140
146
  }
141
147
 
142
- interface FormData
143
- extends Pick<RollTable.Data, 'description' | 'displayRoll' | 'formula' | 'img' | 'name' | 'replacement'> {
144
- [index: number]: FormDataResult;
145
- }
146
-
147
- interface FormDataResult
148
- extends Pick<RollTable.Result, '_id' | 'drawn' | 'img' | 'resultId' | 'text' | 'type' | 'weight'> {
149
- rangeH: RollTable.Result['range'][1];
150
- rangeL: RollTable.Result['range'][0];
148
+ namespace RollTableConfig {
149
+ interface Data extends DocumentSheet.Data<RollTable> {
150
+ results: ToObjectFalseType<foundry.data.TableResultData> & {
151
+ isText: boolean;
152
+ isEntity: boolean;
153
+ isCompendium: boolean;
154
+ img: string;
155
+ text: string;
156
+ };
157
+ resultTypes: {
158
+ [Key in keyof typeof foundry.CONST.TABLE_RESULT_TYPES as typeof foundry.CONST.TABLE_RESULT_TYPES[Key]]: Titlecase<Key>;
159
+ };
160
+ entityTypes: typeof foundry.CONST.COMPENDIUM_ENTITY_TYPES;
161
+ compendiumPacks: string[];
162
+ }
163
+
164
+ type FormData = {
165
+ description: string;
166
+ displayRoll: boolean;
167
+ formula: string;
168
+ img: string;
169
+ name: string;
170
+ replacement: boolean;
171
+ } & FormDataResults;
172
+
173
+ type FormDataResults = {
174
+ [Key in number as `results.${number}._id`]: string;
175
+ } & {
176
+ [Key in number as `results.${number}.drawn`]: boolean;
177
+ } & {
178
+ [Key in number as `results.${number}.img`]: string;
179
+ } & {
180
+ [Key in number as `results.${number}.rangeH`]: number;
181
+ } & {
182
+ [Key in number as `results.${number}.rangeL`]: number;
183
+ } & {
184
+ [Key in number as `results.${number}.text`]: string;
185
+ } & {
186
+ [Key in number as `results.${number}.type`]: foundry.CONST.TABLE_RESULT_TYPES;
187
+ } & {
188
+ [Key in number as `results.${number}.weight`]: string;
189
+ };
151
190
  }
152
191
  }
@@ -1,129 +1,152 @@
1
- // TODO: Remove when updating this class!!!
2
- // eslint-disable-next-line
3
- // @ts-nocheck
1
+ import type { ConfiguredDocumentClassForName, DocumentConstructor } from '../../../../../types/helperTypes';
4
2
 
5
- /**
6
- * A Scene configuration sheet
7
- * @see {@link Scene} The Scene Entity which is being configured
8
- */
9
- declare class SceneConfig extends DocumentSheet<DocumentSheet.Options, SceneConfig.Data, Scene> {
3
+ declare global {
10
4
  /**
11
- * @override
12
- * @defaultValue
13
- * ```typescript
14
- * mergeObject(super.defaultOptions, {
15
- * classes: ["sheet", "scene-sheet"],
16
- * template: "templates/scene/config.html",
17
- * width: 680,
18
- * height: "auto"
19
- * });
20
- * ```
5
+ * The Application responsible for configuring a single Scene document.
6
+ * @see {@link Scene} The Scene Document which is being configured
7
+ *
8
+ * @typeParam Options - the type of the options object
9
+ * @typeParam Data - The data structure used to render the handlebars template.
21
10
  */
22
- static get defaultOptions(): typeof DocumentSheet['defaultOptions'];
11
+ class SceneConfig<
12
+ Options extends DocumentSheet.Options = DocumentSheet.Options,
13
+ Data extends object = SceneConfig.Data<Options>
14
+ > extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'Scene'>>> {
15
+ /**
16
+ * @override
17
+ * @defaultValue
18
+ * ```typescript
19
+ * foundry.utils.mergeObject(super.defaultOptions, {
20
+ * id: "scene-config",
21
+ * classes: ["sheet", "scene-sheet"],
22
+ * template: "templates/scene/config.html",
23
+ * width: 680,
24
+ * height: "auto",
25
+ * });
26
+ * ```
27
+ */
28
+ static get defaultOptions(): DocumentSheet.Options;
23
29
 
24
- /**
25
- * @override
26
- */
27
- get id(): string;
30
+ /**
31
+ * @override
32
+ */
33
+ get title(): string;
28
34
 
29
- /**
30
- * @override
31
- */
32
- get title(): string;
35
+ /**
36
+ * @override
37
+ * @remarks This incorrectly overrides `Application#render` by potentially returning `void`, see https://gitlab.com/foundrynet/foundryvtt/-/issues/6026.
38
+ */
39
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
40
+ // @ts-expect-error
41
+ render(force?: boolean, options?: Application.RenderOptions<Options>): this | void;
33
42
 
34
- /**
35
- * @param options - (unused)
36
- * @override
37
- */
38
- getData(options?: Partial<DocumentSheet.Options>): SceneConfig.Data;
43
+ /**
44
+ * @param options - (unused)
45
+ * @override
46
+ */
47
+ getData(options?: Partial<DocumentSheet.Options>): Data | Promise<Data>;
39
48
 
40
- /**
41
- * Get an enumeration of the available grid types which can be applied to this Scene
42
- */
43
- protected static _getGridTypes(): Record<foundry.CONST.GridType, string>;
49
+ /**
50
+ * Get an enumeration of the available grid types which can be applied to this Scene
51
+ * @internal
52
+ */
53
+ protected static _getGridTypes(): Record<foundry.CONST.GRID_TYPES, string>;
44
54
 
45
- /**
46
- * Get the available weather effect types which can be applied to this Scene
47
- */
48
- protected _getWeatherTypes(): Record<string, string>;
55
+ /**
56
+ * Get the available weather effect types which can be applied to this Scene
57
+ * @internal
58
+ */
59
+ protected _getWeatherTypes(): Record<string, string>;
49
60
 
50
- /**
51
- * Get the alphabetized entities which can be chosen as a configuration for the scene
52
- */
53
- protected _getEntities(collection: EntityCollection): { _id: string; name: string }[];
61
+ /**
62
+ * Get the alphabetized Documents which can be chosen as a configuration for the Scene
63
+ * @internal
64
+ */
65
+ protected _getDocuments(collection: WorldCollection<DocumentConstructor, string>): { _id: string; name: string }[];
54
66
 
55
- /**
56
- * @override
57
- */
58
- activateListeners(html: JQuery): void;
67
+ /** @override */
68
+ activateListeners(html: JQuery): void;
59
69
 
60
- /**
61
- * Capture the current Scene position and zoom level as the initial view in the Scene config
62
- * @param event - The originating click event
63
- */
64
- protected _onCapturePosition(event: JQuery.ClickEvent): void;
70
+ /**
71
+ * Capture the current Scene position and zoom level as the initial view in the Scene config
72
+ * @param event - The originating click event
73
+ * @internal
74
+ */
75
+ protected _onCapturePosition(event: JQuery.ClickEvent): void;
65
76
 
66
- /**
67
- * @override
68
- */
69
- protected _onChangeRange(event: JQuery.ChangeEvent): void;
77
+ /** @override */
78
+ protected _onChangeRange(event: JQuery.ChangeEvent): void;
70
79
 
71
- /**
72
- * Handle click events to open the grid configuration application
73
- * @param event - The originating click event
74
- */
75
- protected _onGridConfig(event: JQuery.ClickEvent): SceneConfig['minimize'];
80
+ /**
81
+ * Handle updating the select menu of PlaylistSound options when the Playlist is changed
82
+ * @param event - The initiating select change event
83
+ * @internal
84
+ */
85
+ _onChangePlaylist(event: JQuery.ChangeEvent): void;
76
86
 
77
- /**
78
- * @override
79
- */
80
- protected _updateObject(event: Event, formData: SceneConfig.FormData): Promise<Scene>;
81
- }
87
+ /**
88
+ * Handle click events to open the grid configuration application
89
+ * @param event - The originating click event
90
+ */
91
+ protected _onGridConfig(event: JQuery.ClickEvent): void;
92
+
93
+ /**
94
+ * @override
95
+ */
96
+ protected _updateObject(
97
+ event: Event,
98
+ formData: SceneConfig.FormData
99
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'Scene'>> | undefined>;
100
+ }
101
+
102
+ namespace SceneConfig {
103
+ interface Data<Options extends DocumentSheet.Options = DocumentSheet.Options>
104
+ extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'Scene'>>, Options> {
105
+ gridTypes: ReturnType<typeof SceneConfig['_getGridTypes']>;
106
+ weatherTypes: ReturnType<SceneConfig['_getWeatherTypes']>;
107
+ playlists: ReturnType<SceneConfig['_getDocuments']>;
108
+ sounds: ReturnType<SceneConfig['_getDocuments']>;
109
+ journals: ReturnType<SceneConfig['_getDocuments']>;
110
+ hasGlobalThreshold: boolean;
111
+ data: DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'Scene'>>, Options>['data'] & {
112
+ /**
113
+ * @defaultValue `0`
114
+ */
115
+ globalLightThreshold: number;
116
+ };
117
+ }
82
118
 
83
- declare namespace SceneConfig {
84
- interface Data extends DocumentSheet.Data {
85
- gridTypes: ReturnType<typeof SceneConfig['_getGridTypes']>;
86
- weatherTypes: ReturnType<SceneConfig['_getWeatherTypes']>;
87
- playlists: ReturnType<SceneConfig['_getEntities']>;
88
- journals: ReturnType<SceneConfig['_getEntities']>;
89
- hasGlobalThreshold: boolean;
90
- document: DocumentSheet.Data['document'] & {
91
- /**
92
- * @defaultValue `0`
93
- */
119
+ type FormData = {
120
+ backgroundColor: string;
121
+ darkness: number;
122
+ fogExploration: boolean;
123
+ foreground: string;
124
+ globalLight: boolean;
94
125
  globalLightThreshold: number;
126
+ grid: number | null;
127
+ gridAlpha: number;
128
+ gridColor: string;
129
+ gridDistance: number | null;
130
+ gridType: foundry.CONST.GRID_TYPES;
131
+ gridUnits: string;
132
+ hasGlobalThreshold: boolean;
133
+ height: number | null;
134
+ img: string;
135
+ 'initial.scale': number | null;
136
+ 'initial.x': number | null;
137
+ 'initial.y': number | null;
138
+ journal: string;
139
+ name: string;
140
+ navName: string;
141
+ navigation: boolean;
142
+ padding: number;
143
+ 'permission.default': foundry.CONST.DOCUMENT_PERMISSION_LEVELS;
144
+ playlist: string;
145
+ shiftX: number | null;
146
+ shiftY: number | null;
147
+ tokenVision: boolean;
148
+ weather: string;
149
+ width: number | null;
95
150
  };
96
151
  }
97
-
98
- type FormData = {
99
- backgroundColor: Scene.Data['backgroundColor'];
100
- darkness: Scene.Data['darkness'];
101
- fogExploration: Scene.Data['fogExploration'];
102
- globalLight: Scene.Data['globalLight'];
103
- globalLightThreshold: Scene.Data['globalLightThreshold'];
104
- grid: GridConfig.FormData['grid'];
105
- gridAlpha: Scene.Data['gridAlpha'];
106
- gridColor: Scene.Data['gridColor'];
107
- gridDistance: Scene.Data['gridDistance'] | null;
108
- gridType: foundry.CONST.GridType;
109
- gridUnits: Scene.Data['gridUnits'];
110
- hasGlobalThreshold: boolean;
111
- height: Scene.Data['height'] | null;
112
- img: Scene.Data['img'];
113
- 'initial.scale': number | null;
114
- 'initial.x': number | null;
115
- 'initial.y': number | null;
116
- journal: Scene.Data['journal'];
117
- name: string;
118
- navName: Scene.Data['navName'];
119
- navigation: Scene.Data['navigation'];
120
- padding: Scene.Data['padding'];
121
- 'permission.default': Scene.Data['permission'];
122
- playlist: Scene.Data['playlist'];
123
- shiftX: GridConfig.FormData['shiftX'];
124
- shiftY: GridConfig.FormData['shiftY'];
125
- tokenVision: Scene.Data['tokenVision'];
126
- weather: Scene.Data['weather'];
127
- width: Scene.Data['width'] | null;
128
- };
129
152
  }
@@ -51,7 +51,7 @@ declare global {
51
51
  interface Data<Options extends DocumentSheet.Options>
52
52
  extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'Tile'>>, Options> {
53
53
  submitText: string;
54
- occlusionModes: Record<foundry.CONST.TileOcclusionModes, string>;
54
+ occlusionModes: Record<foundry.CONST.TILE_OCCLUSION_MODES, string>;
55
55
  }
56
56
 
57
57
  type FormData = Pick<TileDataConstructorData, 'height' | 'img' | 'rotation' | 'width' | 'x' | 'y'>;