@league-of-foundry-developers/foundry-vtt-types 0.8.9-9 → 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 (178) hide show
  1. package/README.md +44 -27
  2. package/index.d.ts +2 -2
  3. package/package.json +34 -15
  4. package/src/foundry/common/abstract/document.mjs.d.ts +24 -10
  5. package/src/foundry/common/config.mjs/index.d.ts +1 -0
  6. package/src/foundry/common/config.mjs/releaseData.d.ts +98 -0
  7. package/src/foundry/common/constants.mjs.d.ts +402 -213
  8. package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +36 -29
  9. package/src/foundry/common/data/data.mjs/actorData.d.ts +32 -21
  10. package/src/foundry/common/data/data.mjs/adventureData.d.ts +165 -0
  11. package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +45 -124
  12. package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +49 -77
  13. package/src/foundry/common/data/data.mjs/animationData.d.ts +17 -9
  14. package/src/foundry/common/data/data.mjs/cardData.d.ts +265 -0
  15. package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +66 -0
  16. package/src/foundry/common/data/data.mjs/cardsData.d.ts +238 -0
  17. package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +51 -39
  18. package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +18 -11
  19. package/src/foundry/common/data/data.mjs/combatData.d.ts +51 -25
  20. package/src/foundry/common/data/data.mjs/combatantData.d.ts +48 -30
  21. package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +8 -7
  22. package/src/foundry/common/data/data.mjs/drawingData.d.ts +68 -67
  23. package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +21 -25
  24. package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +24 -23
  25. package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +23 -16
  26. package/src/foundry/common/data/data.mjs/folderData.d.ts +28 -25
  27. package/src/foundry/common/data/data.mjs/index.d.ts +5 -0
  28. package/src/foundry/common/data/data.mjs/itemData.d.ts +26 -18
  29. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +21 -20
  30. package/src/foundry/common/data/data.mjs/lightData.d.ts +228 -0
  31. package/src/foundry/common/data/data.mjs/macroData.d.ts +52 -35
  32. package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +41 -38
  33. package/src/foundry/common/data/data.mjs/noteData.d.ts +47 -37
  34. package/src/foundry/common/data/data.mjs/playlistData.d.ts +55 -26
  35. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +32 -16
  36. package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +7 -11
  37. package/src/foundry/common/data/data.mjs/rollTableData.d.ts +30 -24
  38. package/src/foundry/common/data/data.mjs/sceneData.d.ts +132 -111
  39. package/src/foundry/common/data/data.mjs/settingData.d.ts +11 -8
  40. package/src/foundry/common/data/data.mjs/tableResultData.d.ts +30 -26
  41. package/src/foundry/common/data/data.mjs/tileData.d.ts +43 -36
  42. package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +10 -9
  43. package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +6 -3
  44. package/src/foundry/common/data/data.mjs/tokenData.d.ts +105 -157
  45. package/src/foundry/common/data/data.mjs/userData.d.ts +111 -33
  46. package/src/foundry/common/data/data.mjs/videoData.d.ts +9 -8
  47. package/src/foundry/common/data/data.mjs/wallData.d.ts +67 -39
  48. package/src/foundry/common/data/fields.mjs.d.ts +180 -83
  49. package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +9 -3
  50. package/src/foundry/common/documents.mjs/baseActor.d.ts +17 -45
  51. package/src/foundry/common/documents.mjs/baseAdventure.d.ts +38 -0
  52. package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +3 -0
  53. package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +3 -1
  54. package/src/foundry/common/documents.mjs/baseCard.d.ts +62 -0
  55. package/src/foundry/common/documents.mjs/baseCards.d.ts +39 -0
  56. package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +3 -0
  57. package/src/foundry/common/documents.mjs/baseCombat.d.ts +5 -2
  58. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +10 -1
  59. package/src/foundry/common/documents.mjs/baseDrawing.d.ts +11 -1
  60. package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +4 -3
  61. package/src/foundry/common/documents.mjs/baseFolder.d.ts +10 -1
  62. package/src/foundry/common/documents.mjs/baseItem.d.ts +11 -29
  63. package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +3 -0
  64. package/src/foundry/common/documents.mjs/baseMacro.d.ts +16 -14
  65. package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +4 -1
  66. package/src/foundry/common/documents.mjs/baseNote.d.ts +2 -2
  67. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +1 -0
  68. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +2 -1
  69. package/src/foundry/common/documents.mjs/baseRollTable.d.ts +3 -0
  70. package/src/foundry/common/documents.mjs/baseScene.d.ts +1 -0
  71. package/src/foundry/common/documents.mjs/baseSetting.d.ts +1 -0
  72. package/src/foundry/common/documents.mjs/baseTableResult.d.ts +10 -3
  73. package/src/foundry/common/documents.mjs/baseTile.d.ts +1 -0
  74. package/src/foundry/common/documents.mjs/baseToken.d.ts +3 -0
  75. package/src/foundry/common/documents.mjs/baseUser.d.ts +7 -1
  76. package/src/foundry/common/documents.mjs/baseWall.d.ts +7 -10
  77. package/src/foundry/common/documents.mjs/index.d.ts +3 -0
  78. package/src/foundry/common/module.mjs.d.ts +3 -0
  79. package/src/foundry/common/packages.mjs/moduleData.d.ts +12 -9
  80. package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +24 -24
  81. package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +27 -21
  82. package/src/foundry/common/packages.mjs/packageData.d.ts +108 -82
  83. package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +18 -11
  84. package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +16 -15
  85. package/src/foundry/common/packages.mjs/systemData.d.ts +21 -20
  86. package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +3 -3
  87. package/src/foundry/common/packages.mjs/worldData.d.ts +29 -18
  88. package/src/foundry/common/types.mjs.d.ts +95 -0
  89. package/src/foundry/common/utils/helpers.mjs.d.ts +27 -2
  90. package/src/foundry/common/utils/primitives.mjs.d.ts +99 -16
  91. package/src/foundry/foundry.js/application.d.ts +2 -2
  92. package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
  93. package/src/foundry/foundry.js/applications/formApplication.d.ts +1 -1
  94. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
  95. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +1 -1
  96. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
  97. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
  98. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +1 -1
  99. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +1 -1
  100. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +1 -0
  101. package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
  102. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +1 -1
  103. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +2 -2
  104. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +5 -5
  105. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +1 -1
  106. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +5 -8
  107. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +3 -3
  108. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +1 -1
  109. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
  110. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  111. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  112. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -0
  113. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
  114. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +8 -9
  115. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +6 -6
  116. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
  117. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
  118. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  119. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
  120. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
  121. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
  122. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +2 -2
  123. package/src/foundry/foundry.js/avSettings.d.ts +7 -7
  124. package/src/foundry/foundry.js/canvas.d.ts +148 -46
  125. package/src/foundry/foundry.js/canvasAnimation.d.ts +1 -1
  126. package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
  127. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
  128. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
  129. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
  130. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
  131. package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
  132. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +384 -0
  133. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
  134. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +4 -8
  135. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +1 -1
  136. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
  137. package/src/foundry/foundry.js/clientDocuments/index.d.ts +2 -0
  138. package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
  139. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
  140. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +1 -1
  141. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
  142. package/src/foundry/foundry.js/clientKeybindings.d.ts +299 -0
  143. package/src/foundry/foundry.js/clientSettings.d.ts +11 -9
  144. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
  145. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
  146. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
  147. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
  148. package/src/foundry/foundry.js/config.d.ts +465 -887
  149. package/src/foundry/foundry.js/game.d.ts +86 -11
  150. package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
  151. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
  152. package/src/foundry/foundry.js/hooks.d.ts +57 -0
  153. package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
  154. package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
  155. package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
  156. package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
  157. package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
  158. package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
  159. package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
  160. package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
  161. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +3 -3
  162. package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
  163. package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
  164. package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
  165. package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
  166. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
  167. package/src/foundry/foundry.js/pointSource.d.ts +2 -2
  168. package/src/foundry/foundry.js/roll.d.ts +25 -36
  169. package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
  170. package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
  171. package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
  172. package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
  173. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
  174. package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
  175. package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
  176. package/src/foundry/foundry.js/textEditor.d.ts +1 -1
  177. package/src/foundry/index.d.ts +4 -0
  178. package/src/types/utils.d.ts +11 -3
@@ -1,18 +1,18 @@
1
+ import { ConfiguredDocumentClass, ConfiguredFlags, PropertiesToSource } from '../../../../types/helperTypes';
1
2
  import DocumentData from '../../abstract/data.mjs';
2
- import * as fields from '../fields.mjs';
3
3
  import * as documents from '../../documents.mjs';
4
- import { ConfiguredFlags, PropertiesToSource } from '../../../../types/helperTypes';
4
+ import * as fields from '../fields.mjs';
5
5
 
6
6
  interface FolderDataSchema extends DocumentSchema {
7
- _id: typeof fields.DOCUMENT_ID;
8
- name: typeof fields.REQUIRED_STRING;
9
- type: DocumentField<foundry.CONST.FolderEntityTypes> & {
7
+ _id: fields.DocumentId;
8
+ name: fields.RequiredString;
9
+ type: DocumentField<foundry.CONST.FOLDER_DOCUMENT_TYPES> & {
10
10
  type: String;
11
11
  required: true;
12
- validate: (t: unknown) => t is foundry.CONST.FolderEntityTypes;
12
+ validate: (t: unknown) => t is foundry.CONST.FOLDER_DOCUMENT_TYPES;
13
13
  validationError: 'Invalid Folder type provided';
14
14
  };
15
- description: typeof fields.STRING_FIELD;
15
+ description: fields.StringField;
16
16
  parent: fields.ForeignDocumentField<{ type: typeof documents.BaseFolder }>;
17
17
  sorting: DocumentField<SortingModes> & {
18
18
  type: String;
@@ -21,14 +21,15 @@ interface FolderDataSchema extends DocumentSchema {
21
21
  validate: (mode: unknown) => mode is SortingModes;
22
22
  validationError: 'Invalid Folder sorting mode';
23
23
  };
24
- sort: typeof fields.INTEGER_SORT_FIELD;
25
- color: typeof fields.COLOR_FIELD;
26
- flags: typeof fields.OBJECT_FIELD;
24
+ sort: fields.IntegerSortField;
25
+ color: fields.ColorField;
26
+ flags: fields.ObjectField;
27
27
  }
28
28
 
29
29
  interface FolderDataProperties {
30
30
  /**
31
31
  * The _id which uniquely identifies this Folder document
32
+ * @defaultValue `null`
32
33
  */
33
34
  _id: string | null;
34
35
 
@@ -38,14 +39,14 @@ interface FolderDataProperties {
38
39
  name: string;
39
40
 
40
41
  /**
41
- * The document type which this Folder contains, from CONST.FOLDER_ENTITY_TYPES
42
+ * The document type which this Folder contains, from CONST.FOLDER_DOCUMENT_TYPES
42
43
  */
43
- type: foundry.CONST.FolderEntityTypes;
44
+ type: foundry.CONST.FOLDER_DOCUMENT_TYPES;
44
45
 
45
46
  /**
46
47
  * An HTML description of the contents of this folder
47
48
  */
48
- description?: string;
49
+ description?: string | undefined;
49
50
 
50
51
  /**
51
52
  * The _id of a parent Folder which contains this Folder
@@ -68,7 +69,7 @@ interface FolderDataProperties {
68
69
  /**
69
70
  * A color string used for the background color of this Folder
70
71
  */
71
- color?: string | null;
72
+ color: string | null | undefined;
72
73
 
73
74
  /**
74
75
  * An object of optional key/value flags
@@ -80,8 +81,9 @@ interface FolderDataProperties {
80
81
  interface FolderDataConstructorData {
81
82
  /**
82
83
  * The _id which uniquely identifies this Folder document
84
+ * @defaultValue `null`
83
85
  */
84
- _id?: string | null;
86
+ _id?: string | null | undefined;
85
87
 
86
88
  /**
87
89
  * The name of this Folder
@@ -89,49 +91,49 @@ interface FolderDataConstructorData {
89
91
  name: string;
90
92
 
91
93
  /**
92
- * The document type which this Folder contains, from CONST.FOLDER_ENTITY_TYPES
94
+ * The document type which this Folder contains, from CONST.FOLDER_DOCUMENT_TYPES
93
95
  */
94
- type: foundry.CONST.FolderEntityTypes;
96
+ type: foundry.CONST.FOLDER_DOCUMENT_TYPES;
95
97
 
96
98
  /**
97
99
  * An HTML description of the contents of this folder
98
100
  */
99
- description?: string | null;
101
+ description?: string | null | undefined;
100
102
 
101
103
  /**
102
104
  * The _id of a parent Folder which contains this Folder
103
105
  * @defaultValue `null`
104
106
  */
105
- parent?: string | null;
107
+ parent?: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseFolder>> | string | null | undefined;
106
108
 
107
109
  /**
108
110
  * The sorting mode used to organize documents within this Folder, in ["a", "m"]
109
111
  * @defaultValue `'a'`
110
112
  */
111
- sorting?: SortingModes | null;
113
+ sorting?: SortingModes | null | undefined;
112
114
 
113
115
  /**
114
116
  * The numeric sort value which orders this Folder relative to its siblings
115
117
  * @defaultValue `0`
116
118
  */
117
- sort?: number | null;
119
+ sort?: number | null | undefined;
118
120
 
119
121
  /**
120
122
  * A color string used for the background color of this Folder
121
123
  */
122
- color?: string | null;
124
+ color?: string | null | undefined;
123
125
 
124
126
  /**
125
127
  * An object of optional key/value flags
126
128
  * @defaultValue `{}`
127
129
  */
128
- flags?: ConfiguredFlags<'Folder'> | null;
130
+ flags?: ConfiguredFlags<'Folder'> | null | undefined;
129
131
  }
130
132
 
131
133
  /**
132
134
  * The data schema for a Folder document.
133
135
  */
134
- export declare class FolderData extends DocumentData<
136
+ export class FolderData extends DocumentData<
135
137
  FolderDataSchema,
136
138
  FolderDataProperties,
137
139
  PropertiesToSource<FolderDataProperties>,
@@ -140,6 +142,7 @@ export declare class FolderData extends DocumentData<
140
142
  > {
141
143
  constructor(data: FolderDataConstructorData, document?: documents.BaseFolder | null);
142
144
 
145
+ /** @override */
143
146
  static defineSchema(): FolderDataSchema;
144
147
 
145
148
  static SORTING_MODES: ['a', 'm'];
@@ -148,4 +151,4 @@ export declare class FolderData extends DocumentData<
148
151
  export type SortingModes = ValueOf<typeof FolderData.SORTING_MODES>;
149
152
 
150
153
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
151
- export declare interface FolderData extends FolderDataProperties {}
154
+ export interface FolderData extends FolderDataProperties {}
@@ -1,8 +1,12 @@
1
1
  export { ActiveEffectData } from './activeEffectData';
2
2
  export { ActorData } from './actorData';
3
+ export { AdventureData } from './adventureData';
3
4
  export { AmbientLightData } from './ambientLightData';
4
5
  export { AmbientSoundData } from './ambientSoundData';
5
6
  export { ChatMessageData } from './chatMessageData';
7
+ export { CardData } from './cardData';
8
+ export { CardFaceData } from './cardFaceData';
9
+ export { CardsData } from './cardsData';
6
10
  export { CombatantData } from './combatantData';
7
11
  export { CombatData } from './combatData';
8
12
  export { DrawingData } from './drawingData';
@@ -10,6 +14,7 @@ export { FogExplorationData } from './fogExplorationData';
10
14
  export { FolderData } from './folderData';
11
15
  export { ItemData } from './itemData';
12
16
  export { JournalEntryData } from './journalEntryData';
17
+ export { LightData } from './lightData';
13
18
  export { MacroData } from './macroData';
14
19
  export { MeasuredTemplateData } from './measuredTemplateData';
15
20
  export { NoteData } from './noteData';
@@ -1,4 +1,3 @@
1
- import EmbeddedCollection from '../../abstract/embedded-collection.mjs';
2
1
  import {
3
2
  ConfiguredData,
4
3
  ConfiguredDocumentClass,
@@ -7,31 +6,33 @@ import {
7
6
  FieldReturnType,
8
7
  PropertiesToSource
9
8
  } from '../../../../types/helperTypes';
9
+ import EmbeddedCollection from '../../abstract/embedded-collection.mjs';
10
10
  import { DocumentData } from '../../abstract/module.mjs';
11
11
  import * as documents from '../../documents.mjs';
12
12
  import * as fields from '../fields.mjs';
13
13
 
14
14
  interface ItemDataSchema extends DocumentSchema {
15
- _id: typeof fields.DOCUMENT_ID;
16
- name: typeof fields.REQUIRED_STRING;
15
+ _id: fields.DocumentId;
16
+ name: fields.RequiredString;
17
17
  type: DocumentField<string> & {
18
18
  type: typeof String;
19
19
  required: true;
20
20
  validate: (t: unknown) => boolean;
21
21
  validationError: 'The provided Item type must be in the array of types defined by the game system';
22
22
  };
23
- img: FieldReturnType<typeof fields.IMAGE_FIELD, { default: () => string }>;
24
- data: FieldReturnType<typeof fields.OBJECT_FIELD, { default: (data: { type: string }) => any }>; // TODO
23
+ img: FieldReturnType<fields.ImageField, { default: () => typeof ItemData.DEFAULT_ICON }>;
24
+ data: fields.SystemDataField;
25
25
  effects: fields.EmbeddedCollectionField<typeof documents.BaseActiveEffect>;
26
26
  folder: fields.ForeignDocumentField<{ type: typeof documents.BaseFolder }>;
27
- sort: typeof fields.INTEGER_SORT_FIELD;
28
- permission: typeof fields.DOCUMENT_PERMISSIONS;
29
- flags: typeof fields.OBJECT_FIELD;
27
+ sort: fields.IntegerSortField;
28
+ permission: fields.DocumentPermissions;
29
+ flags: fields.ObjectField;
30
30
  }
31
31
 
32
32
  interface ItemDataBaseProperties {
33
33
  /**
34
34
  * The _id which uniquely identifies this Item document
35
+ * @defaultValue `null`
35
36
  */
36
37
  _id: string | null;
37
38
 
@@ -53,11 +54,13 @@ interface ItemDataBaseProperties {
53
54
 
54
55
  /**
55
56
  * The system data object which is defined by the system template.json model
57
+ * @defaultValue template from template.json for type or `{}`
56
58
  */
57
59
  data: object;
58
60
 
59
61
  /**
60
62
  * A collection of ActiveEffect embedded Documents
63
+ * @defaultValue `new EmbeddedCollection(ActiveEffectData, [], BaseActiveEffect.implementation)`
61
64
  */
62
65
  effects: EmbeddedCollection<ConfiguredDocumentClass<typeof documents.BaseActiveEffect>, ItemData>;
63
66
 
@@ -77,7 +80,7 @@ interface ItemDataBaseProperties {
77
80
  * An object which configures user permissions to this Item
78
81
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
79
82
  */
80
- permission: Partial<Record<string, foundry.CONST.EntityPermission>>;
83
+ permission: Partial<Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>>;
81
84
 
82
85
  /**
83
86
  * An object of optional key/value flags
@@ -89,8 +92,9 @@ interface ItemDataBaseProperties {
89
92
  interface ItemDataConstructorData {
90
93
  /**
91
94
  * The _id which uniquely identifies this Item document
95
+ * @defaultValue `null`
92
96
  */
93
- _id?: string | null;
97
+ _id?: string | null | undefined;
94
98
 
95
99
  /**
96
100
  * The name of this Item
@@ -106,41 +110,43 @@ interface ItemDataConstructorData {
106
110
  * An image file path which provides the artwork for this Item
107
111
  * @defaultValue `ItemData.DEFAULT_ICON`
108
112
  */
109
- img?: string | null;
113
+ img?: string | null | undefined;
110
114
 
111
115
  /**
112
116
  * The system data object which is defined by the system template.json model
117
+ * @defaultValue template from template.json for type or `{}`
113
118
  */
114
- data?: DeepPartial<ItemDataSource['data']> | null;
119
+ data?: DeepPartial<ItemDataSource['data']> | null | undefined;
115
120
 
116
121
  /**
117
122
  * A collection of ActiveEffect embedded Documents
123
+ * @defaultValue `new EmbeddedCollection(ActiveEffectData, [], BaseActiveEffect.implementation)`
118
124
  */
119
- effects?: ConstructorParameters<ConfiguredDocumentClass<typeof documents.BaseActiveEffect>>[0][] | null;
125
+ effects?: ConstructorParameters<ConfiguredDocumentClass<typeof documents.BaseActiveEffect>>[0][] | null | undefined;
120
126
 
121
127
  /**
122
128
  * The _id of a Folder which contains this Item
123
129
  * @defaultValue `null`
124
130
  */
125
- folder?: string | null;
131
+ folder?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseFolder>> | string | null | undefined;
126
132
 
127
133
  /**
128
134
  * The numeric sort value which orders this Item relative to its siblings
129
135
  * @defaultValue `0`
130
136
  */
131
- sort?: number | null;
137
+ sort?: number | null | undefined;
132
138
 
133
139
  /**
134
140
  * An object which configures user permissions to this Item
135
141
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
136
142
  */
137
- permission?: Partial<Record<string, foundry.CONST.EntityPermission>> | null;
143
+ permission?: Partial<Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>> | null | undefined;
138
144
 
139
145
  /**
140
146
  * An object of optional key/value flags
141
147
  * @defaultValue `{}`
142
148
  */
143
- flags?: ConfiguredFlags<'Item'> | null;
149
+ flags?: ConfiguredFlags<'Item'> | null | undefined;
144
150
  }
145
151
 
146
152
  type ItemDataBaseSource = PropertiesToSource<ItemDataBaseProperties>;
@@ -152,6 +158,7 @@ type DocumentDataConstructor = Pick<typeof DocumentData, keyof typeof DocumentDa
152
158
  interface ItemDataConstructor extends DocumentDataConstructor {
153
159
  new (data: ItemDataConstructorData, document?: documents.BaseItem | null): ItemData;
154
160
 
161
+ /** @override */
155
162
  defineSchema(): ItemDataSchema;
156
163
 
157
164
  /**
@@ -173,6 +180,7 @@ export type ItemData = DocumentData<
173
180
  documents.BaseItem
174
181
  > &
175
182
  ItemDataProperties & {
183
+ /** @override */
176
184
  _initializeSource(data: ItemDataConstructorData): ItemDataSource;
177
185
  };
178
- export declare const ItemData: ItemDataConstructor;
186
+ export const ItemData: ItemDataConstructor;
@@ -1,17 +1,17 @@
1
+ import { ConfiguredDocumentClass, ConfiguredFlags, PropertiesToSource } from '../../../../types/helperTypes';
1
2
  import { DocumentData } from '../../abstract/module.mjs';
2
- import * as fields from '../fields.mjs';
3
3
  import * as documents from '../../documents.mjs';
4
- import { ConfiguredFlags, PropertiesToSource } from '../../../../types/helperTypes';
4
+ import * as fields from '../fields.mjs';
5
5
 
6
6
  interface JournalEntryDataSchema extends DocumentSchema {
7
- _id: typeof fields.DOCUMENT_ID;
8
- name: typeof fields.REQUIRED_STRING;
9
- content: typeof fields.BLANK_STRING;
10
- img: typeof fields.IMAGE_FIELD;
7
+ _id: fields.DocumentId;
8
+ name: fields.RequiredString;
9
+ content: fields.BlankString;
10
+ img: fields.ImageField;
11
11
  folder: fields.ForeignDocumentField<{ type: typeof documents.BaseFolder }>;
12
- sort: typeof fields.INTEGER_SORT_FIELD;
13
- permission: typeof fields.DOCUMENT_PERMISSIONS;
14
- flags: typeof fields.OBJECT_FIELD;
12
+ sort: fields.IntegerSortField;
13
+ permission: fields.DocumentPermissions;
14
+ flags: fields.ObjectField;
15
15
  }
16
16
 
17
17
  interface JournalEntryDataProperties {
@@ -28,7 +28,7 @@ interface JournalEntryDataProperties {
28
28
 
29
29
  /**
30
30
  * The HTML content of the JournalEntry
31
- * @defaultValue `''`
31
+ * @defaultValue `""`
32
32
  */
33
33
  content: string;
34
34
 
@@ -53,7 +53,7 @@ interface JournalEntryDataProperties {
53
53
  * An object which configures user permissions to this JournalEntry
54
54
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
55
55
  */
56
- permission: Partial<Record<string, foundry.CONST.EntityPermission>>;
56
+ permission: Partial<Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>>;
57
57
 
58
58
  /**
59
59
  * An object of optional key/value flags
@@ -67,7 +67,7 @@ interface JournalEntryConstructorData {
67
67
  * The _id which uniquely identifies this JournalEntry document
68
68
  * @defaultValue `null`
69
69
  */
70
- _id?: string | null;
70
+ _id?: string | null | undefined;
71
71
 
72
72
  /**
73
73
  * The name of this JournalEntry
@@ -76,45 +76,45 @@ interface JournalEntryConstructorData {
76
76
 
77
77
  /**
78
78
  * The HTML content of the JournalEntry
79
- * @defaultValue `''`
79
+ * @defaultValue `""`
80
80
  */
81
- content?: string | null;
81
+ content?: string | null | undefined;
82
82
 
83
83
  /**
84
84
  * An image file path which provides the artwork for this JournalEntry
85
85
  */
86
- img?: string | null;
86
+ img?: string | null | undefined;
87
87
 
88
88
  /**
89
89
  * The _id of a Folder which contains this JournalEntry
90
90
  * @defaultValue `null`
91
91
  */
92
- folder?: string | null;
92
+ folder?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseFolder>> | string | null | undefined;
93
93
 
94
94
  /**
95
95
  * The numeric sort value which orders this JournalEntry relative to its siblings
96
96
  * @defaultValue `0`
97
97
  */
98
- sort?: number | null;
98
+ sort?: number | null | undefined;
99
99
 
100
100
  /**
101
101
  * An object which configures user permissions to this JournalEntry
102
102
  * @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
103
103
  */
104
- permission?: Partial<Record<string, foundry.CONST.EntityPermission>> | null;
104
+ permission?: Partial<Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>> | null | undefined;
105
105
 
106
106
  /**
107
107
  * An object of optional key/value flags
108
108
  * @defaultValue `{}`
109
109
  */
110
- flags?: ConfiguredFlags<'JournalEntry'> | null;
110
+ flags?: ConfiguredFlags<'JournalEntry'> | null | undefined;
111
111
  }
112
112
 
113
113
  /**
114
114
  * The data schema for a JournalEntry document.
115
115
  * @see BaseJournalEntry
116
116
  */
117
- export declare class JournalEntryData extends DocumentData<
117
+ export class JournalEntryData extends DocumentData<
118
118
  JournalEntryDataSchema,
119
119
  JournalEntryDataProperties,
120
120
  PropertiesToSource<JournalEntryDataProperties>,
@@ -123,6 +123,7 @@ export declare class JournalEntryData extends DocumentData<
123
123
  > {
124
124
  constructor(data: JournalEntryConstructorData, document?: documents.BaseJournalEntry | null);
125
125
 
126
+ /** @override */
126
127
  static defineSchema(): JournalEntryDataSchema;
127
128
  }
128
129
 
@@ -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 {}