@league-of-foundry-developers/foundry-vtt-types 9.255.1 → 9.268.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 (117) hide show
  1. package/README.md +5 -4
  2. package/package.json +3 -2
  3. package/src/foundry/common/data/data.mjs/index.d.ts +0 -1
  4. package/src/foundry/common/types.mjs.d.ts +4 -4
  5. package/src/foundry/common/utils/helpers.mjs.d.ts +1 -0
  6. package/src/foundry/foundry.js/application.d.ts +0 -1
  7. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +7 -3
  8. package/src/foundry/foundry.js/applications/cameraViews.d.ts +3 -3
  9. package/src/foundry/foundry.js/applications/chatPopout.d.ts +1 -1
  10. package/src/foundry/foundry.js/applications/compendium.d.ts +20 -11
  11. package/src/foundry/foundry.js/applications/controlsReference.d.ts +17 -2
  12. package/src/foundry/foundry.js/applications/dialog.d.ts +14 -29
  13. package/src/foundry/foundry.js/applications/filePicker.d.ts +67 -75
  14. package/src/foundry/foundry.js/applications/formApplication.d.ts +7 -2
  15. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +19 -58
  16. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -4
  17. package/src/foundry/foundry.js/applications/formApplications/{entitySheetConfig.d.ts → documentSheetConfig.d.ts} +36 -19
  18. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +1 -4
  19. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +2 -4
  20. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardConfig.d.ts +51 -0
  21. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfig.d.ts +88 -0
  22. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsHand.d.ts +20 -0
  23. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsPile.d.ts +20 -0
  24. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/index.d.ts +2 -0
  25. package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +2 -4
  26. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +17 -11
  27. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +3 -0
  28. package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +3 -9
  29. package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +10 -12
  30. package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +4 -5
  31. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +2 -6
  32. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +1 -4
  33. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +8 -12
  34. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +2 -1
  35. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +1 -4
  36. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +10 -11
  37. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +28 -15
  38. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +3 -6
  39. package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +1 -4
  40. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +17 -21
  41. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +3 -3
  42. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +40 -7
  43. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +2 -2
  44. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +10 -24
  45. package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +1 -1
  46. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +15 -3
  47. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +23 -16
  48. package/src/foundry/foundry.js/applications/formApplications/{defaultTokenConfig.d.ts → tokenConfigs/defaultTokenConfig.d.ts} +29 -16
  49. package/src/foundry/foundry.js/applications/formApplications/tokenConfigs/index.d.ts +1 -0
  50. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +22 -15
  51. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +23 -12
  52. package/src/foundry/foundry.js/applications/hotbar.d.ts +7 -3
  53. package/src/foundry/foundry.js/applications/index.d.ts +1 -0
  54. package/src/foundry/foundry.js/applications/invitationLinks.d.ts +25 -10
  55. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +16 -1
  56. package/src/foundry/foundry.js/applications/sidebar.d.ts +7 -0
  57. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +65 -38
  58. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +17 -3
  59. package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +19 -16
  60. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +0 -3
  61. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +4 -18
  62. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +2 -8
  63. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +38 -5
  64. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -0
  65. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -1
  66. package/src/foundry/foundry.js/applications/supportDetails.d.ts +78 -0
  67. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -2
  68. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +10 -2
  69. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +87 -49
  70. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +3 -7
  71. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +6 -13
  72. package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +6 -0
  73. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
  74. package/src/foundry/foundry.js/collections/documentCollections/worldCollection.d.ts +2 -2
  75. package/src/foundry/foundry.js/config.d.ts +21 -21
  76. package/src/foundry/foundry.js/contextMenu.d.ts +37 -28
  77. package/src/foundry/foundry.js/game.d.ts +2 -2
  78. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +26 -4
  79. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +1 -1
  80. package/src/foundry/foundry.js/perceptionManager.d.ts +1 -1
  81. package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
  82. package/src/foundry/foundry.js/pixi/containers/canvasLayers/controlsLayer.d.ts +49 -48
  83. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +51 -40
  84. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/lightingLayer.d.ts +63 -20
  85. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayer.d.ts +0 -3
  86. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +4 -4
  87. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +21 -0
  88. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/notesLayer.d.ts +1 -1
  89. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/soundsLayer.d.ts +10 -2
  90. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/tokenLayer.d.ts +41 -20
  91. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +50 -121
  92. package/src/foundry/foundry.js/pixi/containers/canvasLayers/sightLayer.d.ts +125 -107
  93. package/src/foundry/foundry.js/pixi/containers/controlIcon.d.ts +3 -0
  94. package/src/foundry/foundry.js/pixi/containers/index.d.ts +1 -0
  95. package/src/foundry/foundry.js/pixi/containers/objectHUD.d.ts +82 -0
  96. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +27 -6
  97. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +26 -4
  98. package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +34 -20
  99. package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +52 -15
  100. package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +9 -2
  101. package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +50 -12
  102. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +248 -87
  103. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +107 -16
  104. package/src/foundry/foundry.js/pixi/filters/abstractFilter.d.ts +42 -0
  105. package/src/foundry/foundry.js/pixi/filters/abstractFilters/fogColorFilter.d.ts +16 -0
  106. package/src/foundry/foundry.js/pixi/filters/abstractFilters/forceColorFilter.d.ts +17 -0
  107. package/src/foundry/foundry.js/pixi/filters/abstractFilters/glowFilter.d.ts +31 -0
  108. package/src/foundry/foundry.js/pixi/filters/abstractFilters/index.d.ts +4 -0
  109. package/src/foundry/foundry.js/pixi/filters/abstractFilters/roofMaskFilter.d.ts +20 -0
  110. package/src/foundry/foundry.js/pixi/filters/index.d.ts +2 -0
  111. package/src/foundry/foundry.js/roll.d.ts +2 -2
  112. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +5 -0
  113. package/src/foundry/foundry.js/textEditor.d.ts +266 -231
  114. package/src/types/augments/index.d.ts +2 -0
  115. package/src/types/augments/pixiGraphicsSmooth.d.ts +7 -0
  116. package/src/types/augments/pixiLegacyGraphics.d.ts +7 -0
  117. package/src/types/utils.d.ts +5 -0
@@ -1,4 +1,4 @@
1
- import { ConfiguredDocumentClass } from '../../../types/helperTypes';
1
+ import { ConfiguredDocumentClass, ConfiguredObjectClassForName, ToObjectFalseType } from '../../../types/helperTypes';
2
2
  import { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
3
  import type { ChatMessageDataConstructorData } from '../../common/data/data.mjs/chatMessageData';
4
4
 
@@ -13,17 +13,26 @@ declare global {
13
13
  * @param data - Initial data provided to construct the ChatMessage document
14
14
  */
15
15
  class ChatMessage extends ClientDocumentMixin(foundry.documents.BaseChatMessage) {
16
- constructor(
17
- data?: ConstructorParameters<ConstructorOf<foundry.documents.BaseChatMessage>>[0],
18
- context?: ConstructorParameters<ConstructorOf<foundry.documents.BaseChatMessage>>[1]
19
- );
20
-
21
16
  /**
22
- * If the chat message contains a Roll instance, cache it here
17
+ * The cached Roll instance that this message contains, if any
23
18
  * @defaultValue `null`
19
+ * @internal
24
20
  */
25
21
  protected _roll: Roll | null;
26
22
 
23
+ /**
24
+ * Is the display of the roll in this message collapsed (false) or expanded (true)
25
+ * @defaultValue `false`
26
+ * @internal
27
+ */
28
+ protected _rollExpanded: boolean;
29
+
30
+ /**
31
+ * Is this ChatMessage currently displayed in the sidebar ChatLog?
32
+ * @defaultValue `false`
33
+ */
34
+ logged: boolean;
35
+
27
36
  /**
28
37
  * Return the recommended String alias for this message.
29
38
  * The alias could be a Token name in the case of in-character messages or dice rolls.
@@ -61,7 +70,7 @@ declare global {
61
70
  /**
62
71
  * The User who created the chat message.
63
72
  */
64
- get user(): User | undefined;
73
+ get user(): InstanceType<ConfiguredDocumentClass<typeof User>> | undefined;
65
74
 
66
75
  /** @override */
67
76
  prepareData(): void;
@@ -87,44 +96,32 @@ declare global {
87
96
  * Attempt to determine who is the speaking character (and token) for a certain Chat Message
88
97
  * First assume that the currently controlled Token is the speaker
89
98
  *
90
- * @param scene - The Scene in which the speaker resides
91
- * @param actor - The Actor whom is speaking
92
- * @param token - The Token whom is speaking
93
- * @param alias - The name of the speaker to display
99
+ * @param options - (default: `{}`)
94
100
  *
95
101
  * @returns The identified speaker data
96
102
  */
97
- static getSpeaker({
98
- scene,
99
- actor,
100
- token,
101
- alias
102
- }?: {
103
- scene?: InstanceType<ConfiguredDocumentClass<typeof Scene>> | undefined;
104
- actor?: InstanceType<ConfiguredDocumentClass<typeof Actor>> | undefined;
105
- token?: InstanceType<ConfiguredDocumentClass<typeof TokenDocument>> | undefined;
106
- alias?: string | undefined;
107
- }): foundry.data.ChatMessageData['speaker']['_source'];
103
+ static getSpeaker(
104
+ options?: ChatMessage.GetSpeakerOptions | undefined
105
+ ): foundry.data.ChatMessageData['speaker']['_source'];
108
106
 
109
107
  /**
110
108
  * A helper to prepare the speaker object based on a target TokenDocument
111
109
  *
112
- * @param token - The TokenDocument of the speaker
113
- * @param alias - The name of the speaker to display
114
110
  * @returns The identified speaker data
115
111
  */
116
112
  protected static _getSpeakerFromToken({
117
113
  token,
118
114
  alias
119
115
  }: {
120
- token: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>>;
121
- alias: string;
116
+ /** The TokenDocument of the speaker */
117
+ token: InstanceType<ConfiguredDocumentClass<typeof TokenDocument>>;
118
+
119
+ /** The name of the speaker to display */
120
+ alias?: string | undefined;
122
121
  }): foundry.data.ChatMessageData['speaker']['_source'];
123
122
  /**
124
123
  * A helper to prepare the speaker object based on a target TokenDocument
125
124
  *
126
- * @param token - The TokenDocument of the speaker
127
- * @param alias - The name of the speaker to display
128
125
  * @returns The identified speaker data
129
126
  * @deprecated Passing a Token is deprecated, a TokenDocument should be passed instead
130
127
  */
@@ -132,16 +129,16 @@ declare global {
132
129
  token,
133
130
  alias
134
131
  }: {
135
- token: InstanceType<CONFIG['Token']['objectClass']>;
136
- alias: string;
132
+ /** The TokenDocument of the speaker */
133
+ token: InstanceType<ConfiguredObjectClassForName<'Token'>>;
134
+
135
+ /** The name of the speaker to display */
136
+ alias?: string | undefined;
137
137
  }): foundry.data.ChatMessageData['speaker']['_source'];
138
138
 
139
139
  /**
140
140
  * A helper to prepare the speaker object based on a target Actor
141
141
  *
142
- * @param scene - The Scene is which the speaker resides
143
- * @param actor - The Actor that is speaking
144
- * @param alias - The name of the speaker to display
145
142
  * @returns The identified speaker data
146
143
  */
147
144
  protected static _getSpeakerFromActor({
@@ -149,17 +146,19 @@ declare global {
149
146
  actor,
150
147
  alias
151
148
  }: {
152
- scene?: InstanceType<ConfiguredDocumentClass<typeof Scene>>;
149
+ /** The Scene is which the speaker resides */
150
+ scene?: InstanceType<ConfiguredDocumentClass<typeof Scene>> | undefined;
151
+
152
+ /** The Actor that is speaking */
153
153
  actor: InstanceType<ConfiguredDocumentClass<typeof Actor>>;
154
- alias?: string;
154
+
155
+ /** The name of the speaker to display */
156
+ alias?: string | undefined;
155
157
  }): foundry.data.ChatMessageData['speaker']['_source'];
156
158
 
157
159
  /**
158
160
  * A helper to prepare the speaker object based on a target User
159
161
  *
160
- * @param scene - The Scene in which the speaker resides
161
- * @param user - The User who is speaking
162
- * @param alias - The name of the speaker to display
163
162
  * @returns The identified speaker data
164
163
  */
165
164
  protected static _getSpeakerFromUser({
@@ -167,21 +166,28 @@ declare global {
167
166
  user,
168
167
  alias
169
168
  }: {
170
- scene?: InstanceType<ConfiguredDocumentClass<typeof Scene>>;
169
+ /** The Scene in which the speaker resides */
170
+ scene?: InstanceType<ConfiguredDocumentClass<typeof Scene>> | undefined;
171
+
172
+ /** The User who is speaking */
171
173
  user: InstanceType<ConfiguredDocumentClass<typeof User>>;
172
- alias?: string;
174
+
175
+ /** The name of the speaker to display */
176
+ alias?: string | undefined;
173
177
  }): foundry.data.ChatMessageData['speaker']['_source'];
174
178
 
175
179
  /**
176
180
  * Obtain an Actor instance which represents the speaker of this message (if any)
177
181
  * @param speaker - The speaker data object
178
182
  */
179
- static getSpeakerActor(speaker: foundry.data.ChatMessageData['speaker']['_source']): Actor | null;
183
+ static getSpeakerActor(
184
+ speaker: foundry.data.ChatMessageData['speaker']['_source']
185
+ ): InstanceType<ConfiguredDocumentClass<typeof Actor>> | null;
180
186
 
181
187
  /**
182
188
  * Obtain a data object used to evaluate any dice rolls associated with this particular chat message
183
189
  */
184
- getRollData(): InstanceType<ConfiguredDocumentClass<typeof Actor>>['getRollData'] | {};
190
+ getRollData(): object;
185
191
 
186
192
  /**
187
193
  * Given a string whisper target, return an Array of the user IDs which should be targeted for the whisper
@@ -196,35 +202,67 @@ declare global {
196
202
  */
197
203
  getHTML(): Promise<JQuery>;
198
204
 
205
+ /**
206
+ * Render the inner HTML content for ROLL type messages.
207
+ * @param messageData - The chat message data used to render the message HTML
208
+ * @internal
209
+ */
210
+ protected _renderRollContent(messageData: ChatMessage.MessageData): Promise<void>;
211
+
199
212
  /** @override */
200
- _preCreate(
213
+ protected _preCreate(
201
214
  data: ChatMessageDataConstructorData,
202
215
  options: DocumentModificationOptions,
203
216
  user: foundry.documents.BaseUser
204
217
  ): Promise<void>;
205
218
 
206
219
  /** @override */
207
- _onCreate(
220
+ protected _onCreate(
208
221
  data: foundry.data.ChatMessageData['_source'],
209
222
  options: DocumentModificationOptions,
210
223
  userId: string
211
224
  ): void;
212
225
 
213
226
  /** @override */
214
- _onUpdate(
227
+ protected _onUpdate(
215
228
  data: DeepPartial<foundry.data.ChatMessageData['_source']>,
216
229
  options: DocumentModificationOptions,
217
230
  userId: string
218
231
  ): void;
219
232
 
220
233
  /** @override */
221
- _onDelete(options: DocumentModificationOptions, userId: string): void;
234
+ protected _onDelete(options: DocumentModificationOptions, userId: string): void;
222
235
 
223
236
  /**
224
237
  * Export the content of the chat message into a standardized log format
225
238
  */
226
239
  export(): string;
227
240
  }
228
- }
229
241
 
230
- export {};
242
+ namespace ChatMessage {
243
+ interface GetSpeakerOptions {
244
+ /** The Scene in which the speaker resides */
245
+ scene?: InstanceType<ConfiguredDocumentClass<typeof Scene>> | undefined;
246
+
247
+ /** The Actor whom is speaking */
248
+ actor?: InstanceType<ConfiguredDocumentClass<typeof Actor>> | undefined;
249
+
250
+ /** The Token whom is speaking */
251
+ token?: InstanceType<ConfiguredDocumentClass<typeof TokenDocument>> | undefined;
252
+
253
+ /** The name of the speaker to display */
254
+ alias?: string | undefined;
255
+ }
256
+
257
+ interface MessageData {
258
+ message: ToObjectFalseType<ChatMessage>;
259
+ user: StoredDocument<InstanceType<ConfiguredDocumentClass<typeof User>>>;
260
+ author: InstanceType<ConfiguredDocumentClass<typeof User>> | undefined;
261
+ alias: string;
262
+ cssClass: string;
263
+ isWhisper: boolean;
264
+ canDelete: boolean;
265
+ whisperTo: string;
266
+ }
267
+ }
268
+ }
@@ -60,11 +60,7 @@ declare global {
60
60
  * (default: `{}`)
61
61
  * @returns A Promise which resolves to the created Folder, or null if the dialog was closed.
62
62
  *
63
- * @remarks
64
- * For weird reasons, we need to make this generic.
65
- *
66
- * The type of `context` is actually `{options?: DocumentSheetOptions} | undefined` but that's incompatible with the
67
- * base implementation. See https://gitlab.com/foundrynet/foundryvtt/-/issues/6863.
63
+ * @remarks For weird reasons, we need to make this generic.
68
64
  */
69
65
  static createDialog<T extends DocumentConstructor>(
70
66
  this: T,
@@ -74,7 +70,7 @@ declare global {
74
70
  | (ConstructorDataType<InstanceType<T>['data']> & Record<string, unknown>)
75
71
  >
76
72
  | undefined,
77
- context?: any
73
+ context?: Partial<Omit<FolderConfig.Options, 'resolve'>>
78
74
  ): Promise<InstanceType<ConfiguredDocumentClass<T>> | null | undefined>;
79
75
 
80
76
  /**
@@ -97,7 +93,7 @@ declare global {
97
93
  * (default: `{}`)
98
94
  * @returns A Promise which resolves or rejects once the dialog has been submitted or closed
99
95
  */
100
- exportDialog(pack: string, options?: Dialog.Options): Promise<void>;
96
+ exportDialog(pack: string, options?: DialogOptions): Promise<void>;
101
97
 
102
98
  /**
103
99
  * Get the Folder documents which are sub-folders of the current folder, either direct children or recursively.
@@ -22,13 +22,6 @@ declare global {
22
22
  context?: ConstructorParameters<typeof foundry.documents.BasePlaylist>[1]
23
23
  );
24
24
 
25
- /**
26
- * Each sound which is played within the Playlist has a created Sound instance.
27
- * The keys of this object are the sound IDs and the values are the Sound instances.
28
- * @remarks This seems to be unused and will always be the empty object, see https://gitlab.com/foundrynet/foundryvtt/-/issues/5970
29
- */
30
- audio: {};
31
-
32
25
  /**
33
26
  * Playlists may have a playback order which defines the sequence of Playlist Sounds
34
27
  * @defaultValue `undefined`
@@ -57,7 +50,7 @@ declare global {
57
50
 
58
51
  /**
59
52
  * Begin simultaneous playback for all sounds in the Playlist.
60
- * @returns The updated Playlist entity
53
+ * @returns The updated Playlist document
61
54
  */
62
55
  playAll(): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
63
56
 
@@ -94,7 +87,7 @@ declare global {
94
87
 
95
88
  /**
96
89
  * End playback for any/all currently playing sounds within the Playlist.
97
- * @returns The updated Playlist entity
90
+ * @returns The updated Playlist document
98
91
  */
99
92
  stopAll(): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
100
93
 
@@ -187,10 +180,10 @@ declare global {
187
180
  _onSoundStart(sound: InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>): Promise<void>;
188
181
 
189
182
  /** @override */
190
- toCompendium(pack?: CompendiumCollection<CompendiumCollection.Metadata>): Omit<
191
- foundry.data.PlaylistData['_source'],
192
- '_id' | 'folder' | 'permission'
193
- > & {
183
+ toCompendium(
184
+ pack?: CompendiumCollection<CompendiumCollection.Metadata> | null | undefined,
185
+ options?: ClientDocumentMixin.CompendiumExportOptions | undefined
186
+ ): Omit<foundry.data.PlaylistData['_source'], '_id' | 'folder' | 'permission'> & {
194
187
  permission?: foundry.data.PlaylistData['_source']['permission'];
195
188
  };
196
189
  }
@@ -70,6 +70,12 @@ declare global {
70
70
  */
71
71
  sync(): void | Promise<void> | Promise<Sound>;
72
72
 
73
+ override _onCreate(
74
+ data: foundry.data.PlaylistSoundData['_source'],
75
+ options: DocumentModificationOptions,
76
+ userId: string
77
+ ): void;
78
+
73
79
  /** @override */
74
80
  protected _onUpdate(
75
81
  changed: DeepPartial<foundry.data.PlaylistSoundData['_source']>,
@@ -169,7 +169,7 @@ declare global {
169
169
  * null if the dialog was closed without making a choice.
170
170
  */
171
171
  importDialog(
172
- options?: Dialog.Options | undefined
172
+ options?: DialogOptions | undefined
173
173
  ): Promise<StoredDocument<DocumentInstanceForCompendiumMetadata<T>>[] | null | false>;
174
174
 
175
175
  /**
@@ -115,7 +115,7 @@ declare global {
115
115
  * Actors.registerSheet("dnd5e", ActorSheet5eCharacter, { types: ["character], makeDefault: true });
116
116
  * ```
117
117
  */
118
- static registerSheet(...args: DropFirst<Parameters<typeof EntitySheetConfig.registerSheet>>): void;
118
+ static registerSheet(...args: DropFirst<Parameters<typeof DocumentSheetConfig.registerSheet>>): void;
119
119
 
120
120
  /**
121
121
  * Unregister a Document sheet class, removing it from the list of available sheet Applications to use.
@@ -125,7 +125,7 @@ declare global {
125
125
  * @example <caption>Deregister the default ActorSheet subclass to replace it with others.</caption>
126
126
  * Actors.unregisterSheet("core", ActorSheet);
127
127
  */
128
- static unregisterSheet(...args: DropFirst<Parameters<typeof EntitySheetConfig.unregisterSheet>>): void;
128
+ static unregisterSheet(...args: DropFirst<Parameters<typeof DocumentSheetConfig.unregisterSheet>>): void;
129
129
 
130
130
  /**
131
131
  * Return an array of currently registered sheet classes for this Document type.
@@ -1238,7 +1238,7 @@ declare global {
1238
1238
  objectClass: ConfiguredObjectClassOrDefault<typeof AmbientLight>;
1239
1239
 
1240
1240
  /** @defaultValue `AmbientLightDocument` */
1241
- layerClass: ConstructorOf<LightingLayer>;
1241
+ layerClass: typeof LightingLayer;
1242
1242
  };
1243
1243
 
1244
1244
  /**
@@ -1252,7 +1252,7 @@ declare global {
1252
1252
  objectClass: ConfiguredObjectClassOrDefault<typeof AmbientSound>;
1253
1253
 
1254
1254
  /** @defaultValue `SoundsLayer` */
1255
- layerClass: ConstructorOf<SoundsLayer>;
1255
+ layerClass: typeof SoundsLayer;
1256
1256
  };
1257
1257
 
1258
1258
  /**
@@ -1274,7 +1274,7 @@ declare global {
1274
1274
  objectClass: ConfiguredObjectClassOrDefault<typeof Drawing>;
1275
1275
 
1276
1276
  /** @defaultValue `DrawingsLayer` */
1277
- layerClass: ConstructorOf<DrawingsLayer>;
1277
+ layerClass: typeof DrawingsLayer;
1278
1278
  };
1279
1279
 
1280
1280
  /**
@@ -1310,7 +1310,7 @@ declare global {
1310
1310
  objectClass: ConfiguredObjectClassOrDefault<typeof MeasuredTemplate>;
1311
1311
 
1312
1312
  /** @defaultValue `TemplateLayer` */
1313
- layerClass: ConstructorOf<TemplateLayer>;
1313
+ layerClass: typeof TemplateLayer;
1314
1314
  };
1315
1315
 
1316
1316
  /**
@@ -1324,7 +1324,7 @@ declare global {
1324
1324
  objectClass: ConfiguredObjectClassOrDefault<typeof Note>;
1325
1325
 
1326
1326
  /** @defaultValue `NotesLayer` */
1327
- layerClass: ConstructorOf<NotesLayer>;
1327
+ layerClass: typeof NotesLayer;
1328
1328
  };
1329
1329
 
1330
1330
  /**
@@ -1338,7 +1338,7 @@ declare global {
1338
1338
  objectClass: ConfiguredObjectClassOrDefault<typeof Tile>;
1339
1339
 
1340
1340
  /** @defaultValue `BackgroundLayer` */
1341
- layerClass: ConstructorOf<BackgroundLayer>;
1341
+ layerClass: typeof BackgroundLayer;
1342
1342
  };
1343
1343
 
1344
1344
  /**
@@ -1352,7 +1352,7 @@ declare global {
1352
1352
  objectClass: ConfiguredObjectClassOrDefault<typeof Token>;
1353
1353
 
1354
1354
  /** @defaultValue `TokenLayer` */
1355
- layerClass: ConstructorOf<TokenLayer>;
1355
+ layerClass: typeof TokenLayer;
1356
1356
 
1357
1357
  /** @defaultValue `TokenConfig` */
1358
1358
  prototypeSheetClass: ConstructorOf<TokenConfig>;
@@ -1369,7 +1369,7 @@ declare global {
1369
1369
  objectClass: ConfiguredObjectClassOrDefault<typeof Wall>;
1370
1370
 
1371
1371
  /** @defaultValue `WallsLayer` */
1372
- layerClass: ConstructorOf<WallsLayer>;
1372
+ layerClass: typeof WallsLayer;
1373
1373
  };
1374
1374
 
1375
1375
  /**
@@ -1491,43 +1491,43 @@ declare global {
1491
1491
 
1492
1492
  interface Layers {
1493
1493
  /** @defaultValue `{ layerClass: BackgroundLayer, group: "primary" }` */
1494
- background: LayerDefinition<ConstructorOf<BackgroundLayer>>;
1494
+ background: LayerDefinition<typeof BackgroundLayer>;
1495
1495
 
1496
1496
  /** @defaultValue `{ layerClass: DrawingsLayer, group: "primary" }` */
1497
- drawings: LayerDefinition<ConstructorOf<DrawingsLayer>>;
1497
+ drawings: LayerDefinition<typeof DrawingsLayer>;
1498
1498
 
1499
1499
  /** @defaultValue `{ layerClass: GridLayer, group: "primary" }` */
1500
- grid: LayerDefinition<ConstructorOf<GridLayer>>;
1500
+ grid: LayerDefinition<typeof GridLayer>;
1501
1501
 
1502
1502
  /** @defaultValue `{ layerClass: TemplateLayer, group: "primary" }` */
1503
- templates: LayerDefinition<ConstructorOf<TemplateLayer>>;
1503
+ templates: LayerDefinition<typeof TemplateLayer>;
1504
1504
 
1505
1505
  /** @defaultValue `{ layerClass: TokenLayer, group: "primary" }` */
1506
- tokens: LayerDefinition<ConstructorOf<TokenLayer>>;
1506
+ tokens: LayerDefinition<typeof TokenLayer>;
1507
1507
 
1508
1508
  /** @defaultValue `{ layerClass: ForegroundLayer, group: "primary" }` */
1509
- foreground: LayerDefinition<ConstructorOf<ForegroundLayer>>;
1509
+ foreground: LayerDefinition<typeof ForegroundLayer>;
1510
1510
 
1511
1511
  /** @defaultValue `{ layerClass: WallsLayer, group: "effects" }` */
1512
- walls: LayerDefinition<ConstructorOf<WallsLayer>>;
1512
+ walls: LayerDefinition<typeof WallsLayer>;
1513
1513
 
1514
1514
  /** @defaultValue `{ layerClass: LightingLayer, group: "effects" }` */
1515
- lighting: LayerDefinition<ConstructorOf<LightingLayer>>;
1515
+ lighting: LayerDefinition<typeof LightingLayer>;
1516
1516
 
1517
1517
  /** @defaultValue `{ layerClass: WeatherLayer, group: "effects" }` */
1518
- weather: LayerDefinition<ConstructorOf<WeatherLayer>>;
1518
+ weather: LayerDefinition<typeof WeatherLayer>;
1519
1519
 
1520
1520
  /** @defaultValue `{ layerClass: SightLayer, group: "effects" }` */
1521
- sight: LayerDefinition<ConstructorOf<SightLayer>>;
1521
+ sight: LayerDefinition<typeof SightLayer>;
1522
1522
 
1523
1523
  /** @defaultValue `{ layerClass: SoundsLayer, group: "interface" }` */
1524
- sounds: LayerDefinition<ConstructorOf<SoundsLayer>>;
1524
+ sounds: LayerDefinition<typeof SoundsLayer>;
1525
1525
 
1526
1526
  /** @defaultValue `{ layerClass: NotesLayer, group: "interface" }` */
1527
- notes: LayerDefinition<ConstructorOf<NotesLayer>>;
1527
+ notes: LayerDefinition<typeof NotesLayer>;
1528
1528
 
1529
1529
  /** @defaultValue `{ layerClass: ControlsLayer, group: "interface" }` */
1530
- controls: LayerDefinition<ConstructorOf<ControlsLayer>>;
1530
+ controls: LayerDefinition<typeof ControlsLayer>;
1531
1531
 
1532
1532
  [key: string]: LayerDefinition;
1533
1533
  }
@@ -14,7 +14,7 @@ declare class ContextMenu {
14
14
  constructor(
15
15
  element: JQuery,
16
16
  selector: string | null | undefined,
17
- menuItems: ContextMenu.Item[],
17
+ menuItems: ContextMenuEntry[],
18
18
  { eventName }?: { eventName?: string }
19
19
  );
20
20
 
@@ -37,7 +37,7 @@ declare class ContextMenu {
37
37
  /**
38
38
  * The array of menu items being rendered
39
39
  */
40
- menuItems: ContextMenu.Item[];
40
+ menuItems: ContextMenuEntry[];
41
41
 
42
42
  /**
43
43
  * Track which direction the menu is expanded in
@@ -50,18 +50,41 @@ declare class ContextMenu {
50
50
  */
51
51
  get menu(): JQuery;
52
52
 
53
+ /**
54
+ * Create a ContextMenu for this Application and dispatch hooks.
55
+ * @param app - The Application this ContextMenu belongs to.
56
+ * @param html - The Application's rendered HTML.
57
+ * @param selector - The target CSS selector which activates the menu.
58
+ * @param menuItems - The array of menu items being rendered.
59
+ * @param hookName - The name of the hook to call.
60
+ * (default: `'EntryContext'`)
61
+ */
62
+ static create(
63
+ app: Application,
64
+ html: JQuery,
65
+ selector: string,
66
+ menuItems: ContextMenuEntry[],
67
+ hookName?: string
68
+ ): ContextMenu;
69
+
53
70
  /**
54
71
  * Attach a ContextMenu instance to an HTML selector
55
72
  */
56
73
  bind(): void;
57
74
 
58
75
  /**
59
- * Animate closing the menu by sliding up and removing from the DOM
76
+ * Closes the menu and removes it from the DOM.
77
+ * @param options - Options to configure the closing behavior.
60
78
  */
61
- close(): Promise<void>;
79
+ close(options?: ContextMenu.CloseOptions | undefined): Promise<void>;
80
+
81
+ /** @internal */
82
+ protected _close(): void;
62
83
 
84
+ /** @internal */
63
85
  protected _animateOpen(menu: JQuery): Promise<void>;
64
86
 
87
+ /** @internal */
65
88
  protected _animateClose(menu: JQuery): Promise<void>;
66
89
 
67
90
  /**
@@ -80,6 +103,16 @@ declare class ContextMenu {
80
103
  static eventListeners(): void;
81
104
  }
82
105
 
106
+ declare namespace ContextMenu {
107
+ interface CloseOptions {
108
+ /**
109
+ * Animate the context menu closing.
110
+ * @defaultValue `true`
111
+ */
112
+ animate?: boolean;
113
+ }
114
+ }
115
+
83
116
  interface ContextMenuEntry {
84
117
  /**
85
118
  * The context menu label. Can be localized.
@@ -101,27 +134,3 @@ interface ContextMenuEntry {
101
134
  */
102
135
  condition?: boolean | ((target: JQuery) => boolean);
103
136
  }
104
-
105
- declare namespace ContextMenu {
106
- interface Item {
107
- /**
108
- * The displayed item name
109
- */
110
- name: string;
111
-
112
- /**
113
- * An icon glyph HTML string
114
- */
115
- icon: string;
116
-
117
- /**
118
- * A function which returns a Boolean for whether or not to display the item
119
- */
120
- condition?: boolean | ((target: JQuery) => boolean);
121
-
122
- /**
123
- * A callback function to trigger when the entry of the menu is clicked
124
- */
125
- callback: (target: JQuery) => void;
126
- }
127
- }
@@ -587,8 +587,8 @@ declare global {
587
587
  activeUsers: string[];
588
588
  addresses: {
589
589
  local: string;
590
- remote: string;
591
- remoteIsAccessible: boolean;
590
+ remote?: string | undefined;
591
+ remoteIsAccessible: boolean | null;
592
592
  };
593
593
  coreUpdate: {
594
594
  channel: unknown | null;