@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
@@ -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 {
|
@@ -11,7 +11,7 @@ declare global {
|
|
11
11
|
/**
|
12
12
|
* A reference to the PointSource object which defines this light source area of effect
|
13
13
|
*/
|
14
|
-
source:
|
14
|
+
source: LightSource;
|
15
15
|
|
16
16
|
/**
|
17
17
|
* A reference to the ControlIcon used to configure this light
|
@@ -25,6 +25,11 @@ declare global {
|
|
25
25
|
/** @override */
|
26
26
|
get bounds(): NormalizedRectangle;
|
27
27
|
|
28
|
+
/**
|
29
|
+
* A convenience accessor to the LightData configuration object
|
30
|
+
*/
|
31
|
+
get config(): foundry.data.LightData;
|
32
|
+
|
28
33
|
/**
|
29
34
|
* Test whether a specific AmbientLight source provides global illumination
|
30
35
|
*/
|
@@ -53,6 +58,9 @@ declare global {
|
|
53
58
|
/** @override */
|
54
59
|
draw(): Promise<this>;
|
55
60
|
|
61
|
+
/** @override */
|
62
|
+
destroy(options?: Parameters<PlaceableObject['destroy']>[0]): void;
|
63
|
+
|
56
64
|
/**
|
57
65
|
* Draw the ControlIcon for the AmbientLight
|
58
66
|
* @internal
|
@@ -74,12 +82,9 @@ declare global {
|
|
74
82
|
|
75
83
|
/**
|
76
84
|
* Update the source object associated with this light
|
77
|
-
* @param
|
78
|
-
* (default: `false`)
|
79
|
-
* @param deleted - Indicate that this light source has been deleted.
|
80
|
-
* (default: `false`)
|
85
|
+
* @param options - (default: `{}}`)
|
81
86
|
*/
|
82
|
-
updateSource(
|
87
|
+
updateSource(options?: AmbientLight.UpdateSourceOptions | undefined): void;
|
83
88
|
|
84
89
|
/** @override */
|
85
90
|
protected _onCreate(
|
@@ -116,4 +121,20 @@ declare global {
|
|
116
121
|
/** @override */
|
117
122
|
protected _onDragLeftCancel(event: MouseEvent): void;
|
118
123
|
}
|
124
|
+
|
125
|
+
namespace AmbientLight {
|
126
|
+
interface UpdateSourceOptions {
|
127
|
+
/**
|
128
|
+
* Defer refreshing the LightingLayer to manually call that refresh later.
|
129
|
+
* @defaultValue `false`
|
130
|
+
*/
|
131
|
+
defer?: boolean | undefined;
|
132
|
+
|
133
|
+
/**
|
134
|
+
* Indicate that this light source has been deleted.
|
135
|
+
* @defaultValue `false`
|
136
|
+
*/
|
137
|
+
deleted?: boolean | undefined;
|
138
|
+
}
|
139
|
+
}
|
119
140
|
}
|
@@ -13,6 +13,11 @@ declare global {
|
|
13
13
|
*/
|
14
14
|
sound: Sound | null;
|
15
15
|
|
16
|
+
/**
|
17
|
+
* A SoundSource object which manages the area of effect for this ambient sound
|
18
|
+
*/
|
19
|
+
source: SoundSource;
|
20
|
+
|
16
21
|
/** @override */
|
17
22
|
static embeddedName: 'AmbientSound';
|
18
23
|
|
@@ -27,10 +32,13 @@ declare global {
|
|
27
32
|
*/
|
28
33
|
get isAudible(): boolean;
|
29
34
|
|
35
|
+
/** @override */
|
36
|
+
get bounds(): Rectangle;
|
37
|
+
|
30
38
|
/**
|
31
|
-
*
|
39
|
+
* The named identified for the source object associated with this ambient sound
|
32
40
|
*/
|
33
|
-
get
|
41
|
+
get sourceId(): string;
|
34
42
|
|
35
43
|
/**
|
36
44
|
* A convenience accessor for the sound radius in pixels
|
@@ -51,6 +59,9 @@ declare global {
|
|
51
59
|
/** @override */
|
52
60
|
draw(): Promise<this>;
|
53
61
|
|
62
|
+
/** @override */
|
63
|
+
destroy(options?: Parameters<PlaceableObject['destroy']>[0]): void;
|
64
|
+
|
54
65
|
/**
|
55
66
|
* Draw the graphical preview of the audio source area of effect
|
56
67
|
* @internal
|
@@ -73,9 +84,9 @@ declare global {
|
|
73
84
|
|
74
85
|
/**
|
75
86
|
* Compute the field-of-vision for an object, determining its effective line-of-sight and field-of-vision polygons
|
76
|
-
* @
|
87
|
+
* @param options - (default: `{}`)
|
77
88
|
*/
|
78
|
-
updateSource(
|
89
|
+
updateSource(options?: AmbientSound.UpdateSourceOptions | undefined): void;
|
79
90
|
|
80
91
|
/** @override */
|
81
92
|
protected _onCreate(
|
@@ -115,5 +126,19 @@ declare global {
|
|
115
126
|
*/
|
116
127
|
fade: number;
|
117
128
|
}
|
129
|
+
|
130
|
+
interface UpdateSourceOptions {
|
131
|
+
/**
|
132
|
+
* Defer refreshing the SoundsLayer to manually call that refresh later.
|
133
|
+
* @defaultValue `false`
|
134
|
+
*/
|
135
|
+
defer?: boolean | undefined;
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Indicate that this SoundSource has been deleted.
|
139
|
+
* @defaultValue `false`
|
140
|
+
*/
|
141
|
+
deleted?: boolean | undefined;
|
142
|
+
}
|
118
143
|
}
|
119
144
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ConfiguredDocumentClass } from '../../../../../types/helperTypes';
|
1
|
+
import { ConfiguredDocumentClass, ConfiguredDocumentClassForName } from '../../../../../types/helperTypes';
|
2
2
|
import { DocumentModificationOptions } from '../../../../common/abstract/document.mjs';
|
3
3
|
|
4
4
|
declare global {
|
@@ -40,18 +40,25 @@ declare global {
|
|
40
40
|
/**
|
41
41
|
* Internal timestamp for the previous freehand draw time, to limit sampling
|
42
42
|
* @defaultValue `0`
|
43
|
+
* @internal
|
43
44
|
*/
|
44
45
|
protected _drawTime: number;
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @defaultValue `0`
|
49
|
+
* @internal
|
50
|
+
*/
|
45
51
|
protected _sampleTime: number;
|
46
52
|
|
47
53
|
/**
|
48
54
|
* Internal flag for the permanent points of the polygon
|
49
55
|
* @defaultValue `foundry.utils.deepClone(this.data.points || [])`
|
56
|
+
* @internal
|
50
57
|
*/
|
51
58
|
protected _fixedPoints: Array<[x: number, y: number]>;
|
52
59
|
|
53
60
|
/** @override */
|
54
|
-
static
|
61
|
+
static embeddedName: 'Drawing';
|
55
62
|
|
56
63
|
/**
|
57
64
|
* The rate at which points are sampled (in milliseconds) during a freehand drawing workflow
|
@@ -59,6 +66,9 @@ declare global {
|
|
59
66
|
*/
|
60
67
|
static FREEHAND_SAMPLE_RATE: number;
|
61
68
|
|
69
|
+
/** @override */
|
70
|
+
get bounds(): Rectangle;
|
71
|
+
|
62
72
|
/**
|
63
73
|
* A Boolean flag for whether or not the Drawing utilizes a tiled texture background
|
64
74
|
*/
|
@@ -74,6 +84,7 @@ declare global {
|
|
74
84
|
|
75
85
|
/**
|
76
86
|
* Clean the drawing data to constrain its allowed position
|
87
|
+
* @internal
|
77
88
|
*/
|
78
89
|
protected _cleanData(): void;
|
79
90
|
|
@@ -84,11 +95,13 @@ declare global {
|
|
84
95
|
|
85
96
|
/**
|
86
97
|
* Create elements for the foreground text
|
98
|
+
* @internal
|
87
99
|
*/
|
88
100
|
protected _createText(): PreciseText;
|
89
101
|
|
90
102
|
/**
|
91
103
|
* Create elements for the Drawing border and handles
|
104
|
+
* @internal
|
92
105
|
*/
|
93
106
|
protected _createFrame(): void;
|
94
107
|
|
@@ -97,21 +110,25 @@ declare global {
|
|
97
110
|
|
98
111
|
/**
|
99
112
|
* Draw rectangular shapes
|
113
|
+
* @internal
|
100
114
|
*/
|
101
115
|
protected _drawRectangle(): void;
|
102
116
|
|
103
117
|
/**
|
104
118
|
* Draw ellipsoid shapes
|
119
|
+
* @internal
|
105
120
|
*/
|
106
121
|
protected _drawEllipse(): void;
|
107
122
|
|
108
123
|
/**
|
109
124
|
* Draw polygonal shapes
|
125
|
+
* @internal
|
110
126
|
*/
|
111
127
|
protected _drawPolygon(): void;
|
112
128
|
|
113
129
|
/**
|
114
130
|
* Draw freehand shapes with bezier spline smoothing
|
131
|
+
* @internal
|
115
132
|
*/
|
116
133
|
protected _drawFreehand(): void;
|
117
134
|
|
@@ -122,6 +139,7 @@ declare global {
|
|
122
139
|
* @param previous - The prior point
|
123
140
|
* @param point - The current point
|
124
141
|
* @param next - The next point
|
142
|
+
* @internal
|
125
143
|
*/
|
126
144
|
protected _getBezierControlPoints(
|
127
145
|
factor: number,
|
@@ -141,17 +159,20 @@ declare global {
|
|
141
159
|
|
142
160
|
/**
|
143
161
|
* Refresh the boundary frame which outlines the Drawing shape
|
162
|
+
* @internal
|
144
163
|
*/
|
145
164
|
protected _refreshFrame({ x, y, width, height }: Rectangle): void;
|
146
165
|
|
147
166
|
/**
|
148
167
|
* Add a new polygon point to the drawing, ensuring it differs from the last one
|
149
168
|
* @param temporary - (default: `true`)
|
169
|
+
* @internal
|
150
170
|
*/
|
151
171
|
protected _addPoint(position: Point, temporary?: boolean): void;
|
152
172
|
|
153
173
|
/**
|
154
174
|
* Remove the last fixed point from the polygon
|
175
|
+
* @internal
|
155
176
|
*/
|
156
177
|
protected _removePoint(): void;
|
157
178
|
|
@@ -166,13 +187,9 @@ declare global {
|
|
166
187
|
|
167
188
|
/**
|
168
189
|
* Handle text entry in an active text tool
|
190
|
+
* @internal
|
169
191
|
*/
|
170
|
-
protected _onDrawingTextKeydown(
|
171
|
-
event: KeyboardEvent
|
172
|
-
):
|
173
|
-
| ReturnType<InstanceType<ConfiguredDocumentClass<typeof DrawingDocument>>['update']>
|
174
|
-
| ReturnType<InstanceType<ConfiguredDocumentClass<typeof DrawingDocument>>['delete']>
|
175
|
-
| void;
|
192
|
+
protected _onDrawingTextKeydown(event: KeyboardEvent): void;
|
176
193
|
|
177
194
|
/** @override */
|
178
195
|
protected _onUpdate(data: DeepPartial<foundry.data.DrawingData['_source']>): void;
|
@@ -181,20 +198,21 @@ declare global {
|
|
181
198
|
* @override
|
182
199
|
* @param event - unused
|
183
200
|
*/
|
184
|
-
protected _canControl(user: User
|
201
|
+
protected _canControl(user: InstanceType<ConfiguredDocumentClassForName<'User'>>, event?: any): boolean;
|
185
202
|
|
186
203
|
/**
|
187
204
|
* @override
|
188
205
|
* @param user - unused
|
189
206
|
* @param event - unused
|
190
207
|
*/
|
191
|
-
protected _canConfigure(user: User
|
208
|
+
protected _canConfigure(user: InstanceType<ConfiguredDocumentClassForName<'User'>>, event?: any): boolean;
|
192
209
|
|
193
210
|
/** @override */
|
194
211
|
activateListeners(): void;
|
195
212
|
|
196
213
|
/**
|
197
214
|
* Handle mouse movement which modifies the dimensions of the drawn shape
|
215
|
+
* @internal
|
198
216
|
*/
|
199
217
|
protected _onMouseDraw(event: PIXI.InteractionEvent): void;
|
200
218
|
|
@@ -213,35 +231,41 @@ declare global {
|
|
213
231
|
/**
|
214
232
|
* Handle mouse-over event on a control handle
|
215
233
|
* @param event - The mouseover event
|
234
|
+
* @internal
|
216
235
|
*/
|
217
236
|
protected _onHandleHoverIn(event: PIXI.InteractionEvent): void;
|
218
237
|
|
219
238
|
/**
|
220
239
|
* Handle mouse-out event on a control handle
|
221
240
|
* @param event - The mouseout event
|
241
|
+
* @internal
|
222
242
|
*/
|
223
243
|
protected _onHandleHoverOut(event: PIXI.InteractionEvent): void;
|
224
244
|
|
225
245
|
/**
|
226
246
|
* When we start a drag event - create a preview copy of the Tile for re-positioning
|
227
247
|
* @param event - The mousedown event
|
248
|
+
* @internal
|
228
249
|
*/
|
229
250
|
protected _onHandleMouseDown(event: PIXI.InteractionEvent): void;
|
230
251
|
|
231
252
|
/**
|
232
253
|
* Handle the beginning of a drag event on a resize handle
|
254
|
+
* @internal
|
233
255
|
*/
|
234
256
|
protected _onHandleDragStart(event: PIXI.InteractionEvent): void;
|
235
257
|
|
236
258
|
/**
|
237
259
|
* Handle mousemove while dragging a tile scale handler
|
238
260
|
* @param event - The mousemove event
|
261
|
+
* @internal
|
239
262
|
*/
|
240
263
|
protected _onHandleDragMove(event: PIXI.InteractionEvent): void;
|
241
264
|
|
242
265
|
/**
|
243
266
|
* Handle mouseup after dragging a tile scale handler
|
244
267
|
* @param event - The mouseup event
|
268
|
+
* @internal
|
245
269
|
*/
|
246
270
|
protected _onHandleDragDrop(
|
247
271
|
event: PIXI.InteractionEvent
|
@@ -249,6 +273,7 @@ declare global {
|
|
249
273
|
|
250
274
|
/**
|
251
275
|
* Handle cancellation of a drag event for one of the resizing handles
|
276
|
+
* @internal
|
252
277
|
*/
|
253
278
|
protected _onHandleDragCancel(event: PIXI.InteractionEvent): void;
|
254
279
|
|
@@ -257,6 +282,7 @@ declare global {
|
|
257
282
|
* @param original - The original drawing data
|
258
283
|
* @param dx - The pixel distance dragged in the horizontal direction
|
259
284
|
* @param dy - The pixel distance dragged in the vertical direction
|
285
|
+
* @internal
|
260
286
|
*/
|
261
287
|
protected _rescaleDimensions(
|
262
288
|
original: Pick<foundry.data.DrawingData['_source'], 'x' | 'y' | 'points' | 'width' | 'height'>,
|
@@ -269,19 +295,10 @@ declare global {
|
|
269
295
|
* @param data - The Drawing data pending update
|
270
296
|
* @returns The adjusted data
|
271
297
|
* @remarks This is intentionally public because it is called by the DrawingsLayer
|
298
|
+
* @internal
|
272
299
|
*/
|
273
300
|
static normalizeShape(
|
274
301
|
data: Pick<foundry.data.DrawingData['_source'], 'x' | 'y' | 'width' | 'height' | 'points'>
|
275
302
|
): Pick<foundry.data.DrawingData['_source'], 'x' | 'y' | 'width' | 'height' | 'points'>;
|
276
|
-
|
277
|
-
/**
|
278
|
-
* @deprecated since 0.8.0
|
279
|
-
*/
|
280
|
-
get author(): InstanceType<ConfiguredDocumentClass<typeof User>>;
|
281
|
-
|
282
|
-
/**
|
283
|
-
* @deprecated since 0.8.0
|
284
|
-
*/
|
285
|
-
get owner(): boolean;
|
286
303
|
}
|
287
304
|
}
|
@@ -3,36 +3,49 @@ import { DocumentModificationOptions } from '../../../../common/abstract/documen
|
|
3
3
|
|
4
4
|
declare global {
|
5
5
|
/**
|
6
|
-
* A
|
7
|
-
*
|
6
|
+
* A type of Placeable Object which highlights an area of the grid as covered by some area of effect.
|
7
|
+
* @see {@link MeasuredTemplateDocument}
|
8
|
+
* @see {@link TemplateLayer}
|
8
9
|
*/
|
9
10
|
class MeasuredTemplate extends PlaceableObject<
|
10
11
|
InstanceType<ConfiguredDocumentClass<typeof MeasuredTemplateDocument>>
|
11
12
|
> {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
/**
|
14
|
+
* The geometry shape used for testing point intersection
|
15
|
+
* @defaultValue `undefined`
|
16
|
+
*/
|
17
|
+
shape: PIXI.Circle | PIXI.Ellipse | PIXI.Polygon | PIXI.Rectangle | PIXI.RoundedRectangle | undefined;
|
17
18
|
|
18
19
|
/**
|
19
20
|
* The tiling texture used for this template, if any
|
20
21
|
*/
|
21
|
-
texture: PIXI.Texture |
|
22
|
+
texture: PIXI.Texture | undefined;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* The template graphics
|
26
|
+
* @defaultValue `undefined`
|
27
|
+
*/
|
28
|
+
template: PIXI.Graphics | undefined;
|
22
29
|
|
23
30
|
/**
|
24
|
-
* The
|
31
|
+
* The UI frame container which depicts Token metadata and status, displayed in the ControlsLayer.
|
32
|
+
* @defaultValue `new ObjectHUD(this)`
|
25
33
|
*/
|
26
|
-
|
34
|
+
hud: MeasuredTemplate.ObjectHUD;
|
27
35
|
|
28
36
|
/**
|
29
37
|
* Internal property used to configure the control border thickness
|
38
|
+
* @defaultValue `3`
|
39
|
+
* @internal
|
30
40
|
*/
|
31
41
|
protected _borderThickness: number;
|
32
42
|
|
33
43
|
/** @override */
|
34
44
|
static embeddedName: 'MeasuredTemplate';
|
35
45
|
|
46
|
+
/** @override */
|
47
|
+
get bounds(): Rectangle;
|
48
|
+
|
36
49
|
/**
|
37
50
|
* A convenience accessor for the border color as a numeric hex code
|
38
51
|
*/
|
@@ -51,13 +64,24 @@ declare global {
|
|
51
64
|
/** @override */
|
52
65
|
draw(): Promise<this>;
|
53
66
|
|
67
|
+
/** @override */
|
68
|
+
destroy(options?: Parameters<PlaceableObject['destroy']>[0]): void;
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Draw the HUD container which provides an interface for managing this template
|
72
|
+
* @internal
|
73
|
+
*/
|
74
|
+
protected _drawHUD(): MeasuredTemplate.InitializedObjectHUD;
|
75
|
+
|
54
76
|
/**
|
55
77
|
* Draw the ControlIcon for the MeasuredTemplate
|
78
|
+
* @internal
|
56
79
|
*/
|
57
80
|
protected _drawControlIcon(): ControlIcon;
|
58
81
|
|
59
82
|
/**
|
60
83
|
* Draw the Text label used for the MeasuredTemplate
|
84
|
+
* @internal
|
61
85
|
*/
|
62
86
|
protected _drawRulerText(): PreciseText;
|
63
87
|
|
@@ -66,31 +90,31 @@ declare global {
|
|
66
90
|
|
67
91
|
/**
|
68
92
|
* Get a Circular area of effect given a radius of effect
|
93
|
+
* @internal
|
69
94
|
*/
|
70
95
|
protected _getCircleShape(distance: number): PIXI.Circle;
|
71
96
|
|
72
97
|
/**
|
73
98
|
* Get a Conical area of effect given a direction, angle, and distance
|
99
|
+
* @internal
|
74
100
|
*/
|
75
101
|
protected _getConeShape(direction: number, angle: number, distance: number): PIXI.Polygon;
|
76
102
|
|
77
103
|
/**
|
78
104
|
* Get a Rectangular area of effect given a width and height
|
105
|
+
* @internal
|
79
106
|
*/
|
80
107
|
protected _getRectShape(direction: number, distance: number): NormalizedRectangle;
|
81
108
|
|
82
109
|
/**
|
83
110
|
* Get a rotated Rectangular area of effect given a width, height, and direction
|
111
|
+
* @internal
|
84
112
|
*/
|
85
113
|
protected _getRayShape(direction: number, distance: number, width: number): PIXI.Polygon;
|
86
114
|
|
87
|
-
/**
|
88
|
-
* Draw the rotation control handle and assign event listeners
|
89
|
-
*/
|
90
|
-
protected _drawRotationHandle(radius: number): void;
|
91
|
-
|
92
115
|
/**
|
93
116
|
* Update the displayed ruler tooltip text
|
117
|
+
* @internal
|
94
118
|
*/
|
95
119
|
protected _refreshRulerText(): void;
|
96
120
|
|
@@ -121,4 +145,20 @@ declare global {
|
|
121
145
|
/** @override */
|
122
146
|
protected _onDelete(options: DocumentModificationOptions, userId: string): void;
|
123
147
|
}
|
148
|
+
|
149
|
+
namespace MeasuredTemplate {
|
150
|
+
interface ObjectHUD extends globalThis.ObjectHUD {
|
151
|
+
/**
|
152
|
+
* Template control icon
|
153
|
+
*/
|
154
|
+
icon?: ControlIcon;
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Ruler text tooltip
|
158
|
+
*/
|
159
|
+
ruler?: PreciseText;
|
160
|
+
}
|
161
|
+
|
162
|
+
type InitializedObjectHUD = RequiredProps<ObjectHUD, 'icon' | 'ruler'>;
|
163
|
+
}
|
124
164
|
}
|
@@ -4,11 +4,14 @@ import { HoverInOptions } from '../placeableObject';
|
|
4
4
|
declare global {
|
5
5
|
/**
|
6
6
|
* A Note is an implementation of PlaceableObject which represents an annotated location within the Scene.
|
7
|
-
* Each Note links to a JournalEntry
|
7
|
+
* Each Note links to a JournalEntry document and represents its location on the map.
|
8
8
|
*/
|
9
9
|
class Note extends PlaceableObject<InstanceType<ConfiguredDocumentClass<typeof NoteDocument>>> {
|
10
10
|
/** @override */
|
11
|
-
static
|
11
|
+
static embeddedName: 'Note';
|
12
|
+
|
13
|
+
/** @override */
|
14
|
+
get bounds(): Rectangle;
|
12
15
|
|
13
16
|
/**
|
14
17
|
* The associated JournalEntry which is described by this note
|
@@ -25,6 +28,13 @@ declare global {
|
|
25
28
|
*/
|
26
29
|
get size(): number;
|
27
30
|
|
31
|
+
/**
|
32
|
+
* Determine whether the Note is visible to the current user based on their perspective of the Scene.
|
33
|
+
* Visibility depends on permission to the underlying journal entry, as well as the perspective of controlled Tokens.
|
34
|
+
* If Token Vision is required, the user must have a token with vision over the note to see it.
|
35
|
+
*/
|
36
|
+
get isVisible(): boolean;
|
37
|
+
|
28
38
|
/** @override */
|
29
39
|
draw(): Promise<this>;
|
30
40
|
|