@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250718083608 → 13.346.0-beta.20250720082736

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.
Files changed (33) hide show
  1. package/package.json +1 -1
  2. package/src/foundry/client/applications/ui/game-pause.d.mts +17 -2
  3. package/src/foundry/client/applications/ui/hotbar.d.mts +96 -2
  4. package/src/foundry/client/applications/ui/main-menu.d.mts +29 -2
  5. package/src/foundry/client/applications/ui/players.d.mts +77 -2
  6. package/src/foundry/client/applications/ui/region-legend.d.mts +1 -0
  7. package/src/foundry/client/applications/ui/scene-navigation.d.mts +1 -1
  8. package/src/foundry/client/canvas/containers/advanced/cached-container.d.mts +15 -15
  9. package/src/foundry/client/canvas/containers/advanced/full-canvas-mixin.d.mts +2 -2
  10. package/src/foundry/client/canvas/containers/elements/control-icon.d.mts +12 -32
  11. package/src/foundry/client/canvas/containers/elements/cursor.d.mts +14 -1
  12. package/src/foundry/client/canvas/containers/elements/door-control.d.mts +2 -2
  13. package/src/foundry/client/canvas/containers/elements/door-mesh.d.mts +215 -3
  14. package/src/foundry/client/canvas/containers/elements/grid-highlight.d.mts +3 -3
  15. package/src/foundry/client/canvas/containers/elements/grid-mesh.d.mts +4 -4
  16. package/src/foundry/client/canvas/containers/elements/particles/leaves.d.mts +7 -6
  17. package/src/foundry/client/canvas/containers/elements/particles/particle-effect.d.mts +4 -5
  18. package/src/foundry/client/canvas/containers/elements/point-source-mesh.d.mts +18 -23
  19. package/src/foundry/client/canvas/containers/elements/precise-text.d.mts +9 -10
  20. package/src/foundry/client/canvas/containers/elements/quad-mesh.d.mts +1 -2
  21. package/src/foundry/client/canvas/containers/elements/resize-handle.d.mts +37 -11
  22. package/src/foundry/client/canvas/containers/elements/sprite-mesh.d.mts +34 -26
  23. package/src/foundry/client/canvas/layers/masks/depth.d.mts +1 -1
  24. package/src/foundry/client/canvas/layers/masks/occlusion.d.mts +1 -1
  25. package/src/foundry/client/canvas/primary/primary-canvas-container.d.mts +32 -0
  26. package/src/foundry/client/canvas/primary/primary-canvas-object.d.mts +39 -38
  27. package/src/foundry/client/canvas/primary/primary-graphics.d.mts +22 -18
  28. package/src/foundry/client/canvas/primary/primary-occludable-object.d.mts +59 -29
  29. package/src/foundry/client/canvas/primary/primary-particle-effect.d.mts +51 -0
  30. package/src/foundry/client/canvas/primary/primary-sprite-mesh.d.mts +72 -66
  31. package/src/foundry/client/config.d.mts +444 -311
  32. package/src/foundry/client/documents/wall.d.mts +13 -2
  33. package/src/foundry/client/hooks.d.mts +14 -4
@@ -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, NullishProps } from "#utils";
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
- * The constructor options.
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
- * @throws If either `baseWidth` or `baseHeight` are less than 0, or if `options.fit` is not a FitType
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, will be removed in v14
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 = NullishProps<{
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 shader class used to render this sprite.
147
- * @defaultValue `PrimaryBaseSamplerShader`
148
- * @remarks Default provided by `??=` in function body
131
+ * The name of this sprite.
149
132
  */
150
- shaderClass: PrimaryBaseSamplerShader.AnyConstructor;
133
+ name: string | null;
151
134
 
152
135
  /**
153
- * The name of this sprite.
136
+ * Any object that owns this PCO.
154
137
  * @defaultValue `null`
155
- * @remarks Default provided by `?? null` in function body
138
+ * @remarks See {@linkcode foundry.canvas.primary.PrimaryCanvasObjectMixin.AnyMixed.object | PrimaryCanvasObject#object}
156
139
  */
157
- name: string;
140
+ object: PlaceableObject.Any | CanvasGroupMixin.AnyMixed | null;
158
141
 
159
142
  /**
160
- * Any object that owns this PCO.
161
- * @defaultValue `null`
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
- // TODO: (esheyw) Revisit the "any canvas group" type when groups are done
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;