@league-of-foundry-developers/foundry-vtt-types 9.255.0 → 9.255.1
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 +1 -1
- package/src/foundry/common/types.mjs.d.ts +120 -8
- 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/semaphore.mjs.d.ts +6 -3
- 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/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/clientDocumentMixin.d.ts +2 -2
- 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/folder.d.ts +22 -20
- 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/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 +38 -86
- 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/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/ambientSound.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +3 -0
- package/src/foundry/index.d.ts +0 -4
- 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
@@ -12,9 +12,11 @@ interface AVSettingsData {
|
|
12
12
|
declare class AVSettings {
|
13
13
|
constructor();
|
14
14
|
|
15
|
-
|
15
|
+
/** @internal */
|
16
|
+
protected _set: <T>(key: string, value: T) => void;
|
16
17
|
|
17
|
-
|
18
|
+
/** @internal */
|
19
|
+
protected _change: () => void;
|
18
20
|
|
19
21
|
client: AVSettings.ClientSettings;
|
20
22
|
|
@@ -74,15 +76,7 @@ declare class AVSettings {
|
|
74
76
|
/**
|
75
77
|
* @defaultValue `'AVSettings.VOICE_MODES.PTT'`
|
76
78
|
*/
|
77
|
-
mode: AVSettings.
|
78
|
-
|
79
|
-
/**
|
80
|
-
* @defaultValue
|
81
|
-
* ```
|
82
|
-
* "`"
|
83
|
-
* ```
|
84
|
-
*/
|
85
|
-
pttKey: string;
|
79
|
+
mode: AVSettings.VOICE_MODES;
|
86
80
|
|
87
81
|
/**
|
88
82
|
* @defaultValue
|
@@ -92,11 +86,6 @@ declare class AVSettings {
|
|
92
86
|
*/
|
93
87
|
pttName: string;
|
94
88
|
|
95
|
-
/**
|
96
|
-
* @defaultValue `false`
|
97
|
-
*/
|
98
|
-
pttMouse: boolean;
|
99
|
-
|
100
89
|
/**
|
101
90
|
* @defaultValue `100`
|
102
91
|
*/
|
@@ -111,41 +100,14 @@ declare class AVSettings {
|
|
111
100
|
/**
|
112
101
|
* @defaultValue `{}`
|
113
102
|
*/
|
114
|
-
users:
|
103
|
+
users: Record<string, AVSettings.StoredUserSettings>;
|
115
104
|
};
|
116
105
|
|
117
106
|
static DEFAULT_WORLD_SETTINGS: {
|
118
107
|
/**
|
119
108
|
* @defaultValue `AVSettings.AV_MODES.DISABLED`
|
120
109
|
*/
|
121
|
-
mode: AVSettings.
|
122
|
-
|
123
|
-
server: {
|
124
|
-
/**
|
125
|
-
* @defaultValue `'FVTT'`
|
126
|
-
*/
|
127
|
-
type: string;
|
128
|
-
|
129
|
-
/**
|
130
|
-
* @defaultValue `""`
|
131
|
-
*/
|
132
|
-
url: string;
|
133
|
-
|
134
|
-
/**
|
135
|
-
* @defaultValue `""`
|
136
|
-
*/
|
137
|
-
room: string;
|
138
|
-
|
139
|
-
/**
|
140
|
-
* @defaultValue `""`
|
141
|
-
*/
|
142
|
-
username: string;
|
143
|
-
|
144
|
-
/**
|
145
|
-
* @defaultValue `""`
|
146
|
-
*/
|
147
|
-
password: string;
|
148
|
-
};
|
110
|
+
mode: AVSettings.AV_MODES;
|
149
111
|
|
150
112
|
turn: {
|
151
113
|
/**
|
@@ -217,6 +179,11 @@ declare class AVSettings {
|
|
217
179
|
blocked: boolean;
|
218
180
|
};
|
219
181
|
|
182
|
+
/**
|
183
|
+
* Stores the transient AV activity data received from other users.
|
184
|
+
*/
|
185
|
+
activity: Record<string, AVSettingsData>;
|
186
|
+
|
220
187
|
initialize(): void;
|
221
188
|
|
222
189
|
changed(): void;
|
@@ -243,6 +210,11 @@ declare class AVSettings {
|
|
243
210
|
* @internal
|
244
211
|
*/
|
245
212
|
protected _onSettingsChanged(): void;
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Handle another connected user changing their AV settings.
|
216
|
+
*/
|
217
|
+
handleUserActivity(userId: string, settings: AVSettingsData): void;
|
246
218
|
}
|
247
219
|
|
248
220
|
declare namespace AVSettings {
|
@@ -259,5 +231,6 @@ declare namespace AVSettings {
|
|
259
231
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
260
232
|
interface Overrides {}
|
261
233
|
type VoiceModes = PropertyTypeOrFallback<AVSettings.Overrides, 'VoiceModes', DefaultVoiceModes>;
|
262
|
-
type
|
234
|
+
type VOICE_MODES = ValueOf<VoiceModes>;
|
235
|
+
type AV_MODES = ValueOf<typeof AVSettings.AV_MODES>;
|
263
236
|
}
|
@@ -377,8 +377,8 @@ export declare class ClientDocumentMixin<T extends foundry.abstract.Document<any
|
|
377
377
|
* @returns A data object of cleaned data suitable for compendium import
|
378
378
|
*/
|
379
379
|
toCompendium(
|
380
|
-
pack?: CompendiumCollection<CompendiumCollection.Metadata> | null,
|
381
|
-
options?: ClientDocumentMixin.CompendiumExportOptions
|
380
|
+
pack?: CompendiumCollection<CompendiumCollection.Metadata> | null | undefined,
|
381
|
+
options?: ClientDocumentMixin.CompendiumExportOptions | undefined
|
382
382
|
): Omit<T['data']['_source'], '_id' | 'folder' | 'permission'> & {
|
383
383
|
permission?: T['data']['_source']['permission'];
|
384
384
|
};
|
@@ -31,6 +31,11 @@ declare global {
|
|
31
31
|
*/
|
32
32
|
protected _sheet: FormApplication | null; // TODO: Actually an ActiveEffectConfig according to foundry but this is a problem with ClientDocumentMixins _sheet, this should actually be inferred from the CONFIG
|
33
33
|
|
34
|
+
/**
|
35
|
+
* Is there some system logic that makes this active effect ineligible for application?
|
36
|
+
*/
|
37
|
+
get isSuppressed(): boolean;
|
38
|
+
|
34
39
|
/**
|
35
40
|
* Summarize the active effect duration
|
36
41
|
*/
|
@@ -63,12 +68,6 @@ declare global {
|
|
63
68
|
*/
|
64
69
|
get sourceName(): string;
|
65
70
|
|
66
|
-
/**
|
67
|
-
* An instance of the ActiveEffectConfig sheet to use for this ActiveEffect instance.
|
68
|
-
* The reference to the sheet is cached so the same sheet instance is reused.
|
69
|
-
*/
|
70
|
-
get sheet(): FormApplication; // TODO: Actually an ActiveEffectConfig according to foundry but this is a problem with ClientDocumentMixin's sheet, this should actually be inferred from the CONFIG
|
71
|
-
|
72
71
|
/**
|
73
72
|
* Apply this ActiveEffect to a provided Actor.
|
74
73
|
* @param actor - The Actor to whom this effect should be applied
|
@@ -138,6 +137,29 @@ declare global {
|
|
138
137
|
options: DocumentModificationOptions,
|
139
138
|
user: foundry.documents.BaseUser
|
140
139
|
): Promise<void>;
|
140
|
+
|
141
|
+
/** @override */
|
142
|
+
protected _onCreate(
|
143
|
+
data: foundry.data.ActiveEffectData['_source'],
|
144
|
+
options: DocumentModificationOptions,
|
145
|
+
userId: string
|
146
|
+
): void;
|
147
|
+
|
148
|
+
/** @override */
|
149
|
+
protected _onUpdate(
|
150
|
+
data: DeepPartial<foundry.data.ActiveEffectData['_source']>,
|
151
|
+
options: DocumentModificationOptions,
|
152
|
+
userId: string
|
153
|
+
): void;
|
154
|
+
|
155
|
+
/** @override */
|
156
|
+
protected _onDelete(options: DocumentModificationOptions, userId: string): void;
|
157
|
+
|
158
|
+
/**
|
159
|
+
* Display changes to active effects as scrolling Token status text.
|
160
|
+
* @internal
|
161
|
+
*/
|
162
|
+
protected _displayScrollingStatus(enabled: boolean): void;
|
141
163
|
}
|
142
164
|
}
|
143
165
|
|
@@ -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
|
+
}
|
@@ -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.
|
@@ -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
|
@@ -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
|
}
|