@league-of-foundry-developers/foundry-vtt-types 9.249.3 → 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 +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 +120 -8
- 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/formApplications/documentSheets/actorSheet.d.ts +8 -6
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/notifications.d.ts +2 -5
- 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 +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/cards.d.ts +2 -1
- 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 +203 -230
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +3 -1
- 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/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/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
@@ -3,9 +3,10 @@
|
|
3
3
|
*/
|
4
4
|
declare class SquareGrid extends BaseGrid {
|
5
5
|
/** @override */
|
6
|
-
draw(): this;
|
6
|
+
draw(preview?: BaseGrid.Preview | undefined): this;
|
7
7
|
|
8
|
-
|
8
|
+
/** @internal */
|
9
|
+
protected _drawLine(
|
9
10
|
points: [x1: number, y1: number, x2: number, y2: number],
|
10
11
|
lineColor: number,
|
11
12
|
lineAlpha: number
|
@@ -35,6 +36,7 @@ declare class SquareGrid extends BaseGrid {
|
|
35
36
|
*/
|
36
37
|
shiftPosition(x: number, y: number, dx: number, dy: number): PointArray;
|
37
38
|
|
39
|
+
/** @internal */
|
38
40
|
protected _getNearestVertex(x: number, y: number): PointArray;
|
39
41
|
|
40
42
|
/**
|
@@ -47,7 +49,7 @@ declare class SquareGrid extends BaseGrid {
|
|
47
49
|
* @override
|
48
50
|
* @param options - (default: `{}`)
|
49
51
|
*/
|
50
|
-
measureDistances(segments: GridLayer.Segment[], options?:
|
52
|
+
measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions): number[];
|
51
53
|
|
52
54
|
/** @override */
|
53
55
|
getNeighbors(row: number, col: number): PointArray[];
|
@@ -92,9 +92,11 @@ declare class GridLayer extends CanvasLayer<GridLayer.LayerOptions> {
|
|
92
92
|
getCenter(x: number, y: number): PointArray;
|
93
93
|
|
94
94
|
/**
|
95
|
-
* Measure the
|
96
|
-
* @param origin
|
97
|
-
* @param target
|
95
|
+
* Measure the distance between two point coordinates.
|
96
|
+
* @param origin - The origin point
|
97
|
+
* @param target - The target point
|
98
|
+
* @param options - Additional options which modify the measurement
|
99
|
+
* (default: `{}`)
|
98
100
|
* @returns The measured distance between these points
|
99
101
|
*
|
100
102
|
* @example
|
@@ -110,15 +112,17 @@ declare class GridLayer extends CanvasLayer<GridLayer.LayerOptions> {
|
|
110
112
|
target: {
|
111
113
|
x: number;
|
112
114
|
y: number;
|
113
|
-
}
|
115
|
+
},
|
116
|
+
options?: MeasureDistancesOptions | undefined
|
114
117
|
): number;
|
115
118
|
|
116
119
|
/**
|
117
120
|
* Measure the distance traveled over an array of distance segments.
|
118
121
|
* @param segments - An array of measured segments
|
119
122
|
* @param options - Additional options which modify the measurement
|
123
|
+
* (default: `{}`)
|
120
124
|
*/
|
121
|
-
measureDistances(segments: GridLayer.Segment[], options?:
|
125
|
+
measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions | undefined): number[];
|
122
126
|
|
123
127
|
/**
|
124
128
|
* Define a new Highlight graphic
|
@@ -194,3 +198,8 @@ interface DrawOptions {
|
|
194
198
|
*/
|
195
199
|
gridAlpha?: number | null;
|
196
200
|
}
|
201
|
+
|
202
|
+
interface MeasureDistancesOptions {
|
203
|
+
/** Return the distance in grid increments rather than the co-ordinate distance. */
|
204
|
+
gridSpaces?: boolean;
|
205
|
+
}
|
@@ -4,7 +4,7 @@ import { Document } from '../../../common/abstract/module.mjs';
|
|
4
4
|
|
5
5
|
declare global {
|
6
6
|
/**
|
7
|
-
* An Abstract Base Class which defines a Placeable Object which represents
|
7
|
+
* An Abstract Base Class which defines a Placeable Object which represents a Document placed on the Canvas
|
8
8
|
*/
|
9
9
|
abstract class PlaceableObject<
|
10
10
|
D extends Document<any, InstanceType<ConfiguredDocumentClass<typeof Scene>>> = Document<
|
@@ -68,8 +68,8 @@ declare global {
|
|
68
68
|
protected _hover: boolean;
|
69
69
|
|
70
70
|
/**
|
71
|
-
* Identify the official
|
72
|
-
* @remarks This
|
71
|
+
* Identify the official Document name for this PlaceableObject class
|
72
|
+
* @remarks This is abstract in {@link PlaceableObject}.
|
73
73
|
*/
|
74
74
|
static embeddedName: string;
|
75
75
|
|
@@ -77,7 +77,7 @@ declare global {
|
|
77
77
|
* The bounding box for this PlaceableObject.
|
78
78
|
* This is required if the layer uses a Quadtree, otherwise it is optional
|
79
79
|
*/
|
80
|
-
get bounds(): Rectangle;
|
80
|
+
abstract get bounds(): Rectangle;
|
81
81
|
|
82
82
|
/**
|
83
83
|
* The central coordinate pair of the placeable object based on it's own width and height
|
@@ -106,8 +106,8 @@ declare global {
|
|
106
106
|
get los(): this['vision']['los'];
|
107
107
|
|
108
108
|
/**
|
109
|
-
* A Form Application which is used to configure the properties of this Placeable Object or the
|
110
|
-
*
|
109
|
+
* A Form Application which is used to configure the properties of this Placeable Object or the Document it
|
110
|
+
* represents.
|
111
111
|
*/
|
112
112
|
get sheet(): 'sheet' extends keyof D ? D['sheet'] : FormApplication | null;
|
113
113
|
|
@@ -151,7 +151,7 @@ declare global {
|
|
151
151
|
protected _canView(user: InstanceType<ConfiguredDocumentClass<typeof User>>, event?: any): boolean;
|
152
152
|
|
153
153
|
/**
|
154
|
-
* Does the User have permission to create the underlying
|
154
|
+
* Does the User have permission to create the underlying Document?
|
155
155
|
* @param event - (unused)
|
156
156
|
*/
|
157
157
|
protected _canCreate(user: InstanceType<ConfiguredDocumentClass<typeof User>>, event?: any): boolean;
|
@@ -169,13 +169,13 @@ declare global {
|
|
169
169
|
protected _canHover(user: InstanceType<ConfiguredDocumentClass<typeof User>>, event?: any): boolean;
|
170
170
|
|
171
171
|
/**
|
172
|
-
* Does the User have permission to update the underlying
|
172
|
+
* Does the User have permission to update the underlying Document?
|
173
173
|
* @param event - (unused)
|
174
174
|
*/
|
175
175
|
protected _canUpdate(user: InstanceType<ConfiguredDocumentClass<typeof User>>, event?: any): boolean;
|
176
176
|
|
177
177
|
/**
|
178
|
-
* Does the User have permission to delete the underlying
|
178
|
+
* Does the User have permission to delete the underlying Document?
|
179
179
|
* @param event - (unused)
|
180
180
|
*/
|
181
181
|
protected _canDelete(user: InstanceType<ConfiguredDocumentClass<typeof User>>, event?: any): boolean;
|
@@ -378,52 +378,6 @@ declare global {
|
|
378
378
|
* @param event - The triggering mouse click event
|
379
379
|
*/
|
380
380
|
protected _onDragLeftCancel(event: MouseEvent): void;
|
381
|
-
|
382
|
-
/**
|
383
|
-
* @deprecated since 0.8.0
|
384
|
-
* @param options - (default: `{}`)
|
385
|
-
*/
|
386
|
-
static create(
|
387
|
-
data:
|
388
|
-
| Parameters<InstanceType<ConfiguredDocumentClass<typeof Scene>>['createEmbeddedDocuments']>[1]
|
389
|
-
| Parameters<InstanceType<ConfiguredDocumentClass<typeof Scene>>['createEmbeddedDocuments']>[1][],
|
390
|
-
options?: Parameters<InstanceType<ConfiguredDocumentClass<typeof Scene>>['createEmbeddedDocuments']>[1]
|
391
|
-
): ReturnType<InstanceType<ConfiguredDocumentClass<typeof Scene>>['createEmbeddedDocuments']>;
|
392
|
-
|
393
|
-
/**
|
394
|
-
* @deprecated since 0.8.0
|
395
|
-
*/
|
396
|
-
update(data: Parameters<D['update']>[0], options: Parameters<D['update']>[1]): ReturnType<D['update']>;
|
397
|
-
|
398
|
-
/**
|
399
|
-
* @deprecated since 0.8.0
|
400
|
-
*/
|
401
|
-
delete(options: Parameters<D['delete']>[0]): ReturnType<D['delete']>;
|
402
|
-
|
403
|
-
/**
|
404
|
-
* @deprecated since 0.8.0
|
405
|
-
*/
|
406
|
-
getFlag(scope: string, key: string): ReturnType<D['getFlag']>;
|
407
|
-
|
408
|
-
/**
|
409
|
-
* @deprecated since 0.8.0
|
410
|
-
*/
|
411
|
-
setFlag(scope: string, key: string, value: unknown): ReturnType<D['setFlag']>;
|
412
|
-
|
413
|
-
/**
|
414
|
-
* @deprecated since 0.8.0
|
415
|
-
*/
|
416
|
-
unsetFlag(scope: string, key: string): ReturnType<D['unsetFlag']>;
|
417
|
-
|
418
|
-
/**
|
419
|
-
* @deprecated since 0.8.0
|
420
|
-
*/
|
421
|
-
get uuid(): string;
|
422
|
-
|
423
|
-
/**
|
424
|
-
* @deprecated since 0.8.2
|
425
|
-
*/
|
426
|
-
static get layer(): PlaceablesLayer<any>;
|
427
381
|
}
|
428
382
|
|
429
383
|
namespace PlaceableObject {
|
@@ -42,8 +42,9 @@ declare abstract class PointSourcePolygon extends PIXI.Polygon {
|
|
42
42
|
/**
|
43
43
|
* A cached array of SightRay objects used to compute the polygon.
|
44
44
|
* @defaultValue `[]`
|
45
|
+
* @remarks This is documented as `SightRay[]` but that's only correct for the {@link RadialSweepPolygon}
|
45
46
|
*/
|
46
|
-
rays:
|
47
|
+
rays: Ray[];
|
47
48
|
|
48
49
|
/**
|
49
50
|
* Compute the rectangular bounds for the Polygon.
|
@@ -66,11 +67,12 @@ declare abstract class PointSourcePolygon extends PIXI.Polygon {
|
|
66
67
|
* Compute the polygon given a point origin and radius
|
67
68
|
* @param origin - The origin source point
|
68
69
|
* @param config - Configuration options which customize the polygon computation
|
70
|
+
* (default: `{}`)
|
69
71
|
* @returns The computed polygon instance
|
70
72
|
*/
|
71
73
|
static create(
|
72
74
|
origin: Point,
|
73
|
-
config
|
75
|
+
config?: Parameters<PointSourcePolygon['initialize']>[1] | undefined
|
74
76
|
): ReturnType<PointSourcePolygon['compute']>;
|
75
77
|
|
76
78
|
/**
|
@@ -37,13 +37,13 @@ declare global {
|
|
37
37
|
* The minimum ray of emission
|
38
38
|
* @defaultValue `Ray.fromAngle(origin.x, origin.y, config.aMin, config.radius)`
|
39
39
|
*/
|
40
|
-
rMin?:
|
40
|
+
rMin?: PolygonRay;
|
41
41
|
|
42
42
|
/**
|
43
43
|
* The maximum ray of emission
|
44
44
|
* @defaultValue `config.hasLimitedAngle && Ray.fromAngle(origin.x, origin.y, config.aMax, config.radius)`
|
45
45
|
*/
|
46
|
-
rMax?:
|
46
|
+
rMax?: PolygonRay;
|
47
47
|
|
48
48
|
/**
|
49
49
|
* Does this polygon have a limited radius?
|
@@ -70,6 +70,10 @@ declare global {
|
|
70
70
|
radiusE?: number;
|
71
71
|
}
|
72
72
|
|
73
|
+
interface PolygonRay extends Ray {
|
74
|
+
result: CollisionResult;
|
75
|
+
}
|
76
|
+
|
73
77
|
/**
|
74
78
|
* A PointSourcePolygon implementation that uses CCW (counter-clockwise) geometry orientation.
|
75
79
|
* Sweep around the origin, accumulating collision points based on the set of active walls.
|
@@ -97,7 +101,7 @@ declare global {
|
|
97
101
|
/**
|
98
102
|
* A collection of rays which are fired at vertices
|
99
103
|
*/
|
100
|
-
rays:
|
104
|
+
rays: PolygonRay[];
|
101
105
|
|
102
106
|
static benchmark(
|
103
107
|
iterations: number,
|
@@ -125,7 +129,7 @@ declare global {
|
|
125
129
|
* @returns The ray with rounded vertices
|
126
130
|
* @internal
|
127
131
|
*/
|
128
|
-
protected _roundRayVertices(ray:
|
132
|
+
protected _roundRayVertices(ray: PolygonRay): PolygonRay;
|
129
133
|
|
130
134
|
/**
|
131
135
|
* Translate walls and other obstacles into edges which limit visibility
|
@@ -194,7 +198,7 @@ declare global {
|
|
194
198
|
* @internal
|
195
199
|
*/
|
196
200
|
protected _isVertexBehindActiveEdges(
|
197
|
-
ray:
|
201
|
+
ray: PolygonRay,
|
198
202
|
vertex: PolygonVertex,
|
199
203
|
activeEdges: EdgeSet
|
200
204
|
): { isBehind: boolean; wasLimited: boolean };
|
@@ -207,7 +211,12 @@ declare global {
|
|
207
211
|
* @param activeEdges - The set of active edges
|
208
212
|
* @internal
|
209
213
|
*/
|
210
|
-
protected _determineRayResult(
|
214
|
+
protected _determineRayResult(
|
215
|
+
ray: PolygonRay,
|
216
|
+
vertex: PolygonVertex,
|
217
|
+
result: CollisionResult,
|
218
|
+
activeEdges: EdgeSet
|
219
|
+
): void;
|
211
220
|
|
212
221
|
/**
|
213
222
|
* Jump to a new closest active edge.
|
@@ -223,7 +232,7 @@ declare global {
|
|
223
232
|
* (default: `true`)
|
224
233
|
*/
|
225
234
|
protected _beginNewEdge(
|
226
|
-
ray:
|
235
|
+
ray: PolygonRay,
|
227
236
|
result: CollisionResult,
|
228
237
|
activeEdges: EdgeSet,
|
229
238
|
isBinding: boolean,
|
@@ -241,7 +250,12 @@ declare global {
|
|
241
250
|
* @param activeEdges - The set of currently active edges
|
242
251
|
* @param isBinding - Is the target vertex a binding collision point?
|
243
252
|
*/
|
244
|
-
protected _completeCurrentEdge(
|
253
|
+
protected _completeCurrentEdge(
|
254
|
+
ray: PolygonRay,
|
255
|
+
result: CollisionResult,
|
256
|
+
activeEdges: EdgeSet,
|
257
|
+
isBinding: boolean
|
258
|
+
): void;
|
245
259
|
|
246
260
|
/**
|
247
261
|
* Augment a CollisionResult with an additional secondary collision.
|
@@ -251,7 +265,7 @@ declare global {
|
|
251
265
|
* @param edges - The subset of active edges which are candidates for collision
|
252
266
|
* @internal
|
253
267
|
*/
|
254
|
-
protected _getSecondaryCollisions(ray:
|
268
|
+
protected _getSecondaryCollisions(ray: PolygonRay, result: CollisionResult, edges: EdgeSet): PolygonVertex[];
|
255
269
|
|
256
270
|
/**
|
257
271
|
* Identify collision points for a required terminal ray.
|
@@ -261,7 +275,7 @@ declare global {
|
|
261
275
|
* @param result - The pending collision result
|
262
276
|
* @param activeEdges - The set of currently active edges
|
263
277
|
*/
|
264
|
-
protected _findRequiredCollision(ray:
|
278
|
+
protected _findRequiredCollision(ray: PolygonRay, result: CollisionResult, activeEdges: EdgeSet): void;
|
265
279
|
|
266
280
|
/**
|
267
281
|
* Identify the collision points between an emitted Ray and a set of active edges.
|
@@ -271,7 +285,7 @@ declare global {
|
|
271
285
|
* @internal
|
272
286
|
*/
|
273
287
|
protected _getRayCollisions(
|
274
|
-
ray:
|
288
|
+
ray: PolygonRay,
|
275
289
|
activeEdges: EdgeSet,
|
276
290
|
{
|
277
291
|
minimumDistance
|
@@ -304,7 +318,7 @@ declare global {
|
|
304
318
|
* @param r1 - The next ray that collides with some vertex
|
305
319
|
* @internal
|
306
320
|
*/
|
307
|
-
protected _getPaddingPoints(r0:
|
321
|
+
protected _getPaddingPoints(r0: PolygonRay, r1: PolygonRay): Point[];
|
308
322
|
|
309
323
|
/**
|
310
324
|
* Test whether a wall should be included in the computed polygon for a given origin and type
|
@@ -328,7 +342,7 @@ declare global {
|
|
328
342
|
* @param angle - The angle being tested, in degrees
|
329
343
|
* @returns Is the vertex between the two rays?
|
330
344
|
*/
|
331
|
-
static pointBetweenRays(vertex: PolygonVertex, rMin:
|
345
|
+
static pointBetweenRays(vertex: PolygonVertex, rMin: PolygonRay, rMax: PolygonRay, angle: number): boolean;
|
332
346
|
|
333
347
|
/** @override */
|
334
348
|
visualize(): void;
|
@@ -342,7 +356,7 @@ declare global {
|
|
342
356
|
* The closest collision, if mode is "closest"
|
343
357
|
*/
|
344
358
|
static getRayCollisions<Mode extends 'any' | 'closest' | 'all'>(
|
345
|
-
ray:
|
359
|
+
ray: PolygonRay,
|
346
360
|
options?: {
|
347
361
|
/**
|
348
362
|
* Which collision type to check, a value in CONST.WALL_RESTRICTION_TYPES
|
@@ -368,7 +382,7 @@ declare global {
|
|
368
382
|
* Visualize the polygon, displaying its computed area, rays, and collision points
|
369
383
|
* @internal
|
370
384
|
*/
|
371
|
-
protected static _visualizeCollision(ray:
|
385
|
+
protected static _visualizeCollision(ray: PolygonRay, edges: EdgeSet, collisions: PolygonVertex[]): void;
|
372
386
|
}
|
373
387
|
|
374
388
|
namespace ClockwiseSweepPolygon {
|
@@ -385,12 +399,12 @@ declare global {
|
|
385
399
|
rotation: number;
|
386
400
|
hasLimitedAngle: boolean;
|
387
401
|
density: number;
|
388
|
-
rMin:
|
402
|
+
rMin: PolygonRay;
|
389
403
|
}
|
390
404
|
|
391
405
|
interface LimitedAngleConfig extends InitializedConfig {
|
392
406
|
hasLimitedAngle: true;
|
393
|
-
rMax:
|
407
|
+
rMax: PolygonRay;
|
394
408
|
}
|
395
409
|
}
|
396
410
|
}
|
@@ -207,11 +207,6 @@ declare class Die extends DiceTerm {
|
|
207
207
|
}
|
208
208
|
|
209
209
|
declare namespace Die {
|
210
|
-
interface Data extends Partial<TermData> {
|
211
|
-
class: 'Die';
|
212
|
-
results: DiceTerm.Result[];
|
213
|
-
}
|
214
|
-
|
215
210
|
interface TermData extends DiceTerm.TermData {
|
216
211
|
modifiers: Array<keyof typeof Die['MODIFIERS']>;
|
217
212
|
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Mathematically behaves like 1d3-2
|
4
4
|
*/
|
5
5
|
declare class FateDie extends DiceTerm {
|
6
|
-
constructor(termData?: Partial<
|
6
|
+
constructor(termData?: Partial<FateDie.TermData>);
|
7
7
|
|
8
8
|
faces: 3;
|
9
9
|
|
@@ -12,6 +12,9 @@ declare class FateDie extends DiceTerm {
|
|
12
12
|
*/
|
13
13
|
static DENOMINATION: string;
|
14
14
|
|
15
|
+
/** @override */
|
16
|
+
static MODIFIERS: FateDie.Modifiers;
|
17
|
+
|
15
18
|
/**
|
16
19
|
* @override
|
17
20
|
*/
|
@@ -22,3 +25,20 @@ declare class FateDie extends DiceTerm {
|
|
22
25
|
*/
|
23
26
|
getResultLabel(result: DiceTerm.Result): string;
|
24
27
|
}
|
28
|
+
|
29
|
+
declare namespace FateDie {
|
30
|
+
interface TermData extends DiceTerm.TermData {
|
31
|
+
modifiers: Array<keyof typeof FateDie['MODIFIERS']>;
|
32
|
+
}
|
33
|
+
|
34
|
+
interface Modifiers {
|
35
|
+
r: Die['reroll'];
|
36
|
+
rr: Die['rerollRecursive'];
|
37
|
+
k: Die['keep'];
|
38
|
+
kh: Die['keep'];
|
39
|
+
kl: Die['keep'];
|
40
|
+
d: Die['drop'];
|
41
|
+
dh: Die['drop'];
|
42
|
+
dl: Die['drop'];
|
43
|
+
}
|
44
|
+
}
|
@@ -5,13 +5,6 @@
|
|
5
5
|
declare class VideoHelper {
|
6
6
|
constructor();
|
7
7
|
|
8
|
-
/**
|
9
|
-
* A collection of HTML5 video objects which are currently active within the FVTT page
|
10
|
-
* @defaultValue `[]`
|
11
|
-
* @remarks This seems to be unused.
|
12
|
-
*/
|
13
|
-
videos: HTMLVideoElement[];
|
14
|
-
|
15
8
|
/**
|
16
9
|
* A user gesture must be registered before video playback can begin.
|
17
10
|
* This Set records the video elements which await such a gesture.
|
package/src/foundry/index.d.ts
CHANGED
@@ -20,12 +20,9 @@ import './foundry.js/clientSettings';
|
|
20
20
|
import './foundry.js/collections';
|
21
21
|
import './foundry.js/collisionResult';
|
22
22
|
import './foundry.js/config';
|
23
|
-
import './foundry.js/constants';
|
24
23
|
import './foundry.js/contextMenu';
|
25
24
|
import './foundry.js/dragDrop';
|
26
25
|
import './foundry.js/draggable';
|
27
|
-
import './foundry.js/features';
|
28
|
-
import './foundry.js/fonts';
|
29
26
|
import './foundry.js/formDataExtended';
|
30
27
|
import './foundry.js/game';
|
31
28
|
import './foundry.js/gameTime';
|
@@ -74,7 +71,6 @@ import './foundry.js/templateUtils';
|
|
74
71
|
import './foundry.js/textEditor';
|
75
72
|
import './foundry.js/textureLoader';
|
76
73
|
import './foundry.js/textureUtils';
|
77
|
-
import './foundry.js/types';
|
78
74
|
import './foundry.js/userTargets';
|
79
75
|
import './foundry.js/utils';
|
80
76
|
import './foundry.js/videoHelper';
|
@@ -103,6 +103,12 @@ export type PlaceableDocumentType =
|
|
103
103
|
| 'Token'
|
104
104
|
| 'Wall';
|
105
105
|
|
106
|
+
export type DocumentSubTypes<T extends DocumentType> = 'type' extends keyof InstanceType<
|
107
|
+
ConfiguredDocumentClassForName<T>
|
108
|
+
>['data']
|
109
|
+
? InstanceType<ConfiguredDocumentClassForName<T>>['data']['type']
|
110
|
+
: typeof foundry.CONST.BASE_DOCUMENT_TYPE;
|
111
|
+
|
106
112
|
export type ConfiguredDocumentClassForName<Name extends DocumentType> = CONFIG[Name]['documentClass'];
|
107
113
|
|
108
114
|
export type ConfiguredObjectClassForName<Name extends PlaceableDocumentType> = CONFIG[Name]['objectClass'];
|