@league-of-foundry-developers/foundry-vtt-types 9.249.0 → 9.249.4

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 (121) hide show
  1. package/package.json +2 -2
  2. package/src/foundry/common/abstract/data.mjs.d.ts +2 -2
  3. package/src/foundry/common/abstract/document.mjs.d.ts +20 -9
  4. package/src/foundry/common/config.mjs/releaseData.d.ts +3 -1
  5. package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +3 -1
  6. package/src/foundry/common/data/data.mjs/actorData.d.ts +1 -1
  7. package/src/foundry/common/data/data.mjs/adventureData.d.ts +14 -12
  8. package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +5 -3
  9. package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +62 -16
  10. package/src/foundry/common/data/data.mjs/animationData.d.ts +13 -5
  11. package/src/foundry/common/data/data.mjs/cardData.d.ts +4 -4
  12. package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +5 -3
  13. package/src/foundry/common/data/data.mjs/cardsData.d.ts +3 -3
  14. package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +3 -1
  15. package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +3 -1
  16. package/src/foundry/common/data/data.mjs/combatData.d.ts +3 -1
  17. package/src/foundry/common/data/data.mjs/combatantData.d.ts +3 -1
  18. package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +3 -1
  19. package/src/foundry/common/data/data.mjs/drawingData.d.ts +3 -1
  20. package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +3 -1
  21. package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +3 -1
  22. package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +3 -1
  23. package/src/foundry/common/data/data.mjs/folderData.d.ts +3 -1
  24. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +3 -1
  25. package/src/foundry/common/data/data.mjs/lightData.d.ts +7 -5
  26. package/src/foundry/common/data/data.mjs/macroData.d.ts +3 -1
  27. package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +3 -1
  28. package/src/foundry/common/data/data.mjs/noteData.d.ts +3 -1
  29. package/src/foundry/common/data/data.mjs/playlistData.d.ts +3 -1
  30. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +3 -1
  31. package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +6 -4
  32. package/src/foundry/common/data/data.mjs/rollTableData.d.ts +3 -1
  33. package/src/foundry/common/data/data.mjs/sceneData.d.ts +3 -1
  34. package/src/foundry/common/data/data.mjs/settingData.d.ts +3 -1
  35. package/src/foundry/common/data/data.mjs/tableResultData.d.ts +3 -1
  36. package/src/foundry/common/data/data.mjs/tileData.d.ts +4 -2
  37. package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +4 -2
  38. package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +4 -2
  39. package/src/foundry/common/data/data.mjs/tokenData.d.ts +5 -3
  40. package/src/foundry/common/data/data.mjs/userData.d.ts +3 -1
  41. package/src/foundry/common/data/data.mjs/videoData.d.ts +4 -2
  42. package/src/foundry/common/data/data.mjs/wallData.d.ts +4 -2
  43. package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +15 -12
  44. package/src/foundry/common/documents.mjs/baseActor.d.ts +24 -21
  45. package/src/foundry/common/documents.mjs/baseAdventure.d.ts +14 -12
  46. package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +14 -11
  47. package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +14 -11
  48. package/src/foundry/common/documents.mjs/baseCard.d.ts +27 -28
  49. package/src/foundry/common/documents.mjs/baseCards.d.ts +18 -16
  50. package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +24 -17
  51. package/src/foundry/common/documents.mjs/baseCombat.d.ts +21 -20
  52. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +25 -18
  53. package/src/foundry/common/documents.mjs/baseDrawing.d.ts +26 -23
  54. package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +19 -17
  55. package/src/foundry/common/documents.mjs/baseFolder.d.ts +14 -12
  56. package/src/foundry/common/documents.mjs/baseItem.d.ts +25 -19
  57. package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +16 -14
  58. package/src/foundry/common/documents.mjs/baseMacro.d.ts +21 -18
  59. package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +34 -18
  60. package/src/foundry/common/documents.mjs/baseNote.d.ts +20 -14
  61. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +16 -14
  62. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +14 -11
  63. package/src/foundry/common/documents.mjs/baseRollTable.d.ts +16 -14
  64. package/src/foundry/common/documents.mjs/baseScene.d.ts +23 -21
  65. package/src/foundry/common/documents.mjs/baseSetting.d.ts +18 -16
  66. package/src/foundry/common/documents.mjs/baseTableResult.d.ts +27 -19
  67. package/src/foundry/common/documents.mjs/baseTile.d.ts +17 -11
  68. package/src/foundry/common/documents.mjs/baseToken.d.ts +20 -16
  69. package/src/foundry/common/documents.mjs/baseUser.d.ts +45 -11
  70. package/src/foundry/common/documents.mjs/baseWall.d.ts +17 -15
  71. package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +3 -1
  72. package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +4 -2
  73. package/src/foundry/common/packages.mjs/packageData.d.ts +3 -4
  74. package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +3 -1
  75. package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +3 -1
  76. package/src/foundry/common/utils/primitives.mjs.d.ts +1 -1
  77. package/src/foundry/foundry.js/application.d.ts +1 -1
  78. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +2 -2
  79. package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
  80. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +1 -1
  81. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +2 -2
  82. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +1 -1
  83. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +1 -1
  84. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +1 -1
  85. package/src/foundry/foundry.js/avSettings.d.ts +11 -0
  86. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +36 -34
  87. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +1 -1
  88. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +1 -1
  89. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +1 -1
  90. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +5 -5
  91. package/src/foundry/foundry.js/clientDocuments/item.d.ts +2 -2
  92. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +1 -1
  93. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +39 -38
  94. package/src/foundry/foundry.js/clientDocuments/user.d.ts +27 -35
  95. package/src/foundry/foundry.js/clientSettings.d.ts +1 -1
  96. package/src/foundry/foundry.js/collections/documentCollection.d.ts +65 -11
  97. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +78 -67
  98. package/src/foundry/foundry.js/collections/documentCollections/worldCollection.d.ts +73 -32
  99. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/actors.d.ts +3 -37
  100. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/combatEncounters.d.ts +5 -2
  101. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/fogExplorations.d.ts +0 -2
  102. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/folders.d.ts +1 -1
  103. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/items.d.ts +1 -22
  104. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/journal.d.ts +1 -1
  105. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/macros.d.ts +3 -8
  106. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/messages.d.ts +7 -2
  107. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +5 -5
  108. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/rollTables.d.ts +1 -1
  109. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/scenes.d.ts +3 -2
  110. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/users.d.ts +7 -4
  111. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/worldSettings.d.ts +2 -2
  112. package/src/foundry/foundry.js/hooks.d.ts +3 -3
  113. package/src/foundry/foundry.js/pixi/containers/ruler.d.ts +18 -7
  114. package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +1 -1
  115. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +1 -1
  116. package/src/foundry/foundry.js/pointSources/lightSource.d.ts +1 -1
  117. package/src/foundry/foundry.js/pointSources/soundSource.d.ts +1 -1
  118. package/src/foundry/foundry.js/pointSources/visionSource.d.ts +1 -1
  119. package/src/foundry/foundry.js/polygonEdge.d.ts +1 -1
  120. package/src/foundry/foundry.js/ray.d.ts +1 -1
  121. package/src/types/helperTypes.d.ts +31 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@league-of-foundry-developers/foundry-vtt-types",
3
- "version": "9.249.0",
3
+ "version": "9.249.4",
4
4
  "description": "TypeScript type definitions for Foundry VTT",
5
5
  "exports": {
6
6
  ".": {
@@ -73,7 +73,7 @@
73
73
  "husky": "^7.0.4",
74
74
  "lint-staged": "^12.1.2",
75
75
  "prettier": "^2.5.1",
76
- "tsd": "~0.18.0",
76
+ "tsd": "^0.19.1",
77
77
  "typescript": "~4.5.3"
78
78
  },
79
79
  "husky": {
@@ -283,14 +283,14 @@ declare abstract class DocumentData<
283
283
  toObject(source: false): {
284
284
  [Key in keyof ConcreteDocumentSchema as string extends Key ? never : Key]: Key extends keyof this
285
285
  ? ToObjectFalseType<this[Key]>
286
- : undefined;
286
+ : unknown;
287
287
  };
288
288
 
289
289
  /**
290
290
  * Extract the source data for the DocumentData into a simple object format that can be serialized.
291
291
  * @returns The document source data expressed as a plain object
292
292
  */
293
- toJSON(): this['_id'] extends string ? SourceData & { _id: string } : SourceData;
293
+ toJSON(): this['_id'] extends string ? this['_source'] & { _id: string } : this['_source'];
294
294
 
295
295
  /**
296
296
  * Create a DocumentData instance using a provided serialized JSON string.
@@ -18,7 +18,8 @@ export type DocumentDataType<T extends Document<any, any>> = T extends Document<
18
18
  */
19
19
  declare abstract class Document<
20
20
  ConcreteDocumentData extends AnyDocumentData,
21
- Parent extends Document<any, any> | null = null
21
+ Parent extends Document<any, any> | null = null,
22
+ ConcreteMetadata extends Metadata<any> = Metadata<any>
22
23
  > {
23
24
  /**
24
25
  * Create a new Document by providing an initial data object.
@@ -101,12 +102,12 @@ declare abstract class Document<
101
102
  /**
102
103
  * The named collection to which this Document belongs.
103
104
  */
104
- get collectionName(): string;
105
+ get collectionName(): ConcreteMetadata['collection'];
105
106
 
106
107
  /**
107
108
  * The canonical name of this Document type, for example "Actor".
108
109
  */
109
- get documentName(): string;
110
+ get documentName(): ConcreteMetadata['name'];
110
111
 
111
112
  /**
112
113
  * The canonical identifier for this Document
@@ -672,7 +673,11 @@ declare abstract class Document<
672
673
  * @param source - Draw values from the underlying data source rather than transformed values
673
674
  * @returns The extracted primitive object
674
675
  */
675
- toObject(source?: true): ReturnType<this['toJSON']>;
676
+ toObject(
677
+ source?: true
678
+ ): this['id'] extends string
679
+ ? ReturnType<this['data']['toJSON']> & { _id: string }
680
+ : ReturnType<this['data']['toJSON']>;
676
681
  toObject(
677
682
  source: false
678
683
  ): this['id'] extends string
@@ -685,8 +690,8 @@ declare abstract class Document<
685
690
  * @returns The document data expressed as a plain object
686
691
  */
687
692
  toJSON(): this['id'] extends string
688
- ? ReturnType<ConcreteDocumentData['toJSON']> & { _id: string }
689
- : ReturnType<ConcreteDocumentData['toJSON']>;
693
+ ? ReturnType<this['data']['toJSON']> & { _id: string }
694
+ : ReturnType<this['data']['toJSON']>;
690
695
 
691
696
  /**
692
697
  * For Documents which include game system data, migrate the system data object to conform to its latest data model.
@@ -802,9 +807,15 @@ export interface Metadata<ConcreteDocument extends Document<any, any>> {
802
807
  embedded: Record<string, ConstructorOf<Document<any, any>>>;
803
808
  hasSystemData: boolean;
804
809
  permissions: {
805
- create: string | ((user: BaseUser, doc: ConcreteDocument, data?: object) => boolean); // data isn't actually ever passed in on the client side
806
- update: string | ((user: BaseUser, doc: ConcreteDocument, data?: object) => boolean); // data isn't actually ever passed in on the client side
807
- delete: string | ((user: BaseUser, doc: ConcreteDocument, data?: object) => boolean); // data isn't actually ever passed in on the client side
810
+ create: string | ((user: BaseUser, doc: ConcreteDocument, data: ConcreteDocument['data']['_source']) => boolean);
811
+ update:
812
+ | string
813
+ | ((
814
+ user: BaseUser,
815
+ doc: ConcreteDocument,
816
+ data: DeepPartial<ConstructorDataType<ConcreteDocument['data']>>
817
+ ) => boolean);
818
+ delete: string | ((user: BaseUser, doc: ConcreteDocument, data: {}) => boolean);
808
819
  };
809
820
  pack: any;
810
821
  }
@@ -65,12 +65,14 @@ export interface ReleaseDataConstructorData {
65
65
  download?: string | undefined | null;
66
66
  }
67
67
 
68
+ type ReleaseDataSource = PropertiesToSource<ReleaseDataProperties>;
69
+
68
70
  /** A data object which represents the details of this Release of Foundry VTT */
69
71
  export declare class ReleaseData<
70
72
  Schema extends ReleaseDataSchema = ReleaseDataSchema,
71
73
  Properties extends ReleaseDataProperties = ReleaseDataProperties,
72
74
  ConstructorData extends ReleaseDataConstructorData = ReleaseDataConstructorData
73
- > extends DocumentData<Schema, Properties, PropertiesToSource<ReleaseDataProperties>, ConstructorData> {
75
+ > extends DocumentData<Schema, Properties, ReleaseDataSource, ConstructorData> {
74
76
  static defineSchema(): ReleaseDataSchema;
75
77
 
76
78
  /** A formatted string for shortened display, such as "Version 9" */
@@ -148,6 +148,8 @@ interface ActiveEffectDataConstructorData {
148
148
  flags?: (ConfiguredFlags<'ActiveEffect'> & CoreFlags) | null | undefined;
149
149
  }
150
150
 
151
+ type ActiveEffectDataSource = PropertiesToSource<ActiveEffectDataProperties>;
152
+
151
153
  /**
152
154
  * The data schema for an ActiveEffect document.
153
155
  * @see BaseActiveEffect
@@ -155,7 +157,7 @@ interface ActiveEffectDataConstructorData {
155
157
  export class ActiveEffectData extends DocumentData<
156
158
  ActiveEffectDataSchema,
157
159
  ActiveEffectDataProperties,
158
- PropertiesToSource<ActiveEffectDataProperties>,
160
+ ActiveEffectDataSource,
159
161
  ActiveEffectDataConstructorData,
160
162
  documents.BaseActiveEffect
161
163
  > {
@@ -11,7 +11,7 @@ import { DocumentData } from '../../abstract/module.mjs';
11
11
  import * as documents from '../../documents.mjs';
12
12
  import { PrototypeTokenData } from '../data.mjs';
13
13
  import * as fields from '../fields.mjs';
14
- import { PrototypeTokenDataConstructorData } from './prototypeTokenData.js';
14
+ import { PrototypeTokenDataConstructorData } from './prototypeTokenData';
15
15
 
16
16
  interface ActorDataSchema extends DocumentSchema {
17
17
  _id: fields.DocumentId;
@@ -1,17 +1,17 @@
1
- import type { PropertiesToSource } from '../../../../types/helperTypes.js';
1
+ import type { PropertiesToSource } from '../../../../types/helperTypes';
2
2
  import type DocumentData from '../../abstract/data.mjs';
3
3
  import { AnyDocumentData } from '../../abstract/data.mjs';
4
4
  import * as fields from '../fields.mjs';
5
- import type { ActorData, ActorDataConstructorData } from './actorData.js';
6
- import type { CardsData, CardsDataConstructorData } from './cardsData.js';
7
- import type { CombatData, CombatDataConstructorData } from './combatData.js';
8
- import type { FolderData, FolderDataConstructorData } from './folderData.js';
9
- import type { ItemData, ItemDataConstructorData } from './itemData.js';
10
- import type { JournalEntryData, JournalEntryDataConstructorData } from './journalEntryData.js';
11
- import type { MacroData, MacroDataConstructorData } from './macroData.js';
12
- import type { PlaylistData, PlaylistDataConstructorData } from './playlistData.js';
13
- import type { RollTableData, RollTableDataConstructorData } from './rollTableData.js';
14
- import type { SceneData, SceneDataConstructorData } from './sceneData.js';
5
+ import type { ActorData, ActorDataConstructorData } from './actorData';
6
+ import type { CardsData, CardsDataConstructorData } from './cardsData';
7
+ import type { CombatData, CombatDataConstructorData } from './combatData';
8
+ import type { FolderData, FolderDataConstructorData } from './folderData';
9
+ import type { ItemData, ItemDataConstructorData } from './itemData';
10
+ import type { JournalEntryData, JournalEntryDataConstructorData } from './journalEntryData';
11
+ import type { MacroData, MacroDataConstructorData } from './macroData';
12
+ import type { PlaylistData, PlaylistDataConstructorData } from './playlistData';
13
+ import type { RollTableData, RollTableDataConstructorData } from './rollTableData';
14
+ import type { SceneData, SceneDataConstructorData } from './sceneData';
15
15
 
16
16
  interface AdventureDataSchema extends DocumentSchema {
17
17
  _id: fields.DocumentId;
@@ -128,6 +128,8 @@ interface AdventureDataConstructorData {
128
128
  flags?: Record<string, unknown> | null | undefined;
129
129
  }
130
130
 
131
+ type AdventureDataSource = PropertiesToSource<AdventureDataProperties>;
132
+
131
133
  /**
132
134
  * A data schema which encompasses a collection of base Documents which comprise an adventure module.
133
135
  *
@@ -140,7 +142,7 @@ interface AdventureDataConstructorData {
140
142
  export class AdventureData extends DocumentData<
141
143
  AdventureDataSchema,
142
144
  AdventureDataProperties,
143
- PropertiesToSource<AdventureDataProperties>,
145
+ AdventureDataSource,
144
146
  AdventureDataConstructorData
145
147
  > {
146
148
  /** @override */
@@ -2,7 +2,7 @@ import { ConfiguredFlags, FieldReturnType, PropertiesToSource } from '../../../.
2
2
  import { DocumentData } from '../../abstract/module.mjs';
3
3
  import { BaseAmbientLight } from '../../documents.mjs';
4
4
  import * as fields from '../fields.mjs';
5
- import type { LightData, LightDataConstructorData } from './lightData.js';
5
+ import type { LightData, LightDataConstructorData } from './lightData';
6
6
 
7
7
  interface AmbientLightDataSchema extends DocumentSchema {
8
8
  _id: fields.DocumentId;
@@ -130,6 +130,8 @@ interface AmbientLightDataConstructorData {
130
130
  flags?: ConfiguredFlags<'AmbientLight'> | null | undefined;
131
131
  }
132
132
 
133
+ type AmbientLightDataSource = PropertiesToSource<AmbientLightDataProperties>;
134
+
133
135
  /**
134
136
  * The data schema for a AmbientLight embedded document.
135
137
  * @see BaseAmbientLight
@@ -137,7 +139,7 @@ interface AmbientLightDataConstructorData {
137
139
  export class AmbientLightData extends DocumentData<
138
140
  AmbientLightDataSchema,
139
141
  AmbientLightDataProperties,
140
- PropertiesToSource<AmbientLightDataProperties>,
142
+ AmbientLightDataSource,
141
143
  AmbientLightDataConstructorData,
142
144
  BaseAmbientLight
143
145
  > {
@@ -145,7 +147,7 @@ export class AmbientLightData extends DocumentData<
145
147
  static defineSchema(): AmbientLightDataSchema;
146
148
 
147
149
  /** @override */
148
- _initializeSource(data: AmbientLightDataConstructorData): PropertiesToSource<AmbientLightDataProperties>;
150
+ _initializeSource(data: AmbientLightDataConstructorData): AmbientLightDataSource;
149
151
 
150
152
  /** @override */
151
153
  protected _initialize(): void;
@@ -30,13 +30,22 @@ interface AmbientSoundDataProperties {
30
30
  */
31
31
  _id: string | null;
32
32
 
33
- /** @defaultValue `0` */
33
+ /**
34
+ * The x-coordinate position of the origin of the sound.
35
+ * @defaultValue `0`
36
+ */
34
37
  x: number;
35
38
 
36
- /** @defaultValue `0` */
39
+ /**
40
+ * The y-coordinate position of the origin of the sound.
41
+ * @defaultValue `0`
42
+ */
37
43
  y: number;
38
44
 
39
- /** @defaultValue `0` */
45
+ /**
46
+ * The radius of the emitted sound.
47
+ * @defaultValue `0`
48
+ */
40
49
  radius: number;
41
50
 
42
51
  /**
@@ -56,16 +65,29 @@ interface AmbientSoundDataProperties {
56
65
  */
57
66
  volume: number;
58
67
 
59
- /** @defaultValue `true` */
68
+ /**
69
+ * Whether or not this sound source is constrained by Walls.
70
+ * @defaultValue `true`
71
+ */
60
72
  walls: boolean;
61
73
 
62
- /** @defaultValue `true` */
74
+ /**
75
+ * Whether to adjust the volume of the sound heard by the listener based on how
76
+ * close the listener is to the center of the sound source.
77
+ * @defaultValue `true`
78
+ */
63
79
  easing: boolean;
64
80
 
65
- /** @defaultValue `false` */
81
+ /**
82
+ * Is the sound source currently hidden?
83
+ * @defaultValue `false`
84
+ */
66
85
  hidden: boolean;
67
86
 
68
- /** @defaultValue `new DarknessActivation({})` */
87
+ /**
88
+ * Darkness activation configuration data.
89
+ * @defaultValue `new DarknessActivation({})`
90
+ */
69
91
  darkness: DarknessActivation;
70
92
 
71
93
  /**
@@ -82,13 +104,22 @@ interface AmbientSoundDataConstructorData {
82
104
  */
83
105
  _id?: string | null | undefined;
84
106
 
85
- /** @defaultValue `0` */
107
+ /**
108
+ * The x-coordinate position of the origin of the sound.
109
+ * @defaultValue `0`
110
+ */
86
111
  x?: number | null | undefined;
87
112
 
88
- /** @defaultValue `0` */
113
+ /**
114
+ * The y-coordinate position of the origin of the sound.
115
+ * @defaultValue `0`
116
+ */
89
117
  y?: number | null | undefined;
90
118
 
91
- /** @defaultValue `0` */
119
+ /**
120
+ * The radius of the emitted sound.
121
+ * @defaultValue `0`
122
+ */
92
123
  radius?: number | null | undefined;
93
124
 
94
125
  /**
@@ -108,16 +139,29 @@ interface AmbientSoundDataConstructorData {
108
139
  */
109
140
  volume?: number | null | undefined;
110
141
 
111
- /** @defaultValue `true` */
142
+ /**
143
+ * Whether or not this sound source is constrained by Walls.
144
+ * @defaultValue `true`
145
+ */
112
146
  walls?: boolean | null | undefined;
113
147
 
114
- /** @defaultValue `true` */
148
+ /**
149
+ * Whether to adjust the volume of the sound heard by the listener based on how
150
+ * close the listener is to the center of the sound source.
151
+ * @defaultValue `true`
152
+ */
115
153
  easing?: boolean | null | undefined;
116
154
 
117
- /** @defaultValue `false` */
155
+ /**
156
+ * Is the sound source currently hidden?
157
+ * @defaultValue `false`
158
+ */
118
159
  hidden?: boolean | null | undefined;
119
160
 
120
- /** @defaultValue `new DarknessActivation({})` */
161
+ /**
162
+ * Darkness activation configuration data.
163
+ * @defaultValue `new DarknessActivation({})`
164
+ */
121
165
  darkness?: DarknessActivationConstructorData | null | undefined;
122
166
 
123
167
  /**
@@ -127,6 +171,8 @@ interface AmbientSoundDataConstructorData {
127
171
  flags?: ConfiguredFlags<'AmbientSound'> | null | undefined;
128
172
  }
129
173
 
174
+ type AmbientSoundDataSource = PropertiesToSource<AmbientSoundDataProperties>;
175
+
130
176
  /**
131
177
  * The data schema for a AmbientSound embedded document.
132
178
  * @see BaseAmbientSound
@@ -134,7 +180,7 @@ interface AmbientSoundDataConstructorData {
134
180
  export class AmbientSoundData extends DocumentData<
135
181
  AmbientSoundDataSchema,
136
182
  AmbientSoundDataProperties,
137
- PropertiesToSource<AmbientSoundDataProperties>,
183
+ AmbientSoundDataSource,
138
184
  AmbientSoundDataConstructorData,
139
185
  documents.BaseAmbientSound
140
186
  > {
@@ -142,7 +188,7 @@ export class AmbientSoundData extends DocumentData<
142
188
  static defineSchema(): AmbientSoundDataSchema;
143
189
 
144
190
  /** @override */
145
- _initializeSource(data: AmbientSoundDataConstructorData): PropertiesToSource<AmbientSoundDataProperties>;
191
+ _initializeSource(data: AmbientSoundDataConstructorData): AmbientSoundDataSource;
146
192
 
147
193
  /** @override */
148
194
  protected _initialize(): void;
@@ -29,7 +29,7 @@ interface AnimationDataProperties {
29
29
  type: string | undefined;
30
30
 
31
31
  /**
32
- * The speed of the animation, a number between 1 and 10
32
+ * The speed of the animation, a number between 0 and 10
33
33
  * @defaultValue `5`
34
34
  */
35
35
  speed: number;
@@ -40,7 +40,10 @@ interface AnimationDataProperties {
40
40
  */
41
41
  intensity: number;
42
42
 
43
- /** @defaultValue `false` */
43
+ /**
44
+ * Reverse the direction of animation.
45
+ * @defaultValue `false`
46
+ */
44
47
  reverse: boolean;
45
48
  }
46
49
 
@@ -51,7 +54,7 @@ interface AnimationDataConstructorData {
51
54
  type?: string | null | undefined;
52
55
 
53
56
  /**
54
- * The speed of the animation, a number between 1 and 10
57
+ * The speed of the animation, a number between 0 and 10
55
58
  * @defaultValue `5`
56
59
  */
57
60
  speed?: number | null | undefined;
@@ -62,17 +65,22 @@ interface AnimationDataConstructorData {
62
65
  */
63
66
  intensity?: number | null | undefined;
64
67
 
65
- /** @defaultValue `false` */
68
+ /**
69
+ * Reverse the direction of animation.
70
+ * @defaultValue `false`
71
+ */
66
72
  reverse?: boolean | null | undefined;
67
73
  }
68
74
 
75
+ type AnimationDataSource = PropertiesToSource<AnimationDataProperties>;
76
+
69
77
  /**
70
78
  * An embedded data object which defines the properties of a light source animation
71
79
  */
72
80
  export class AnimationData extends DocumentData<
73
81
  AnimationDataSchema,
74
82
  AnimationDataProperties,
75
- PropertiesToSource<AnimationDataProperties>,
83
+ AnimationDataSource,
76
84
  AnimationDataConstructorData,
77
85
  BaseAmbientLight
78
86
  > {
@@ -4,11 +4,11 @@ import type {
4
4
  ConfiguredSource,
5
5
  FieldReturnType,
6
6
  PropertiesToSource
7
- } from '../../../../types/helperTypes.js';
8
- import type DocumentData from '../../abstract/data.mjs.js';
7
+ } from '../../../../types/helperTypes';
8
+ import type DocumentData from '../../abstract/data.mjs';
9
9
  import * as documents from '../../documents.mjs';
10
10
  import * as fields from '../fields.mjs';
11
- import type { CardFaceData, CardFaceDataConstructorData } from './cardFaceData.js';
11
+ import type { CardFaceData, CardFaceDataConstructorData } from './cardFaceData';
12
12
 
13
13
  interface CardDataSchema extends DocumentSchema {
14
14
  _id: fields.DocumentId;
@@ -44,7 +44,7 @@ interface CardDataSchema extends DocumentSchema {
44
44
  validationError: '{name} {field} "{value}" must have a non-negative integer value or null';
45
45
  };
46
46
  drawn: fields.BooleanField;
47
- origin: fields.DocumentId;
47
+ origin: Omit<fields.DocumentId, 'nullable'> & { nullable: true };
48
48
  width: fields.PositiveIntegerField;
49
49
  height: fields.PositiveIntegerField;
50
50
  rotation: fields.AngleField;
@@ -1,5 +1,5 @@
1
- import type { PropertiesToSource } from '../../../../types/helperTypes.js';
2
- import type DocumentData from '../../abstract/data.mjs.js';
1
+ import type { PropertiesToSource } from '../../../../types/helperTypes';
2
+ import type DocumentData from '../../abstract/data.mjs';
3
3
  import * as fields from '../fields.mjs';
4
4
 
5
5
  interface CardFaceDataSchema extends DocumentSchema {
@@ -42,6 +42,8 @@ interface CardFaceDataConstructorData {
42
42
  img?: string | null | undefined;
43
43
  }
44
44
 
45
+ type CardFaceDataSource = PropertiesToSource<CardFaceDataProperties>;
46
+
45
47
  /**
46
48
  * The data schema of a single card face which belongs to a specific Card.
47
49
  * @see CardData
@@ -49,7 +51,7 @@ interface CardFaceDataConstructorData {
49
51
  export class CardFaceData extends DocumentData<
50
52
  CardFaceDataSchema,
51
53
  CardFaceDataProperties,
52
- PropertiesToSource<CardFaceDataProperties>,
54
+ CardFaceDataSource,
53
55
  CardFaceDataConstructorData
54
56
  > {
55
57
  /** @override */
@@ -5,9 +5,9 @@ import {
5
5
  ConfiguredSource,
6
6
  FieldReturnType,
7
7
  PropertiesToSource
8
- } from '../../../../types/helperTypes.js';
9
- import type EmbeddedCollection from '../../abstract/embedded-collection.mjs.js';
10
- import { DocumentData } from '../../abstract/module.mjs.js';
8
+ } from '../../../../types/helperTypes';
9
+ import type EmbeddedCollection from '../../abstract/embedded-collection.mjs';
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
 
@@ -194,13 +194,15 @@ interface ChatMessageDataConstructorData {
194
194
  flags?: ConfiguredFlags<'ChatMessage'> | null | undefined;
195
195
  }
196
196
 
197
+ type ChatMessageDataSource = PropertiesToSource<ChatMessageDataProperties>;
198
+
197
199
  /**
198
200
  * An embedded data object which defines the properties of a light source animation
199
201
  */
200
202
  export class ChatMessageData extends DocumentData<
201
203
  ChatMessageDataSchema,
202
204
  ChatMessageDataProperties,
203
- PropertiesToSource<ChatMessageDataProperties>,
205
+ ChatMessageDataSource,
204
206
  ChatMessageDataConstructorData,
205
207
  documents.BaseChatMessage
206
208
  > {
@@ -61,13 +61,15 @@ interface ChatSpeakerDataConstructorData {
61
61
  alias?: string | null | undefined;
62
62
  }
63
63
 
64
+ type ChatSpeakerDataSource = PropertiesToSource<ChatSpeakerDataProperties>;
65
+
64
66
  /**
65
67
  * An embedded data object which defines the properties of a light source animation
66
68
  */
67
69
  export class ChatSpeakerData extends DocumentData<
68
70
  ChatSpeakerDataSchema,
69
71
  ChatSpeakerDataProperties,
70
- PropertiesToSource<ChatSpeakerDataProperties>,
72
+ ChatSpeakerDataSource,
71
73
  ChatSpeakerDataConstructorData,
72
74
  BaseChatMessage
73
75
  > {
@@ -129,6 +129,8 @@ interface CombatDataConstructorData {
129
129
  flags?: ConfiguredFlags<'Combat'> | null | undefined;
130
130
  }
131
131
 
132
+ type CombatDataSource = PropertiesToSource<CombatDataProperties>;
133
+
132
134
  /**
133
135
  * The data schema for an Combat document.
134
136
  * @see BaseCombat
@@ -136,7 +138,7 @@ interface CombatDataConstructorData {
136
138
  export class CombatData extends DocumentData<
137
139
  CombatDataSchema,
138
140
  CombatDataProperties,
139
- PropertiesToSource<CombatDataProperties>,
141
+ CombatDataSource,
140
142
  CombatDataConstructorData,
141
143
  documents.BaseCombat
142
144
  > {
@@ -116,6 +116,8 @@ interface CombatantDataConstructorData {
116
116
  flags?: ConfiguredFlags<'Combatant'> | null | undefined;
117
117
  }
118
118
 
119
+ type CombatantDataSource = PropertiesToSource<CombatantDataProperties>;
120
+
119
121
  /**
120
122
  * The data schema for a Combatant embedded document within a CombatEncounter document.
121
123
  * @see CombatantData
@@ -123,7 +125,7 @@ interface CombatantDataConstructorData {
123
125
  export class CombatantData extends DocumentData<
124
126
  CombatantDataSchema,
125
127
  CombatantDataProperties,
126
- PropertiesToSource<CombatantDataProperties>,
128
+ CombatantDataSource,
127
129
  CombatantDataConstructorData,
128
130
  documents.BaseCombatant
129
131
  > {
@@ -36,13 +36,15 @@ interface DarknessActivationConstructorData {
36
36
  max?: number | null | undefined;
37
37
  }
38
38
 
39
+ type DarknessActivationSource = PropertiesToSource<DarknessActivationProperties>;
40
+
39
41
  /**
40
42
  * An embedded data object which defines the darkness range during which some attribute is active
41
43
  */
42
44
  export class DarknessActivation extends DocumentData<
43
45
  DarknessActivationSchema,
44
46
  DarknessActivationProperties,
45
- PropertiesToSource<DarknessActivationProperties>,
47
+ DarknessActivationSource,
46
48
  DarknessActivationConstructorData,
47
49
  BaseAmbientLight
48
50
  > {
@@ -373,6 +373,8 @@ interface DrawingDataConstructorData {
373
373
  flags?: ConfiguredFlags<'Drawing'> | null | undefined;
374
374
  }
375
375
 
376
+ type DrawingDataSource = PropertiesToSource<DrawingDataProperties>;
377
+
376
378
  /**
377
379
  * The data schema for a Drawing embedded document.
378
380
  * @see BaseDrawing
@@ -383,7 +385,7 @@ interface DrawingDataConstructorData {
383
385
  export class DrawingData extends DocumentData<
384
386
  DrawingDataSchema,
385
387
  DrawingDataProperties,
386
- PropertiesToSource<DrawingDataProperties>,
388
+ DrawingDataSource,
387
389
  DrawingDataConstructorData,
388
390
  documents.BaseFolder
389
391
  > {
@@ -60,6 +60,8 @@ interface EffectChangeDataConstructorData {
60
60
  priority?: number | null | undefined;
61
61
  }
62
62
 
63
+ type EffectChangeDataSource = PropertiesToSource<EffectChangeDataProperties>;
64
+
63
65
  /**
64
66
  * An embedded data structure which defines the structure of a change applied by an ActiveEffect.
65
67
  * @see ActiveEffectData
@@ -67,7 +69,7 @@ interface EffectChangeDataConstructorData {
67
69
  export class EffectChangeData extends DocumentData<
68
70
  EffectChangeDataSchema,
69
71
  EffectChangeDataProperties,
70
- PropertiesToSource<EffectChangeDataProperties>,
72
+ EffectChangeDataSource,
71
73
  EffectChangeDataConstructorData,
72
74
  BaseActiveEffect
73
75
  > {
@@ -89,6 +89,8 @@ interface EffectDurationDataConstructorData {
89
89
  startTurn?: number | null | undefined;
90
90
  }
91
91
 
92
+ type EffectDurationDataSource = PropertiesToSource<EffectDurationDataProperties>;
93
+
92
94
  /**
93
95
  * An embedded data structure which tracks the duration of an ActiveEffect.
94
96
  * @see ActiveEffectData
@@ -96,7 +98,7 @@ interface EffectDurationDataConstructorData {
96
98
  export class EffectDurationData extends DocumentData<
97
99
  EffectDurationDataSchema,
98
100
  EffectDurationDataProperties,
99
- PropertiesToSource<EffectDurationDataProperties>,
101
+ EffectDurationDataSource,
100
102
  EffectDurationDataConstructorData,
101
103
  BaseActiveEffect
102
104
  > {
@@ -97,13 +97,15 @@ interface FogExplorationDataConstructorData {
97
97
  timestamp?: number | null | undefined;
98
98
  }
99
99
 
100
+ type FogExplorationDataSource = PropertiesToSource<FogExplorationDataProperties>;
101
+
100
102
  /**
101
103
  * The data schema for a FogExploration document.
102
104
  */
103
105
  export class FogExplorationData extends DocumentData<
104
106
  FogExplorationDataSchema,
105
107
  FogExplorationDataProperties,
106
- PropertiesToSource<FogExplorationDataProperties>,
108
+ FogExplorationDataSource,
107
109
  FogExplorationDataConstructorData
108
110
  > {
109
111
  /** @override */