@league-of-foundry-developers/foundry-vtt-types 9.255.0 → 9.255.3

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 (64) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/foundry/common/types.mjs.d.ts +122 -10
  4. package/src/foundry/common/utils/http.mjs.d.ts +52 -0
  5. package/src/foundry/common/utils/module.mjs.d.ts +1 -0
  6. package/src/foundry/common/utils/semaphore.mjs.d.ts +6 -3
  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/dialog.d.ts +14 -29
  10. package/src/foundry/foundry.js/applications/formApplication.d.ts +5 -0
  11. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +18 -57
  12. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +8 -6
  13. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +4 -4
  14. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +23 -12
  15. package/src/foundry/foundry.js/applications/hotbar.d.ts +7 -3
  16. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +16 -1
  17. package/src/foundry/foundry.js/applications/sidebar.d.ts +7 -0
  18. package/src/foundry/foundry.js/avClient.d.ts +15 -1
  19. package/src/foundry/foundry.js/avClients/index.d.ts +0 -1
  20. package/src/foundry/foundry.js/avClients/simplePeerAVClient.d.ts +31 -4
  21. package/src/foundry/foundry.js/avMaster.d.ts +21 -48
  22. package/src/foundry/foundry.js/avSettings.d.ts +19 -46
  23. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +4 -4
  24. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +28 -6
  25. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +13 -70
  26. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +42 -9
  27. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +2 -2
  28. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +23 -21
  29. package/src/foundry/foundry.js/clientDocuments/item.d.ts +5 -23
  30. package/src/foundry/foundry.js/clientDocuments/macro.d.ts +10 -0
  31. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +6 -13
  32. package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +1 -1
  33. package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +24 -14
  34. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +16 -14
  35. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +12 -7
  36. package/src/foundry/foundry.js/clientDocuments/user.d.ts +2 -12
  37. package/src/foundry/foundry.js/clientSettings.d.ts +38 -86
  38. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
  39. package/src/foundry/foundry.js/gamepadManager.d.ts +12 -0
  40. package/src/foundry/foundry.js/globalVariables.d.ts +0 -31
  41. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +26 -4
  42. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +1 -1
  43. package/src/foundry/foundry.js/perceptionManager.d.ts +1 -1
  44. package/src/foundry/foundry.js/pixi/containers/baseGrid.d.ts +21 -6
  45. package/src/foundry/foundry.js/pixi/containers/baseGrids/hexagonalGrid.d.ts +13 -8
  46. package/src/foundry/foundry.js/pixi/containers/baseGrids/squareGrid.d.ts +5 -3
  47. package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +14 -5
  48. package/src/foundry/foundry.js/pixi/containers/index.d.ts +1 -0
  49. package/src/foundry/foundry.js/pixi/containers/objectHUD.d.ts +82 -0
  50. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +9 -55
  51. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +27 -6
  52. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +29 -4
  53. package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +37 -20
  54. package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +55 -15
  55. package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +12 -2
  56. package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +42 -12
  57. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +219 -62
  58. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +107 -16
  59. package/src/foundry/foundry.js/textEditor.d.ts +266 -231
  60. package/src/foundry/index.d.ts +0 -4
  61. package/src/types/utils.d.ts +5 -0
  62. package/src/foundry/foundry.js/avClients/easyRTCClient.d.ts +0 -392
  63. package/src/foundry/foundry.js/features.d.ts +0 -0
  64. package/src/foundry/foundry.js/fonts.d.ts +0 -24
@@ -61,6 +61,11 @@ declare global {
61
61
  */
62
62
  get img(): this['data']['img'];
63
63
 
64
+ /**
65
+ * Provide a thumbnail image path used to represent this document.
66
+ */
67
+ get thumbnail(): this['data']['img'];
68
+
64
69
  /**
65
70
  * Provide an object which organizes all embedded Item instances by their type
66
71
  */
@@ -69,7 +74,7 @@ declare global {
69
74
  Array<InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseItem>>>
70
75
  >;
71
76
  /**
72
- * Test whether an Actor entity is a synthetic representation of a Token (if true) or a full Entity (if false)
77
+ * Test whether an Actor document is a synthetic representation of a Token (if true) or a full Document (if false)
73
78
  */
74
79
  get isToken(): boolean;
75
80
 
@@ -83,11 +88,6 @@ declare global {
83
88
  */
84
89
  get token(): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>> | null;
85
90
 
86
- /**
87
- * A convenience reference to the item type (data.type) of this Actor
88
- */
89
- get type(): this['data']['type'];
90
-
91
91
  /** @override */
92
92
  get uuid(): string;
93
93
 
@@ -122,9 +122,6 @@ declare global {
122
122
  */
123
123
  getRollData(): object;
124
124
 
125
- /** @override */
126
- protected _getSheetClass(): ConstructorOf<FormApplication> | null;
127
-
128
125
  /**
129
126
  * Create a new TokenData object which can be used to create a Token representation of the Actor.
130
127
  * @param data - Additional data, such as x, y, rotation, etc. for the created token data (default: `{}`)
@@ -149,15 +146,15 @@ declare global {
149
146
  modifyTokenAttribute(attribute: string, value: number, isDelta: boolean, isBar: boolean): Promise<this | undefined>;
150
147
 
151
148
  /** @override */
152
- prepareEmbeddedEntities(): void;
149
+ prepareEmbeddedDocuments(): void;
153
150
 
154
151
  /**
155
152
  * Roll initiative for all Combatants in the currently active Combat encounter which are associated with this Actor.
156
- * If viewing a full Actor entity, all Tokens which map to that actor will be targeted for initiative rolls.
153
+ * If viewing a full Actor document, all Tokens which map to that actor will be targeted for initiative rolls.
157
154
  * If viewing a synthetic Token actor, only that particular Token will be targeted for an initiative roll.
158
155
  *
159
156
  * @param options - Configuration for how initiative for this Actor is rolled.
160
- * @returns A promise which resolves to the Combat entity once rolls are complete.
157
+ * @returns A promise which resolves to the Combat document once rolls are complete.
161
158
  */
162
159
  rollInitiative(options?: Actor.RollInitiativeOptions): Promise<void>;
163
160
 
@@ -206,65 +203,11 @@ declare global {
206
203
  ): void;
207
204
 
208
205
  /**
209
- * Refresh the display of active Tokens for this Actor if ActiveEffects were changed
210
- */
211
- protected _refreshTokens(): void;
212
-
213
- /**
214
- * You are referencing Actor#_data which has been deprecated in favor of Actor#data#_source. Support for this reference will be removed in 0.9.0
215
- * @deprecated since 0.8.0
216
- */
217
- get _data(): this['data']['_source'];
218
-
219
- /**
220
- * You are referencing Actor#getOwnedItem(itemId) which is deprecated in favor of Actor#items#get(itemId). Support will be removed in 0.9.0
221
- * @deprecated since 0.8.0
222
- */
223
- getOwnedItem(itemId: string): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseItem>> | undefined;
224
-
225
- /**
226
- * You are referencing Actor#createOwnedItem which is deprecated in favor of Item.create or Actor#createEmbeddedDocuments. Support will be removed in 0.9.0
227
- * @deprecated since 0.8.0
228
- */
229
- createOwnedItem(
230
- itemData: Parameters<this['createEmbeddedDocuments']>[1][] | Parameters<this['createEmbeddedDocuments']>[1],
231
- options: Parameters<this['createEmbeddedDocuments']>[2]
232
- ): ReturnType<this['createEmbeddedDocuments']>;
233
-
234
- /**
235
- * You are referencing Actor#updateOwnedItem which is deprecated in favor of Item#update or Actor#updateEmbeddedDocuments. Support will be removed in 0.9.0
236
- * @deprecated since 0.8.0
237
- */
238
- updateOwnedItem(
239
- itemData: Parameters<this['updateEmbeddedDocuments']>[1][] | Parameters<this['updateEmbeddedDocuments']>[1],
240
- options: Parameters<this['updateEmbeddedDocuments']>[2]
241
- ): ReturnType<this['updateEmbeddedDocuments']>;
242
-
243
- /**
244
- * You are referencing Actor#deleteOwnedItem which is deprecated in favor of Item#delete or Actor#deleteEmbeddedDocuments. Support will be removed in 0.9.0
245
- * @deprecated since 0.8.0
246
- */
247
- deleteOwnedItem(
248
- itemId: Parameters<this['deleteEmbeddedDocuments']>[1][] | Parameters<this['deleteEmbeddedDocuments']>[1],
249
- options: Parameters<this['deleteEmbeddedDocuments']>[2]
250
- ): ReturnType<this['deleteEmbeddedDocuments']>;
251
-
252
- /**
253
- * You are referencing Actor.fromToken which is deprecated in favor of TokenDocument#getActor. Support will be removed in 0.9.0
254
- * @deprecated since 0.8.0
255
- */
256
- static fromToken(
257
- token: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>>
258
- ): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseActor>>;
259
-
260
- /**
261
- * You are referencing Actor.createTokenActor which is deprecated in favor of TokenDocument#getActor. Support will be removed in 0.9.0
262
- * @deprecated since 0.8.0
206
+ * Perform various actions on active tokens if embedded documents were changed.
207
+ * @param embeddedName - The type of embedded document that was modified.
208
+ * @internal
263
209
  */
264
- static createTokenActor(
265
- _baseActor: unknown,
266
- token: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>>
267
- ): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseActor>>;
210
+ protected _onEmbeddedDocumentChange(embeddedName: string): void;
268
211
  }
269
212
  namespace Actor {
270
213
  interface RollInitiativeOptions {
@@ -1,6 +1,7 @@
1
1
  import { ConfiguredDocumentClass } from '../../../../types/helperTypes';
2
2
  import { DocumentModificationOptions } from '../../../common/abstract/document.mjs';
3
3
  import * as data from '../../../common/data/data.mjs';
4
+ import type { ActiveEffectDataConstructorData } from '../../../common/data/data.mjs/activeEffectData';
4
5
 
5
6
  declare global {
6
7
  /**
@@ -30,8 +31,8 @@ declare global {
30
31
 
31
32
  /**
32
33
  * A lazily evaluated reference to the Actor this Token modifies.
33
- * If actorLink is true, then the entity is the primary Actor document.
34
- * Otherwise the Actor entity is a synthetic (ephemeral) document constructed using the Token's actorData.
34
+ * If actorLink is true, then the document is the primary Actor document.
35
+ * Otherwise the Actor document is a synthetic (ephemeral) document constructed using the Token's actorData.
35
36
  */
36
37
  get actor(): InstanceType<ConfiguredDocumentClass<typeof Actor>> | null;
37
38
 
@@ -55,6 +56,11 @@ declare global {
55
56
  */
56
57
  get inCombat(): boolean;
57
58
 
59
+ /**
60
+ * Is the Token currently hidden from player view?
61
+ */
62
+ get hidden(): boolean;
63
+
58
64
  /**
59
65
  * @param data - (default: `{}`, unused)
60
66
  * @param options - (default: `{}`, unused)
@@ -67,7 +73,7 @@ declare global {
67
73
 
68
74
  /**
69
75
  * Create a synthetic Actor using a provided Token instance
70
- * If the Token data is linked, return the true Actor entity
76
+ * If the Token data is linked, return the true Actor document
71
77
  * If the Token data is not linked, create a synthetic Actor using the Token's actorData override
72
78
  */
73
79
  getActor(): InstanceType<ConfiguredDocumentClass<typeof Actor>> | null;
@@ -83,6 +89,18 @@ declare global {
83
89
  { alternative }?: { alternative?: string }
84
90
  ): SingleAttributeBar | ObjectAttributeBar | null;
85
91
 
92
+ /**
93
+ * A helper function to toggle a status effect which includes an Active Effect template
94
+ * @param effectData - The Active Effect data, including statusId
95
+ * @param options - Options to configure application of the Active Effect
96
+ * (default: `{}`)
97
+ * @returns Whether the Active Effect is now on or off
98
+ */
99
+ toggleActiveEffect(
100
+ effectData: ActiveEffectDataConstructorData & { id: string; label: string; icon: string },
101
+ options?: ToggleActiveEffectOptions | undefined
102
+ ): Promise<boolean>;
103
+
86
104
  /**
87
105
  * Redirect updates to a synthetic Token Actor to instead update the tokenData override object.
88
106
  * Once an attribute in the Token has been overridden, it must always remain overridden.
@@ -138,10 +156,10 @@ declare global {
138
156
 
139
157
  /**
140
158
  * Redirect deletion of Documents within a synthetic Token Actor to instead update the tokenData override object.
141
- * @param embeddedName - The named embedded Document type being modified
142
- * @param ids - The provided differential data with which to update the embedded Documents
143
- * @param options - Provided options which modify the update request
144
- * @returns The updated Embedded Document instances
159
+ * @param embeddedName - The named embedded Document type being deleted
160
+ * @param ids - The IDs of Documents to delete
161
+ * @param options - Provided options which modify the deletion request
162
+ * @returns The deleted Embedded Document instances
145
163
  */
146
164
  deleteActorEmbeddedDocuments(
147
165
  embeddedName: 'Item',
@@ -163,6 +181,7 @@ declare global {
163
181
 
164
182
  /**
165
183
  * When the Actor data overrides change for an un-linked Token Actor, simulate the pre-update process.
184
+ * @internal
166
185
  */
167
186
  protected _preUpdateTokenActor(
168
187
  data: Parameters<foundry.documents.BaseActor['_preUpdate']>[0],
@@ -180,11 +199,16 @@ declare global {
180
199
  /**
181
200
  * When the base Actor for a TokenDocument changes, we may need to update its Actor instance
182
201
  * @param update - (default: `{}`)
202
+ * @internal
183
203
  */
184
- protected _onUpdateBaseActor(update?: Parameters<foundry.documents.BaseActor['_onUpdate']>[0]): void;
204
+ protected _onUpdateBaseActor(
205
+ update?: Parameters<foundry.documents.BaseActor['_onUpdate']>[0],
206
+ options?: Parameters<foundry.data.ActorData['update']>[1]
207
+ ): void;
185
208
 
186
209
  /**
187
210
  * When the Actor data overrides change for an un-linked Token Actor, simulate the post-update process.
211
+ * @internal
188
212
  */
189
213
  protected _onUpdateTokenActor(
190
214
  data: Parameters<foundry.documents.BaseActor['_onUpdate']>[0],
@@ -228,4 +252,13 @@ interface TrackedAttributes {
228
252
  value: string[][];
229
253
  }
230
254
 
231
- export {};
255
+ interface ToggleActiveEffectOptions {
256
+ /**
257
+ * Should the Active Effect icon be displayed as an overlay on the token?
258
+ * @defaultValue `false`
259
+ */
260
+ overlay?: boolean | undefined;
261
+
262
+ /** Force a certain active state for the effect. */
263
+ active?: boolean | undefined;
264
+ }
@@ -224,7 +224,7 @@ declare global {
224
224
  resetDialog(): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>> | false | null>;
225
225
 
226
226
  /** @override */
227
- deleteDialog(options?: Partial<Dialog.Options> | undefined): Promise<this | false | null | undefined>;
227
+ deleteDialog(options?: Partial<DialogOptions> | undefined): Promise<this | false | null | undefined>;
228
228
 
229
229
  // TODO: It's a bit weird that we have to do it in this generic way but otherwise there is an error overriding this. Investigate later.
230
230
  /** @override */
@@ -236,7 +236,7 @@ declare global {
236
236
  | (ConstructorDataType<foundry.data.CardsData> & Record<string, unknown>)
237
237
  >
238
238
  | undefined,
239
- context?: (Pick<DocumentModificationContext, 'parent' | 'pack'> & Partial<Dialog.Options>) | undefined
239
+ context?: (Pick<DocumentModificationContext, 'parent' | 'pack'> & Partial<DialogOptions>) | undefined
240
240
  ): Promise<InstanceType<ConfiguredDocumentClass<T>> | null | undefined>;
241
241
  }
242
242
 
@@ -52,22 +52,19 @@ declare global {
52
52
  get parentFolder(): Folder | null;
53
53
 
54
54
  /**
55
- * Return the named Entity type for elements in this folder.
56
- */
57
- get type(): this['data']['type'];
58
-
59
- /**
60
- * Create a new Folder by rendering a dialog window to provide basic creation details
55
+ * Present a Dialog form to create a new Folder.
56
+ * @see {@link ClientDocumentMixin.createDialog}
61
57
  * @param data - Initial data with which to populate the creation form
62
- * @param options - Initial positioning and sizing options for the dialog form
63
58
  * (default: `{}`)
64
- * @returns An active FolderConfig instance for creating the new Folder entity
59
+ * @param context - Additional context options or dialog positioning options
60
+ * (default: `{}`)
61
+ * @returns A Promise which resolves to the created Folder, or null if the dialog was closed.
65
62
  *
66
63
  * @remarks
67
- * The documented return type is incorrect. It now returns a promise that resolves to the
68
- * created folder as intended. See https://gitlab.com/foundrynet/foundryvtt/-/issues/6619
69
- *
70
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.
71
68
  */
72
69
  static createDialog<T extends DocumentConstructor>(
73
70
  this: T,
@@ -77,18 +74,21 @@ declare global {
77
74
  | (ConstructorDataType<InstanceType<T>['data']> & Record<string, unknown>)
78
75
  >
79
76
  | undefined,
80
- options?: Partial<DocumentSheetOptions> | undefined
77
+ context?: any
81
78
  ): Promise<InstanceType<ConfiguredDocumentClass<T>> | null | undefined>;
82
79
 
83
80
  /**
84
81
  * Export all Documents contained in this Folder to a given Compendium pack.
85
82
  * Optionally update existing Documents within the Pack by name, otherwise append all new entries.
86
- * @param pack - A Compendium pack to which the entities will be exported
87
- * @param updateByName - Update existing entries in the Compendium pack, matching by name
88
- * (default: `false`)
83
+ * @param pack - A Compendium pack to which the documents will be exported
84
+ * @param options - Additional options which customize how content is exported. See {@link ClientDocumentMixin#toCompendium}
85
+ * (default: `{}`)
89
86
  * @returns The updated Compendium Collection instance
90
87
  */
91
- exportToCompendium(pack: any, { updateByName }?: { updateByName?: boolean }): Promise<any>; // TODO: CompendiumCollection
88
+ exportToCompendium<Metadata extends CompendiumCollection.Metadata>(
89
+ pack: CompendiumCollection<Metadata>,
90
+ options?: Folder.ExportToCompendiumOptions | undefined
91
+ ): Promise<CompendiumCollection<Metadata>>;
92
92
 
93
93
  /**
94
94
  * Provide a dialog form that allows for exporting the contents of a Folder into an eligible Compendium pack.
@@ -97,7 +97,7 @@ declare global {
97
97
  * (default: `{}`)
98
98
  * @returns A Promise which resolves or rejects once the dialog has been submitted or closed
99
99
  */
100
- exportDialog(pack: string, options?: Dialog.Options): Promise<void>;
100
+ exportDialog(pack: string, options?: DialogOptions): Promise<void>;
101
101
 
102
102
  /**
103
103
  * Get the Folder documents which are sub-folders of the current folder, either direct children or recursively.
@@ -108,10 +108,12 @@ declare global {
108
108
  getSubfolders(recursive?: boolean): InstanceType<ConfiguredDocumentClass<typeof Folder>>[];
109
109
 
110
110
  protected _onDelete(options: DocumentModificationOptions, userId: string): void;
111
+ }
111
112
 
112
- /**
113
- * @deprecated since 0.8.0
114
- */
115
- get entities(): this['contents'];
113
+ namespace Folder {
114
+ interface ExportToCompendiumOptions {
115
+ /** Update existing entries in the Compendium pack, matching by name */
116
+ updateByName?: boolean | undefined;
117
+ }
116
118
  }
117
119
  }
@@ -1,5 +1,4 @@
1
1
  import { ConfiguredDocumentClass } from '../../../types/helperTypes';
2
- import type { ItemDataConstructorData } from '../../common/data/data.mjs/itemData';
3
2
 
4
3
  declare global {
5
4
  /**
@@ -24,6 +23,11 @@ declare global {
24
23
  */
25
24
  get img(): this['data']['img'];
26
25
 
26
+ /**
27
+ * Provide a thumbnail image path used to represent this document.
28
+ */
29
+ get thumbnail(): this['data']['img'];
30
+
27
31
  /**
28
32
  * A convenience alias of Item#isEmbedded which is preserves legacy support
29
33
  */
@@ -35,19 +39,11 @@ declare global {
35
39
  */
36
40
  get transferredEffects(): ReturnType<this['effects']['filter']>;
37
41
 
38
- /**
39
- * A convenience reference to the item type (data.type) of this Item
40
- */
41
- get type(): this['data']['type'];
42
-
43
42
  /**
44
43
  * Prepare a data object which defines the data schema used by dice roll commands against this Item
45
44
  */
46
45
  getRollData(): object;
47
46
 
48
- /** @override */
49
- protected _getSheetClass(): typeof ItemSheet | null;
50
-
51
47
  /** @override */
52
48
  protected static _onCreateDocuments(
53
49
  items: Array<InstanceType<ConfiguredDocumentClass<typeof Item>>>,
@@ -59,19 +55,5 @@ declare global {
59
55
  items: Array<InstanceType<ConfiguredDocumentClass<typeof Item>>>,
60
56
  context: DocumentModificationContext
61
57
  ): Promise<unknown>;
62
-
63
- /**
64
- * You are referencing Item#_data which has been deprecated in favor of Item#data#_source. Support for this reference will be removed in 0.9.0
65
- * @deprecated since 0.8.0
66
- */
67
- get _data(): this['data']['_source'];
68
-
69
- /**
70
- * @deprecated since 0.8.1
71
- */
72
- static createOwned(
73
- itemData: ItemDataConstructorData | (ItemDataConstructorData & Record<string, unknown>),
74
- actor: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseActor>>
75
- ): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseItem>>;
76
58
  }
77
59
  }
@@ -15,6 +15,16 @@ declare global {
15
15
  */
16
16
  get isAuthor(): boolean;
17
17
 
18
+ /**
19
+ * Test whether the current user is capable of executing a Macro script
20
+ */
21
+ get canExecute(): boolean;
22
+
23
+ /**
24
+ * Provide a thumbnail image path used to represent this document.
25
+ */
26
+ get thumbnail(): string | null;
27
+
18
28
  /**
19
29
  * Execute the Macro command.
20
30
  * @param scope - Provide some additional scope configuration for the Macro
@@ -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
  }
@@ -4,7 +4,7 @@ import type { DocumentModificationOptions } from '../../common/abstract/document
4
4
  declare global {
5
5
  /**
6
6
  * The client-side PlaylistSound document which extends the common BasePlaylistSound model.
7
- * Each PlaylistSound belongs to the sounds collection of a Playlist entity.
7
+ * Each PlaylistSound belongs to the sounds collection of a Playlist document.
8
8
  * Each PlaylistSound contains a PlaylistSoundData object which provides its source data.
9
9
  *
10
10
  * @see {@link foundry.data.PlaylistSoundData} The PlaylistSound data schema
@@ -1,15 +1,25 @@
1
- /**
2
- * An extended Document definition used specifically
3
- * This ensures that the PrototypeTokenData schema is used instead of the standard TokenData.
4
- * This exists specifically for prototype Token configuration in the TokenConfig app and should not be used otherwise.
5
- * @internal
6
- * @remarks The types for this are incorrect, in particular everything related to the data should use
7
- * {@link foundry.data.PrototypeTokenData} instead of {@link foundry.data.TokenData}. However, with the current approach
8
- * to type documents, we don't see a way to do this. This class is just added for reference. As the documentation above
9
- * says, don't use it (there really shouldn't be a need to do so).
10
- */
11
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
- // @ts-ignore
13
- declare class PrototypeTokenDocument extends TokenDocument {
14
- static get schema(): typeof foundry.data.PrototypeTokenData;
1
+ import type { PrototypeTokenDataConstructorData } from '../../common/data/data.mjs/prototypeTokenData';
2
+
3
+ declare global {
4
+ /**
5
+ * An extended Document definition used specifically
6
+ * This ensures that the PrototypeTokenData schema is used instead of the standard TokenData.
7
+ * This exists specifically for prototype Token configuration in the TokenConfig app and should not be used otherwise.
8
+ * @internal
9
+ * @remarks The types for this are incorrect, in particular everything related to the data should use
10
+ * {@link foundry.data.PrototypeTokenData} instead of {@link foundry.data.TokenData}. However, with the current approach
11
+ * to type documents, we don't see a way to do this. This class is just added for reference. As the documentation above
12
+ * says, don't use it (there really shouldn't be a need to do so).
13
+ */
14
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15
+ // @ts-ignore
16
+ class PrototypeTokenDocument extends TokenDocument {
17
+ static get schema(): typeof foundry.data.PrototypeTokenData;
18
+
19
+ /** @override */
20
+ update(
21
+ data?: DeepPartial<PrototypeTokenDataConstructorData> | undefined,
22
+ context?: (DocumentModificationContext & foundry.utils.MergeObjectOptions) | undefined
23
+ ): Promise<this | undefined>;
24
+ }
15
25
  }
@@ -20,6 +20,11 @@ declare global {
20
20
  context?: ConstructorParameters<typeof foundry.documents.BaseRollTable>[1]
21
21
  );
22
22
 
23
+ /**
24
+ * Provide a thumbnail image path used to represent this document.
25
+ */
26
+ get thumbnail(): this['data']['img'];
27
+
23
28
  /**
24
29
  * Display a result drawn from a RollTable in the Chat Log along.
25
30
  * Optionally also display the Roll which produced the result and configure aspects of the displayed messages.
@@ -65,6 +70,9 @@ declare global {
65
70
  * Note that this function only performs the roll and identifies the result, the RollTable#draw function should be
66
71
  * called to formalize the draw from the table.
67
72
  *
73
+ * @param options - (default: `{}`)
74
+ * @returns The Roll and results drawn by that Roll
75
+ *
68
76
  * @example
69
77
  * ```typescript
70
78
  * // Draw results using the default table formula
@@ -75,7 +83,7 @@ declare global {
75
83
  * const customResults = await table.roll({roll});
76
84
  * ```
77
85
  */
78
- roll(options?: RollTable.RollOptions): Promise<RollTableDraw>;
86
+ roll(options?: RollTable.RollOptions | undefined): Promise<RollTableDraw>;
79
87
 
80
88
  /**
81
89
  * Get an Array of valid results for a given rolled total
@@ -103,28 +111,22 @@ declare global {
103
111
  ): void;
104
112
 
105
113
  /** @override */
106
- toCompendium(pack?: CompendiumCollection<CompendiumCollection.Metadata>): Omit<
107
- foundry.data.RollTableData['_source'],
108
- '_id' | 'folder' | 'permission'
109
- > & {
114
+ toCompendium(
115
+ pack?: CompendiumCollection<CompendiumCollection.Metadata> | null | undefined,
116
+ options?: ClientDocumentMixin.CompendiumExportOptions | undefined
117
+ ): Omit<foundry.data.RollTableData['_source'], '_id' | 'folder' | 'permission'> & {
110
118
  permission?: foundry.data.RollTableData extends { toObject(): infer U } ? U : never;
111
119
  };
112
120
 
113
121
  /**
114
- * Create a new RollTable entity using all of the Entities from a specific Folder as new results.
115
- * @param folder - The Folder entity from which to create a roll table
122
+ * Create a new RollTable document using all of the Documents from a specific Folder as new results.
123
+ * @param folder - The Folder document from which to create a roll table
116
124
  * @param options - Additional options passed to the RollTable.create method
117
125
  */
118
126
  static fromFolder(
119
127
  folder: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseFolder>>,
120
128
  options?: DocumentModificationOptions
121
129
  ): Promise<InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseRollTable>> | undefined>;
122
-
123
- /**
124
- * The RollTable#getTableResult method is deprecated in favor of RollTable#results#get and will be removed in 0.9.0
125
- * @deprecated since 0.8.0
126
- */
127
- getTableResult(id: string): ReturnType<this['results']['get']>;
128
130
  }
129
131
 
130
132
  namespace RollTable {
@@ -190,7 +192,7 @@ declare global {
190
192
  roll?: Roll;
191
193
 
192
194
  /**
193
- * If a RollTable entity is drawn as a result, recursively roll it
195
+ * If a RollTable document is drawn as a result, recursively roll it
194
196
  * @defaultValue `true`
195
197
  */
196
198
  recursive?: boolean;
@@ -68,18 +68,23 @@ declare global {
68
68
  */
69
69
  get img(): this['data']['img'];
70
70
 
71
+ /**
72
+ * Provide a thumbnail image path used to represent this document.
73
+ */
74
+ get thumbnail(): this['data']['thumb'];
75
+
71
76
  /**
72
77
  * A convenience accessor for whether the Scene is currently viewed
73
78
  */
74
79
  get isView(): boolean;
75
80
 
76
81
  /**
77
- * A reference to the JournalEntry entity associated with this Scene, or null
82
+ * A reference to the JournalEntry document associated with this Scene, or null
78
83
  */
79
84
  get journal(): InstanceType<ConfiguredDocumentClass<typeof JournalEntry>> | null;
80
85
 
81
86
  /**
82
- * A reference to the Playlist entity for this Scene, or null
87
+ * A reference to the Playlist document for this Scene, or null
83
88
  */
84
89
  get playlist(): InstanceType<ConfiguredDocumentClass<typeof Playlist>> | null;
85
90
 
@@ -435,10 +440,10 @@ declare global {
435
440
  ): void;
436
441
 
437
442
  /** @override */
438
- toCompendium(pack?: CompendiumCollection<CompendiumCollection.Metadata>): Omit<
439
- foundry.data.SceneData['_source'],
440
- '_id' | 'folder' | 'permission'
441
- > & {
443
+ toCompendium(
444
+ pack?: CompendiumCollection<CompendiumCollection.Metadata> | null | undefined,
445
+ options?: ClientDocumentMixin.CompendiumExportOptions | undefined
446
+ ): Omit<foundry.data.SceneData['_source'], '_id' | 'folder' | 'permission'> & {
442
447
  permission?: foundry.data.SceneData extends { toObject(): infer U } ? U : never;
443
448
  };
444
449
 
@@ -451,7 +456,7 @@ declare global {
451
456
  }
452
457
  }
453
458
 
454
- interface ThumbnailCreationData {
459
+ interface ThumbnailCreationData extends ImageHelper.TextureToImageOptions {
455
460
  /**
456
461
  * A background image to use for thumbnail creation, otherwise the current scene
457
462
  * background is used.