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

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 (191) hide show
  1. package/package.json +1 -1
  2. package/src/foundry/common/abstract/document.mjs.d.ts +13 -6
  3. package/src/foundry/common/config.mjs/releaseData.d.ts +3 -1
  4. package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +3 -1
  5. package/src/foundry/common/data/data.mjs/actorData.d.ts +1 -1
  6. package/src/foundry/common/data/data.mjs/adventureData.d.ts +14 -12
  7. package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +5 -3
  8. package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +62 -16
  9. package/src/foundry/common/data/data.mjs/animationData.d.ts +13 -5
  10. package/src/foundry/common/data/data.mjs/cardData.d.ts +4 -4
  11. package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +5 -3
  12. package/src/foundry/common/data/data.mjs/cardsData.d.ts +3 -3
  13. package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +3 -1
  14. package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +3 -1
  15. package/src/foundry/common/data/data.mjs/combatData.d.ts +3 -1
  16. package/src/foundry/common/data/data.mjs/combatantData.d.ts +3 -1
  17. package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +3 -1
  18. package/src/foundry/common/data/data.mjs/drawingData.d.ts +3 -1
  19. package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +3 -1
  20. package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +3 -1
  21. package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +3 -1
  22. package/src/foundry/common/data/data.mjs/folderData.d.ts +3 -1
  23. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +3 -1
  24. package/src/foundry/common/data/data.mjs/lightData.d.ts +7 -5
  25. package/src/foundry/common/data/data.mjs/macroData.d.ts +3 -1
  26. package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +3 -1
  27. package/src/foundry/common/data/data.mjs/noteData.d.ts +3 -1
  28. package/src/foundry/common/data/data.mjs/playlistData.d.ts +3 -1
  29. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +3 -1
  30. package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +6 -4
  31. package/src/foundry/common/data/data.mjs/rollTableData.d.ts +3 -1
  32. package/src/foundry/common/data/data.mjs/sceneData.d.ts +3 -1
  33. package/src/foundry/common/data/data.mjs/settingData.d.ts +3 -1
  34. package/src/foundry/common/data/data.mjs/tableResultData.d.ts +3 -1
  35. package/src/foundry/common/data/data.mjs/tileData.d.ts +4 -2
  36. package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +4 -2
  37. package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +4 -2
  38. package/src/foundry/common/data/data.mjs/tokenData.d.ts +5 -3
  39. package/src/foundry/common/data/data.mjs/userData.d.ts +3 -1
  40. package/src/foundry/common/data/data.mjs/videoData.d.ts +4 -2
  41. package/src/foundry/common/data/data.mjs/wallData.d.ts +4 -2
  42. package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +15 -12
  43. package/src/foundry/common/documents.mjs/baseActor.d.ts +24 -21
  44. package/src/foundry/common/documents.mjs/baseAdventure.d.ts +14 -12
  45. package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +14 -11
  46. package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +14 -11
  47. package/src/foundry/common/documents.mjs/baseCard.d.ts +27 -28
  48. package/src/foundry/common/documents.mjs/baseCards.d.ts +18 -16
  49. package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +24 -17
  50. package/src/foundry/common/documents.mjs/baseCombat.d.ts +21 -20
  51. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +25 -18
  52. package/src/foundry/common/documents.mjs/baseDrawing.d.ts +26 -23
  53. package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +19 -17
  54. package/src/foundry/common/documents.mjs/baseFolder.d.ts +14 -12
  55. package/src/foundry/common/documents.mjs/baseItem.d.ts +25 -19
  56. package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +16 -14
  57. package/src/foundry/common/documents.mjs/baseMacro.d.ts +21 -18
  58. package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +34 -18
  59. package/src/foundry/common/documents.mjs/baseNote.d.ts +20 -14
  60. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +16 -14
  61. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +14 -11
  62. package/src/foundry/common/documents.mjs/baseRollTable.d.ts +16 -14
  63. package/src/foundry/common/documents.mjs/baseScene.d.ts +23 -21
  64. package/src/foundry/common/documents.mjs/baseSetting.d.ts +18 -16
  65. package/src/foundry/common/documents.mjs/baseTableResult.d.ts +27 -19
  66. package/src/foundry/common/documents.mjs/baseTile.d.ts +17 -11
  67. package/src/foundry/common/documents.mjs/baseToken.d.ts +20 -16
  68. package/src/foundry/common/documents.mjs/baseUser.d.ts +45 -11
  69. package/src/foundry/common/documents.mjs/baseWall.d.ts +17 -15
  70. package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +3 -1
  71. package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +4 -2
  72. package/src/foundry/common/packages.mjs/packageData.d.ts +3 -4
  73. package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +3 -1
  74. package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +3 -1
  75. package/src/foundry/common/utils/primitives.mjs.d.ts +8 -1
  76. package/src/foundry/foundry.js/application.d.ts +139 -111
  77. package/src/foundry/foundry.js/applications/basePlaceableHUD.d.ts +2 -2
  78. package/src/foundry/foundry.js/applications/basePlaceableHUDs/drawingHUD.d.ts +2 -2
  79. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tileHUD.d.ts +2 -2
  80. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +3 -3
  81. package/src/foundry/foundry.js/applications/cameraViews.d.ts +2 -2
  82. package/src/foundry/foundry.js/applications/chatPopout.d.ts +3 -3
  83. package/src/foundry/foundry.js/applications/compendium.d.ts +2 -2
  84. package/src/foundry/foundry.js/applications/dialog.d.ts +1 -1
  85. package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
  86. package/src/foundry/foundry.js/applications/formApplication.d.ts +45 -14
  87. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +1 -1
  88. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -2
  89. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +1 -1
  90. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +20 -31
  91. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  92. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
  93. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +5 -5
  94. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +4 -4
  95. package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +3 -3
  96. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +2 -2
  97. package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
  98. package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +1 -1
  99. package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +3 -3
  100. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +3 -3
  101. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +3 -3
  102. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +2 -2
  103. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +3 -3
  104. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +3 -3
  105. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +3 -3
  106. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +4 -4
  107. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +2 -2
  108. package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +7 -7
  109. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
  110. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +5 -5
  111. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  112. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  113. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +2 -2
  114. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +2 -2
  115. package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +2 -2
  116. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +1 -1
  117. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +4 -4
  118. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +3 -3
  119. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +1 -1
  120. package/src/foundry/foundry.js/applications/frameViewer.d.ts +1 -1
  121. package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +2 -2
  122. package/src/foundry/foundry.js/applications/hotbar.d.ts +2 -2
  123. package/src/foundry/foundry.js/applications/mainMenu.d.ts +2 -2
  124. package/src/foundry/foundry.js/applications/notifications.d.ts +7 -4
  125. package/src/foundry/foundry.js/applications/pause.d.ts +2 -2
  126. package/src/foundry/foundry.js/applications/playerList.d.ts +2 -2
  127. package/src/foundry/foundry.js/applications/sceneControls.d.ts +2 -2
  128. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +3 -3
  129. package/src/foundry/foundry.js/applications/sidebar.d.ts +2 -2
  130. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +4 -7
  131. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +2 -2
  132. package/src/foundry/foundry.js/applications/sidebarTabs/combatTracker.d.ts +26 -28
  133. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  134. package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +2 -2
  135. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +2 -2
  136. package/src/foundry/foundry.js/avSettings.d.ts +11 -0
  137. package/src/foundry/foundry.js/canvas.d.ts +5 -0
  138. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +38 -35
  139. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +1 -1
  140. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +1 -1
  141. package/src/foundry/foundry.js/clientDocuments/card.d.ts +2 -1
  142. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +1 -6
  143. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +1 -1
  144. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +5 -5
  145. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +15 -9
  146. package/src/foundry/foundry.js/clientDocuments/item.d.ts +2 -2
  147. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +1 -1
  148. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +39 -38
  149. package/src/foundry/foundry.js/clientDocuments/user.d.ts +27 -35
  150. package/src/foundry/foundry.js/clientSettings.d.ts +1 -1
  151. package/src/foundry/foundry.js/collections/documentCollection.d.ts +66 -12
  152. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +78 -67
  153. package/src/foundry/foundry.js/collections/documentCollections/worldCollection.d.ts +73 -32
  154. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/actors.d.ts +3 -37
  155. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/combatEncounters.d.ts +5 -2
  156. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/fogExplorations.d.ts +0 -2
  157. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/folders.d.ts +2 -2
  158. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/items.d.ts +1 -22
  159. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/journal.d.ts +1 -1
  160. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/macros.d.ts +3 -8
  161. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/messages.d.ts +7 -2
  162. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +5 -5
  163. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/rollTables.d.ts +1 -1
  164. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/scenes.d.ts +3 -2
  165. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/users.d.ts +7 -4
  166. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/worldSettings.d.ts +2 -2
  167. package/src/foundry/foundry.js/config.d.ts +5 -2
  168. package/src/foundry/foundry.js/dragDrop.d.ts +27 -34
  169. package/src/foundry/foundry.js/hooks.d.ts +3 -3
  170. package/src/foundry/foundry.js/pixi/containers/ruler.d.ts +18 -7
  171. package/src/foundry/foundry.js/pixi/index.d.ts +2 -0
  172. package/src/foundry/foundry.js/pixi/meshes/index.d.ts +1 -0
  173. package/src/foundry/foundry.js/pixi/meshes/samplerMesh.d.ts +22 -0
  174. package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +1 -1
  175. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +9 -1
  176. package/src/foundry/foundry.js/pixi/rectangles/normalizedRectangle.d.ts +7 -0
  177. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +1 -1
  178. package/src/foundry/foundry.js/pixi/transforms/index.d.ts +1 -0
  179. package/src/foundry/foundry.js/pixi/transforms/synchronizedTransform.d.ts +38 -0
  180. package/src/foundry/foundry.js/pointSources/lightSource.d.ts +1 -1
  181. package/src/foundry/foundry.js/pointSources/soundSource.d.ts +1 -1
  182. package/src/foundry/foundry.js/pointSources/visionSource.d.ts +1 -1
  183. package/src/foundry/foundry.js/polygonEdge.d.ts +1 -1
  184. package/src/foundry/foundry.js/quadtree.d.ts +2 -2
  185. package/src/foundry/foundry.js/ray.d.ts +1 -1
  186. package/src/foundry/foundry.js/roll.d.ts +13 -11
  187. package/src/foundry/foundry.js/searchFilter.d.ts +37 -33
  188. package/src/foundry/foundry.js/textureLoader.d.ts +28 -18
  189. package/src/foundry/foundry.js/textureUtils.d.ts +5 -8
  190. package/src/foundry/foundry.js/videoHelper.d.ts +2 -1
  191. package/src/types/helperTypes.d.ts +31 -13
@@ -147,21 +147,21 @@ declare global {
147
147
  * console.log(r.total); // 11
148
148
  * ```
149
149
  */
150
- evaluate(options?: InexactPartial<Options & { async: false }>): this;
151
- evaluate(options: InexactPartial<Options> & { async: true }): Promise<this>;
152
- evaluate(options?: InexactPartial<Options>): this | Promise<this>;
150
+ evaluate(options?: InexactPartial<Options & { async: false }>): Evaluated<this>;
151
+ evaluate(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
152
+ evaluate(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<this>>;
153
153
 
154
154
  /**
155
155
  * Evaluate the roll asynchronously.
156
156
  * A temporary helper method used to migrate behavior from 0.7.x (sync by default) to 0.9.x (async by default).
157
157
  */
158
- protected _evaluate(options?: InexactPartial<Omit<Options, 'async'>>): Promise<this>;
158
+ protected _evaluate(options?: InexactPartial<Omit<Options, 'async'>>): Promise<Evaluated<this>>;
159
159
 
160
160
  /**
161
161
  * Evaluate the roll synchronously.
162
162
  * A temporary helper method used to migrate behavior from 0.7.x (sync by default) to 0.9.x (async by default).
163
163
  */
164
- protected _evaluateSync(options?: InexactPartial<Omit<Options, 'async'>>): this;
164
+ protected _evaluateSync(options?: InexactPartial<Omit<Options, 'async'>>): Evaluated<this>;
165
165
 
166
166
  /**
167
167
  * Safely evaluate the final total result for the Roll using its component terms.
@@ -173,9 +173,9 @@ declare global {
173
173
  * Alias for evaluate.
174
174
  * @see Roll#evaluate
175
175
  */
176
- roll(options?: InexactPartial<Options & { async: false }>): this;
177
- roll(options: InexactPartial<Options> & { async: true }): Promise<this>;
178
- roll(options?: InexactPartial<Options>): this | Promise<this>;
176
+ roll(options?: InexactPartial<Options & { async: false }>): Evaluated<this>;
177
+ roll(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
178
+ roll(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<this>>;
179
179
 
180
180
  /**
181
181
  * Create a new Roll object using the original provided formula and data.
@@ -183,9 +183,9 @@ declare global {
183
183
  * @param options - Evaluation options passed to Roll#evaluate
184
184
  * @returns A new Roll object, rolled using the same formula and data
185
185
  */
186
- reroll(options?: InexactPartial<Options & { async: false }>): this;
187
- reroll(options: InexactPartial<Options> & { async: true }): Promise<this>;
188
- reroll(options?: InexactPartial<Options>): this | Promise<this>;
186
+ reroll(options?: InexactPartial<Options & { async: false }>): Evaluated<this>;
187
+ reroll(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
188
+ reroll(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<this>>;
189
189
 
190
190
  /**
191
191
  * A factory method which constructs a Roll instance using the default configured Roll class.
@@ -491,3 +491,5 @@ type MessageData<T extends DeepPartial<ConstructorParameters<typeof ChatMessage>
491
491
  content: number;
492
492
  sound: typeof CONFIG.sounds.dice;
493
493
  } & T;
494
+
495
+ type Evaluated<T extends Roll> = T & { _evaluated: true; _total: number; get total(): number };
@@ -1,3 +1,33 @@
1
+ /** Options which customize the behavior of the filter */
2
+ interface SearchFilterConfiguration {
3
+ /**
4
+ * The CSS selector used to target the text input element.
5
+ */
6
+ inputSelector: string;
7
+
8
+ /**
9
+ * The CSS selector used to target the content container for these tabs.
10
+ */
11
+ contentSelector: string;
12
+
13
+ /**
14
+ * A callback function which executes when the filter changes.
15
+ */
16
+ callback?: SearchFilter['callback'];
17
+
18
+ /**
19
+ * The initial value of the search query.
20
+ * @defaultValue `""`
21
+ */
22
+ initial?: SearchFilter['query'] | undefined;
23
+
24
+ /**
25
+ * The number of milliseconds to wait for text input before processing.
26
+ * @defaultValue `100`
27
+ */
28
+ delay?: number;
29
+ }
30
+
1
31
  /**
2
32
  * A controller class for managing a text input widget that filters the contents of some other UI element
3
33
  * @see {@link Application}
@@ -6,7 +36,7 @@ declare class SearchFilter {
6
36
  /**
7
37
  * @param options - Options which customize the behavior of the filter
8
38
  */
9
- constructor(options: SearchFilter.Options);
39
+ constructor(options: SearchFilterConfiguration);
10
40
 
11
41
  /**
12
42
  * The value of the current query string
@@ -26,28 +56,33 @@ declare class SearchFilter {
26
56
 
27
57
  /**
28
58
  * The CSS selector used to target the tab navigation element
59
+ * @internal
29
60
  */
30
61
  protected _inputSelector: string;
31
62
 
32
63
  /**
33
64
  * A reference to the HTML navigation element the tab controller is bound to
65
+ * @internal
34
66
  */
35
67
  protected _input: HTMLElement | null;
36
68
 
37
69
  /**
38
70
  * The CSS selector used to target the tab content element
71
+ * @internal
39
72
  */
40
73
  protected _contentSelector: string;
41
74
 
42
75
  /**
43
76
  * A reference to the HTML container element of the tab content
77
+ * @internal
44
78
  */
45
79
  protected _content: HTMLElement | null;
46
80
 
47
81
  /**
48
82
  * A debounced function which applies the search filtering
83
+ * @internal
49
84
  */
50
- protected _filter: this['callback'];
85
+ protected _filter: (...args: Parameters<this['callback']>) => void;
51
86
 
52
87
  /**
53
88
  * Bind the SearchFilter controller to an HTML application
@@ -69,34 +104,3 @@ declare class SearchFilter {
69
104
  */
70
105
  static cleanQuery(query: string): string;
71
106
  }
72
-
73
- declare namespace SearchFilter {
74
- interface Options {
75
- /**
76
- * The CSS selector used to target the text input element.
77
- */
78
- inputSelector: string;
79
-
80
- /**
81
- * The CSS selector used to target the content container for these tabs.
82
- */
83
- contentSelector: string;
84
-
85
- /**
86
- * The initial value of the search query.
87
- * @defaultValue `""`
88
- */
89
- initial?: SearchFilter['query'];
90
-
91
- /**
92
- * A callback function which executes when the filter changes.
93
- */
94
- callback: SearchFilter['callback'];
95
-
96
- /**
97
- * The number of milliseconds to wait for text input before processing.
98
- * @defaultValue `100`
99
- */
100
- delay?: number;
101
- }
102
- }
@@ -8,11 +8,11 @@ declare global {
8
8
  /**
9
9
  * The cached mapping of textures
10
10
  */
11
- cache: Map<string, { tex: PIXI.Texture; time: number }>;
11
+ cache: Map<string, { tex: PIXI.BaseTexture; time: number }>;
12
12
 
13
13
  /**
14
14
  * The duration in milliseconds for which a texture will remain cached
15
- * @defaultValue `1000`
15
+ * @defaultValue `1000 * 60 * 15`
16
16
  */
17
17
  static CACHE_TTL: number;
18
18
 
@@ -33,14 +33,14 @@ declare global {
33
33
  * @param options - Additional options which modify loading
34
34
  * @returns A Promise which resolves once all textures are loaded
35
35
  */
36
- load(sources: string[], options?: Partial<TextureLoader.LoadOptions>): Promise<void[]>;
36
+ load(sources: string[], options?: Partial<TextureLoader.LoadOptions>): Promise<PIXI.BaseTexture | void[]>;
37
37
 
38
38
  /**
39
39
  * Load a single texture on-demand from a given source URL path
40
40
  * @param src - The source texture path to load
41
41
  * @returns The loaded texture object
42
42
  */
43
- loadTexture(src: string): Promise<PIXI.Texture>;
43
+ loadTexture(src: string): Promise<PIXI.BaseTexture>;
44
44
 
45
45
  /**
46
46
  * Log texture loading progress in the console and in the Scene loading bar
@@ -57,40 +57,50 @@ declare global {
57
57
  /**
58
58
  * Load an image texture from a provided source url
59
59
  */
60
- loadImageTexture(src: string): Promise<PIXI.Texture>;
60
+ loadImageTexture(src: string): Promise<PIXI.BaseTexture>;
61
61
 
62
62
  /**
63
- * If an attempted image load failed, we may attempt a re-load in case the issue was CORS + caching
64
- * Cross-origin requests which failed might be CORS, or might be 404, no way to know - so try a 2nd time
65
- * @param src - The source URL being attempted
66
- * @param resolve - Resolve the promise
67
- * @param reject - Reject the promise
63
+ * Use the Fetch API to retrieve a resource and return a Blob instance for it.
64
+ * @param options - Options to configure the loading behaviour.
65
+ * (default: `{}`)
68
66
  * @internal
69
67
  */
70
- protected _attemptCORSReload<T>(
68
+ protected _fetchResource(
71
69
  src: string,
72
- resolve: (tex: PIXI.Texture) => void,
73
- reject: (reason: string) => T
74
- ): Promise<PIXI.Texture | T>;
70
+ options?: {
71
+ /**
72
+ * Append a cache-busting query parameter to the request.
73
+ * @defaultValue `false`
74
+ */
75
+ bustCache?: boolean | undefined;
76
+ }
77
+ ): Promise<Blob>;
78
+
79
+ /**
80
+ * Return a URL with a cache-busting query parameter appended.
81
+ * @param src - The source URL being attempted
82
+ * @returns The new URL, or false on a failure.
83
+ * @internal
84
+ */
85
+ protected _getCacheBustURL(src: string): string | false;
75
86
 
76
87
  /**
77
88
  * Load a video texture from a provided source url
78
- * @param src -
79
89
  */
80
- loadVideoTexture(src: string): Promise<PIXI.Texture>;
90
+ loadVideoTexture(src: string): Promise<PIXI.BaseTexture>;
81
91
 
82
92
  /**
83
93
  * Add an image url to the texture cache
84
94
  * @param src - The source URL
85
95
  * @param tex - The readied texture
86
96
  */
87
- setCache(src: string, tex: PIXI.Texture): void;
97
+ setCache(src: string, tex: PIXI.BaseTexture): void;
88
98
 
89
99
  /**
90
100
  * Retrieve a texture from the texture cache
91
101
  * @param src - The source URL
92
102
  */
93
- getCache(src: string): PIXI.Texture | undefined;
103
+ getCache(src: string): PIXI.BaseTexture | undefined;
94
104
 
95
105
  /**
96
106
  * Expire (and destroy) textures from the cache which have not been used for more than CACHE_TTL milliseconds.
@@ -13,16 +13,13 @@ declare function getTexture(src: string): PIXI.Texture | null;
13
13
  /**
14
14
  * Load a single texture and return a Promise which resolves once the texture is ready to use
15
15
  * @param src - The requested texture source
16
+ * @param options - Additional options which modify texture loading
16
17
  * @param fallback - A fallback texture to use if the requested source is unavailable or invalid
17
18
  */
18
19
  declare function loadTexture(
19
20
  src: string,
20
- {
21
- fallback
22
- }?: {
23
- /**
24
- * A fallback texture to use if the requested source is unavailable or invalid
25
- */
26
- fallback?: string;
21
+ options?: {
22
+ /** A fallback texture to use if the requested source is unavailable or invalid */
23
+ fallback?: string | undefined;
27
24
  }
28
- ): Promise<PIXI.Texture>;
25
+ ): Promise<PIXI.Texture | null>;
@@ -65,7 +65,8 @@ declare class VideoHelper {
65
65
  * The thumbnail is cached using the video file path or URL.
66
66
  * @param src - The source video URL
67
67
  * @param options - Thumbnail creation options, including width and height
68
- * @returns The created and cached base64 thumbnail image
68
+ * @returns The created and cached base64 thumbnail image, or a placeholder image if the canvas is
69
+ * disabled and no thumbnail can be generated.
69
70
  */
70
71
  createThumbnail(src: string, options: ImageHelper.CompositeOptions): Promise<string>;
71
72
  }
@@ -63,9 +63,35 @@ export type ConfiguredDocumentClass<T extends DocumentConstructor> = ConfiguredD
63
63
  T['metadata']['name']
64
64
  >;
65
65
 
66
- export type DocumentType = keyof {
67
- [Key in keyof CONFIG as 'documentClass' extends keyof CONFIG[Key] ? Key : never]: unknown;
68
- };
66
+ export type DocumentType =
67
+ | 'Actor'
68
+ | 'Adventure'
69
+ | 'Cards'
70
+ | 'ChatMessage'
71
+ | 'Combat'
72
+ | 'FogExploration'
73
+ | 'Folder'
74
+ | 'Item'
75
+ | 'JournalEntry'
76
+ | 'Macro'
77
+ | 'Playlist'
78
+ | 'RollTable'
79
+ | 'Scene'
80
+ | 'Setting'
81
+ | 'User'
82
+ | 'ActiveEffect'
83
+ | 'Card'
84
+ | 'TableResult'
85
+ | 'PlaylistSound'
86
+ | 'AmbientLight'
87
+ | 'AmbientSound'
88
+ | 'Combatant'
89
+ | 'Drawing'
90
+ | 'MeasuredTemplate'
91
+ | 'Note'
92
+ | 'Tile'
93
+ | 'Token'
94
+ | 'Wall';
69
95
 
70
96
  export type PlaceableDocumentType =
71
97
  | 'AmbientLight'
@@ -77,17 +103,9 @@ export type PlaceableDocumentType =
77
103
  | 'Token'
78
104
  | 'Wall';
79
105
 
80
- export type ConfiguredDocumentClassForName<Name extends DocumentType> = 'documentClass' extends keyof CONFIG[Name]
81
- ? CONFIG[Name]['documentClass']
82
- : never;
83
-
84
- export type ObjectType = keyof {
85
- [Key in keyof CONFIG as 'objectClass' extends keyof CONFIG[Key] ? Key : never]: unknown;
86
- };
106
+ export type ConfiguredDocumentClassForName<Name extends DocumentType> = CONFIG[Name]['documentClass'];
87
107
 
88
- export type ConfiguredObjectClassForName<Name extends ObjectType> = 'objectClass' extends keyof CONFIG[Name]
89
- ? CONFIG[Name]['objectClass']
90
- : never;
108
+ export type ConfiguredObjectClassForName<Name extends PlaceableDocumentType> = CONFIG[Name]['objectClass'];
91
109
 
92
110
  export type ConfiguredData<Name extends string> = Name extends keyof DataConfig ? DataConfig[Name] : {};
93
111