@league-of-foundry-developers/foundry-vtt-types 9.249.4 → 9.255.2
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.
- package/README.md +1 -1
- package/package.json +2 -2
- package/src/foundry/common/constants.mjs.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseMacro.d.ts +0 -3
- package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +8 -1
- package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +7 -1
- package/src/foundry/common/types.mjs.d.ts +125 -10
- package/src/foundry/common/utils/helpers.mjs.d.ts +0 -1
- package/src/foundry/common/utils/http.mjs.d.ts +52 -0
- package/src/foundry/common/utils/module.mjs.d.ts +1 -0
- package/src/foundry/common/utils/primitives.mjs.d.ts +2 -2
- package/src/foundry/common/utils/semaphore.mjs.d.ts +6 -3
- package/src/foundry/foundry.js/applications/dialog.d.ts +14 -29
- package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +18 -57
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +8 -6
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +23 -12
- package/src/foundry/foundry.js/applications/notifications.d.ts +2 -5
- package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +16 -1
- package/src/foundry/foundry.js/applications/sidebar.d.ts +7 -0
- package/src/foundry/foundry.js/avClient.d.ts +15 -1
- package/src/foundry/foundry.js/avClients/index.d.ts +0 -1
- package/src/foundry/foundry.js/avClients/simplePeerAVClient.d.ts +31 -4
- package/src/foundry/foundry.js/avMaster.d.ts +21 -48
- package/src/foundry/foundry.js/avSettings.d.ts +19 -46
- package/src/foundry/foundry.js/canvas.d.ts +0 -8
- package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +6 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +4 -4
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +28 -6
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +13 -70
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +42 -9
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +4 -3
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +23 -21
- package/src/foundry/foundry.js/clientDocuments/item.d.ts +5 -23
- package/src/foundry/foundry.js/clientDocuments/macro.d.ts +10 -0
- package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +6 -13
- package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +24 -14
- package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +16 -14
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +12 -7
- package/src/foundry/foundry.js/clientDocuments/user.d.ts +2 -12
- package/src/foundry/foundry.js/clientSettings.d.ts +203 -230
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +4 -2
- package/src/foundry/foundry.js/config.d.ts +3 -0
- package/src/foundry/foundry.js/game.d.ts +1 -1
- package/src/foundry/foundry.js/gamepadManager.d.ts +12 -0
- package/src/foundry/foundry.js/globalVariables.d.ts +0 -31
- package/src/foundry/foundry.js/handlebarsHelpers.d.ts +26 -4
- package/src/foundry/foundry.js/mouseInteractionManager.d.ts +1 -1
- package/src/foundry/foundry.js/perceptionManager.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/baseGrid.d.ts +21 -6
- package/src/foundry/foundry.js/pixi/containers/baseGrids/hexagonalGrid.d.ts +13 -8
- package/src/foundry/foundry.js/pixi/containers/baseGrids/squareGrid.d.ts +5 -3
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +14 -5
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +9 -55
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +27 -6
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +29 -4
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +37 -20
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +12 -2
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +42 -12
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +4 -2
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +31 -17
- package/src/foundry/foundry.js/rollTerms/diceTerms/die.d.ts +0 -5
- package/src/foundry/foundry.js/rollTerms/diceTerms/fateDie.d.ts +21 -1
- package/src/foundry/foundry.js/videoHelper.d.ts +0 -7
- package/src/foundry/index.d.ts +0 -4
- package/src/types/helperTypes.d.ts +6 -0
- package/src/foundry/foundry.js/avClients/easyRTCClient.d.ts +0 -392
- package/src/foundry/foundry.js/features.d.ts +0 -0
- 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
|
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
|
-
|
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
|
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
|
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
|
-
*
|
210
|
-
|
211
|
-
|
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
|
-
|
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
|
34
|
-
* Otherwise the Actor
|
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
|
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
|
142
|
-
* @param ids - The
|
143
|
-
* @param options - Provided options which modify the
|
144
|
-
* @returns The
|
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(
|
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
|
-
|
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
|
+
}
|
@@ -72,7 +72,8 @@ declare global {
|
|
72
72
|
* Pass an array of specific Card documents from this document to some other Cards stack.
|
73
73
|
* @param to - Some other Cards document that is the destination for the pass operation
|
74
74
|
* @param ids - The embedded Card ids which should be passed
|
75
|
-
* @param options -
|
75
|
+
* @param options - Additional options which modify the pass operation
|
76
|
+
* (default: `{}`)
|
76
77
|
* @returns An array of the Card embedded documents created within the destination stack
|
77
78
|
*/
|
78
79
|
pass(
|
@@ -223,7 +224,7 @@ declare global {
|
|
223
224
|
resetDialog(): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>> | false | null>;
|
224
225
|
|
225
226
|
/** @override */
|
226
|
-
deleteDialog(options?: Partial<
|
227
|
+
deleteDialog(options?: Partial<DialogOptions> | undefined): Promise<this | false | null | undefined>;
|
227
228
|
|
228
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.
|
229
230
|
/** @override */
|
@@ -235,7 +236,7 @@ declare global {
|
|
235
236
|
| (ConstructorDataType<foundry.data.CardsData> & Record<string, unknown>)
|
236
237
|
>
|
237
238
|
| undefined,
|
238
|
-
context?: (Pick<DocumentModificationContext, 'parent' | 'pack'> & Partial<
|
239
|
+
context?: (Pick<DocumentModificationContext, 'parent' | 'pack'> & Partial<DialogOptions>) | undefined
|
239
240
|
): Promise<InstanceType<ConfiguredDocumentClass<T>> | null | undefined>;
|
240
241
|
}
|
241
242
|
|
@@ -52,22 +52,19 @@ declare global {
|
|
52
52
|
get parentFolder(): Folder | null;
|
53
53
|
|
54
54
|
/**
|
55
|
-
*
|
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
|
-
* @
|
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
|
-
|
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
|
87
|
-
* @param
|
88
|
-
*
|
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
|
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?:
|
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
|
-
|
114
|
-
|
115
|
-
|
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
|
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
|
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(
|
191
|
-
|
192
|
-
|
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
|
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
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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(
|
107
|
-
|
108
|
-
|
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
|
115
|
-
* @param folder - The Folder
|
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
|
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
|
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
|
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(
|
439
|
-
|
440
|
-
|
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.
|