@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,13 +1,23 @@
1
- import { ConfiguredDocumentClass, ConstructorDataType, PropertiesToSource } from '../../../types/helperTypes';
1
+ import { ConfiguredDocumentClass, PropertiesToSource } from '../../../types/helperTypes';
2
2
  import { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
- import { AmbientLightDataProperties } from '../../common/data/data.mjs/ambientLightData';
4
- import { AmbientSoundDataProperties } from '../../common/data/data.mjs/ambientSoundData';
5
- import { DrawingDataProperties } from '../../common/data/data.mjs/drawingData';
6
- import { MeasuredTemplateDataProperties } from '../../common/data/data.mjs/measuredTemplateData';
7
- import { NoteDataProperties } from '../../common/data/data.mjs/noteData';
8
- import { TileDataProperties } from '../../common/data/data.mjs/tileData';
9
- import { TokenDataProperties } from '../../common/data/data.mjs/tokenData';
10
- import { WallDataProperties } from '../../common/data/data.mjs/wallData';
3
+ import {
4
+ AmbientLightDataConstructorData,
5
+ AmbientLightDataProperties
6
+ } from '../../common/data/data.mjs/ambientLightData';
7
+ import {
8
+ AmbientSoundDataConstructorData,
9
+ AmbientSoundDataProperties
10
+ } from '../../common/data/data.mjs/ambientSoundData';
11
+ import { DrawingDataConstructorData, DrawingDataProperties } from '../../common/data/data.mjs/drawingData';
12
+ import {
13
+ MeasuredTemplateDataConstructorData,
14
+ MeasuredTemplateDataProperties
15
+ } from '../../common/data/data.mjs/measuredTemplateData';
16
+ import { NoteDataConstructorData, NoteDataProperties } from '../../common/data/data.mjs/noteData';
17
+ import type { SceneDataConstructorData } from '../../common/data/data.mjs/sceneData.js';
18
+ import { TileDataConstructorData, TileDataProperties } from '../../common/data/data.mjs/tileData';
19
+ import { TokenDataConstructorData, TokenDataProperties } from '../../common/data/data.mjs/tokenData';
20
+ import { WallDataConstructorData, WallDataProperties } from '../../common/data/data.mjs/wallData';
11
21
 
12
22
  declare global {
13
23
  /**
@@ -94,10 +104,7 @@ declare global {
94
104
  * @param options - (default: `{}`)
95
105
  */
96
106
  clone(
97
- createData?: DeepPartial<
98
- | ConstructorDataType<foundry.data.SceneData>
99
- | (ConstructorDataType<foundry.data.SceneData> & Record<string, unknown>)
100
- >,
107
+ createData?: DeepPartial<SceneDataConstructorData | (SceneDataConstructorData & Record<string, unknown>)>,
101
108
  options?: { save?: boolean; keepId?: boolean }
102
109
  ): TemporaryDocument<this> | Promise<TemporaryDocument<this | undefined>>;
103
110
 
@@ -106,7 +113,7 @@ declare global {
106
113
 
107
114
  /** @override */
108
115
  protected _preCreate(
109
- data: ConstructorDataType<foundry.data.SceneData>,
116
+ data: SceneDataConstructorData,
110
117
  options: DocumentModificationOptions,
111
118
  user: foundry.documents.BaseUser
112
119
  ): Promise<void>;
@@ -120,7 +127,7 @@ declare global {
120
127
 
121
128
  /** @override */
122
129
  protected _preUpdate(
123
- changed: DeepPartial<ConstructorDataType<foundry.data.SceneData>>,
130
+ changed: DeepPartial<SceneDataConstructorData>,
124
131
  options: DocumentModificationOptions,
125
132
  user: foundry.documents.BaseUser
126
133
  ): Promise<void>;
@@ -147,49 +154,49 @@ declare global {
147
154
  /** @override */
148
155
  _preCreateEmbeddedDocuments(
149
156
  embeddedName: string,
150
- result: ConstructorDataType<foundry.data.DrawingData>[],
157
+ result: DrawingDataConstructorData[],
151
158
  options: DocumentModificationOptions,
152
159
  userId: string
153
160
  ): void;
154
161
  _preCreateEmbeddedDocuments(
155
162
  embeddedName: string,
156
- result: ConstructorDataType<foundry.data.TokenData>[],
163
+ result: TokenDataConstructorData[],
157
164
  options: DocumentModificationOptions,
158
165
  userId: string
159
166
  ): void;
160
167
  _preCreateEmbeddedDocuments(
161
168
  embeddedName: string,
162
- result: ConstructorDataType<foundry.data.AmbientLightData>[],
169
+ result: AmbientLightDataConstructorData[],
163
170
  options: DocumentModificationOptions,
164
171
  userId: string
165
172
  ): void;
166
173
  _preCreateEmbeddedDocuments(
167
174
  embeddedName: string,
168
- result: ConstructorDataType<foundry.data.NoteData>[],
175
+ result: NoteDataConstructorData[],
169
176
  options: DocumentModificationOptions,
170
177
  userId: string
171
178
  ): void;
172
179
  _preCreateEmbeddedDocuments(
173
180
  embeddedName: string,
174
- result: ConstructorDataType<foundry.data.AmbientSoundData>[],
181
+ result: AmbientSoundDataConstructorData[],
175
182
  options: DocumentModificationOptions,
176
183
  userId: string
177
184
  ): void;
178
185
  _preCreateEmbeddedDocuments(
179
186
  embeddedName: string,
180
- result: ConstructorDataType<foundry.data.MeasuredTemplateData>[],
187
+ result: MeasuredTemplateDataConstructorData[],
181
188
  options: DocumentModificationOptions,
182
189
  userId: string
183
190
  ): void;
184
191
  _preCreateEmbeddedDocuments(
185
192
  embeddedName: string,
186
- result: ConstructorDataType<foundry.data.TileData>[],
193
+ result: TileDataConstructorData[],
187
194
  options: DocumentModificationOptions,
188
195
  userId: string
189
196
  ): void;
190
197
  _preCreateEmbeddedDocuments(
191
198
  embeddedName: string,
192
- result: ConstructorDataType<foundry.data.WallData>[],
199
+ result: WallDataConstructorData[],
193
200
  options: DocumentModificationOptions,
194
201
  userId: string
195
202
  ): void;
@@ -0,0 +1,299 @@
1
+ /**
2
+ * A class responsible for managing defined game keybinding.
3
+ * Each keybinding is a string key/value pair belonging to a certain namespace and a certain store scope.
4
+ *
5
+ * When Foundry Virtual Tabletop is initialized, a singleton instance of this class is constructed within the global
6
+ * Game object as as game.keybindings.
7
+ *
8
+ * @see {@link Game#keybindings}
9
+ * @see {@link SettingKeybindingConfig}
10
+ * @see {@link KeybindingsConfig}
11
+ */
12
+ declare class ClientKeybindings {
13
+ constructor();
14
+
15
+ /** Registered Keybinding actions */
16
+ actions: Map<string, KeybindingActionConfig>;
17
+
18
+ /** A mapping of a string key to possible Actions that might execute off it */
19
+ activeKeys: Map<string, KeybindingAction[]>;
20
+
21
+ /**
22
+ * A stored cache of Keybind Actions Ids to Bindings
23
+ * @remarks This is only undefined before the "ready" hook.
24
+ */
25
+ bindings: Map<string, KeybindingActionBinding[]> | undefined;
26
+
27
+ /**
28
+ * A count of how many registered keybindings there are
29
+ * @internal
30
+ * @defaultValue `0`
31
+ */
32
+ protected _registered: number;
33
+
34
+ /**
35
+ * A timestamp which tracks the last time a pan operation was performed
36
+ * @internal
37
+ * @defaultValue `0`
38
+ */
39
+ protected _moveTime: number;
40
+
41
+ static MOVEMENT_DIRECTIONS: ClientKeybindings.MovementDirections;
42
+
43
+ static ZOOM_DIRECTIONS: ClientKeybindings.ZoomDirections;
44
+
45
+ /**
46
+ * An alias of the movement key set tracked by the keyboard
47
+ */
48
+ get moveKeys(): Set<string>;
49
+
50
+ /** Initializes the keybinding values for all registered actions */
51
+ initialize(): void;
52
+
53
+ /**
54
+ * Register a new keybinding
55
+ *
56
+ * @param namespace - The namespace the Keybinding Action belongs to
57
+ * @param action - A unique machine-readable id for the Keybinding Action
58
+ * @param data - Configuration for keybinding data
59
+ *
60
+ * @example <caption>Define a keybinding which shows a notification</caption>
61
+ * ```typescript
62
+ * game.keybindings.register("myModule", "showNotification", {
63
+ * name: "My Settings Keybinding",
64
+ * hint: "A description of what will occur when the Keybinding is executed.",
65
+ * uneditable: [
66
+ * {
67
+ * key: "Digit1",
68
+ * modifiers: ["Control"]
69
+ * }
70
+ * ],
71
+ * editable: [
72
+ * {
73
+ * key: "F1"
74
+ * }
75
+ * ],
76
+ * onDown: () => { ui.notifications.info("Pressed!") },
77
+ * onUp: () => {},
78
+ * restricted: true, // Restrict this Keybinding to gamemaster only?
79
+ * reservedModifiers: ["Alt""], // If the ALT modifier is pressed, the notification is permanent instead of temporary
80
+ * precedence: CONST.KEYBINDING_PRECEDENCE.NORMAL
81
+ * }
82
+ * ```
83
+ * @throws if called after `this.bindings` has been initialized.
84
+ */
85
+ register(namespace: string, action: string, data: KeybindingActionConfig): void;
86
+
87
+ /**
88
+ * Get the current Bindings of a given namespace's Keybinding Action
89
+ *
90
+ * @param namespace - The namespace under which the setting is registered
91
+ * @param action - The keybind action to retrieve
92
+ *
93
+ * @example <caption>Retrieve the current Keybinding Action Bindings</caption>
94
+ * ```typescript
95
+ * game.keybindings.get("myModule", "showNotification");
96
+ * ```
97
+ */
98
+ get(namespace: string, action: string): KeybindingActionBinding[];
99
+
100
+ /**
101
+ * Set the editable Bindings of a Keybinding Action for a certain namespace and Action
102
+ *
103
+ * @param namespace - The namespace under which the Keybinding is registered
104
+ * @param action - The Keybinding action to set
105
+ * @param bindings - The Bindings to assign to the Keybinding
106
+ *
107
+ * @example <caption>Update the current value of a keybinding</caption>
108
+ * ```typescript
109
+ * game.keybindings.set("myModule", "showNotification", [
110
+ * {
111
+ * key: "F2",
112
+ * modifiers: [ "CONTROL" ]
113
+ * }
114
+ * ]);
115
+ * ```
116
+ * @remarks Passing `undefined` or nothing as `bindings` resets to the default.
117
+ */
118
+ set(namespace: string, action: string, bindings?: KeybindingActionBinding[] | undefined): Promise<void>;
119
+
120
+ /** Reset all client keybindings back to their default configuration. */
121
+ resetDefaults(): Promise<void>;
122
+
123
+ /**
124
+ * A helper method that, when given a value, ensures that the returned value is a standardized Binding array
125
+ * @param values - An array of keybinding assignments to be validated
126
+ * @returns An array of keybinding assignments confirmed as valid
127
+ * @internal
128
+ */
129
+ protected static _validateBindings(values: Array<KeybindingActionBinding>): Array<Required<KeybindingActionBinding>>;
130
+
131
+ /**
132
+ * Validate that assigned modifiers are allowed
133
+ * @param keys - An array of modifiers which may be valid
134
+ * @returns An array of modifiers which are confirmed as valid
135
+ * @internal
136
+ */
137
+ protected static _validateModifiers(keys: string[]): string[];
138
+
139
+ /**
140
+ * Compares two Keybinding Actions based on their Order
141
+ * @param a - The first Keybinding Action
142
+ * @param b - the second Keybinding Action
143
+ */
144
+ protected static _compareActions(a: KeybindingAction, b: KeybindingAction): number;
145
+
146
+ /** Register core keybindings */
147
+ protected _registerCoreKeybindings(): void;
148
+
149
+ /**
150
+ * Handle Select all action
151
+ * @param event - The originating keyboard event
152
+ * (unused)
153
+ * @param context - The context data of the event
154
+ * (unused)
155
+ * @internal
156
+ */
157
+ protected static _onSelectAllObjects(event?: KeyboardEvent, context?: KeyboardEventContext): boolean;
158
+
159
+ /**
160
+ * Handle Cycle View actions
161
+ * @param context - The context data of the event
162
+ * @internal
163
+ */
164
+ protected static _onCycleView(context: KeyboardEventContext): boolean;
165
+
166
+ /**
167
+ * Handle Dismiss actions
168
+ * @param context - The context data of the event
169
+ * (unused)
170
+ * @internal
171
+ */
172
+ protected static _onDismiss(context?: KeyboardEventContext): boolean;
173
+
174
+ /**
175
+ * Open Character sheet for current token or controlled actor
176
+ * @param event - (unused)
177
+ * @param context - The context data of the event
178
+ * (unused)
179
+ * @internal
180
+ */
181
+ protected static _onToggleCharacterSheet(event?: KeyboardEvent, context?: KeyboardEventContext): ActorSheet | null;
182
+
183
+ /**
184
+ * Handle action to target the currently hovered token.
185
+ * @param context - The context data of the event
186
+ * @internal
187
+ */
188
+ protected static _onTarget(context: KeyboardEventContext): boolean;
189
+
190
+ /**
191
+ * Handle DELETE Keypress Events
192
+ * @param event - The originating keyboard event
193
+ * @param context - The context data of the event
194
+ * (unused)
195
+ * @internal
196
+ */
197
+ protected static _onDelete(event: KeyboardEvent, context?: KeyboardEventContext): boolean;
198
+
199
+ /**
200
+ * Handle keyboard movement once a small delay has elapsed to allow for multiple simultaneous key-presses.
201
+ * @param context - The context data of the event
202
+ * @param layer - The Placeables layer
203
+ * @internal
204
+ */
205
+ protected _handleMovement(context: KeyboardEventContext, layer: TokenLayer | BackgroundLayer): void;
206
+
207
+ /** Handle panning the canvas using CTRL + directional keys */
208
+ protected _handleCanvasPan(): ReturnType<Canvas['animatePan']>;
209
+
210
+ /**
211
+ * Handle Measured Ruler Movement Action
212
+ * @param context - The context data of the event
213
+ * (unused)
214
+ * @internal
215
+ */
216
+ protected static _onMeasuredRulerMovement(context?: KeyboardEventContext): boolean | void;
217
+
218
+ /**
219
+ * Handle Pause Action
220
+ * @param context - The context data of the event
221
+ * (unused)
222
+ * @internal
223
+ */
224
+ protected static _onPause(context?: KeyboardEventContext): true;
225
+
226
+ /**
227
+ * Handle Highlight action
228
+ * @param context - The context data of the event
229
+ * (unused)
230
+ * @internal
231
+ */
232
+ protected static _onHighlight(context?: KeyboardEventContext): boolean;
233
+
234
+ /**
235
+ * Handle Pan action
236
+ * @param context - The context data of the event
237
+ * @param movementDirections - The Directions being panned in
238
+ * @internal
239
+ */
240
+ protected _onPan(context: KeyboardEventContext, movementDirections: ClientKeybindings.MovementDirection[]): boolean;
241
+
242
+ /**
243
+ * Handle number key presses
244
+ * @param context - The context data of the event
245
+ * @internal
246
+ */
247
+ protected static _onMacro(context: KeyboardEventContext): true;
248
+
249
+ /**
250
+ * Handle action to copy data to clipboard
251
+ * @param context - The context data of the event
252
+ * (unused)
253
+ * @internal
254
+ */
255
+ protected static _onCopy(context?: KeyboardEventContext): boolean;
256
+
257
+ /**
258
+ * Handle Paste action
259
+ * @param context - The context data of the event
260
+ * @internal
261
+ */
262
+ protected static _onPaste(context: KeyboardEventContext): boolean;
263
+
264
+ /**
265
+ * Handle Undo action
266
+ * @param context - The context data of the event
267
+ * (unused)
268
+ * @internal
269
+ */
270
+ protected static _onUndo(context?: KeyboardEventContext): boolean;
271
+
272
+ /**
273
+ * Handle presses to keyboard zoom keys
274
+ * @param context - The context data of the event
275
+ * (unused)
276
+ * @param zoomDirection - The direction to zoom
277
+ * @internal
278
+ */
279
+ protected static _onZoom(
280
+ context: KeyboardEventContext | unknown,
281
+ zoomDirection: ClientKeybindings.ZoomDirection
282
+ ): boolean;
283
+ }
284
+
285
+ declare namespace ClientKeybindings {
286
+ type MovementDirections = {
287
+ UP: 'up';
288
+ LEFT: 'left';
289
+ DOWN: 'down';
290
+ RIGHT: 'right';
291
+ };
292
+ type MovementDirection = ValueOf<MovementDirections>;
293
+
294
+ type ZoomDirections = {
295
+ IN: 'in';
296
+ OUT: 'out';
297
+ };
298
+ type ZoomDirection = ValueOf<ZoomDirections>;
299
+ }
@@ -219,16 +219,31 @@ declare namespace ClientSettings {
219
219
  }
220
220
 
221
221
  interface Values {
222
- 'core.combatTrackerConfig': { resource: string; skipDefeated: boolean };
223
- 'core.compendiumConfiguration': Partial<Record<string, CompendiumCollection.Configuration>>;
224
- 'core.rollMode': foundry.CONST.DiceRollMode;
225
222
  'core.animateRollTable': boolean;
226
- 'core.permissions': Game.Permissions;
223
+ 'core.chatBubbles': boolean;
224
+ 'core.chatBubblesPan': boolean;
225
+ 'core.combatTrackerConfig': { resource: string; skipDefeated: boolean } | {};
226
+ 'core.compendiumConfiguration': Partial<Record<string, CompendiumCollection.Configuration>>;
227
+ 'core.coneTemplateType': 'round' | 'flat';
227
228
  'core.defaultDrawingConfig': foundry.data.DrawingData['_source'] | {};
228
- 'core.time': number;
229
- 'core.globalPlaylistVolume': number;
230
229
  'core.globalAmbientVolume': number;
231
230
  'core.globalInterfaceVolume': number;
231
+ 'core.globalPlaylistVolume': number;
232
+ 'core.keybindings': Record<string, KeybindingActionBinding[]>;
233
+ 'core.language': string;
234
+ 'core.leftClickRelease': boolean;
235
+ 'core.lightAnimation': boolean;
236
+ 'core.maxFPS': number;
237
+ 'core.mipmap': boolean;
238
+ 'core.moduleConfiguration': Record<string, boolean>;
239
+ 'core.nue.shownTips': boolean;
240
+ 'core.noCanvas': boolean;
241
+ 'core.permissions': Game.Permissions;
242
+ 'core.rollMode': foundry.CONST.DICE_ROLL_MODES;
243
+ 'core.softShadows': boolean;
244
+ 'core.time': number;
245
+ 'core.tokenDragPreview': boolean;
246
+ 'core.visionAnimation': boolean;
232
247
  [key: string]: unknown;
233
248
  }
234
249
  }
@@ -1,5 +1,4 @@
1
1
  import { ConfiguredDocumentClassForName, ConstructorDataType } from '../../../../types/helperTypes';
2
- import { IdQuery } from '../../../common/abstract/backend.mjs';
3
2
  import { DocumentModificationOptions } from '../../../common/abstract/document.mjs';
4
3
 
5
4
  declare global {
@@ -25,6 +24,12 @@ declare global {
25
24
  /** A debounced function which will clear the contents of the Compendium pack if it is not accessed frequently. */
26
25
  _flush: () => void;
27
26
 
27
+ /**
28
+ * Has this Compendium pack been fully indexed?
29
+ * @defaultValue `false`
30
+ */
31
+ indexed: boolean;
32
+
28
33
  /**
29
34
  * The amount of time that Document instances within this CompendiumCollection are held in memory.
30
35
  * Accessing the contents of the Compendium pack extends the duration of this lifetime.
@@ -37,6 +42,32 @@ declare global {
37
42
  */
38
43
  static CONFIG_SETTING: 'compendiumConfiguration';
39
44
 
45
+ /**
46
+ * The default index fields which should be retrieved for each Compendium document type
47
+ */
48
+ static INDEX_FIELDS: {
49
+ /** @defaultValue `["name", "img", "type"]` */
50
+ Actor: (keyof foundry.data.ActorData['_source'])[];
51
+
52
+ /** @defaultValue `["name", "img", "type"]` */
53
+ Item: (keyof foundry.data.ItemData['_source'])[];
54
+
55
+ /** @defaultValue `["name", "thumb"]` */
56
+ Scene: (keyof foundry.data.SceneData['_source'])[];
57
+
58
+ /** @defaultValue `["name", "img"]` */
59
+ JournalEntry: (keyof foundry.data.JournalEntryData['_source'])[];
60
+
61
+ /** @defaultValue `["name", "img"]` */
62
+ Macro: (keyof foundry.data.MacroData['_source'])[];
63
+
64
+ /** @defaultValue `["name", "img"]` */
65
+ RollTable: (keyof foundry.data.RollTableData['_source'])[];
66
+
67
+ /** @defaultValue `["name"]` */
68
+ Playlist: (keyof foundry.data.PlaylistData['_source'])[];
69
+ };
70
+
40
71
  /** The canonical Compendium name - comprised of the originating package and the pack name */
41
72
  get collection(): string;
42
73
 
@@ -64,8 +95,11 @@ declare global {
64
95
 
65
96
  delete: (id: string) => boolean;
66
97
 
67
- /** Load the Compendium index and cache it as the keys and values of the Collection. */
68
- getIndex(): Promise<this['index']>;
98
+ /**
99
+ * Load the Compendium index and cache it as the keys and values of the Collection.
100
+ * @param options - Options which customize how the index is created
101
+ */
102
+ getIndex(options?: CompendiumCollection.GetIndexOptions<T>): Promise<this['index']>;
69
103
 
70
104
  /**
71
105
  * Get a single Document from this Compendium by ID.
@@ -81,7 +115,7 @@ declare global {
81
115
  * default: `{}`
82
116
  * @returns The retrieved Document instances
83
117
  */
84
- getDocuments(query?: IdQuery): Promise<StoredDocument<DocumentInstanceForCompendiumMetadata<T>>[]>;
118
+ getDocuments(query?: Record<string, unknown>): Promise<StoredDocument<DocumentInstanceForCompendiumMetadata<T>>[]>;
85
119
 
86
120
  /**
87
121
  * Import a Document into this Compendium Collection.
@@ -236,6 +270,11 @@ declare global {
236
270
  package: string;
237
271
  system?: string;
238
272
  }
273
+
274
+ interface GetIndexOptions<T extends CompendiumCollection.Metadata> {
275
+ /** An array of fields to return as part of the index */
276
+ fields?: (keyof DocumentInstanceForCompendiumMetadata<T>['data']['_source'])[];
277
+ }
239
278
  }
240
279
  }
241
280
 
@@ -247,7 +286,7 @@ interface ImportAllOptions {
247
286
  folderId?: string | null;
248
287
  /**
249
288
  * A new Folder name to create.
250
- * @defaultValue `''`
289
+ * @defaultValue `""`
251
290
  * */
252
291
  folderName?: string;
253
292
  /**
@@ -266,11 +305,5 @@ type DocumentInstanceForCompendiumMetadata<T extends CompendiumCollection.Metada
266
305
  >;
267
306
 
268
307
  type IndexTypeForMetadata<T extends CompendiumCollection.Metadata> = foundry.utils.Collection<
269
- Pick<
270
- StoredDocument<DocumentInstanceForCompendiumMetadata<T>>['data'],
271
- | '_id'
272
- | 'name'
273
- | ('img' extends keyof StoredDocument<DocumentInstanceForCompendiumMetadata<T>>['data'] ? 'img' : never)
274
- | ('type' extends keyof StoredDocument<DocumentInstanceForCompendiumMetadata<T>>['data'] ? 'type' : never)
275
- >
308
+ { _id: string } & Partial<DocumentInstanceForCompendiumMetadata<T>['data']['_source']>
276
309
  >;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The collection of Cards documents which exist within the active World.
3
+ * This Collection is accessible within the Game object as game.cards.
4
+ * @see {@link Cards} The Cards document
5
+ */
6
+ declare class CardStacks extends WorldCollection<typeof foundry.documents.BaseCards, 'Cards'> {
7
+ /** @override */
8
+ static documentName: 'Cards';
9
+ }
@@ -1,4 +1,5 @@
1
1
  import './actors';
2
+ import './cardStacks';
2
3
  import './combatEncounters';
3
4
  import './fogExplorations';
4
5
  import './folders';
@@ -1,4 +1,5 @@
1
- import { ConfiguredDocumentClass, ConstructorDataType } from '../../../../../types/helperTypes';
1
+ import { ConfiguredDocumentClass } from '../../../../../types/helperTypes';
2
+ import type { SceneDataConstructorData } from '../../../../common/data/data.mjs/sceneData.js';
2
3
 
3
4
  declare global {
4
5
  /**
@@ -35,7 +36,7 @@ declare global {
35
36
  */
36
37
  protected _onChangeScene(
37
38
  scene: StoredDocument<InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseScene>>>,
38
- data: DeepPartial<ConstructorDataType<foundry.documents.BaseScene['data']>>
39
+ data: DeepPartial<SceneDataConstructorData>
39
40
  ): Promise<void>;
40
41
  }
41
42
  }