@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
@@ -8,7 +8,7 @@
8
8
  * const dragDrop = new DragDrop({
9
9
  * dragSelector: ".item",
10
10
  * dropSelector: ".items",
11
- * permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }
11
+ * permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) },
12
12
  * callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDragDrop.bind(this) }
13
13
  * });
14
14
  * dragDrop.bind(html);
@@ -17,9 +17,9 @@
17
17
  declare class DragDrop {
18
18
  /**
19
19
  * @param dragSelector - The CSS selector used to target draggable elements.
20
- * (default: `null`)
20
+ * (default: `undefined`)
21
21
  * @param dropSelector - The CSS selector used to target viable drop targets.
22
- * (default: `null`)
22
+ * (default: `undefined`)
23
23
  * @param permissions - An object of permission test functions for each action
24
24
  * (default: `{}`)
25
25
  * @param callbacks - An object of callback functions for each action
@@ -29,27 +29,27 @@ declare class DragDrop {
29
29
 
30
30
  /**
31
31
  * The HTML selector which identifies draggable elements
32
- * @defaultValue `null`
32
+ * @defaultValue `undefined`
33
33
  */
34
- dragSelector: string | null;
34
+ dragSelector: string | null | undefined;
35
35
 
36
36
  /**
37
37
  * The HTML selector which identifies drop targets
38
- * @defaultValue `null`
38
+ * @defaultValue `undefined`
39
39
  */
40
- dropSelector: string | null;
40
+ dropSelector: string | null | undefined;
41
41
 
42
42
  /**
43
43
  * A set of permission checking functions for each action of the Drag and Drop workflow
44
44
  * @defaultValue `{}`
45
45
  */
46
- permissions: Partial<Record<string, (selector: string | null) => boolean>>;
46
+ permissions: Partial<Record<DragDrop.Action, (selector: string | undefined) => boolean>>;
47
47
 
48
48
  /**
49
49
  * A set of callback functions for each action of the Drag and Drop workflow
50
50
  * @defaultValue `{}`
51
51
  */
52
- callbacks: Partial<Record<string, (event: DragEvent) => unknown>>;
52
+ callbacks: Partial<Record<DragDrop.Action, (event: DragEvent) => void>>;
53
53
 
54
54
  /**
55
55
  * Bind the DragDrop controller to an HTML application
@@ -62,7 +62,7 @@ declare class DragDrop {
62
62
  * @param event - The drag event being handled
63
63
  * @param action - The action being attempted
64
64
  */
65
- callback(event: DragEvent, action: string): unknown;
65
+ callback(event: DragEvent, action: DragDrop.Action): void;
66
66
 
67
67
  /**
68
68
  * Test whether the current user has permission to perform a step of the workflow
@@ -70,40 +70,41 @@ declare class DragDrop {
70
70
  * @param selector - The selector being targeted
71
71
  * @returns Can the action be performed?
72
72
  */
73
- can(action: string, selector: string | null): boolean;
73
+ can(action: DragDrop.Action, selector: string | undefined): boolean;
74
74
 
75
75
  /**
76
76
  * Handle the start of a drag workflow
77
77
  * @param event - The drag event being handled
78
+ * @internal
78
79
  */
79
80
  protected _handleDragStart(event: DragEvent): void;
80
81
 
81
82
  /**
82
83
  * Handle a dragged element over a droppable target
83
84
  * @param event - The drag event being handled
85
+ * @internal
84
86
  */
85
87
  protected _handleDragOver(event: DragEvent): false;
86
88
 
87
89
  /**
88
90
  * Handle a dragged element dropped on a droppable target
89
91
  * @param event - The drag event being handled
92
+ * @internal
90
93
  */
91
94
  protected _handleDrop(event: DragEvent): unknown;
92
95
 
93
- static createDragImage(img: HTMLImageElement, width: number, height: number): HTMLDivElement | HTMLElement;
96
+ static createDragImage(img: HTMLImageElement, width: number, height: number): HTMLDivElement;
94
97
  }
95
98
 
96
99
  declare namespace DragDrop {
97
100
  interface Options {
98
101
  /**
99
102
  * The CSS selector used to target draggable elements.
100
- * @defaultValue `null`
101
103
  */
102
104
  dragSelector?: DragDrop['dragSelector'];
103
105
 
104
106
  /**
105
107
  * The CSS selector used to target viable drop targets.
106
- * @defaultValue `null`
107
108
  */
108
109
  dropSelector?: DragDrop['dropSelector'];
109
110
 
@@ -119,4 +120,6 @@ declare namespace DragDrop {
119
120
  */
120
121
  callbacks?: DragDrop['callbacks'];
121
122
  }
123
+
124
+ type Action = 'dragstart' | 'dragover' | 'drop';
122
125
  }
@@ -1,3 +1,4 @@
1
+ import type { Socket } from 'socket.io-client';
1
2
  import { ConfiguredDocumentClass, ConfiguredDocumentClassForName, DocumentConstructor } from '../../types/helperTypes';
2
3
 
3
4
  declare global {
@@ -25,6 +26,9 @@ declare global {
25
26
  */
26
27
  data: Game.Data;
27
28
 
29
+ /** The Release data for this version of Foundry */
30
+ release: foundry.config.ReleaseData;
31
+
28
32
  /**
29
33
  * The id of the active World user, if any
30
34
  */
@@ -70,6 +74,25 @@ declare global {
70
74
  */
71
75
  keyboard: KeyboardManager | null;
72
76
 
77
+ /**
78
+ * The Mouse Manager
79
+ * @remarks Initialized between the `'setup'` and `'ready'` hook events.
80
+ * @defaultValue `null`
81
+ */
82
+ mouse: MouseManager | null;
83
+
84
+ /**
85
+ * The Gamepad Manager
86
+ * @remarks Initialized between the `'setup'` and `'ready'` hook events.
87
+ * @defaultValue `null`
88
+ */
89
+ gamepad: GamepadManager | null;
90
+
91
+ /**
92
+ * The New User Experience manager.
93
+ */
94
+ nue: NewUserExperience;
95
+
73
96
  /**
74
97
  * The user role permissions setting
75
98
  * @remarks Initialized between the `'setup'` and `'ready'` hook events.
@@ -87,6 +110,11 @@ declare global {
87
110
  */
88
111
  settings: ClientSettings;
89
112
 
113
+ /**
114
+ * Client keybindings which are used to configure application behavior
115
+ */
116
+ keybindings: ClientKeybindings;
117
+
90
118
  /**
91
119
  * A reference to the open Socket.io connection
92
120
  */
@@ -130,6 +158,9 @@ declare global {
130
158
  */
131
159
  ready: boolean;
132
160
 
161
+ /** Returns the current version of the Release, usable for comparisons using isNewerVersion */
162
+ get version(): string;
163
+
133
164
  /**
134
165
  * Fetch World data and return a Game instance
135
166
  * @param view - The named view being created
@@ -151,6 +182,13 @@ declare global {
151
182
  */
152
183
  static getCookies(): Record<string, string>;
153
184
 
185
+ /**
186
+ * Request World data from server and return it
187
+ * @param socket - The active socket connection
188
+ * @param view - The view for which data is being requested
189
+ */
190
+ static getData(socket: Socket, view: string): Promise<unknown>;
191
+
154
192
  /**
155
193
  * Request World data from server and return it
156
194
  */
@@ -189,14 +227,14 @@ declare global {
189
227
  shutDown(): Promise<void>;
190
228
 
191
229
  /**
192
- * Fully set up the game state, initializing Entities, UI applications, and the Canvas
230
+ * Fully set up the game state, initializing Documents, UI applications, and the Canvas
193
231
  */
194
232
  setupGame(): Promise<void>;
195
233
 
196
234
  /**
197
235
  * Initialize game state data by creating WorldCollection instances for every primary Document type
198
236
  */
199
- initializeEntities(): void;
237
+ initializeDocuments(): void;
200
238
 
201
239
  /**
202
240
  * @remarks Initialized between the `'setup'` and `'ready'` hook events.
@@ -248,6 +286,11 @@ declare global {
248
286
  */
249
287
  tables?: ConfiguredCollectionClassForName<'RollTable'>;
250
288
 
289
+ /**
290
+ * @remarks Initialized between the `'setup'` and `'ready'` hook events.
291
+ */
292
+ cards?: ConfiguredCollectionClassForName<'Cards'>;
293
+
251
294
  /**
252
295
  * @remarks Initialized between the `'setup'` and `'ready'` hook events.
253
296
  */
@@ -288,10 +331,20 @@ declare global {
288
331
  protected _checkFontsReady(ms: number): Promise<void>;
289
332
 
290
333
  /**
291
- * Initialize Keyboard and Mouse controls
334
+ * Initialize Keyboard controls
292
335
  */
293
336
  initializeKeyboard(): void;
294
337
 
338
+ /**
339
+ * Initialize Mouse controls
340
+ */
341
+ initializeMouse(): void;
342
+
343
+ /**
344
+ * Initialize Gamepad controls
345
+ */
346
+ initializeGamepads(): void;
347
+
295
348
  /**
296
349
  * Register core game settings
297
350
  */
@@ -331,11 +384,24 @@ declare global {
331
384
  */
332
385
  togglePause(pause: boolean, push?: boolean): void;
333
386
 
387
+ /**
388
+ * Open Character sheet for current token or controlled actor
389
+ * @returns The ActorSheet which was toggled, or null if the User has no character
390
+ */
391
+ toggleCharacterSheet(): ActorSheet | null;
392
+
334
393
  /**
335
394
  * Log out of the game session by returning to the Join screen
336
395
  */
337
396
  logOut(): void;
338
397
 
398
+ /**
399
+ * Scale the base font size according to the user's settings.
400
+ * @param index - Optionally supply a font size index to use, otherwise use the user's setting.
401
+ * Available font sizes, starting at index 1, are: 8, 10, 12, 14, 16, 18, 20, 24, 28, and 32.
402
+ */
403
+ scaleFonts(index?: number): void;
404
+
339
405
  /**
340
406
  * Activate Socket event listeners which are used to transact game state data with the server
341
407
  */
@@ -389,8 +455,9 @@ declare global {
389
455
  protected _onPointerUp(event: PointerEvent): void;
390
456
 
391
457
  /**
392
- * Handle resizing of the game window
393
- * Reposition any active UI windows
458
+ * Handle resizing of the game window by adjusting the canvas and repositioning active interface applications.
459
+ * @param event - The window resize event which has occurred
460
+ * @internal
394
461
  */
395
462
  protected _onWindowResize(event: UIEvent): void;
396
463
 
@@ -425,6 +492,11 @@ declare global {
425
492
  * Initialization steps for the Stream helper view
426
493
  */
427
494
  protected _initializeStreamView(): Promise<void>;
495
+
496
+ /**
497
+ * @deprecated since v9 - Use initializeDocuments instead.
498
+ */
499
+ initializeEntities(): void;
428
500
  }
429
501
 
430
502
  namespace Game {
@@ -448,7 +520,7 @@ declare global {
448
520
  label: string;
449
521
  path: string;
450
522
  private: boolean;
451
- entity: foundry.CONST.CompendiumEntityType;
523
+ entity: foundry.CONST.COMPENDIUM_DOCUMENT_TYPES;
452
524
  system?: string;
453
525
  absPath: string;
454
526
  package: string;
@@ -475,7 +547,7 @@ declare global {
475
547
  templates?: Partial<Record<string, unknown>>;
476
548
  } & Partial<Record<string, unknown>>;
477
549
  };
478
- entityTypes: { [Key in foundry.CONST.EntityType | 'Setting' | 'FogExploration']: string[] };
550
+ entityTypes: { [Key in foundry.CONST.DOCUMENT_TYPES | 'Setting' | 'FogExploration']: string[] };
479
551
  model: {
480
552
  Actor: Partial<Record<string, Partial<Record<string, unknown>>>>;
481
553
  Item: Partial<Record<string, Partial<Record<string, unknown>>>>;
@@ -489,6 +561,7 @@ declare global {
489
561
 
490
562
  type Data = {
491
563
  userId: string;
564
+ /** @deprecated since V9 */
492
565
  version: string;
493
566
  world: WorldData<foundry.packages.WorldData>;
494
567
  system: SystemData<foundry.packages.SystemData>;
@@ -526,7 +599,7 @@ declare global {
526
599
  label: string;
527
600
  path: string;
528
601
  private: boolean;
529
- entity: foundry.CONST.CompendiumEntityType;
602
+ entity: foundry.CONST.COMPENDIUM_DOCUMENT_TYPES;
530
603
  system?: string;
531
604
  package: string;
532
605
  index: { name: string; type: string; _id: string }[];
@@ -535,7 +608,7 @@ declare global {
535
608
  systemUpdate: string | null;
536
609
  } & {
537
610
  [DocumentType in
538
- | foundry.CONST.EntityType
611
+ | foundry.CONST.DOCUMENT_TYPES
539
612
  | 'Setting' as ConfiguredDocumentClassForName<DocumentType>['metadata']['collection']]?: InstanceType<
540
613
  ConfiguredDocumentClassForName<DocumentType>
541
614
  >['data']['_source'][];
@@ -548,11 +621,13 @@ declare global {
548
621
  };
549
622
 
550
623
  type Permissions = {
551
- [Key in keyof typeof foundry.CONST.USER_PERMISSIONS]: foundry.CONST.UserRole[];
624
+ [Key in keyof typeof foundry.CONST.USER_PERMISSIONS]: foundry.CONST.USER_ROLES[];
552
625
  };
553
626
 
554
627
  type View = ValueOf<typeof foundry.CONST.GAME_VIEWS>;
555
628
  }
556
629
  }
557
630
 
558
- type ConfiguredCollectionClassForName<Name extends foundry.CONST.EntityType> = InstanceType<CONFIG[Name]['collection']>;
631
+ type ConfiguredCollectionClassForName<Name extends foundry.CONST.DOCUMENT_TYPES> = InstanceType<
632
+ CONFIG[Name]['collection']
633
+ >;
@@ -0,0 +1,41 @@
1
+ /** Management class for Gamepad events */
2
+ declare class GamepadManager {
3
+ constructor();
4
+
5
+ /**
6
+ * How often Gamepad polling should check for button presses
7
+ * @defaultValue `100`
8
+ */
9
+ static GAMEPAD_POLLER_INTERVAL_MS: number;
10
+
11
+ /**
12
+ * Handles a Gamepad Connection event, adding its info to the poll list
13
+ * @param event - The originating Event
14
+ * @internal
15
+ */
16
+ protected _onGamepadConnect(event: GamepadEvent): void;
17
+
18
+ /**
19
+ * Handles a Gamepad Disconnect event, removing it from consideration for polling
20
+ * @param event - The originating Event
21
+ * @internal
22
+ */
23
+ protected _onGamepadDisconnect(event: GamepadEvent): void;
24
+
25
+ /**
26
+ * Polls all Connected Gamepads for updates. If they have been updated, checks status of Axis and Buttons,
27
+ * firing off Keybinding Contexts as appropriate
28
+ * @internal
29
+ */
30
+ protected _pollGamepads(): void;
31
+
32
+ /**
33
+ * Converts a Gamepad Input event into a KeyboardEvent, then fires it
34
+ * @param gamepadId - The string representation of the Gamepad Input
35
+ * @param up - True if the Input is pressed or active
36
+ * @param repeat - True if the Input is being held
37
+ * (default: `false`)
38
+ * @internal
39
+ */
40
+ protected _handleGamepadInput(gamepadId: string, up: boolean, repeat?: boolean): void;
41
+ }
@@ -15,6 +15,7 @@ declare global {
15
15
  * The currently supported variables are:
16
16
  * - {@link game}
17
17
  * - {@link socket}
18
+ * - {@link ui}
18
19
  * - {@link canvas}
19
20
  *
20
21
  * @example
@@ -64,9 +65,7 @@ declare global {
64
65
  * @defaultValue `{}`
65
66
  */
66
67
  windows: Record<number, Application>;
67
- } & {
68
- [Key in keyof CONFIG['ui']]?: InstanceType<CONFIG['ui'][Key]>;
69
- };
68
+ } & ('ui' extends keyof LenientGlobalVariableTypes ? UiApplications : Partial<UiApplications>);
70
69
 
71
70
  /** The client-side console is the default logger */
72
71
  let logger: typeof console;
@@ -115,7 +114,7 @@ declare global {
115
114
  let _token: InstanceType<CONFIG['Token']['objectClass']> | null;
116
115
 
117
116
  /*
118
- * Global Vairables
117
+ * Global Variables
119
118
  * The following variables are declared directly in foundry's HTML file (or more concretely, in `main.hbs`)
120
119
  */
121
120
 
@@ -128,4 +127,8 @@ declare global {
128
127
  | null;
129
128
  }
130
129
 
130
+ type UiApplications = {
131
+ [Key in keyof CONFIG['ui']]: InstanceType<CONFIG['ui'][Key]>;
132
+ };
133
+
131
134
  export {};
@@ -218,7 +218,7 @@ declare namespace HandlebarsHelpers {
218
218
 
219
219
  /**
220
220
  * The original HTML content as a string
221
- * @defaultValue `''`
221
+ * @defaultValue `""`
222
222
  */
223
223
  content?: string;
224
224
  };
@@ -259,7 +259,7 @@ declare namespace HandlebarsHelpers {
259
259
  interface NumberInputOptions extends Handlebars.HelperOptions {
260
260
  hash: {
261
261
  /**
262
- * @defaultValue `''`
262
+ * @defaultValue `""`
263
263
  */
264
264
  name?: string;
265
265
 
@@ -271,12 +271,12 @@ declare namespace HandlebarsHelpers {
271
271
  disabled?: boolean;
272
272
 
273
273
  /**
274
- * @defaultValue `''`
274
+ * @defaultValue `""`
275
275
  */
276
276
  placeholder?: string;
277
277
 
278
278
  /**
279
- * @defaultValue `''`
279
+ * @defaultValue `""`
280
280
  */
281
281
  class?: string;
282
282
 
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  ConfiguredDocumentClass,
3
+ ConfiguredDocumentClassForName,
3
4
  ConfiguredObjectClassForName,
4
5
  DocumentConstructor,
5
6
  ToObjectFalseType
@@ -162,6 +163,22 @@ declare global {
162
163
  change: EffectChangeData
163
164
  ) => boolean | void;
164
165
 
166
+ /**
167
+ * A hook event that fires immediately prior to PIXI Application construction with the configuration parameters.
168
+ * @param canvasConfig - Canvas configuration parameters that will be used
169
+ */
170
+ canvasConfig: (canvasConfig: {
171
+ view: HTMLCanvasElement;
172
+ width: number;
173
+ height: number;
174
+ transparent: boolean;
175
+ resolution: number;
176
+ autoDensity: boolean;
177
+ backgroundColor: string | null;
178
+ antialias: boolean;
179
+ powerPreference: string;
180
+ }) => unknown;
181
+
165
182
  /**
166
183
  * A hook event that fires when the Canvas is initialized.
167
184
  * @param canvas - the Canvas
@@ -259,6 +276,20 @@ declare global {
259
276
  */
260
277
  collapseSidebar: (sidebar: Sidebar, collapsed: boolean) => unknown;
261
278
 
279
+ /**
280
+ * A hook event that fires when Cards are dealt from a deck to other hands
281
+ * @param origin - The origin Cards document
282
+ * @param destinations - An array of destination Cards documents
283
+ * @param context - Additional context which describes the operation
284
+ * @remarks This is called by {@link Hooks.call}.
285
+ * @remarks An explicit return value of `false` prevents the operation.
286
+ */
287
+ dealCards: (
288
+ origin: InstanceType<ConfiguredDocumentClassForName<'Cards'>>,
289
+ destinations: InstanceType<ConfiguredDocumentClassForName<'Cards'>>[],
290
+ context: Cards.DealContext
291
+ ) => boolean | void;
292
+
262
293
  /**
263
294
  * A hook event that fires when some useful data is dropped onto an ActorSheet.
264
295
  * @param actor - The Actor
@@ -395,6 +426,20 @@ declare global {
395
426
  updates: Record<string, number>
396
427
  ) => boolean;
397
428
 
429
+ /**
430
+ * A hook event that fires when Cards are passed from one stack to another
431
+ * @param origin - The origin Cards document
432
+ * @param destination - The destination Cards document
433
+ * @param context - Additional context which describes the operation
434
+ * @remarks This is called by {@link Hooks.call}.
435
+ * @remarks An explicit return value of `false` prevents the operation.
436
+ */
437
+ passCards: (
438
+ origin: InstanceType<ConfiguredDocumentClassForName<'Cards'>>,
439
+ destination: InstanceType<ConfiguredDocumentClassForName<'Cards'>>,
440
+ context: Cards.DealContext
441
+ ) => boolean | void;
442
+
398
443
  /**
399
444
  * A hook event that fires when the game is paused or un-paused.
400
445
  * @param paused - Is the game now paused (true) or un-paused (false)
@@ -434,6 +479,18 @@ declare global {
434
479
  }
435
480
  ) => boolean | void;
436
481
 
482
+ /**
483
+ * A hook event that fires when a stack of Cards are returned to the decks they originally came from.
484
+ * @param origin - The origin Cards document.
485
+ * @param returned - The cards being returned.
486
+ * @param context - Additional context which describes the operation.
487
+ */
488
+ returnCards: (
489
+ origin: InstanceType<ConfiguredDocumentClassForName<'Cards'>>,
490
+ returned: InstanceType<ConfiguredDocumentClassForName<'Card'>>[],
491
+ context: Cards.ReturnContext
492
+ ) => boolean | void;
493
+
437
494
  /**
438
495
  * A hook event that fires when the AV settings are changed.
439
496
  * @param settings - The AVSettings manager