@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,41 +1,46 @@
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/module.mjs';
3
- import * as fields from '../fields.mjs';
4
8
  import * as documents from '../../documents.mjs';
5
- import * as CONST from '../../constants.mjs';
9
+ import * as fields from '../fields.mjs';
6
10
 
7
11
  interface MacroDataSchema extends DocumentSchema {
8
- _id: typeof fields.DOCUMENT_ID;
9
- name: typeof fields.REQUIRED_STRING;
10
- type: DocumentField<string> & {
12
+ _id: fields.DocumentId;
13
+ name: fields.RequiredString;
14
+ type: DocumentField<foundry.CONST.MACRO_TYPES> & {
11
15
  type: String;
12
16
  required: true;
13
- default: typeof CONST.MACRO_TYPES.CHAT;
14
- validate: (t: unknown) => boolean;
17
+ default: typeof foundry.CONST.MACRO_TYPES.CHAT;
18
+ validate: (t: unknown) => t is foundry.CONST.MACRO_TYPES;
15
19
  validationError: 'The provided Macro type must be in CONST.MACRO_TYPES';
16
20
  };
17
21
  author: fields.ForeignDocumentField<{
18
22
  type: typeof documents.BaseUser;
19
23
  default: () => Game['user'];
20
24
  }>;
21
- img: FieldReturnType<typeof fields.IMAGE_FIELD, { required: true; default: typeof CONST.DEFAULT_MACRO_ICON }>;
22
- scope: DocumentField<string> & {
25
+ img: FieldReturnType<fields.ImageField, { required: true; default: typeof MacroData.DEFAULT_ICON }>;
26
+ scope: DocumentField<foundry.CONST.MACRO_SCOPES> & {
23
27
  type: String;
24
28
  required: true;
25
- default: typeof CONST.MACRO_SCOPES[0];
26
- validate: (t: unknown) => boolean;
29
+ default: typeof foundry.CONST.MACRO_SCOPES[0];
30
+ validate: (t: unknown) => t is foundry.CONST.MACRO_SCOPES;
27
31
  validationError: 'The provided Macro scope must be in CONST.MACRO_SCOPES';
28
32
  };
29
- command: typeof fields.BLANK_STRING;
33
+ command: fields.BlankString;
30
34
  folder: fields.ForeignDocumentField<{ type: typeof documents.BaseFolder }>;
31
- sort: typeof fields.INTEGER_SORT_FIELD;
32
- permission: typeof fields.DOCUMENT_PERMISSIONS;
33
- flags: typeof fields.OBJECT_FIELD;
35
+ sort: fields.IntegerSortField;
36
+ permission: fields.DocumentPermissions;
37
+ flags: fields.ObjectField;
34
38
  }
35
39
 
36
40
  interface MacroDataProperties {
37
41
  /**
38
42
  * The _id which uniquely identifies this Macro document
43
+ * @defaultValue `null`
39
44
  */
40
45
  _id: string | null;
41
46
 
@@ -46,11 +51,13 @@ interface MacroDataProperties {
46
51
 
47
52
  /**
48
53
  * A Macro subtype from CONST.MACRO_TYPES
54
+ * @defaultValue `foundry.CONST.MACRO_TYPES.CHAT`
49
55
  */
50
- type: foundry.CONST.MacroTypes;
56
+ type: foundry.CONST.MACRO_TYPES;
51
57
 
52
58
  /**
53
59
  * The _id of a User document which created this Macro *
60
+ * @defaultValue `game?.user`
54
61
  */
55
62
  author: string;
56
63
 
@@ -62,13 +69,13 @@ interface MacroDataProperties {
62
69
 
63
70
  /**
64
71
  * The scope of this Macro application from CONST.MACRO_SCOPES
65
- * @defaultValue `'global'`
72
+ * @defaultValue `CONST.MACRO_SCOPES[0]` ("global")
66
73
  */
67
- scope: foundry.CONST.MacroScopes;
74
+ scope: foundry.CONST.MACRO_SCOPES;
68
75
 
69
76
  /**
70
77
  * The string content of the macro command
71
- * @defaultValue `''`
78
+ * @defaultValue `""`
72
79
  */
73
80
  command: string;
74
81
 
@@ -88,7 +95,7 @@ interface MacroDataProperties {
88
95
  * An object which configures user permissions to this Macro
89
96
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
90
97
  */
91
- permission: Partial<Record<string, foundry.CONST.EntityPermission>>;
98
+ permission: Partial<Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>>;
92
99
 
93
100
  /**
94
101
  * An object of optional key/value flags
@@ -100,8 +107,9 @@ interface MacroDataProperties {
100
107
  interface MacroDataConstructorData {
101
108
  /**
102
109
  * The _id which uniquely identifies this Macro document
110
+ * @defaultValue `null`
103
111
  */
104
- _id?: string | null;
112
+ _id?: string | null | undefined;
105
113
 
106
114
  /**
107
115
  * The name of this Macro
@@ -110,62 +118,64 @@ interface MacroDataConstructorData {
110
118
 
111
119
  /**
112
120
  * A Macro subtype from CONST.MACRO_TYPES
121
+ * @defaultValue `foundry.CONST.MACRO_TYPES.CHAT`
113
122
  */
114
- type?: foundry.CONST.MacroTypes | null;
123
+ type?: foundry.CONST.MACRO_TYPES | null | undefined;
115
124
 
116
125
  /**
117
126
  * The _id of a User document which created this Macro *
127
+ * @defaultValue `game?.user`
118
128
  */
119
- author?: string | null;
129
+ author?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseUser>> | string | null | undefined;
120
130
 
121
131
  /**
122
132
  * An image file path which provides the thumbnail artwork for this Macro
123
133
  * @defaultValue `CONST.DEFAULT_MACRO_ICON`
124
134
  */
125
- img?: string | null;
135
+ img?: string | null | undefined;
126
136
 
127
137
  /**
128
138
  * The scope of this Macro application from CONST.MACRO_SCOPES
129
- * @defaultValue `'global'`
139
+ * @defaultValue `CONST.MACRO_SCOPES[0]` ("global")
130
140
  */
131
- scope?: foundry.CONST.MacroScopes | null;
141
+ scope?: foundry.CONST.MACRO_SCOPES | null | undefined;
132
142
 
133
143
  /**
134
144
  * The string content of the macro command
135
- * @defaultValue `''`
145
+ * @defaultValue `""`
136
146
  */
137
- command?: string | null;
147
+ command?: string | null | undefined;
138
148
 
139
149
  /**
140
150
  * The _id of a Folder which contains this Macro
141
151
  * @defaultValue `null`
142
152
  */
143
- folder?: string | null;
153
+ folder?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseFolder>> | string | null | undefined;
144
154
 
145
155
  /**
146
156
  * The numeric sort value which orders this Macro relative to its siblings
147
157
  * @defaultValue `0`
148
158
  */
149
- sort?: number | null;
159
+ sort?: number | null | undefined;
150
160
 
151
161
  /**
152
162
  * An object which configures user permissions to this Macro
153
163
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
154
164
  */
155
- permission?: Partial<Record<string, foundry.CONST.EntityPermission>> | null;
165
+ permission?: Partial<Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>> | null | undefined;
156
166
 
157
167
  /**
158
168
  * An object of optional key/value flags
159
169
  * @defaultValue `{}`
160
170
  */
161
- flags?: ConfiguredFlags<'Macro'> | null;
171
+ flags?: ConfiguredFlags<'Macro'> | null | undefined;
162
172
  }
163
173
 
164
174
  /**
165
175
  * The data schema for a Macro document.
166
176
  * @see BaseMacro
167
177
  */
168
- export declare class MacroData extends DocumentData<
178
+ export class MacroData extends DocumentData<
169
179
  MacroDataSchema,
170
180
  MacroDataProperties,
171
181
  PropertiesToSource<MacroDataProperties>,
@@ -174,8 +184,15 @@ export declare class MacroData extends DocumentData<
174
184
  > {
175
185
  constructor(data: MacroDataConstructorData, document?: documents.BaseMacro | null);
176
186
 
187
+ /** @override */
177
188
  static defineSchema(): MacroDataSchema;
189
+
190
+ /**
191
+ * The default icon used for newly created Macro documents.
192
+ * @defaultValue `"icons/svg/dice-target.svg"`
193
+ */
194
+ static DEFAULT_ICON: string;
178
195
  }
179
196
 
180
197
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
181
- export declare interface MacroData extends MacroDataProperties {}
198
+ export interface MacroData extends MacroDataProperties {}
@@ -5,34 +5,35 @@ import {
5
5
  PropertiesToSource
6
6
  } from '../../../../types/helperTypes';
7
7
  import { DocumentData } from '../../abstract/module.mjs';
8
- import * as fields from '../fields.mjs';
9
8
  import * as documents from '../../documents.mjs';
9
+ import * as fields from '../fields.mjs';
10
10
 
11
11
  interface MeasuredTemplateDataSchema extends DocumentSchema {
12
- _id: typeof fields.DOCUMENT_ID;
12
+ _id: fields.DocumentId;
13
13
  user: fields.ForeignDocumentField<{ type: typeof documents.BaseUser; required: true }>;
14
- t: {
14
+ t: DocumentField<typeof foundry.CONST.MEASURED_TEMPLATE_TYPES> & {
15
15
  type: typeof String;
16
16
  required: true;
17
- default: typeof CONST.MEASURED_TEMPLATE_TYPES.CIRCLE;
18
- validate: (t: unknown) => boolean;
17
+ default: typeof foundry.CONST.MEASURED_TEMPLATE_TYPES.CIRCLE;
18
+ validate: (t: unknown) => t is typeof foundry.CONST.MEASURED_TEMPLATE_TYPES;
19
19
  validationError: 'Invalid {name} {field} which must be a value in CONST.MEASURED_TEMPLATE_TYPES';
20
20
  };
21
- x: typeof fields.REQUIRED_NUMBER;
22
- y: typeof fields.REQUIRED_NUMBER;
23
- distance: FieldReturnType<typeof fields.REQUIRED_POSITIVE_NUMBER, { default: 1 }>;
24
- direction: FieldReturnType<typeof fields.ANGLE_FIELD, { default: 0 }>;
25
- angle: typeof fields.ANGLE_FIELD;
26
- width: FieldReturnType<typeof fields.REQUIRED_POSITIVE_NUMBER, { default: 1 }>;
27
- borderColor: FieldReturnType<typeof fields.COLOR_FIELD, { required: true; default: '#000000' }>;
28
- fillColor: FieldReturnType<typeof fields.COLOR_FIELD, { required: true; default: '#FF0000' }>;
29
- texture: typeof fields.VIDEO_FIELD;
30
- flags: typeof fields.OBJECT_FIELD;
21
+ x: fields.RequiredNumber;
22
+ y: fields.RequiredNumber;
23
+ distance: FieldReturnType<fields.RequiredPositiveNumber, { default: 1; validate: (n: number) => boolean }>;
24
+ direction: FieldReturnType<fields.AngleField, { default: 0 }>;
25
+ angle: fields.AngleField;
26
+ width: FieldReturnType<fields.RequiredPositiveNumber, { default: 1 }>;
27
+ borderColor: FieldReturnType<fields.ColorField, { required: true; default: '#000000' }>;
28
+ fillColor: FieldReturnType<fields.ColorField, { required: true; default: '#FF0000' }>;
29
+ texture: fields.VideoField;
30
+ flags: fields.ObjectField;
31
31
  }
32
32
 
33
33
  interface MeasuredTemplateDataProperties {
34
34
  /**
35
- The _id which uniquely identifies this BaseMeasuredTemplate embedded document
35
+ * The _id which uniquely identifies this BaseMeasuredTemplate embedded document
36
+ * @defaultValue `null`
36
37
  */
37
38
  _id: string | null;
38
39
 
@@ -40,9 +41,9 @@ interface MeasuredTemplateDataProperties {
40
41
 
41
42
  /**
42
43
  * The value in CONST.MEASURED_TEMPLATE_TYPES which defines the geometry type of this template
43
- * @defaultValue `'circle'`
44
+ * @defaultValue `foundry.CONST.MEASURED_TEMPLATE_TYPES.CIRCLE`
44
45
  */
45
- t: ValueOf<foundry.CONST.MeasuredTemplateTypes>;
46
+ t: foundry.CONST.MEASURED_TEMPLATE_TYPES;
46
47
 
47
48
  /**
48
49
  * The x-coordinate position of the origin of the template effect
@@ -70,7 +71,7 @@ interface MeasuredTemplateDataProperties {
70
71
 
71
72
  /**
72
73
  * The angle of effect of the measured template, applies to cone types
73
- * @defaultValue `0`
74
+ * @defaultValue `360`
74
75
  */
75
76
  angle: number;
76
77
 
@@ -95,7 +96,7 @@ interface MeasuredTemplateDataProperties {
95
96
  /**
96
97
  * A repeatable tiling texture used to add a texture fill to the template shape
97
98
  */
98
- texture: string | undefined | null;
99
+ texture: string | null | undefined;
99
100
 
100
101
  /**
101
102
  * An object of optional key/value flags
@@ -106,83 +107,84 @@ interface MeasuredTemplateDataProperties {
106
107
 
107
108
  interface MeasuredTemplateDataConstructorData {
108
109
  /**
109
- The _id which uniquely identifies this BaseMeasuredTemplate embedded document
110
+ * The _id which uniquely identifies this BaseMeasuredTemplate embedded document
111
+ * @defaultValue `null`
110
112
  */
111
- _id?: string | null;
113
+ _id?: string | null | undefined;
112
114
 
113
- user?: string | null;
115
+ user?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseUser>> | string | null | undefined;
114
116
 
115
117
  /**
116
118
  * The value in CONST.MEASURED_TEMPLATE_TYPES which defines the geometry type of this template
117
- * @defaultValue `'circle'`
119
+ * @defaultValue `foundry.CONST.MEASURED_TEMPLATE_TYPES.CIRCLE`
118
120
  */
119
- t?: ValueOf<foundry.CONST.MeasuredTemplateTypes> | null;
121
+ t?: foundry.CONST.MEASURED_TEMPLATE_TYPES | null | undefined;
120
122
 
121
123
  /**
122
124
  * The x-coordinate position of the origin of the template effect
123
125
  * @defaultValue `0`
124
126
  */
125
- x?: number | null;
127
+ x?: number | null | undefined;
126
128
 
127
129
  /**
128
130
  * The y-coordinate position of the origin of the template effect
129
131
  * @defaultValue `0`
130
132
  */
131
- y?: number | null;
133
+ y?: number | null | undefined;
132
134
 
133
135
  /**
134
136
  * The distance of the template effect
135
137
  * @defaultValue `1`
136
138
  */
137
- distance?: number | null;
139
+ distance?: number | null | undefined;
138
140
 
139
141
  /**
140
142
  * The angle of rotation for the measured template
141
143
  * @defaultValue `0`
142
144
  */
143
- direction?: number | null;
145
+ direction?: number | null | undefined;
144
146
 
145
147
  /**
146
148
  * The angle of effect of the measured template, applies to cone types
147
- * @defaultValue `0`
149
+ * @defaultValue `360`
148
150
  */
149
- angle?: number | null;
151
+ angle?: number | null | undefined;
150
152
 
151
153
  /**
152
154
  * The width of the measured template, applies to ray types
153
155
  * @defaultValue `1`
154
156
  */
155
- width?: number | null;
157
+ width?: number | null | undefined;
156
158
 
157
159
  /**
158
160
  * A color string used to tint the border of the template shape
159
161
  * @defaultValue `'#000000'`
160
162
  */
161
- borderColor?: string | null;
163
+ borderColor?: string | null | undefined;
162
164
 
163
165
  /**
164
166
  * A color string used to tint the fill of the template shape
165
167
  * @defaultValue `'#FF0000'`
166
168
  */
167
- fillColor?: string | null;
169
+ fillColor?: string | null | undefined;
168
170
 
169
171
  /**
170
172
  * A repeatable tiling texture used to add a texture fill to the template shape
171
173
  */
172
- texture?: string | null;
174
+ texture?: string | null | undefined;
173
175
 
174
176
  /**
175
177
  * An object of optional key/value flags
176
178
  * @defaultValue `{}`
177
179
  */
178
- flags?: ConfiguredFlags<'MeasuredTemplate'> | null;
180
+ flags?: ConfiguredFlags<'MeasuredTemplate'> | null | undefined;
179
181
  }
180
182
 
181
183
  /**
182
184
  * The data schema for a MeasuredTemplate embedded document.
183
185
  * @see BaseMeasuredTemplate
184
186
  */
185
- export declare class MeasuredTemplateData extends DocumentData<
187
+ export class MeasuredTemplateData extends DocumentData<
186
188
  MeasuredTemplateDataSchema,
187
189
  MeasuredTemplateDataProperties,
188
190
  PropertiesToSource<MeasuredTemplateDataProperties>,
@@ -197,6 +199,7 @@ export declare class MeasuredTemplateData extends DocumentData<
197
199
  document: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseScene>>
198
200
  );
199
201
 
202
+ /** @override */
200
203
  static defineSchema(): MeasuredTemplateDataSchema;
201
204
 
202
205
  /** @override */
@@ -207,4 +210,4 @@ export declare class MeasuredTemplateData extends DocumentData<
207
210
  }
208
211
 
209
212
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
210
- export declare interface MeasuredTemplateData extends MeasuredTemplateDataProperties {}
213
+ export interface MeasuredTemplateData extends MeasuredTemplateDataProperties {}
@@ -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 {}