@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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/foundry/common/types.mjs.d.ts +122 -10
- 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/basePlaceableHUDs/tokenHUD.d.ts +7 -3
- package/src/foundry/foundry.js/applications/cameraViews.d.ts +3 -3
- package/src/foundry/foundry.js/applications/dialog.d.ts +14 -29
- package/src/foundry/foundry.js/applications/formApplication.d.ts +5 -0
- 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/hotbar.d.ts +7 -3
- 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/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 +2 -2
- 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 +38 -86
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.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/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/containers/objectHUD.d.ts +82 -0
- 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 +55 -15
- 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 +219 -62
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +107 -16
- package/src/foundry/foundry.js/textEditor.d.ts +266 -231
- package/src/foundry/index.d.ts +0 -4
- package/src/types/utils.d.ts +5 -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
@@ -36,6 +36,12 @@ declare global {
|
|
36
36
|
*/
|
37
37
|
tile: PIXI.Sprite | undefined;
|
38
38
|
|
39
|
+
/**
|
40
|
+
* The occlusion image sprite
|
41
|
+
* @defaultValue `undefined`
|
42
|
+
*/
|
43
|
+
occlusionTile: PIXI.Sprite | undefined;
|
44
|
+
|
39
45
|
/**
|
40
46
|
* A Tile background which is displayed if no valid image texture is present
|
41
47
|
* @defaultValue `undefined`
|
@@ -72,6 +78,9 @@ declare global {
|
|
72
78
|
*/
|
73
79
|
get aspectRatio(): number;
|
74
80
|
|
81
|
+
/** @override */
|
82
|
+
get bounds(): Rectangle;
|
83
|
+
|
75
84
|
/**
|
76
85
|
* The HTML source element for the primary Tile texture
|
77
86
|
*/
|
@@ -91,7 +100,12 @@ declare global {
|
|
91
100
|
draw(): Promise<this>;
|
92
101
|
|
93
102
|
/** @override */
|
94
|
-
|
103
|
+
destroy(options?: Parameters<PlaceableObject['destroy']>[0]): void;
|
104
|
+
|
105
|
+
/**
|
106
|
+
* @param options - (default: `{}`)
|
107
|
+
* @override */
|
108
|
+
refresh(options?: Tile.RefreshOptions | undefined): this;
|
95
109
|
|
96
110
|
/**
|
97
111
|
* Refresh the display of the Tile border
|
@@ -111,7 +125,14 @@ declare global {
|
|
111
125
|
* @param options - Additional options for modifying video playback
|
112
126
|
* (default: `{}`)
|
113
127
|
*/
|
114
|
-
play(playing: boolean, options?:
|
128
|
+
play(playing: boolean, options?: Tile.PlayOptions | undefined): void;
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Unlink the playback of this video tile from the playback of other tokens which are using the same base texture.
|
132
|
+
* @param source - The video element source
|
133
|
+
* @internal
|
134
|
+
*/
|
135
|
+
protected _unlinkVideoPlayback(source: HTMLVideoElement): Promise<void>;
|
115
136
|
|
116
137
|
/**
|
117
138
|
* Update the occlusion rendering for this overhead Tile for a given controlled Token.
|
@@ -128,7 +149,7 @@ declare global {
|
|
128
149
|
*/
|
129
150
|
testOcclusion(
|
130
151
|
token: InstanceType<ConfiguredObjectClassForName<'Token'>>,
|
131
|
-
options?:
|
152
|
+
options?: Tile.OcclusionOptions | undefined
|
132
153
|
): boolean;
|
133
154
|
|
134
155
|
/**
|
@@ -154,7 +175,7 @@ declare global {
|
|
154
175
|
* @param options - Options which customize the return value
|
155
176
|
* @internal
|
156
177
|
*/
|
157
|
-
protected _createAlphaMap(options:
|
178
|
+
protected _createAlphaMap(options: Tile.AlphaMapOptions): Exclude<Tile['_alphaMap'], undefined>;
|
158
179
|
|
159
180
|
/**
|
160
181
|
* Compute the alpha-based bounding box for the tile, including an angle of rotation.
|
@@ -239,7 +260,7 @@ declare global {
|
|
239
260
|
* Get resized Tile dimensions
|
240
261
|
* @internal
|
241
262
|
*/
|
242
|
-
protected _getResizedDimensions(event: MouseEvent, origin: Point, destination: Point):
|
263
|
+
protected _getResizedDimensions(event: MouseEvent, origin: Point, destination: Point): Rectangle;
|
243
264
|
|
244
265
|
/**
|
245
266
|
* Handle cancellation of a drag event for one of the resizing handles
|
@@ -248,18 +269,27 @@ declare global {
|
|
248
269
|
|
249
270
|
/**
|
250
271
|
* Create a preview tile with a background texture instead of an image
|
272
|
+
* @param data - Initial data with which to create the preview Tile
|
251
273
|
*/
|
252
|
-
static createPreview(data: TileDataConstructorData): Tile
|
274
|
+
static createPreview(data: TileDataConstructorData): InstanceType<ConfiguredObjectClassForName<'Tile'>>;
|
253
275
|
}
|
254
276
|
|
255
277
|
namespace Tile {
|
278
|
+
interface RefreshOptions {
|
279
|
+
/**
|
280
|
+
* Also refresh the perception layer.
|
281
|
+
* @defaultValue `false`
|
282
|
+
*/
|
283
|
+
refreshPerception?: boolean | undefined;
|
284
|
+
}
|
285
|
+
|
256
286
|
interface PlayOptions {
|
257
287
|
/** Should the video loop? */
|
258
|
-
loop
|
288
|
+
loop?: boolean | undefined;
|
259
289
|
/** A specific timestamp between 0 and the video duration to begin playback */
|
260
|
-
offset
|
290
|
+
offset?: number | undefined;
|
261
291
|
/** Desired volume level of the video's audio channel (if any) */
|
262
|
-
volume
|
292
|
+
volume?: number | undefined;
|
263
293
|
}
|
264
294
|
|
265
295
|
interface OcclusionOptions {
|
@@ -267,7 +297,7 @@ declare global {
|
|
267
297
|
* Test corners of the hit-box in addition to the token center?
|
268
298
|
* @defaultValue `true`
|
269
299
|
*/
|
270
|
-
corners
|
300
|
+
corners?: boolean | undefined;
|
271
301
|
}
|
272
302
|
|
273
303
|
interface AlphaMapOptions {
|
@@ -275,13 +305,13 @@ declare global {
|
|
275
305
|
* Keep the Uint8Array of pixel alphas?
|
276
306
|
* @defaultValue `false`
|
277
307
|
*/
|
278
|
-
keepPixels
|
308
|
+
keepPixels?: boolean | undefined;
|
279
309
|
|
280
310
|
/**
|
281
311
|
* Keep the pure white RenderTexture?
|
282
312
|
* @defaultValue `false`
|
283
313
|
*/
|
284
|
-
keepTexture
|
314
|
+
keepTexture?: boolean | undefined;
|
285
315
|
}
|
286
316
|
}
|
287
317
|
}
|
@@ -25,22 +25,37 @@ declare global {
|
|
25
25
|
protected _validPosition: { x: number; y: number };
|
26
26
|
|
27
27
|
/**
|
28
|
-
* Track the set of User
|
28
|
+
* Track the set of User documents which are currently targeting this Token
|
29
29
|
*/
|
30
30
|
targeted: Set<User>;
|
31
31
|
|
32
32
|
/**
|
33
|
-
* A reference to the
|
33
|
+
* A reference to the VisionSource object which defines this vision source area of effect
|
34
34
|
*/
|
35
35
|
vision: VisionSource;
|
36
36
|
|
37
37
|
/**
|
38
|
-
* A reference to the
|
38
|
+
* A reference to the LightSource object which defines this light source area of effect
|
39
39
|
*/
|
40
40
|
light: LightSource;
|
41
41
|
|
42
|
+
/**
|
43
|
+
* A linked ObjectHUD element which is synchronized with the location and visibility of this Token
|
44
|
+
* @defaultValue `new ObjectHUD(this);`
|
45
|
+
*/
|
46
|
+
hud: Token.ObjectHUD;
|
47
|
+
|
48
|
+
/** @defaultValue `undefined` */
|
49
|
+
texture?: PIXI.Texture | null;
|
50
|
+
|
51
|
+
/** @defaultValue `undefined` */
|
52
|
+
border?: PIXI.Graphics;
|
53
|
+
|
54
|
+
/** @defaultValue `undefined` */
|
55
|
+
icon?: PIXI.Sprite;
|
56
|
+
|
42
57
|
/** @override */
|
43
|
-
static
|
58
|
+
static embeddedName: 'Token';
|
44
59
|
|
45
60
|
/**
|
46
61
|
* Establish an initial velocity of the token based on it's direction of facing.
|
@@ -77,6 +92,9 @@ declare global {
|
|
77
92
|
*/
|
78
93
|
readonly name: string;
|
79
94
|
|
95
|
+
/** @override */
|
96
|
+
get bounds(): Rectangle;
|
97
|
+
|
80
98
|
/**
|
81
99
|
* Translate the token's grid width into a pixel width based on the canvas size
|
82
100
|
*/
|
@@ -92,6 +110,16 @@ declare global {
|
|
92
110
|
*/
|
93
111
|
get center(): ReturnType<this['getCenter']>;
|
94
112
|
|
113
|
+
/**
|
114
|
+
* The HTML source element for the primary Tile texture
|
115
|
+
*/
|
116
|
+
get sourceElement(): HTMLImageElement | HTMLVideoElement | undefined;
|
117
|
+
|
118
|
+
/**
|
119
|
+
* Does this Tile depict an animated video texture?
|
120
|
+
*/
|
121
|
+
get isVideo(): boolean;
|
122
|
+
|
95
123
|
/**
|
96
124
|
* An indicator for whether or not this token is currently involved in the active combat encounter.
|
97
125
|
*/
|
@@ -118,6 +146,11 @@ declare global {
|
|
118
146
|
*/
|
119
147
|
get isVisible(): boolean;
|
120
148
|
|
149
|
+
/**
|
150
|
+
* The animation name used for Token movement
|
151
|
+
*/
|
152
|
+
get movementAnimationName(): string;
|
153
|
+
|
121
154
|
/**
|
122
155
|
* Test whether the Token has sight (or blindness) at any radius
|
123
156
|
*/
|
@@ -152,23 +185,43 @@ declare global {
|
|
152
185
|
|
153
186
|
/**
|
154
187
|
* Update the light and vision source objects associated with this Token
|
155
|
-
* @param
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
*
|
188
|
+
* @param options - (default: `{}}`)
|
189
|
+
*/
|
190
|
+
updateSource(options?: Token.UpdateSourceOptions | undefined): void;
|
191
|
+
|
192
|
+
/**
|
193
|
+
* Update an emitted light source associated with this Token.
|
194
|
+
* @param options - (default `{}`)
|
161
195
|
*/
|
162
|
-
|
196
|
+
updateLightSource(options?: Token.UpdateLightSourceOptions | undefined): void;
|
197
|
+
|
198
|
+
/**
|
199
|
+
* Update an Token vision source associated for this token.
|
200
|
+
* @param options - (default `{}`)
|
201
|
+
*/
|
202
|
+
updateVisionSource(options?: Token.UpdateVisionSourceOptions | undefined): void;
|
163
203
|
|
164
204
|
/**
|
165
205
|
* Test whether this Token is a viable vision source for the current User
|
206
|
+
* @internal
|
166
207
|
*/
|
167
208
|
protected _isVisionSource(): boolean;
|
168
209
|
|
210
|
+
/** @override */
|
211
|
+
clear(): this;
|
212
|
+
|
169
213
|
/** @override */
|
170
214
|
draw(): Promise<this>;
|
171
215
|
|
216
|
+
/**
|
217
|
+
* Draw the HUD container which provides an interface for managing this Token
|
218
|
+
* @internal
|
219
|
+
*/
|
220
|
+
protected _drawHUD(): Token.InitializedObjectHUD;
|
221
|
+
|
222
|
+
/** @override */
|
223
|
+
destroy(options?: Parameters<PlaceableObject['destroy']>[0]): void;
|
224
|
+
|
172
225
|
/**
|
173
226
|
* Apply initial sanitizations to the provided input data to ensure that a Token has valid required attributes.
|
174
227
|
*/
|
@@ -184,6 +237,22 @@ declare global {
|
|
184
237
|
*/
|
185
238
|
protected _drawIcon(): Promise<PIXI.Sprite>;
|
186
239
|
|
240
|
+
/**
|
241
|
+
* Play video for this Token (if applicable).
|
242
|
+
* @param playing - Should the Token video be playing?
|
243
|
+
* (default: `true`)
|
244
|
+
* @param options - Additional options for modifying video playback
|
245
|
+
* (default: `{}`)
|
246
|
+
*/
|
247
|
+
play(playing?: boolean | undefined, options?: Token.PlayOptions | undefined): void;
|
248
|
+
|
249
|
+
/**
|
250
|
+
* Unlink the playback of this video token from the playback of other tokens which are using the same base texture.
|
251
|
+
* @param source - The video element source
|
252
|
+
* @internal
|
253
|
+
*/
|
254
|
+
protected _unlinkVideoPlayback(source: HTMLVideoElement): Promise<void>;
|
255
|
+
|
187
256
|
/**
|
188
257
|
* Update display of the Token, pulling latest data and re-rendering the display of Token components
|
189
258
|
*/
|
@@ -191,24 +260,33 @@ declare global {
|
|
191
260
|
|
192
261
|
/**
|
193
262
|
* Draw the Token border, taking into consideration the grid type and border color
|
263
|
+
* @internal
|
194
264
|
*/
|
195
265
|
protected _refreshBorder(): void;
|
196
266
|
|
197
267
|
/**
|
198
268
|
* Get the hex color that should be used to render the Token border
|
199
269
|
* @returns The hex color used to depict the border color
|
270
|
+
* @internal
|
200
271
|
*/
|
201
272
|
protected _getBorderColor(): number | null;
|
202
273
|
|
274
|
+
/**
|
275
|
+
* Refresh the display of the Token HUD interface.
|
276
|
+
*/
|
277
|
+
refreshHUD(): void;
|
278
|
+
|
203
279
|
/**
|
204
280
|
* Refresh the target indicators for the Token.
|
205
281
|
* Draw both target arrows for the primary User as well as indicator pips for other Users targeting the same Token.
|
282
|
+
* @internal
|
206
283
|
*/
|
207
284
|
protected _refreshTarget(): void;
|
208
285
|
|
209
286
|
/**
|
210
287
|
* Refresh the display of Token attribute bars, rendering latest resource data
|
211
288
|
* If the bar attribute is valid (has a value and max), draw the bar. Otherwise hide it.
|
289
|
+
* @internal
|
212
290
|
*/
|
213
291
|
drawBars(): void;
|
214
292
|
|
@@ -218,7 +296,7 @@ declare global {
|
|
218
296
|
* @param bar - The Bar container
|
219
297
|
* @param data - Resource data for this bar
|
220
298
|
*/
|
221
|
-
protected _drawBar(number: number, bar: PIXI.Graphics, data: ReturnType<
|
299
|
+
protected _drawBar(number: number, bar: PIXI.Graphics, data: ReturnType<TokenDocument['getBarAttribute']>): void;
|
222
300
|
|
223
301
|
/**
|
224
302
|
* Draw the token's nameplate as a text object
|
@@ -228,14 +306,18 @@ declare global {
|
|
228
306
|
|
229
307
|
/**
|
230
308
|
* Draw a text tooltip for the token which can be used to display Elevation or a resource value
|
309
|
+
* @returns The text object used to render the tooltip
|
310
|
+
* @internal
|
231
311
|
*/
|
232
|
-
|
312
|
+
protected _drawTooltip(): PreciseText;
|
233
313
|
|
234
314
|
/**
|
235
315
|
* Return the text which should be displayed in a token's tooltip field
|
316
|
+
* @internal
|
236
317
|
*/
|
237
318
|
protected _getTooltipText(): string;
|
238
319
|
|
320
|
+
/** @internal */
|
239
321
|
protected _getTextStyle(): PIXI.TextStyle;
|
240
322
|
|
241
323
|
/**
|
@@ -245,11 +327,14 @@ declare global {
|
|
245
327
|
|
246
328
|
/**
|
247
329
|
* Draw the overlay effect icon
|
330
|
+
* @param options - (default: `{}`)
|
331
|
+
* @internal
|
248
332
|
*/
|
249
|
-
protected _drawOverlay(
|
333
|
+
protected _drawOverlay(options?: Token.DrawOverlayOptions | undefined): Promise<void>;
|
250
334
|
|
251
335
|
/**
|
252
336
|
* Draw a status effect icon
|
337
|
+
* @internal
|
253
338
|
*/
|
254
339
|
protected _drawEffect(src: string, i: number, bg: PIXI.Graphics, w: number, tint: number): Promise<void>;
|
255
340
|
|
@@ -257,6 +342,7 @@ declare global {
|
|
257
342
|
* Helper method to determine whether a token attribute is viewable under a certain mode
|
258
343
|
* @param mode - The mode from CONST.TOKEN_DISPLAY_MODES
|
259
344
|
* @returns Is the attribute viewable?
|
345
|
+
* @internal
|
260
346
|
*/
|
261
347
|
protected _canViewMode(mode: foundry.CONST.TOKEN_DISPLAY_MODES): boolean;
|
262
348
|
|
@@ -268,6 +354,7 @@ declare global {
|
|
268
354
|
|
269
355
|
/**
|
270
356
|
* Animate the continual revealing of Token vision during a movement animation
|
357
|
+
* @internal
|
271
358
|
*/
|
272
359
|
protected _onMovementFrame(
|
273
360
|
dt: number,
|
@@ -285,6 +372,7 @@ declare global {
|
|
285
372
|
* @param source - (default: `false`)
|
286
373
|
* @param sound - (default: `false`)
|
287
374
|
* @param fog - (default: `false`)
|
375
|
+
* @internal
|
288
376
|
*/
|
289
377
|
protected _animatePerceptionFrame({
|
290
378
|
source,
|
@@ -311,6 +399,7 @@ declare global {
|
|
311
399
|
/**
|
312
400
|
* @param releaseOthers - (default: `true`)
|
313
401
|
* @param pan - (default: `false`)
|
402
|
+
* @override
|
314
403
|
*/
|
315
404
|
protected _onControl({ releaseOthers, pan }?: { releaseOthers?: boolean; pan?: boolean }): void;
|
316
405
|
|
@@ -342,13 +431,14 @@ declare global {
|
|
342
431
|
* (defaultValue: `{}`)
|
343
432
|
* @returns The Token after animation has completed
|
344
433
|
*/
|
345
|
-
setPosition(x: number, y: number, options?: PositionOptions): Promise<this>;
|
434
|
+
setPosition(x: number, y: number, options?: Token.PositionOptions): Promise<this>;
|
346
435
|
|
347
436
|
/**
|
348
437
|
* Update the Token velocity auto-regressively, shifting increasing weight towards more recent movement
|
349
438
|
* Employ a magic constant chosen to minimize (effectively zero) the likelihood of trigonometric edge cases
|
350
439
|
* @param ray - The proposed movement ray
|
351
440
|
* @returns An updated velocity with directional memory
|
441
|
+
* @internal
|
352
442
|
*/
|
353
443
|
protected _updateVelocity(ray: Ray): Token.Velocity;
|
354
444
|
|
@@ -384,7 +474,7 @@ declare global {
|
|
384
474
|
toggleCombat(combat?: InstanceType<ConfiguredDocumentClass<typeof Combat>>): Promise<this>;
|
385
475
|
|
386
476
|
/**
|
387
|
-
* Toggle an active effect by
|
477
|
+
* Toggle an active effect by its texture path.
|
388
478
|
* Copy the existing Array in order to ensure the update method detects the data as changed.
|
389
479
|
*
|
390
480
|
* @param effect - The texture file-path of the effect icon to toggle on the Token.
|
@@ -394,19 +484,12 @@ declare global {
|
|
394
484
|
*/
|
395
485
|
toggleEffect(
|
396
486
|
effect: string | ConstructorParameters<ConfiguredDocumentClassForName<'ActiveEffect'>>[0],
|
397
|
-
options?: EffectToggleOptions
|
398
|
-
): Promise<boolean>;
|
399
|
-
|
400
|
-
/**
|
401
|
-
* A helper function to toggle a status effect which includes an Active Effect template
|
402
|
-
*/
|
403
|
-
protected _toggleActiveEffect(
|
404
|
-
effectData: ConstructorParameters<ConfiguredDocumentClassForName<'ActiveEffect'>>[0],
|
405
|
-
{ overlay }?: { overlay?: boolean }
|
487
|
+
options?: Token.EffectToggleOptions | undefined
|
406
488
|
): Promise<boolean>;
|
407
489
|
|
408
490
|
/**
|
409
491
|
* A helper function to toggle the overlay status icon on the Token
|
492
|
+
* @internal
|
410
493
|
*/
|
411
494
|
protected _toggleOverlayEffect(texture: string, { active }?: { active: boolean }): Promise<this>;
|
412
495
|
|
@@ -439,8 +522,9 @@ declare global {
|
|
439
522
|
/**
|
440
523
|
* Extend the PlaceableObject.rotate method to prevent rotation if the Token is in the midst of a movement animation
|
441
524
|
* @returns Actually a Promise<void>
|
525
|
+
* @remarks The return type is `Promise<this> | undefined` but this breaks the interface of PlaceableObject, see https://gitlab.com/foundrynet/foundryvtt/-/issues/6876
|
442
526
|
*/
|
443
|
-
rotate(
|
527
|
+
rotate(...args: Parameters<PlaceableObject['rotate']>): any;
|
444
528
|
|
445
529
|
/** @override */
|
446
530
|
protected _onCreate(
|
@@ -506,22 +590,8 @@ declare global {
|
|
506
590
|
/** @override */
|
507
591
|
protected _onDragLeftMove(event: PIXI.InteractionEvent): void;
|
508
592
|
|
509
|
-
/**
|
510
|
-
|
511
|
-
*/
|
512
|
-
static fromActor(
|
513
|
-
actor: InstanceType<ConfiguredDocumentClass<typeof Actor>>,
|
514
|
-
tokenData?: InstanceType<ConfiguredDocumentClass<typeof TokenDocument>>['data']['_source']
|
515
|
-
): never;
|
516
|
-
|
517
|
-
/**
|
518
|
-
* @deprecated since 0.8.0
|
519
|
-
*/
|
520
|
-
getBarAttribute(
|
521
|
-
barName: string,
|
522
|
-
{ alternative }?: { alternative?: string }
|
523
|
-
): ReturnType<this['document']['getBarAttribute']>;
|
524
|
-
|
593
|
+
/** @override */
|
594
|
+
protected _onDragLeftCancel(event: MouseEvent): void;
|
525
595
|
/**
|
526
596
|
* @remarks This does not exist in foundry. It marks the controlIcon as not used because `Token` does never store a value here.
|
527
597
|
*/
|
@@ -539,27 +609,114 @@ declare global {
|
|
539
609
|
dy: number;
|
540
610
|
sy: number;
|
541
611
|
}
|
542
|
-
}
|
543
|
-
}
|
544
612
|
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
*/
|
550
|
-
animate?: boolean;
|
551
|
-
}
|
613
|
+
/** The UI frame container which depicts Token metadata and status, displayed in the ControlsLayer. */
|
614
|
+
interface ObjectHUD extends globalThis.ObjectHUD {
|
615
|
+
/** Token health bars */
|
616
|
+
bars?: PIXI.Container;
|
552
617
|
|
553
|
-
|
554
|
-
|
555
|
-
* Force a certain active state for the effect
|
556
|
-
* @defaultValue `false`
|
557
|
-
*/
|
558
|
-
active?: boolean;
|
618
|
+
/** Token nameplate */
|
619
|
+
nameplate?: PreciseText;
|
559
620
|
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
621
|
+
/** Token elevation tooltip */
|
622
|
+
tooltip?: PreciseText;
|
623
|
+
|
624
|
+
/** Token status effects */
|
625
|
+
effects?: PIXI.Container;
|
626
|
+
|
627
|
+
/** Token target marker */
|
628
|
+
target?: PIXI.Graphics;
|
629
|
+
}
|
630
|
+
|
631
|
+
type InitializedObjectHUD = RequiredProps<ObjectHUD, 'bars' | 'nameplate' | 'tooltip' | 'effects' | 'target'>;
|
632
|
+
|
633
|
+
interface UpdateLightSourceOptions {
|
634
|
+
/**
|
635
|
+
* Defer refreshing the LightingLayer to manually call that refresh later.
|
636
|
+
* @defaultValue `false`
|
637
|
+
*/
|
638
|
+
defer?: boolean | undefined;
|
639
|
+
|
640
|
+
/**
|
641
|
+
* Indicate that this light source has been deleted.
|
642
|
+
* @defaultValue `false`
|
643
|
+
*/
|
644
|
+
deleted?: boolean | undefined;
|
645
|
+
}
|
646
|
+
|
647
|
+
interface UpdateVisionSourceOptions {
|
648
|
+
/**
|
649
|
+
* Defer refreshing the SightLayer to manually call that refresh later.
|
650
|
+
* @defaultValue `false`
|
651
|
+
*/
|
652
|
+
defer?: boolean | undefined;
|
653
|
+
|
654
|
+
/**
|
655
|
+
* Indicate that this vision source has been deleted.
|
656
|
+
* @defaultValue `false`
|
657
|
+
*/
|
658
|
+
deleted?: boolean | undefined;
|
659
|
+
|
660
|
+
/**
|
661
|
+
* Never update the Fog exploration progress for this update.
|
662
|
+
* @defaultValue `false`
|
663
|
+
*/
|
664
|
+
skipUpdateFog?: boolean | undefined;
|
665
|
+
}
|
666
|
+
|
667
|
+
type UpdateSourceOptions = UpdateLightSourceOptions & UpdateVisionSourceOptions;
|
668
|
+
|
669
|
+
interface PlayOptions {
|
670
|
+
/**
|
671
|
+
* Should the video loop?
|
672
|
+
* @defaultValue `true`
|
673
|
+
*/
|
674
|
+
loop?: boolean | undefined;
|
675
|
+
|
676
|
+
/**
|
677
|
+
* A specific timestamp between 0 and the video duration to begin playback
|
678
|
+
* @defaultValue `0`
|
679
|
+
*/
|
680
|
+
offset?: number | undefined;
|
681
|
+
|
682
|
+
/**
|
683
|
+
* Desired volume level of the video's audio channel (if any)
|
684
|
+
* @defaultValue `0`
|
685
|
+
*/
|
686
|
+
volume?: number | undefined;
|
687
|
+
}
|
688
|
+
|
689
|
+
interface DrawOverlayOptions {
|
690
|
+
src?: string | undefined;
|
691
|
+
tint?: number | undefined;
|
692
|
+
}
|
693
|
+
|
694
|
+
interface PositionOptions {
|
695
|
+
/**
|
696
|
+
* Animate the movement path
|
697
|
+
* @defaultValue `true`
|
698
|
+
*/
|
699
|
+
animate?: boolean;
|
700
|
+
|
701
|
+
/**
|
702
|
+
* Automatically re-center the view if token movement goes off-screen
|
703
|
+
* @defaultValue `true`
|
704
|
+
*/
|
705
|
+
recenter?: boolean | undefined;
|
706
|
+
}
|
707
|
+
|
708
|
+
interface EffectToggleOptions {
|
709
|
+
/**
|
710
|
+
* Force a certain active state for the effect
|
711
|
+
* @defaultValue `false`
|
712
|
+
*/
|
713
|
+
active?: boolean | undefined;
|
714
|
+
|
715
|
+
/**
|
716
|
+
* Whether to set the effect as the overlay effect?
|
717
|
+
* @defaultValue `false`
|
718
|
+
*/
|
719
|
+
overlay?: boolean | undefined;
|
720
|
+
}
|
721
|
+
}
|
565
722
|
}
|