@league-of-foundry-developers/foundry-vtt-types 0.8.9-6 → 9.238.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/README.md +44 -27
  2. package/index-lenient.d.ts +10 -0
  3. package/index.d.ts +2 -2
  4. package/package.json +43 -15
  5. package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
  6. package/src/foundry/common/abstract/document.mjs.d.ts +30 -12
  7. package/src/foundry/common/config.mjs/index.d.ts +1 -0
  8. package/src/foundry/common/config.mjs/releaseData.d.ts +98 -0
  9. package/src/foundry/common/constants.mjs.d.ts +402 -213
  10. package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +36 -29
  11. package/src/foundry/common/data/data.mjs/actorData.d.ts +32 -21
  12. package/src/foundry/common/data/data.mjs/adventureData.d.ts +165 -0
  13. package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +45 -124
  14. package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +49 -77
  15. package/src/foundry/common/data/data.mjs/animationData.d.ts +17 -9
  16. package/src/foundry/common/data/data.mjs/cardData.d.ts +265 -0
  17. package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +66 -0
  18. package/src/foundry/common/data/data.mjs/cardsData.d.ts +238 -0
  19. package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +51 -39
  20. package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +18 -11
  21. package/src/foundry/common/data/data.mjs/combatData.d.ts +51 -25
  22. package/src/foundry/common/data/data.mjs/combatantData.d.ts +48 -30
  23. package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +8 -7
  24. package/src/foundry/common/data/data.mjs/drawingData.d.ts +72 -66
  25. package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +21 -25
  26. package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +24 -23
  27. package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +23 -16
  28. package/src/foundry/common/data/data.mjs/folderData.d.ts +28 -25
  29. package/src/foundry/common/data/data.mjs/index.d.ts +5 -0
  30. package/src/foundry/common/data/data.mjs/itemData.d.ts +26 -18
  31. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +21 -20
  32. package/src/foundry/common/data/data.mjs/lightData.d.ts +228 -0
  33. package/src/foundry/common/data/data.mjs/macroData.d.ts +52 -35
  34. package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +41 -38
  35. package/src/foundry/common/data/data.mjs/noteData.d.ts +47 -37
  36. package/src/foundry/common/data/data.mjs/playlistData.d.ts +55 -26
  37. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +32 -16
  38. package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +7 -11
  39. package/src/foundry/common/data/data.mjs/rollTableData.d.ts +30 -24
  40. package/src/foundry/common/data/data.mjs/sceneData.d.ts +132 -111
  41. package/src/foundry/common/data/data.mjs/settingData.d.ts +11 -8
  42. package/src/foundry/common/data/data.mjs/tableResultData.d.ts +30 -26
  43. package/src/foundry/common/data/data.mjs/tileData.d.ts +43 -36
  44. package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +10 -9
  45. package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +6 -3
  46. package/src/foundry/common/data/data.mjs/tokenData.d.ts +105 -157
  47. package/src/foundry/common/data/data.mjs/userData.d.ts +111 -33
  48. package/src/foundry/common/data/data.mjs/videoData.d.ts +9 -8
  49. package/src/foundry/common/data/data.mjs/wallData.d.ts +67 -39
  50. package/src/foundry/common/data/fields.mjs.d.ts +180 -83
  51. package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +9 -3
  52. package/src/foundry/common/documents.mjs/baseActor.d.ts +17 -45
  53. package/src/foundry/common/documents.mjs/baseAdventure.d.ts +38 -0
  54. package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +3 -0
  55. package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +3 -1
  56. package/src/foundry/common/documents.mjs/baseCard.d.ts +62 -0
  57. package/src/foundry/common/documents.mjs/baseCards.d.ts +39 -0
  58. package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +3 -0
  59. package/src/foundry/common/documents.mjs/baseCombat.d.ts +5 -2
  60. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +10 -1
  61. package/src/foundry/common/documents.mjs/baseDrawing.d.ts +11 -1
  62. package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +4 -3
  63. package/src/foundry/common/documents.mjs/baseFolder.d.ts +10 -1
  64. package/src/foundry/common/documents.mjs/baseItem.d.ts +11 -29
  65. package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +3 -0
  66. package/src/foundry/common/documents.mjs/baseMacro.d.ts +16 -14
  67. package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +4 -1
  68. package/src/foundry/common/documents.mjs/baseNote.d.ts +2 -2
  69. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +1 -0
  70. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +2 -1
  71. package/src/foundry/common/documents.mjs/baseRollTable.d.ts +3 -0
  72. package/src/foundry/common/documents.mjs/baseScene.d.ts +1 -0
  73. package/src/foundry/common/documents.mjs/baseSetting.d.ts +1 -0
  74. package/src/foundry/common/documents.mjs/baseTableResult.d.ts +10 -3
  75. package/src/foundry/common/documents.mjs/baseTile.d.ts +1 -0
  76. package/src/foundry/common/documents.mjs/baseToken.d.ts +3 -0
  77. package/src/foundry/common/documents.mjs/baseUser.d.ts +7 -1
  78. package/src/foundry/common/documents.mjs/baseWall.d.ts +7 -10
  79. package/src/foundry/common/documents.mjs/index.d.ts +3 -0
  80. package/src/foundry/common/module.mjs.d.ts +3 -0
  81. package/src/foundry/common/packages.mjs/moduleData.d.ts +12 -9
  82. package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +24 -24
  83. package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +27 -21
  84. package/src/foundry/common/packages.mjs/packageData.d.ts +108 -82
  85. package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +18 -11
  86. package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +16 -15
  87. package/src/foundry/common/packages.mjs/systemData.d.ts +21 -20
  88. package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +3 -3
  89. package/src/foundry/common/packages.mjs/worldData.d.ts +29 -18
  90. package/src/foundry/common/types.mjs.d.ts +100 -0
  91. package/src/foundry/common/utils/helpers.mjs.d.ts +27 -2
  92. package/src/foundry/common/utils/primitives.mjs.d.ts +99 -16
  93. package/src/foundry/foundry.js/application.d.ts +4 -7
  94. package/src/foundry/foundry.js/applications/cameraViews.d.ts +36 -31
  95. package/src/foundry/foundry.js/applications/compendium.d.ts +5 -2
  96. package/src/foundry/foundry.js/applications/filePicker.d.ts +116 -116
  97. package/src/foundry/foundry.js/applications/formApplication.d.ts +2 -2
  98. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +20 -27
  99. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +66 -0
  100. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
  101. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  102. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +6 -3
  103. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
  104. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +1 -1
  105. package/src/foundry/foundry.js/applications/formApplications/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +3 -3
  106. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +4 -0
  107. package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
  108. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +60 -0
  109. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +72 -0
  110. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +5 -5
  111. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +1 -1
  112. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +187 -148
  113. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +133 -110
  114. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +1 -1
  115. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +93 -95
  116. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +163 -147
  117. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  118. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  119. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +2 -3
  120. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
  121. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +41 -23
  122. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +95 -86
  123. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +142 -155
  124. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +60 -70
  125. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +25 -17
  126. package/src/foundry/foundry.js/applications/hotbar.d.ts +5 -4
  127. package/src/foundry/foundry.js/applications/sceneControls.d.ts +13 -3
  128. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
  129. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
  130. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
  131. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  132. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
  133. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
  134. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
  135. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/itemDirectory.d.ts +7 -30
  136. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
  137. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
  138. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
  139. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
  140. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +4 -6
  141. package/src/foundry/foundry.js/avSettings.d.ts +7 -7
  142. package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
  143. package/src/foundry/foundry.js/canvas.d.ts +150 -47
  144. package/src/foundry/foundry.js/canvasAnimation.d.ts +1 -1
  145. package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
  146. package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
  147. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
  148. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
  149. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
  150. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
  151. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
  152. package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
  153. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +384 -0
  154. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
  155. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +4 -8
  156. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +1 -1
  157. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
  158. package/src/foundry/foundry.js/clientDocuments/index.d.ts +3 -0
  159. package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
  160. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
  161. package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
  162. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +1 -1
  163. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
  164. package/src/foundry/foundry.js/clientKeybindings.d.ts +299 -0
  165. package/src/foundry/foundry.js/clientSettings.d.ts +21 -6
  166. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +45 -12
  167. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
  168. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
  169. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
  170. package/src/foundry/foundry.js/config.d.ts +494 -902
  171. package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
  172. package/src/foundry/foundry.js/game.d.ts +86 -11
  173. package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
  174. package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
  175. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
  176. package/src/foundry/foundry.js/hooks.d.ts +57 -0
  177. package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
  178. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
  179. package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
  180. package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
  181. package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
  182. package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
  183. package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
  184. package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
  185. package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
  186. package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
  187. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +10 -19
  188. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +6 -2
  189. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +2 -2
  190. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +4 -4
  191. package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
  192. package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
  193. package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
  194. package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
  195. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +4 -1
  196. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
  197. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
  198. package/src/foundry/foundry.js/pointSource.d.ts +174 -86
  199. package/src/foundry/foundry.js/roll.d.ts +25 -36
  200. package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
  201. package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
  202. package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
  203. package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
  204. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
  205. package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
  206. package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
  207. package/src/foundry/foundry.js/textEditor.d.ts +40 -9
  208. package/src/foundry/index.d.ts +5 -0
  209. package/src/types/utils.d.ts +11 -3
  210. package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
  211. package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
@@ -1,58 +1,58 @@
1
- import { ConfiguredFlags, FieldReturnType, PropertiesToSource } from '../../../../types/helperTypes';
1
+ import {
2
+ ConfiguredDocumentClass,
3
+ ConfiguredFlags,
4
+ FieldReturnType,
5
+ PropertiesToSource
6
+ } from '../../../../types/helperTypes';
2
7
  import DocumentData from '../../abstract/data.mjs';
3
8
  import * as documents from '../../documents.mjs';
4
9
  import * as fields from '../fields.mjs';
5
10
 
6
11
  interface NoteDataSchema extends DocumentSchema {
7
- _id: typeof fields.DOCUMENT_ID;
12
+ _id: fields.DocumentId;
8
13
  entryId: fields.ForeignDocumentField<{ type: typeof documents.BaseJournalEntry; required: false }>;
9
- x: typeof fields.REQUIRED_NUMBER;
10
- y: typeof fields.REQUIRED_NUMBER;
11
- icon: FieldReturnType<
12
- typeof fields.IMAGE_FIELD,
13
- {
14
- required: true;
15
- default: typeof CONST.DEFAULT_NOTE_ICON;
16
- }
17
- >;
14
+ x: fields.RequiredNumber;
15
+ y: fields.RequiredNumber;
16
+ icon: FieldReturnType<fields.ImageField, { required: true; default: typeof NoteData.DEFAULT_ICON }>;
18
17
  iconSize: FieldReturnType<
19
- typeof fields.REQUIRED_NUMBER,
18
+ fields.RequiredNumber,
20
19
  {
21
20
  default: 40;
22
21
  validate: (n: unknown) => n is number;
23
22
  validationError: 'Invalid {name} {field} which must be an integer greater than 32';
24
23
  }
25
24
  >;
26
- iconTint: typeof fields.COLOR_FIELD;
27
- text: typeof fields.STRING_FIELD;
25
+ iconTint: fields.ColorField;
26
+ text: fields.StringField;
28
27
  fontFamily: FieldReturnType<
29
- typeof fields.REQUIRED_STRING,
28
+ fields.RequiredString,
30
29
  {
31
30
  default: () => typeof CONFIG['defaultFontFamily'];
32
31
  }
33
32
  >;
34
33
  fontSize: FieldReturnType<
35
- typeof fields.REQUIRED_NUMBER,
34
+ fields.RequiredNumber,
36
35
  {
37
36
  default: 48;
38
37
  validate: (n: unknown) => n is number;
39
38
  validationError: 'Invalid {name} {field} which must be an integer between 8 and 128';
40
39
  }
41
40
  >;
42
- textAnchor: DocumentField<number> & {
41
+ textAnchor: DocumentField<typeof foundry.CONST.TEXT_ANCHOR_POINTS> & {
43
42
  type: typeof Number;
44
43
  required: true;
45
- default: typeof CONST.TEXT_ANCHOR_POINTS.BOTTOM;
46
- validate: (p: unknown) => p is foundry.CONST.TextAnchorPoint;
44
+ default: typeof foundry.CONST.TEXT_ANCHOR_POINTS.BOTTOM;
45
+ validate: (p: unknown) => p is foundry.CONST.TEXT_ANCHOR_POINTS;
47
46
  validationError: 'Invalid {name} {field} which must be a value in CONST.TEXT_ANCHOR_POINTS';
48
47
  };
49
- textColor: FieldReturnType<typeof fields.COLOR_FIELD, { default: '#FFFFFF' }>;
50
- flags: typeof fields.OBJECT_FIELD;
48
+ textColor: FieldReturnType<fields.ColorField, { default: '#FFFFFF' }>;
49
+ flags: fields.ObjectField;
51
50
  }
52
51
 
53
52
  interface NoteDataProperties {
54
53
  /**
55
54
  * The _id which uniquely identifies this BaseNote embedded document
55
+ * @defaultValue `null`
56
56
  */
57
57
  _id: string | null;
58
58
 
@@ -76,6 +76,7 @@ interface NoteDataProperties {
76
76
 
77
77
  /**
78
78
  * An image icon path used to represent this note
79
+ * @defaultValue `CONST.DEFAULT_NOTE_ICON`
79
80
  */
80
81
  icon: string | null;
81
82
 
@@ -112,7 +113,7 @@ interface NoteDataProperties {
112
113
  * to the note icon.
113
114
  * @defaultValue `CONST.TEXT_ANCHOR_POINTS.BOTTOM`
114
115
  */
115
- textAnchor: foundry.CONST.TextAnchorPoint;
116
+ textAnchor: foundry.CONST.TEXT_ANCHOR_POINTS;
116
117
 
117
118
  /**
118
119
  * The string that defines the color with which the note text is rendered
@@ -130,93 +131,102 @@ interface NoteDataProperties {
130
131
  interface NoteDataConstructorData {
131
132
  /**
132
133
  * The _id which uniquely identifies this BaseNote embedded document
134
+ * @defaultValue `null`
133
135
  */
134
- _id?: string | null;
136
+ _id?: string | null | undefined;
135
137
 
136
138
  /**
137
139
  * The _id of a JournalEntry document which this Note represents
138
140
  * @defaultValue `null`
139
141
  */
140
- entryId?: string | null;
142
+ entryId?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseJournalEntry>> | string | null | undefined;
141
143
 
142
144
  /**
143
145
  * The x-coordinate position of the center of the note icon
144
146
  * @defaultValue `0`
145
147
  */
146
- x?: number | null;
148
+ x?: number | null | undefined;
147
149
 
148
150
  /**
149
151
  * The y-coordinate position of the center of the note icon
150
152
  * @defaultValue `0`
151
153
  */
152
- y?: number | null;
154
+ y?: number | null | undefined;
153
155
 
154
156
  /**
155
157
  * An image icon path used to represent this note
158
+ * @defaultValue `CONST.DEFAULT_NOTE_ICON`
156
159
  */
157
- icon?: string | null;
160
+ icon?: string | null | undefined;
158
161
 
159
162
  /**
160
163
  * The pixel size of the map note icon
161
164
  * @defaultValue `40`
162
165
  */
163
- iconSize?: number | null;
166
+ iconSize?: number | null | undefined;
164
167
 
165
168
  /**
166
169
  * An optional color string used to tint the map note icon
167
170
  */
168
- iconTint?: string | null;
171
+ iconTint?: string | null | undefined;
169
172
 
170
173
  /**
171
174
  * Optional text which overrides the title of the linked Journal Entry
172
175
  */
173
- text?: string | null;
176
+ text?: string | null | undefined;
174
177
 
175
178
  /**
176
179
  * The font family used to display the text label on this note
177
180
  * @defaultValue `CONFIG?.defaultFontFamily || "Signika"`
178
181
  */
179
- fontFamily?: string | null;
182
+ fontFamily?: string | null | undefined;
180
183
 
181
184
  /**
182
185
  * The font size used to display the text label on this note
183
186
  * @defaultValue `48`
184
187
  */
185
- fontSize?: number | null;
188
+ fontSize?: number | null | undefined;
186
189
 
187
190
  /**
188
191
  * A value in CONST.TEXT_ANCHOR_POINTS which defines where the text label anchors
189
192
  * to the note icon.
190
193
  * @defaultValue `CONST.TEXT_ANCHOR_POINTS.BOTTOM`
191
194
  */
192
- textAnchor?: foundry.CONST.TextAnchorPoint | null;
195
+ textAnchor?: foundry.CONST.TEXT_ANCHOR_POINTS | null | undefined;
193
196
 
194
197
  /**
195
198
  * The string that defines the color with which the note text is rendered
196
199
  * @defaultValue `#FFFFFF`
197
200
  */
198
- textColor?: string | null;
201
+ textColor?: string | null | undefined;
199
202
 
200
203
  /**
201
204
  * An object of optional key/value flags
202
205
  * @defaultValue `{}`
203
206
  */
204
- flags?: ConfiguredFlags<'Note'> | null;
207
+ flags?: ConfiguredFlags<'Note'> | null | undefined;
205
208
  }
206
209
 
207
210
  /**
208
211
  * The data schema for a Note embedded document.
209
212
  * @see BaseNote
210
213
  */
211
- export declare class NoteData extends DocumentData<
214
+ export class NoteData extends DocumentData<
212
215
  NoteDataSchema,
213
216
  NoteDataProperties,
214
217
  PropertiesToSource<NoteDataProperties>,
215
218
  NoteDataConstructorData,
216
219
  documents.BaseNote
217
220
  > {
221
+ /** @override */
218
222
  static defineSchema(): NoteDataSchema;
223
+
224
+ /**
225
+ * The default icon used for newly created Note documents.
226
+ * @defaultValue `"icons/svg/book.svg"`
227
+ */
228
+ static DEFAULT_ICON: string;
219
229
  }
220
230
 
221
231
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
222
- export declare interface NoteData extends NoteDataProperties {}
232
+ export interface NoteData extends NoteDataProperties {}
@@ -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