@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
@@ -0,0 +1,228 @@
1
+ import type { FieldReturnType, PropertiesToSource } from '../../../../types/helperTypes.js';
2
+ import { DocumentData } from '../../abstract/module.mjs';
3
+ import * as documents from '../../documents.mjs';
4
+ import * as fields from '../fields.mjs';
5
+ import type { AnimationData, AnimationDataConstructorData } from './animationData.js';
6
+ import type { DarknessActivation, DarknessActivationConstructorData } from './darknessActivation.js';
7
+
8
+ interface LightDataSchema extends DocumentSchema {
9
+ alpha: FieldReturnType<fields.AlphaField, { default: 0.5 }>;
10
+ angle: fields.AngleField;
11
+ bright: fields.NonnegativeNumberField;
12
+ color: fields.ColorField;
13
+ coloration: FieldReturnType<fields.NonnegativeIntegerField, { default: 1 }>;
14
+ dim: fields.NonnegativeNumberField;
15
+ gradual: FieldReturnType<fields.BooleanField, { default: true }>;
16
+ luminosity: FieldReturnType<LightData.LightUniformField, { default: 0.5 }>;
17
+ saturation: LightData.LightUniformField;
18
+ contrast: LightData.LightUniformField;
19
+ shadows: LightData.LightUniformField;
20
+ animation: DocumentField<AnimationData> & {
21
+ type: typeof AnimationData;
22
+ required: true;
23
+ default: Record<string, never>;
24
+ };
25
+ darkness: DocumentField<DarknessActivation> & {
26
+ type: typeof DarknessActivation;
27
+ required: true;
28
+ default: Record<string, never>;
29
+ };
30
+ }
31
+
32
+ interface LightDataProperties {
33
+ /**
34
+ * An opacity for the emitted light, if any
35
+ * @defaultValue `0.5`
36
+ */
37
+ alpha: number;
38
+
39
+ /**
40
+ * The angle of emission for this point source
41
+ * @defaultValue `360`
42
+ */
43
+ angle: number;
44
+
45
+ /**
46
+ * The allowed radius of bright vision or illumination
47
+ * @defaultValue `0`
48
+ */
49
+ bright: number;
50
+
51
+ /** A tint color for the emitted light, if any */
52
+ color: string | null | undefined;
53
+
54
+ /**
55
+ * The coloration technique applied in the shader
56
+ * @defaultValue `1`
57
+ */
58
+ coloration: number;
59
+
60
+ /**
61
+ * The allowed radius of dim vision or illumination
62
+ * @defaultValue `0`
63
+ */
64
+ dim: number;
65
+
66
+ /**
67
+ * Fade the difference between bright, dim, and dark gradually?
68
+ * @defaultValue `true`
69
+ */
70
+ gradual: boolean;
71
+
72
+ /**
73
+ * The luminosity applied in the shader
74
+ * @defaultValue `0.5`
75
+ */
76
+ luminosity: number;
77
+
78
+ /**
79
+ * The amount of color saturation this light applies to the background texture
80
+ * @defaultValue `0`
81
+ */
82
+ saturation: number;
83
+
84
+ /**
85
+ * The amount of contrast this light applies to the background texture
86
+ * @defaultValue `0`
87
+ */
88
+ contrast: number;
89
+
90
+ /**
91
+ * The depth of shadows this light applies to the background texture
92
+ * @defaultValue `0`
93
+ */
94
+ shadows: number;
95
+
96
+ /**
97
+ * An animation configuration for the source
98
+ * @defaultValue `new AnimationData({})`
99
+ */
100
+ animation: AnimationData;
101
+
102
+ /**
103
+ * A darkness range (min and max) for which the source should be active
104
+ * @defaultValue `new DarknessActivation({})`
105
+ */
106
+ darkness: DarknessActivation;
107
+ }
108
+
109
+ interface LightDataConstructorData {
110
+ /**
111
+ * An opacity for the emitted light, if any
112
+ * @defaultValue `0.5`
113
+ */
114
+ alpha?: number | null | undefined;
115
+
116
+ /**
117
+ * The angle of emission for this point source
118
+ * @defaultValue `360`
119
+ */
120
+ angle?: number | null | undefined;
121
+
122
+ /**
123
+ * The allowed radius of bright vision or illumination
124
+ * @defaultValue `0`
125
+ */
126
+ bright?: number | null | undefined;
127
+
128
+ /** A tint color for the emitted light, if any */
129
+ color?: string | null | undefined;
130
+
131
+ /**
132
+ * The coloration technique applied in the shader
133
+ * @defaultValue `1`
134
+ */
135
+ coloration?: number | null | undefined;
136
+
137
+ /**
138
+ * The allowed radius of dim vision or illumination
139
+ * @defaultValue `0`
140
+ */
141
+ dim?: number | null | undefined;
142
+
143
+ /**
144
+ * Fade the difference between bright, dim, and dark gradually?
145
+ * @defaultValue `true`
146
+ */
147
+ gradual?: boolean | null | undefined;
148
+
149
+ /**
150
+ * The luminosity applied in the shader
151
+ * @defaultValue `0.5`
152
+ */
153
+ luminosity?: number | null | undefined;
154
+
155
+ /**
156
+ * The amount of color saturation this light applies to the background texture
157
+ * @defaultValue `0`
158
+ */
159
+ saturation?: number | null | undefined;
160
+
161
+ /**
162
+ * The amount of contrast this light applies to the background texture
163
+ * @defaultValue `0`
164
+ */
165
+ contrast?: number | null | undefined;
166
+
167
+ /**
168
+ * The depth of shadows this light applies to the background texture
169
+ * @defaultValue `0`
170
+ */
171
+ shadows?: number | null | undefined;
172
+
173
+ /**
174
+ * An animation configuration for the source
175
+ * @defaultValue `new AnimationData({})`
176
+ */
177
+ animation?: AnimationDataConstructorData | null | undefined;
178
+
179
+ /**
180
+ * A darkness range (min and max) for which the source should be active
181
+ * @defaultValue `new DarknessActivation({})`
182
+ */
183
+ darkness?: DarknessActivationConstructorData | null | undefined;
184
+ }
185
+
186
+ /**
187
+ * A reusable document structure for the internal data used to render the appearance of a light source.
188
+ * This is re-used by both the AmbientLightData and TokenData classes.
189
+ */
190
+ export class LightData extends DocumentData<
191
+ LightDataSchema,
192
+ LightDataProperties,
193
+ PropertiesToSource<LightDataProperties>,
194
+ LightDataConstructorData,
195
+ documents.BaseAmbientLight | documents.BaseToken
196
+ > {
197
+ /** @override */
198
+ static defineSchema(): LightDataSchema;
199
+
200
+ /**
201
+ * A reusable field definition for uniform fields used by LightData
202
+ */
203
+ static LIGHT_UNIFORM_FIELD: LightData.LightUniformField;
204
+
205
+ /** @override */
206
+ _initializeSource(data: LightDataConstructorData): PropertiesToSource<LightDataProperties>;
207
+
208
+ /** @override */
209
+ protected _initialize(): void;
210
+ }
211
+
212
+ declare namespace LightData {
213
+ /**
214
+ * Property type: `number`
215
+ * Constructor type: `number | null | undefined`
216
+ * Default: `0`
217
+ */
218
+ interface LightUniformField {
219
+ type: typeof Number;
220
+ required: true;
221
+ default: 0;
222
+ validate: (n: number) => boolean;
223
+ validationError: '{name} {field} "{value}" is not a number between -1 and 1';
224
+ }
225
+ }
226
+
227
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
228
+ export interface LightData extends LightDataProperties {}
@@ -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 {}