@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,34 +1,41 @@
1
- import * as documents from '../../documents.mjs';
2
- import * as fields from '../fields.mjs';
3
-
4
1
  import type { ConfiguredDocumentClass, ConfiguredFlags, PropertiesToSource } from '../../../../types/helperTypes';
5
- import type EmbeddedCollection from '../../abstract/embedded-collection.mjs';
6
2
  import type DocumentData from '../../abstract/data.mjs';
3
+ import type EmbeddedCollection from '../../abstract/embedded-collection.mjs';
4
+ import * as documents from '../../documents.mjs';
5
+ import * as fields from '../fields.mjs';
7
6
 
8
7
  interface PlaylistDataSchema extends DocumentSchema {
9
- _id: typeof fields.DOCUMENT_ID;
10
- name: typeof fields.REQUIRED_STRING;
11
- description: typeof fields.BLANK_STRING;
8
+ _id: fields.DocumentId;
9
+ name: fields.RequiredString;
10
+ description: fields.BlankString;
12
11
  sounds: fields.EmbeddedCollectionField<typeof documents.BasePlaylistSound>;
13
- mode: DocumentField<foundry.CONST.PlaylistMode> & {
12
+ mode: DocumentField<foundry.CONST.PLAYLIST_MODES> & {
14
13
  type: typeof Number;
15
14
  required: true;
16
- default: typeof CONST.PLAYLIST_MODES.SEQUENTIAL;
17
- validate: (m: unknown) => m is foundry.CONST.PlaylistMode;
15
+ default: typeof foundry.CONST.PLAYLIST_MODES.SEQUENTIAL;
16
+ validate: (m: unknown) => m is foundry.CONST.PLAYLIST_MODES;
18
17
  validationError: 'Invalid {name} {field} provided which must be a value from CONST.PLAYLIST_MODES';
19
18
  };
20
- playing: typeof fields.BOOLEAN_FIELD;
21
- fade: typeof fields.INTEGER_FIELD;
19
+ playing: fields.BooleanField;
20
+ fade: fields.IntegerField;
22
21
  folder: fields.ForeignDocumentField<{ type: typeof documents.BaseFolder }>;
23
- sort: typeof fields.INTEGER_SORT_FIELD;
24
- seed: typeof fields.NONNEGATIVE_INTEGER_FIELD;
25
- permission: typeof fields.DOCUMENT_PERMISSIONS;
26
- flags: typeof fields.OBJECT_FIELD;
22
+ sorting: DocumentField<foundry.CONST.PLAYLIST_SORT_MODES> & {
23
+ type: foundry.CONST.PLAYLIST_SORT_MODES;
24
+ required: true;
25
+ default: typeof foundry.CONST.PLAYLIST_SORT_MODES.ALPHABETICAL;
26
+ validate: (m: unknown) => m is foundry.CONST.PLAYLIST_SORT_MODES;
27
+ validationError: 'Invalid Playlist sorting mode';
28
+ };
29
+ sort: fields.IntegerSortField;
30
+ seed: fields.NonnegativeIntegerField;
31
+ permission: fields.DocumentPermissions;
32
+ flags: fields.ObjectField;
27
33
  }
28
34
 
29
35
  interface PlaylistDataProperties {
30
36
  /**
31
37
  * The _id which uniquely identifies this Playlist document
38
+ * @defaultValue `null`
32
39
  */
33
40
  _id: string | null;
34
41
 
@@ -38,12 +45,14 @@ interface PlaylistDataProperties {
38
45
  name: string;
39
46
 
40
47
  /**
41
- * @defaultValue `''`
48
+ * The description of this playlist
49
+ * @defaultValue `""`
42
50
  */
43
51
  description: string;
44
52
 
45
53
  /**
46
54
  * A Collection of PlaylistSounds embedded documents which belong to this playlist
55
+ * @defaultValue `new EmbeddedCollection(PlaylistSoundData, [], BasePlaylistSound.implementation)`
47
56
  */
48
57
  sounds: EmbeddedCollection<ConfiguredDocumentClass<typeof documents.BasePlaylistSound>, PlaylistData>;
49
58
 
@@ -51,7 +60,7 @@ interface PlaylistDataProperties {
51
60
  * The playback mode for sounds in this playlist
52
61
  * @defaultValue `CONST.PLAYLIST_MODES.SEQUENTIAL`
53
62
  */
54
- mode: foundry.CONST.PlaylistMode;
63
+ mode: foundry.CONST.PLAYLIST_MODES;
55
64
 
56
65
  /**
57
66
  * Is this playlist currently playing?
@@ -59,6 +68,7 @@ interface PlaylistDataProperties {
59
68
  */
60
69
  playing: boolean;
61
70
 
71
+ /** A duration in milliseconds to fade volume transition */
62
72
  fade: number | undefined;
63
73
 
64
74
  /**
@@ -67,19 +77,26 @@ interface PlaylistDataProperties {
67
77
  */
68
78
  folder: string | null;
69
79
 
80
+ /**
81
+ * The sorting mode used for this playlist.
82
+ * @defaultValue `CONST.PLAYLIST_SORT_MODES.ALPHABETICAL`
83
+ */
84
+ sorting: foundry.CONST.PLAYLIST_SORT_MODES;
85
+
70
86
  /**
71
87
  * The numeric sort value which orders this playlist relative to its siblings
72
88
  * @defaultValue `0`
73
89
  */
74
90
  sort: number;
75
91
 
92
+ /** A seed used for playlist randomization to guarantee that all clients generate the same random order. */
76
93
  seed: number | undefined;
77
94
 
78
95
  /**
79
96
  * An object which configures user permissions to this playlist
80
97
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
81
98
  */
82
- permission: Record<string, foundry.CONST.EntityPermission>;
99
+ permission: Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>;
83
100
 
84
101
  /**
85
102
  * An object of optional key/value flags
@@ -91,6 +108,7 @@ interface PlaylistDataProperties {
91
108
  interface PlaylistDataConstructorData {
92
109
  /**
93
110
  * The _id which uniquely identifies this Playlist document
111
+ * @defaultValue `null`
94
112
  */
95
113
  _id?: string | null | undefined;
96
114
 
@@ -100,12 +118,14 @@ interface PlaylistDataConstructorData {
100
118
  name: string;
101
119
 
102
120
  /**
103
- * @defaultValue `''`
121
+ * The description of this playlist
122
+ * @defaultValue `""`
104
123
  */
105
124
  description?: string | null | undefined;
106
125
 
107
126
  /**
108
127
  * A Collection of PlaylistSounds embedded documents which belong to this playlist
128
+ * @defaultValue `new EmbeddedCollection(PlaylistSoundData, [], BasePlaylistSound.implementation)`
109
129
  */
110
130
  sounds?:
111
131
  | EmbeddedCollection<ConfiguredDocumentClass<typeof documents.BasePlaylistSound>, PlaylistData>
@@ -116,7 +136,7 @@ interface PlaylistDataConstructorData {
116
136
  * The playback mode for sounds in this playlist
117
137
  * @defaultValue `CONST.PLAYLIST_MODES.SEQUENTIAL`
118
138
  */
119
- mode?: foundry.CONST.PlaylistMode | null | undefined;
139
+ mode?: foundry.CONST.PLAYLIST_MODES | null | undefined;
120
140
 
121
141
  /**
122
142
  * Is this playlist currently playing?
@@ -124,13 +144,20 @@ interface PlaylistDataConstructorData {
124
144
  */
125
145
  playing?: boolean | null | undefined;
126
146
 
127
- fade?: number | undefined | null;
147
+ /** A duration in milliseconds to fade volume transition */
148
+ fade?: number | null | undefined;
128
149
 
129
150
  /**
130
151
  * The _id of a Folder which contains this playlist
131
152
  * @defaultValue `null`
132
153
  */
133
- folder?: string | null | undefined;
154
+ folder?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseFolder>> | string | null | undefined;
155
+
156
+ /**
157
+ * The sorting mode used for this playlist.
158
+ * @defaultValue `CONST.PLAYLIST_SORT_MODES.ALPHABETICAL`
159
+ */
160
+ sorting?: foundry.CONST.PLAYLIST_SORT_MODES | null | undefined;
134
161
 
135
162
  /**
136
163
  * The numeric sort value which orders this playlist relative to its siblings
@@ -138,13 +165,14 @@ interface PlaylistDataConstructorData {
138
165
  */
139
166
  sort?: number | null | undefined;
140
167
 
141
- seed?: number | undefined | null;
168
+ /** A seed used for playlist randomization to guarantee that all clients generate the same random order. */
169
+ seed?: number | null | undefined;
142
170
 
143
171
  /**
144
172
  * An object which configures user permissions to this playlist
145
173
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
146
174
  */
147
- permission?: Record<string, foundry.CONST.EntityPermission> | undefined | null;
175
+ permission?: Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS> | null | undefined;
148
176
 
149
177
  /**
150
178
  * An object of optional key/value flags
@@ -157,13 +185,14 @@ interface PlaylistDataConstructorData {
157
185
  * The data schema for a Playlist document.
158
186
  * @see BasePlaylist
159
187
  */
160
- export declare class PlaylistData extends DocumentData<
188
+ export class PlaylistData extends DocumentData<
161
189
  PlaylistDataSchema,
162
190
  PlaylistDataProperties,
163
191
  PropertiesToSource<PlaylistDataProperties>,
164
192
  PlaylistDataConstructorData,
165
193
  documents.BasePlaylist
166
194
  > {
195
+ /** @override */
167
196
  static defineSchema(): PlaylistDataSchema;
168
197
  }
169
198
 
@@ -1,24 +1,26 @@
1
- import * as fields from '../fields.mjs';
2
1
  import type { ConfiguredFlags, FieldReturnType, PropertiesToSource } from '../../../../types/helperTypes';
3
2
  import type DocumentData from '../../abstract/data.mjs';
4
3
  import type { documents } from '../../module.mjs';
4
+ import * as fields from '../fields.mjs';
5
5
 
6
6
  interface PlaylistSoundDataSchema extends DocumentSchema {
7
- _id: typeof fields.DOCUMENT_ID;
8
- name: typeof fields.REQUIRED_STRING;
9
- description: typeof fields.BLANK_STRING;
10
- path: typeof fields.AUDIO_FIELD;
11
- playing: typeof fields.BOOLEAN_FIELD;
12
- pausedTime: FieldReturnType<typeof fields.NUMERIC_FIELD, { default: null }>;
13
- repeat: typeof fields.BOOLEAN_FIELD;
14
- volume: FieldReturnType<typeof fields.ALPHA_FIELD, { default: 0.5 }>;
15
- fade: typeof fields.INTEGER_FIELD;
16
- flags: typeof fields.OBJECT_FIELD;
7
+ _id: fields.DocumentId;
8
+ name: fields.RequiredString;
9
+ description: fields.BlankString;
10
+ path: fields.AudioField;
11
+ playing: fields.BooleanField;
12
+ pausedTime: FieldReturnType<fields.NumericField, { default: null }>;
13
+ repeat: fields.BooleanField;
14
+ volume: FieldReturnType<fields.AlphaField, { default: 0.5 }>;
15
+ fade: fields.IntegerField;
16
+ sort: fields.IntegerSortField;
17
+ flags: fields.ObjectField;
17
18
  }
18
19
 
19
20
  interface PlaylistSoundDataProperties {
20
21
  /**
21
22
  * The _id which uniquely identifies this PlaylistSound document
23
+ * @defaultValue `null`
22
24
  */
23
25
  _id: string | null;
24
26
 
@@ -28,14 +30,15 @@ interface PlaylistSoundDataProperties {
28
30
  name: string;
29
31
 
30
32
  /**
31
- * @defaultValue `''`
33
+ * The description of this sound track
34
+ * @defaultValue `""`
32
35
  */
33
36
  description: string;
34
37
 
35
38
  /**
36
39
  * The audio file path that is played by this sound
37
40
  */
38
- path: string | undefined | null;
41
+ path: string | null | undefined;
39
42
 
40
43
  /**
41
44
  * Is this sound currently playing?
@@ -44,6 +47,7 @@ interface PlaylistSoundDataProperties {
44
47
  playing: boolean;
45
48
 
46
49
  /**
50
+ * The time in seconds at which playback was paused
47
51
  * @defaultValue `null`
48
52
  */
49
53
  pausedTime: number | null;
@@ -60,8 +64,12 @@ interface PlaylistSoundDataProperties {
60
64
  */
61
65
  volume: number;
62
66
 
67
+ /** A duration in milliseconds to fade volume transition */
63
68
  fade: number | undefined;
64
69
 
70
+ /** @defaultValue `0` */
71
+ sort: number;
72
+
65
73
  /**
66
74
  * An object of optional key/value flags
67
75
  * @defaultValue `{}`
@@ -72,6 +80,7 @@ interface PlaylistSoundDataProperties {
72
80
  interface PlaylistSoundDataConstructorData {
73
81
  /**
74
82
  * The _id which uniquely identifies this PlaylistSound document
83
+ * @defaultValue `null`
75
84
  */
76
85
  _id?: string | null | undefined;
77
86
 
@@ -81,14 +90,15 @@ interface PlaylistSoundDataConstructorData {
81
90
  name: string;
82
91
 
83
92
  /**
84
- * @defaultValue `''`
93
+ * The description of this sound track
94
+ * @defaultValue `""`
85
95
  */
86
96
  description?: string | null | undefined;
87
97
 
88
98
  /**
89
99
  * The audio file path that is played by this sound
90
100
  */
91
- path?: string | undefined | null;
101
+ path?: string | null | undefined;
92
102
 
93
103
  /**
94
104
  * Is this sound currently playing?
@@ -97,6 +107,7 @@ interface PlaylistSoundDataConstructorData {
97
107
  playing?: boolean | null | undefined;
98
108
 
99
109
  /**
110
+ * The time in seconds at which playback was paused
100
111
  * @defaultValue `null`
101
112
  */
102
113
  pausedTime?: number | null | undefined;
@@ -113,8 +124,12 @@ interface PlaylistSoundDataConstructorData {
113
124
  */
114
125
  volume?: number | null | undefined;
115
126
 
127
+ /** A duration in milliseconds to fade volume transition */
116
128
  fade?: number | null | undefined;
117
129
 
130
+ /** @defaultValue `0` */
131
+ sort: number | null | undefined;
132
+
118
133
  /**
119
134
  * An object of optional key/value flags
120
135
  * @defaultValue `{}`
@@ -126,13 +141,14 @@ interface PlaylistSoundDataConstructorData {
126
141
  * The data schema for a PlaylistSound embedded document.
127
142
  * @see BasePlaylistSound
128
143
  */
129
- export declare class PlaylistSoundData extends DocumentData<
144
+ export class PlaylistSoundData extends DocumentData<
130
145
  PlaylistSoundDataSchema,
131
146
  PlaylistSoundDataProperties,
132
147
  PropertiesToSource<PlaylistSoundDataProperties>,
133
148
  PlaylistSoundDataConstructorData,
134
149
  documents.BasePlaylistSound
135
150
  > {
151
+ /** @override */
136
152
  static defineSchema(): PlaylistSoundDataSchema;
137
153
 
138
154
  /** @override */
@@ -17,9 +17,9 @@ type FieldExclusions =
17
17
  | 'hidden';
18
18
 
19
19
  interface PrototypeTokenDataSchema extends Omit<TokenDataSchema, FieldExclusions> {
20
- randomImg: typeof fields.BOOLEAN_FIELD;
20
+ randomImg: fields.BooleanField;
21
21
  img: FieldReturnType<
22
- typeof fields.VIDEO_FIELD,
22
+ fields.VideoField,
23
23
  { default: typeof foundry.CONST.DEFAULT_TOKEN; validate: (src: unknown) => boolean }
24
24
  >;
25
25
  }
@@ -38,18 +38,18 @@ interface PrototypeTokenDataProperties extends Omit<TokenDataProperties, FieldEx
38
38
  img: string | null;
39
39
  }
40
40
 
41
- export interface PrototypeTokenDataConstructorData extends Omit<TokenDataConstructorData, FieldExclusions> {
41
+ interface PrototypeTokenDataConstructorData extends Omit<TokenDataConstructorData, FieldExclusions> {
42
42
  /**
43
43
  * Uses a random "wildcard" image path which is resolved with a Token is created
44
44
  * @defaultValue `false`
45
45
  */
46
- randomImg?: boolean | null;
46
+ randomImg?: boolean | null | undefined;
47
47
 
48
48
  /**
49
49
  * A file path to an image or video file used to depict the Token
50
50
  * @defaultValue `CONST.DEFAULT_TOKEN`
51
51
  */
52
- img?: string | null;
52
+ img?: string | null | undefined;
53
53
  }
54
54
 
55
55
  export class PrototypeTokenData extends DocumentData<
@@ -59,14 +59,10 @@ export class PrototypeTokenData extends DocumentData<
59
59
  PrototypeTokenDataConstructorData,
60
60
  documents.BaseActor
61
61
  > {
62
- /**
63
- * @override
64
- */
62
+ /** @override */
65
63
  _initialize(): void;
66
64
 
67
- /**
68
- * @override
69
- */
65
+ /** @override */
70
66
  toObject(source?: true): ReturnType<this['toJSON']> & { actorId: documents.BaseActor['id'] };
71
67
  toObject(source: false): {
72
68
  [Key in keyof PrototypeTokenDataSchema as string extends Key ? never : Key]: Key extends keyof this
@@ -10,23 +10,24 @@ import * as documents from '../../documents.mjs';
10
10
  import * as fields from '../fields.mjs';
11
11
 
12
12
  interface RollTableDataSchema extends DocumentSchema {
13
- _id: typeof fields.DOCUMENT_ID;
14
- name: typeof fields.REQUIRED_STRING;
15
- img: FieldReturnType<typeof fields.IMAGE_FIELD, { default: () => string }>;
16
- description: typeof fields.STRING_FIELD;
13
+ _id: fields.DocumentId;
14
+ name: fields.RequiredString;
15
+ img: FieldReturnType<fields.ImageField, { default: () => typeof RollTableData.DEFAULT_ICON }>;
16
+ description: fields.StringField;
17
17
  results: fields.EmbeddedCollectionField<typeof documents.BaseTableResult>;
18
- formula: typeof fields.STRING_FIELD;
19
- replacement: FieldReturnType<typeof fields.BOOLEAN_FIELD, { default: true }>;
20
- displayRoll: FieldReturnType<typeof fields.BOOLEAN_FIELD, { default: true }>;
18
+ formula: fields.StringField;
19
+ replacement: FieldReturnType<fields.BooleanField, { default: true }>;
20
+ displayRoll: FieldReturnType<fields.BooleanField, { default: true }>;
21
21
  folder: fields.ForeignDocumentField<{ type: typeof documents.BaseFolder }>;
22
- sort: typeof fields.INTEGER_SORT_FIELD;
23
- permission: typeof fields.DOCUMENT_PERMISSIONS;
24
- flags: typeof fields.OBJECT_FIELD;
22
+ sort: fields.IntegerSortField;
23
+ permission: fields.DocumentPermissions;
24
+ flags: fields.ObjectField;
25
25
  }
26
26
 
27
27
  interface RollTableDataProperties {
28
28
  /**
29
29
  * The _id which uniquely identifies this RollTable document
30
+ * @defaultValue `null`
30
31
  */
31
32
  _id: string | null;
32
33
 
@@ -37,6 +38,7 @@ interface RollTableDataProperties {
37
38
 
38
39
  /**
39
40
  * An image file path which provides the thumbnail artwork for this RollTable
41
+ * @defaultValue `RollTableData.DEFAULT_ICON`
40
42
  */
41
43
  img: string;
42
44
 
@@ -47,6 +49,7 @@ interface RollTableDataProperties {
47
49
 
48
50
  /**
49
51
  * A Collection of TableResult embedded documents which belong to this RollTable
52
+ * @defaultValue `new EmbeddedCollection(TableResultData, [], BaseTableResult.implementation)`
50
53
  */
51
54
  results: EmbeddedCollection<ConfiguredDocumentClass<typeof documents.BaseTableResult>, RollTableData>;
52
55
 
@@ -82,7 +85,7 @@ interface RollTableDataProperties {
82
85
  * An object which configures user permissions to this RollTable
83
86
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
84
87
  */
85
- permission: Partial<Record<string, foundry.CONST.EntityPermission>>;
88
+ permission: Partial<Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>>;
86
89
 
87
90
  /**
88
91
  * An object of optional key/value flags
@@ -95,7 +98,7 @@ interface RollTableDataConstructorData {
95
98
  /**
96
99
  * The _id which uniquely identifies this RollTable document
97
100
  */
98
- _id?: string | null;
101
+ _id?: string | null | undefined;
99
102
 
100
103
  /**
101
104
  * The name of this RollTable
@@ -104,70 +107,73 @@ interface RollTableDataConstructorData {
104
107
 
105
108
  /**
106
109
  * An image file path which provides the thumbnail artwork for this RollTable
110
+ * @defaultValue `RollTableData.DEFAULT_ICON`
107
111
  */
108
- img?: string | null;
112
+ img?: string | null | undefined;
109
113
 
110
114
  /**
111
115
  * The HTML text description for this RollTable document
112
116
  */
113
- description?: string | null;
117
+ description?: string | null | undefined;
114
118
 
115
119
  /**
116
120
  * A Collection of TableResult embedded documents which belong to this RollTable
121
+ * @defaultValue `new EmbeddedCollection(TableResultData, [], BaseTableResult.implementation)`
117
122
  */
118
- results?: ConstructorParameters<ConfiguredDocumentClass<typeof documents.BaseTableResult>>[0][] | null;
123
+ results?: ConstructorParameters<ConfiguredDocumentClass<typeof documents.BaseTableResult>>[0][] | null | undefined;
119
124
 
120
125
  /**
121
126
  * The Roll formula which determines the results chosen from the table
122
127
  */
123
- formula?: string | null;
128
+ formula?: string | null | undefined;
124
129
 
125
130
  /**
126
131
  * Are results from this table drawn with replacement?
127
132
  * @defaultValue `true`
128
133
  */
129
- replacement?: boolean | null;
134
+ replacement?: boolean | null | undefined;
130
135
 
131
136
  /**
132
137
  * Is the Roll result used to draw from this RollTable displayed in chat?
133
138
  * @defaultValue `true`
134
139
  */
135
- displayRoll?: boolean | null;
140
+ displayRoll?: boolean | null | undefined;
136
141
 
137
142
  /**
138
143
  * The _id of a Folder which contains this RollTable
139
144
  */
140
- folder?: string | null;
145
+ folder?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseFolder>> | string | null | undefined;
141
146
 
142
147
  /**
143
148
  * The numeric sort value which orders this RollTable relative to its siblings
144
149
  */
145
- sort?: number | null;
150
+ sort?: number | null | undefined;
146
151
 
147
152
  /**
148
153
  * An object which configures user permissions to this RollTable
149
154
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
150
155
  */
151
- permission?: Partial<Record<string, foundry.CONST.EntityPermission>> | null;
156
+ permission?: Partial<Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>> | null | undefined;
152
157
 
153
158
  /**
154
159
  * An object of optional key/value flags
155
160
  * @defaultValue `{}`
156
161
  */
157
- flags?: ConfiguredFlags<'RollTable'> | null;
162
+ flags?: ConfiguredFlags<'RollTable'> | null | undefined;
158
163
  }
159
164
 
160
165
  /**
161
166
  * The data schema for an RollTable document.
162
167
  * @see BaseRollTable
163
168
  */
164
- export declare class RollTableData extends DocumentData<
169
+ export class RollTableData extends DocumentData<
165
170
  RollTableDataSchema,
166
171
  RollTableDataProperties,
167
172
  PropertiesToSource<RollTableDataProperties>,
168
173
  RollTableDataConstructorData,
169
174
  documents.BaseRollTable
170
175
  > {
176
+ /** @override */
171
177
  static defineSchema(): RollTableDataSchema;
172
178
 
173
179
  /**
@@ -179,4 +185,4 @@ export declare class RollTableData extends DocumentData<
179
185
  }
180
186
 
181
187
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
182
- export declare interface RollTableData extends RollTableDataProperties {}
188
+ export interface RollTableData extends RollTableDataProperties {}