@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250718083253 → 13.346.0-beta.20250719181625
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/package.json +1 -1
- package/src/foundry/client/canvas/containers/advanced/cached-container.d.mts +15 -15
- package/src/foundry/client/canvas/containers/advanced/full-canvas-mixin.d.mts +2 -2
- package/src/foundry/client/canvas/containers/elements/control-icon.d.mts +12 -32
- package/src/foundry/client/canvas/containers/elements/cursor.d.mts +14 -1
- package/src/foundry/client/canvas/containers/elements/door-control.d.mts +2 -2
- package/src/foundry/client/canvas/containers/elements/door-mesh.d.mts +215 -3
- package/src/foundry/client/canvas/containers/elements/grid-highlight.d.mts +3 -3
- package/src/foundry/client/canvas/containers/elements/grid-mesh.d.mts +4 -4
- package/src/foundry/client/canvas/containers/elements/particles/leaves.d.mts +7 -6
- package/src/foundry/client/canvas/containers/elements/particles/particle-effect.d.mts +4 -5
- package/src/foundry/client/canvas/containers/elements/point-source-mesh.d.mts +18 -23
- package/src/foundry/client/canvas/containers/elements/precise-text.d.mts +9 -10
- package/src/foundry/client/canvas/containers/elements/quad-mesh.d.mts +1 -2
- package/src/foundry/client/canvas/containers/elements/resize-handle.d.mts +37 -11
- package/src/foundry/client/canvas/containers/elements/sprite-mesh.d.mts +34 -26
- package/src/foundry/client/canvas/layers/masks/depth.d.mts +1 -1
- package/src/foundry/client/canvas/layers/masks/occlusion.d.mts +1 -1
- package/src/foundry/client/canvas/primary/primary-canvas-container.d.mts +32 -0
- package/src/foundry/client/canvas/primary/primary-canvas-object.d.mts +39 -38
- package/src/foundry/client/canvas/primary/primary-graphics.d.mts +22 -18
- package/src/foundry/client/canvas/primary/primary-occludable-object.d.mts +59 -29
- package/src/foundry/client/canvas/primary/primary-particle-effect.d.mts +51 -0
- package/src/foundry/client/canvas/primary/primary-sprite-mesh.d.mts +72 -66
- package/src/foundry/client/config.d.mts +444 -311
- package/src/foundry/client/documents/collections/actors.d.mts +2 -2
- package/src/foundry/client/documents/collections/card-stacks.d.mts +2 -2
- package/src/foundry/client/documents/collections/chat-messages.d.mts +2 -2
- package/src/foundry/client/documents/collections/combat-encounters.d.mts +2 -2
- package/src/foundry/client/documents/collections/fog-explorations.d.mts +2 -2
- package/src/foundry/client/documents/collections/folders.d.mts +2 -2
- package/src/foundry/client/documents/collections/items.d.mts +2 -2
- package/src/foundry/client/documents/collections/journal.d.mts +2 -2
- package/src/foundry/client/documents/collections/macros.d.mts +2 -2
- package/src/foundry/client/documents/collections/playlists.d.mts +2 -2
- package/src/foundry/client/documents/collections/roll-tables.d.mts +2 -2
- package/src/foundry/client/documents/collections/scenes.d.mts +2 -2
- package/src/foundry/client/documents/collections/users.d.mts +2 -2
- package/src/foundry/client/documents/collections/world-settings.d.mts +2 -2
- package/src/foundry/client/documents/wall.d.mts +13 -2
- package/src/foundry/common/abstract/document.d.mts +22 -12
@@ -1,26 +1,27 @@
|
|
1
|
-
import type { Identity,
|
1
|
+
import type { Identity, InexactPartial } from "#utils";
|
2
2
|
import type { PrimaryCanvasObjectMixin } from "./_module.d.mts";
|
3
3
|
import type { PlaceableObject } from "#client/canvas/placeables/_module.d.mts";
|
4
4
|
|
5
5
|
/**
|
6
6
|
* A basic PCO which is handling drawings of any shape.
|
7
7
|
*/
|
8
|
-
declare class PrimaryGraphics extends PrimaryCanvasObjectMixin(PIXI.
|
8
|
+
declare class PrimaryGraphics extends PrimaryCanvasObjectMixin(PIXI.smooth.SmoothGraphics) {
|
9
9
|
/**
|
10
10
|
* @param options - A config object
|
11
|
+
* @remarks Passing a {@linkcode PIXI.smooth.SmoothGraphicsGeometry} instead of an `options` should be supported here,
|
12
|
+
* but has been disabled due to a core bug: {@link https://github.com/foundryvtt/foundryvtt/issues/13170}
|
13
|
+
*
|
14
|
+
* If you need to pass a specific geometry instead of using a default `new SmoothGraphicsGeometry`, pass it as `options.geometry`.
|
11
15
|
*/
|
12
|
-
constructor(
|
13
|
-
/**
|
14
|
-
* @remarks Passing `null`, or an object where the `geometry` property is either missing or nullish, will result in an effective default of `new PIXI.GraphicsGeometry()`
|
15
|
-
*/
|
16
|
-
options?: PIXI.GraphicsGeometry | PrimaryGraphics.ConstructorOptions | null,
|
17
|
-
);
|
16
|
+
constructor(options?: PrimaryGraphics.ConstructorOptions);
|
18
17
|
|
19
|
-
override _calculateCanvasBounds(): void;
|
18
|
+
protected override _calculateCanvasBounds(): void;
|
20
19
|
|
21
20
|
override updateCanvasTransform(): void;
|
22
21
|
|
23
22
|
override containsCanvasPoint(point: PIXI.IPointData): boolean;
|
23
|
+
|
24
|
+
#PrimaryGraphics: true;
|
24
25
|
}
|
25
26
|
|
26
27
|
declare namespace PrimaryGraphics {
|
@@ -28,28 +29,31 @@ declare namespace PrimaryGraphics {
|
|
28
29
|
interface AnyConstructor extends Identity<typeof AnyPrimaryGraphics> {}
|
29
30
|
|
30
31
|
/** @internal */
|
31
|
-
type _ConstructorOptions =
|
32
|
+
type _ConstructorOptions = InexactPartial<{
|
32
33
|
/**
|
33
34
|
* A geometry passed to the graphics.
|
34
|
-
* @defaultValue
|
35
|
-
* @remarks Default
|
35
|
+
* @defaultValue {@linkcode PIXI.smooth.SmoothGraphicsGeometry | new PIXI.smooth.SmoothGraphicsGeometry()}
|
36
|
+
* @remarks Default applied in the {@linkcode PIXI.smooth.SmoothGraphics} constructor.
|
37
|
+
*
|
38
|
+
* @privateRemarks Foundry types this incorrectly because they didn't update it when they switched base classes:
|
39
|
+
* {@link https://github.com/foundryvtt/foundryvtt/issues/13170}
|
36
40
|
*/
|
37
|
-
geometry: PIXI.
|
41
|
+
geometry: PIXI.smooth.SmoothGraphicsGeometry;
|
38
42
|
|
39
43
|
/**
|
40
44
|
* The name of the PCO.
|
41
45
|
* @defaultValue `null`
|
42
|
-
* @remarks Default via `?? null` in function body
|
43
46
|
*/
|
44
|
-
name: string;
|
47
|
+
name: string | null;
|
45
48
|
|
46
49
|
/**
|
47
50
|
* Any object that owns this PCO.
|
48
51
|
* @defaultValue `null`
|
49
|
-
* @remarks
|
50
|
-
*
|
52
|
+
* @remarks Foundry types as `*`, but the only place this class sees core use it's in {@linkcode PrimaryCanvasGroup.addDrawing | PrimaryCanvasGroup#addDrawing}
|
53
|
+
*
|
54
|
+
* See {@linkcode PrimaryCanvasObjectMixin.AnyMixed.object | PrimaryCanvasObject#object}
|
51
55
|
*/
|
52
|
-
object: PlaceableObject.Any;
|
56
|
+
object: PlaceableObject.Any | null;
|
53
57
|
}>;
|
54
58
|
|
55
59
|
interface ConstructorOptions extends _ConstructorOptions {}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { FixedInstanceType,
|
1
|
+
import type { FixedInstanceType, InexactPartial, Mixin } from "#utils";
|
2
2
|
import type { PrimaryCanvasObjectMixin } from "./_module.d.mts";
|
3
3
|
import type { Token } from "#client/canvas/placeables/_module.d.mts";
|
4
4
|
|
@@ -21,7 +21,7 @@ declare class PrimaryOccludableObject {
|
|
21
21
|
|
22
22
|
/**
|
23
23
|
* The occlusion mode of this occludable object.
|
24
|
-
* @defaultValue
|
24
|
+
* @defaultValue {@linkcode CONST.OCCLUSION_MODES.NONE}
|
25
25
|
*/
|
26
26
|
occlusionMode: CONST.OCCLUSION_MODES;
|
27
27
|
|
@@ -39,7 +39,6 @@ declare class PrimaryOccludableObject {
|
|
39
39
|
|
40
40
|
/**
|
41
41
|
* Fade this object on hover?
|
42
|
-
* @defaultValue `true`
|
43
42
|
*/
|
44
43
|
get hoverFade(): boolean;
|
45
44
|
|
@@ -55,9 +54,11 @@ declare class PrimaryOccludableObject {
|
|
55
54
|
* vision: 0.0
|
56
55
|
* }
|
57
56
|
* ```
|
58
|
-
* @
|
57
|
+
* @internal
|
58
|
+
* @remarks Accessed externally in {@linkcode foundry.canvas.rendering.shaders.DepthSamplerShader._preRender | DepthSamplerShader#_preRender}
|
59
|
+
* and {@linkcode foundry.canvas.rendering.shaders.OccludableSamplerShader._preRender | OccludableSamplerShader#_preRender}
|
59
60
|
*/
|
60
|
-
_occlusionState: PrimaryOccludableObjectMixin.OcclusionState;
|
61
|
+
protected _occlusionState: PrimaryOccludableObjectMixin.OcclusionState;
|
61
62
|
|
62
63
|
/**
|
63
64
|
* The state of hover-fading.
|
@@ -66,21 +67,24 @@ declare class PrimaryOccludableObject {
|
|
66
67
|
* {
|
67
68
|
* hovered: false,
|
68
69
|
* hoveredTime: 0,
|
70
|
+
* _hoveredTime: 0,
|
69
71
|
* faded: false,
|
70
72
|
* fading: false,
|
71
73
|
* fadingTime: 0,
|
72
74
|
* occlusion: 0.0
|
73
75
|
* }
|
74
76
|
* ```
|
75
|
-
* @
|
77
|
+
* @internal
|
78
|
+
* @remarks Properties accessed and set remotely in {@linkcode foundry.canvas.groups.PrimaryCanvasGroup._onMouseMove | PrimaryCanvasGroup#_onMouseMove}
|
79
|
+
* and `##updateHoveredObjects`
|
76
80
|
*/
|
77
|
-
_hoverFadeState: PrimaryOccludableObjectMixin.HoverFadeState;
|
81
|
+
protected _hoverFadeState: PrimaryOccludableObjectMixin.HoverFadeState;
|
78
82
|
|
79
83
|
/**
|
80
84
|
* Get the blocking option bitmask value.
|
81
|
-
* @
|
85
|
+
* @internal
|
82
86
|
*/
|
83
|
-
get _restrictionState(): number;
|
87
|
+
protected get _restrictionState(): number;
|
84
88
|
|
85
89
|
/**
|
86
90
|
* Is this object blocking light?
|
@@ -106,13 +110,19 @@ declare class PrimaryOccludableObject {
|
|
106
110
|
* change PCO appearance.
|
107
111
|
* Uses a 50ms debounce threshold.
|
108
112
|
* Objects which are in the hovered state remain occluded until their hovered state ends.
|
109
|
-
* @remarks Actually the return value of an arrow function passed to
|
113
|
+
* @remarks Actually the return value of an arrow function passed to {@linkcode foundry.utils.debounce} with a timeout of 50ms
|
110
114
|
*/
|
111
115
|
debounceSetOcclusion: (occluded: boolean) => boolean;
|
112
116
|
|
117
|
+
/**
|
118
|
+
* @remarks Actually an override of {@linkcode foundry.canvas.primary.CanvasTransformMixin.AnyMixed.updateCanvasTransform | CanvasTransformMixin#updateCanvasTransform}
|
119
|
+
*/
|
113
120
|
updateCanvasTransform(): void;
|
114
121
|
|
115
|
-
|
122
|
+
/**
|
123
|
+
* @remarks Actually an override of {@linkcode foundry.canvas.primary.PrimaryCanvasObjectMixin.AnyMixed._shouldRenderDepth | PrimaryCanvasObjectMixin#_shouldRenderDepth}
|
124
|
+
*/
|
125
|
+
protected _shouldRenderDepth(): boolean;
|
116
126
|
|
117
127
|
/**
|
118
128
|
* Test whether a specific Token occludes this PCO.
|
@@ -124,28 +134,24 @@ declare class PrimaryOccludableObject {
|
|
124
134
|
testOcclusion(token: Token.Implementation, options?: PrimaryOccludableObjectMixin.TestOcclusionOptions): boolean;
|
125
135
|
|
126
136
|
/**
|
127
|
-
* @deprecated
|
128
|
-
* @
|
137
|
+
* @deprecated "`#roof` is deprecated in favor of more granular options: {@linkcode PrimaryOccludableObject.restrictsLight | #restrictsLight}
|
138
|
+
* and {@linkcode PrimaryOccludableObject.restrictsWeather | #restrictsWeather}" (since v12, until v14)
|
129
139
|
*/
|
130
140
|
get roof(): boolean;
|
131
141
|
|
132
142
|
/**
|
133
|
-
* @deprecated
|
134
|
-
* @
|
143
|
+
* @deprecated "`#roof` is deprecated in favor of more granular options: {@linkcode PrimaryOccludableObject.restrictsLight | #restrictsLight}
|
144
|
+
* and {@linkcode PrimaryOccludableObject.restrictsWeather | #restrictsWeather}" (since v12, until v14)
|
135
145
|
*/
|
136
146
|
set roof(enabled);
|
137
147
|
|
138
148
|
/**
|
139
149
|
* @deprecated since v12, will be removed in v14
|
140
|
-
* @remarks "
|
150
|
+
* @remarks "`#containsPixel` is deprecated. Use {@linkcode PrimaryOccludableObject.containsCanvasPoint | #containsCanvasPoint} instead."
|
141
151
|
*/
|
142
152
|
containsPixel(x: number, y: number, alphaThreshold?: number): boolean;
|
143
153
|
|
144
|
-
|
145
|
-
* @deprecated since v11, will be removed in v13
|
146
|
-
* @remarks "PrimaryCanvasObject#renderOcclusion is deprecated in favor of PrimaryCanvasObject#renderDepth"
|
147
|
-
*/
|
148
|
-
renderOcclusion(renderer: PIXI.Renderer): void;
|
154
|
+
#PrimaryOccludableObject: true;
|
149
155
|
}
|
150
156
|
|
151
157
|
declare function PrimaryOccludableObjectMixin<BaseClass extends PrimaryOccludableObjectMixin.BaseClass>(
|
@@ -159,10 +165,10 @@ declare namespace PrimaryOccludableObjectMixin {
|
|
159
165
|
type BaseClass = PIXI.Container.AnyConstructor;
|
160
166
|
|
161
167
|
/** @internal */
|
162
|
-
type _TestOcclusionOptions =
|
168
|
+
type _TestOcclusionOptions = InexactPartial<{
|
163
169
|
/**
|
164
170
|
* Test corners of the hit-box in addition to the token center?
|
165
|
-
* @defaultValue `
|
171
|
+
* @defaultValue `true`
|
166
172
|
*/
|
167
173
|
corners: boolean;
|
168
174
|
}>;
|
@@ -182,22 +188,46 @@ declare namespace PrimaryOccludableObjectMixin {
|
|
182
188
|
}
|
183
189
|
|
184
190
|
interface HoverFadeState {
|
185
|
-
/**
|
191
|
+
/**
|
192
|
+
* The hovered state
|
193
|
+
* @defaultValue `false`
|
194
|
+
*/
|
186
195
|
hovered: boolean;
|
187
196
|
|
188
|
-
/**
|
197
|
+
/**
|
198
|
+
* The last time when a mouse event was hovering this object
|
199
|
+
* @defaultValue `0`
|
200
|
+
*/
|
189
201
|
hoveredTime: number;
|
190
202
|
|
191
|
-
/**
|
203
|
+
/**
|
204
|
+
* @defaultValue `0`
|
205
|
+
* @remarks Gets set to the previous `hoveredTime` in {@linkcode foundry.canvas.groups.PrimaryCanvasGroup._onMouseMove | PrimaryCanvasGroup#_onMouseMove}
|
206
|
+
*/
|
207
|
+
_hoveredTime: number;
|
208
|
+
|
209
|
+
/**
|
210
|
+
* The faded state
|
211
|
+
* @defaultValue `false`
|
212
|
+
*/
|
192
213
|
faded: boolean;
|
193
214
|
|
194
|
-
/**
|
215
|
+
/**
|
216
|
+
* The fading state
|
217
|
+
* @defaultValue `false`
|
218
|
+
*/
|
195
219
|
fading: boolean;
|
196
220
|
|
197
|
-
/**
|
221
|
+
/**
|
222
|
+
* The time the fade animation started
|
223
|
+
* @defaultValue `0`
|
224
|
+
*/
|
198
225
|
fadingTime: number;
|
199
226
|
|
200
|
-
/**
|
227
|
+
/**
|
228
|
+
* The amount of occlusion
|
229
|
+
* @defaultValue `0`
|
230
|
+
*/
|
201
231
|
occlusion: number;
|
202
232
|
}
|
203
233
|
}
|
@@ -1,7 +1,58 @@
|
|
1
1
|
import type { Identity } from "#utils";
|
2
|
+
import type { IDestroyOptions } from "pixi.js";
|
2
3
|
import type { CanvasTransformMixin } from "./primary-canvas-object.d.mts";
|
3
4
|
|
5
|
+
/**
|
6
|
+
* A configurable particle effect meant to be used in the PrimaryCanvasGroup.
|
7
|
+
* You must provide a full configuration object.
|
8
|
+
* @remarks "full configuration object" meaning something valid for passing to the {@linkcode PIXI.particles.Emitter} constructor.
|
9
|
+
* Any properties optional on the {@linkcode PIXI.particles.EmitterConfigV3 | EmitterConfigV3} interface remain optional.
|
10
|
+
* The {@linkcode PIXI.particles.EmitterConfigV3.autoUpdate | autoUpdate} and {@linkcode PIXI.particles.EmitterConfigV3.emit | emit}
|
11
|
+
* properties are forced `true` and `false`, respectively, before the emitter is created.
|
12
|
+
*
|
13
|
+
* This class is entirely unused as of 13.346
|
14
|
+
*/
|
4
15
|
declare class PrimaryParticleEffect extends CanvasTransformMixin(PIXI.Container) {
|
16
|
+
constructor(config: PIXI.particles.EmitterConfigV3);
|
17
|
+
|
18
|
+
/**
|
19
|
+
* A key which resolves ties amongst objects at the same elevation within the same layer.
|
20
|
+
*/
|
21
|
+
get sort(): number;
|
22
|
+
|
23
|
+
set sort(value);
|
24
|
+
|
25
|
+
/**
|
26
|
+
* The elevation of this container.
|
27
|
+
*/
|
28
|
+
get elevation(): number;
|
29
|
+
|
30
|
+
set elevation(value);
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Always false for a Primary Particle Effect.
|
34
|
+
*/
|
35
|
+
get shouldRenderDepth(): boolean;
|
36
|
+
|
37
|
+
override destroy(options?: IDestroyOptions | boolean): void;
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Initialize the emitter with optional configuration.
|
41
|
+
* @param config - Optional config object.
|
42
|
+
* @param play - Should we play immediately? False by default. (default: `false`)
|
43
|
+
*/
|
44
|
+
initialize(config: PIXI.particles.EmitterConfigV3, play?: boolean): void;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Begin animation for the configured emitter.
|
48
|
+
*/
|
49
|
+
play(): void;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Stop animation for the configured emitter.
|
53
|
+
*/
|
54
|
+
stop(): void;
|
55
|
+
|
5
56
|
#PrimaryParticleEffect: true;
|
6
57
|
}
|
7
58
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Identity, InexactPartial
|
1
|
+
import type { Identity, InexactPartial } from "#utils";
|
2
2
|
import type { PrimaryBaseSamplerShader } from "#client/canvas/rendering/shaders/_module.d.mts";
|
3
3
|
import type { TextureLoader } from "#client/canvas/_module.d.mts";
|
4
4
|
import type { SpriteMesh } from "#client/canvas/containers/_module.mjs";
|
@@ -10,37 +10,33 @@ import type { PlaceableObject } from "#client/canvas/placeables/_module.d.mts";
|
|
10
10
|
* A basic PCO sprite mesh which is handling occlusion and depth.
|
11
11
|
*/
|
12
12
|
declare class PrimarySpriteMesh extends PrimaryOccludableObjectMixin(SpriteMesh) {
|
13
|
+
/**
|
14
|
+
* @param options - Constructor options or a Texture
|
15
|
+
* @param shaderClass - A shader class for the sprite (default: {@linkcode foundry.canvas.rendering.shaders.PrimaryBaseSamplerShader | PrimaryBaseSamplerShader})
|
16
|
+
* @remarks If `options` is an object, `options.shaderClass` takes precedence over the `shaderClass` argument.
|
17
|
+
*/
|
13
18
|
constructor(
|
14
|
-
|
15
|
-
|
16
|
-
* @defaultValue `{}`
|
17
|
-
* @remarks Default is applied if `options` is `instanceof PIXI.Texture`, or neither that nor `instanceof Object`
|
18
|
-
*/
|
19
|
-
options?: PrimarySpriteMesh.ConstructorOptions | PIXI.Texture | null,
|
20
|
-
|
21
|
-
/**
|
22
|
-
* The shader class used to render this sprite.
|
23
|
-
* @defaultValue `PrimaryBaseSamplerShader`
|
24
|
-
* @remarks If `options` is an object, `options.shaderClass` takes precedence. If omitted,
|
25
|
-
* or if `options` is a `PIXI.Texture`, default is provided by `??` in function body.
|
26
|
-
*/
|
27
|
-
shaderClass?: PrimaryBaseSamplerShader.AnyConstructor | null,
|
19
|
+
options?: PrimarySpriteMesh.ConstructorOptions | PIXI.Texture,
|
20
|
+
shaderClass?: PrimaryBaseSamplerShader.AnyConstructor,
|
28
21
|
);
|
29
22
|
|
23
|
+
/** @privateRemarks Fake type override, {@linkcode _updateBatchData} dumps a bunch of extra properties in with no documentation */
|
24
|
+
protected override _batchData: PrimarySpriteMesh.BatchData;
|
25
|
+
|
30
26
|
/**
|
31
27
|
* The texture alpha data.
|
28
|
+
* @defaultValue `null`
|
32
29
|
*/
|
33
|
-
protected _textureAlphaData: TextureLoader.TextureAlphaData | null;
|
30
|
+
protected _textureAlphaData: TextureLoader.TextureAlphaData | null | undefined;
|
34
31
|
|
35
32
|
/**
|
36
|
-
* The texture alpha threshold used for point containment tests.
|
37
|
-
* If set to a value larger than 0, the texture alpha data is
|
33
|
+
* The texture alpha threshold used for point containment tests. If set to a value larger than 0, the texture alpha data is
|
38
34
|
* extracted from the texture at 25% resolution.
|
39
35
|
* @defaultValue `0`
|
40
36
|
*/
|
41
37
|
textureAlphaThreshold: number;
|
42
38
|
|
43
|
-
override _onTextureUpdate(): void;
|
39
|
+
protected override _onTextureUpdate(): void;
|
44
40
|
|
45
41
|
override setShaderClass(shaderClass: PrimaryBaseSamplerShader.AnyConstructor): void;
|
46
42
|
|
@@ -53,13 +49,13 @@ declare class PrimarySpriteMesh extends PrimaryOccludableObjectMixin(SpriteMesh)
|
|
53
49
|
*
|
54
50
|
* Additionally, It takes into account the desired fit options:
|
55
51
|
*
|
56
|
-
* - (default) "fill" computes the exact width and height ratio.
|
57
|
-
* - "cover" takes the maximum ratio of width and height and applies it to both.
|
58
|
-
* - "contain" takes the minimum ratio of width and height and applies it to both.
|
59
|
-
* - "width" applies the width ratio to both width and height.
|
60
|
-
* - "height" applies the height ratio to both width and height.
|
52
|
+
* - (default) `"fill"` computes the exact width and height ratio.
|
53
|
+
* - `"cover"` takes the maximum ratio of width and height and applies it to both.
|
54
|
+
* - `"contain"` takes the minimum ratio of width and height and applies it to both.
|
55
|
+
* - `"width"` applies the width ratio to both width and height.
|
56
|
+
* - `"height"` applies the height ratio to both width and height.
|
61
57
|
*
|
62
|
-
* You can also apply optional scaleX and scaleY options to both width and height. The scale is applied after fitting.
|
58
|
+
* You can also apply optional `scaleX` and `scaleY` options to both width and height. The scale is applied after fitting.
|
63
59
|
*
|
64
60
|
* **Important**: By using this helper, you don't need to set the height, width, and scale properties of the DisplayObject.
|
65
61
|
*
|
@@ -67,7 +63,8 @@ declare class PrimarySpriteMesh extends PrimaryOccludableObjectMixin(SpriteMesh)
|
|
67
63
|
* @param baseWidth - The base width used for computations.
|
68
64
|
* @param baseHeight - The base height used for computations.
|
69
65
|
* @param options - The options.
|
70
|
-
* @
|
66
|
+
* @remarks
|
67
|
+
* @throws If either `baseWidth` or `baseHeight` are `>= 0`
|
71
68
|
*/
|
72
69
|
resize(baseWidth: number, baseHeight: number, options?: PrimarySpriteMesh.ResizeOptions): void;
|
73
70
|
|
@@ -78,53 +75,43 @@ declare class PrimarySpriteMesh extends PrimaryOccludableObjectMixin(SpriteMesh)
|
|
78
75
|
/**
|
79
76
|
* Is the given point in canvas space contained in this object?
|
80
77
|
* @param point - The point in canvas space
|
81
|
-
* @param textureAlphaThreshold - The minimum texture alpha required for containment
|
78
|
+
* @param textureAlphaThreshold - The minimum texture alpha required for containment (default: {@linkcode PrimarySpriteMesh.textureAlphaThreshold | this.textureAlphaThreshold})
|
82
79
|
*/
|
83
|
-
containsCanvasPoint(
|
84
|
-
point: PIXI.IPointData,
|
85
|
-
|
86
|
-
/** @defaultValue `this.textureAlphaThreshold` */
|
87
|
-
textureAlphaThreshold?: number,
|
88
|
-
): boolean;
|
80
|
+
containsCanvasPoint(point: PIXI.IPointData, textureAlphaThreshold?: number): boolean;
|
89
81
|
|
90
82
|
/**
|
91
83
|
* Is the given point in world space contained in this object?
|
92
84
|
* @param point - The point in world space
|
93
|
-
* @param textureAlphaThreshold - The minimum texture alpha required for containment
|
85
|
+
* @param textureAlphaThreshold - The minimum texture alpha required for containment (default: {@linkcode PrimarySpriteMesh.textureAlphaThreshold | this.textureAlphaThreshold})
|
94
86
|
*/
|
95
|
-
containsPoint(
|
96
|
-
point: PIXI.IPointData,
|
97
|
-
|
98
|
-
/** @defaultValue `this.textureAlphaThreshold` */
|
99
|
-
textureAlphaThreshold?: number,
|
100
|
-
): boolean;
|
87
|
+
containsPoint(point: PIXI.IPointData, textureAlphaThreshold?: number): boolean;
|
101
88
|
|
102
89
|
override renderDepthData(renderer: PIXI.Renderer): void;
|
103
90
|
|
104
91
|
/**
|
105
|
-
* Render the sprite with ERASE blending.
|
92
|
+
* Render the sprite with {@linkcode PIXI.BLEND_MODES.ERASE | ERASE} blending.
|
106
93
|
* Note: The sprite must not have visible/renderable children.
|
107
94
|
* @param renderer - The renderer
|
95
|
+
* @internal
|
108
96
|
*/
|
109
97
|
protected _renderVoid(renderer: PIXI.Renderer): void;
|
110
98
|
|
111
99
|
/**
|
112
|
-
* @deprecated since v12,
|
113
|
-
* @remarks "#getPixelAlpha is deprecated without replacement."
|
100
|
+
* @deprecated "`#getPixelAlpha `is deprecated without replacement." (since v12, until v14)
|
114
101
|
*/
|
115
102
|
getPixelAlpha(x: number, y: number): number;
|
116
103
|
|
117
104
|
/**
|
118
|
-
* @deprecated since v12, until v14
|
119
|
-
* @remarks "#_getAlphaBounds is deprecated without replacement."
|
105
|
+
* @deprecated "`#_getAlphaBounds` is deprecated without replacement." (since v12, until v14)
|
120
106
|
*/
|
121
107
|
_getAlphaBounds(): PIXI.Rectangle;
|
122
108
|
|
123
109
|
/**
|
124
|
-
* @deprecated since v12, until v14
|
125
|
-
* @remarks "#_getTextureCoordinate is deprecated without replacement."
|
110
|
+
* @deprecated "`#_getTextureCoordinate` is deprecated without replacement." (since v12, until v14)
|
126
111
|
*/
|
127
112
|
_getTextureCoordinate(testX: number, testY: number): PIXI.IPointData;
|
113
|
+
|
114
|
+
#PrimarySpriteMesh: true;
|
128
115
|
}
|
129
116
|
|
130
117
|
declare namespace PrimarySpriteMesh {
|
@@ -134,36 +121,29 @@ declare namespace PrimarySpriteMesh {
|
|
134
121
|
type FitType = "fill" | "cover" | "contain" | "width" | "height";
|
135
122
|
|
136
123
|
/** @internal */
|
137
|
-
type _ConstructorOptions =
|
124
|
+
type _ConstructorOptions = InexactPartial<{
|
138
125
|
/**
|
139
126
|
* Texture passed to the SpriteMesh.
|
140
|
-
* @defaultValue `null`
|
141
|
-
* @remarks Default ultimately provided by the `SpriteMesh` constructor
|
142
127
|
*/
|
143
128
|
texture: PIXI.Texture;
|
144
129
|
|
145
130
|
/**
|
146
|
-
* The
|
147
|
-
* @defaultValue `PrimaryBaseSamplerShader`
|
148
|
-
* @remarks Default provided by `??=` in function body
|
131
|
+
* The name of this sprite.
|
149
132
|
*/
|
150
|
-
|
133
|
+
name: string | null;
|
151
134
|
|
152
135
|
/**
|
153
|
-
*
|
136
|
+
* Any object that owns this PCO.
|
154
137
|
* @defaultValue `null`
|
155
|
-
* @remarks
|
138
|
+
* @remarks See {@linkcode foundry.canvas.primary.PrimaryCanvasObjectMixin.AnyMixed.object | PrimaryCanvasObject#object}
|
156
139
|
*/
|
157
|
-
|
140
|
+
object: PlaceableObject.Any | CanvasGroupMixin.AnyMixed | null;
|
158
141
|
|
159
142
|
/**
|
160
|
-
*
|
161
|
-
* @defaultValue
|
162
|
-
* @remarks Default via `?? null` in function body
|
163
|
-
* @privateRemarks Foundry types as `*`, but the only things passed in practice are `Tile`s, `Token`s, and the `PrimaryCanvasGroup`
|
143
|
+
* The shader class used to render this sprite.
|
144
|
+
* @defaultValue {@linkcode foundry.canvas.rendering.shaders.PrimaryBaseSamplerShader | PrimaryBaseSamplerShader}
|
164
145
|
*/
|
165
|
-
|
166
|
-
object: PlaceableObject.Any | CanvasGroupMixin.AnyMixed;
|
146
|
+
shaderClass: PrimaryBaseSamplerShader.AnyConstructor;
|
167
147
|
}>;
|
168
148
|
|
169
149
|
/** The constructor options */
|
@@ -174,26 +154,52 @@ declare namespace PrimarySpriteMesh {
|
|
174
154
|
/**
|
175
155
|
* The fit type.
|
176
156
|
* @defaultValue `"fill"`
|
177
|
-
* @remarks Can't be `null` because it only has a parameter default, and is then fed into a switch statement where the default is throw
|
178
157
|
*/
|
179
158
|
fit: FitType;
|
180
159
|
|
181
160
|
/**
|
182
161
|
* The scale on X axis.
|
183
162
|
* @defaultValue `1`
|
184
|
-
* @remarks Can't be `null` because it only has a parameter default and a width scale of 0 is, if not nonsensical, not to be done by accident.
|
185
163
|
*/
|
186
164
|
scaleX: number;
|
187
165
|
|
188
166
|
/**
|
189
167
|
* The scale on Y axis.
|
190
168
|
* @defaultValue `1`
|
191
|
-
* @remarks Can't be `null` because it only has a parameter default and a height scale of 0 is, if not nonsensical, not to be done by accident.
|
192
169
|
*/
|
193
170
|
scaleY: number;
|
194
171
|
}>;
|
195
172
|
|
196
173
|
interface ResizeOptions extends _ResizeOptions {}
|
174
|
+
|
175
|
+
/** @internal */
|
176
|
+
type _BatchData = InexactPartial<{
|
177
|
+
/** @remarks Doesn't exist prior to first render, set in {@linkcode PrimarySpriteMesh._updateBatchData | PrimarySpriteMesh#_updateBatchData} */
|
178
|
+
elevation: PrimarySpriteMesh["elevation"];
|
179
|
+
|
180
|
+
/** @remarks Doesn't exist prior to first render, set in {@linkcode PrimarySpriteMesh._updateBatchData | PrimarySpriteMesh#_updateBatchData} */
|
181
|
+
textureAlphaThreshold: PrimarySpriteMesh["textureAlphaThreshold"];
|
182
|
+
|
183
|
+
/** @remarks Doesn't exist prior to first render, set in {@linkcode PrimarySpriteMesh._updateBatchData | PrimarySpriteMesh#_updateBatchData} */
|
184
|
+
unoccludedAlpha: PrimarySpriteMesh["unoccludedAlpha"];
|
185
|
+
|
186
|
+
/** @remarks Doesn't exist prior to first render, set in {@linkcode PrimarySpriteMesh._updateBatchData | PrimarySpriteMesh#_updateBatchData} */
|
187
|
+
occludedAlpha: PrimarySpriteMesh["occludedAlpha"];
|
188
|
+
|
189
|
+
/** @remarks Doesn't exist prior to first render, set in {@linkcode PrimarySpriteMesh._updateBatchData | PrimarySpriteMesh#_updateBatchData} */
|
190
|
+
fadeOcclusion: PrimaryOccludableObjectMixin.OcclusionState["fade"];
|
191
|
+
|
192
|
+
/** @remarks Doesn't exist prior to first render, set in {@linkcode PrimarySpriteMesh._updateBatchData | PrimarySpriteMesh#_updateBatchData} */
|
193
|
+
radialOcclusion: PrimaryOccludableObjectMixin.OcclusionState["radial"];
|
194
|
+
|
195
|
+
/** @remarks Doesn't exist prior to first render, set in {@linkcode PrimarySpriteMesh._updateBatchData | PrimarySpriteMesh#_updateBatchData} */
|
196
|
+
visionOcclusion: PrimaryOccludableObjectMixin.OcclusionState["vision"];
|
197
|
+
|
198
|
+
/** @remarks Doesn't exist prior to first render, set in {@linkcode PrimarySpriteMesh._updateBatchData | PrimarySpriteMesh#_updateBatchData} */
|
199
|
+
restrictionState: PrimarySpriteMesh["_restrictionState"];
|
200
|
+
}>;
|
201
|
+
|
202
|
+
interface BatchData extends SpriteMesh.BatchData, _BatchData {}
|
197
203
|
}
|
198
204
|
|
199
205
|
export default PrimarySpriteMesh;
|