@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.
- package/package.json +1 -1
- package/src/foundry/client/applications/ui/game-pause.d.mts +17 -2
- package/src/foundry/client/applications/ui/hotbar.d.mts +96 -2
- package/src/foundry/client/applications/ui/main-menu.d.mts +29 -2
- package/src/foundry/client/applications/ui/players.d.mts +77 -2
- package/src/foundry/client/applications/ui/region-legend.d.mts +1 -0
- package/src/foundry/client/applications/ui/scene-navigation.d.mts +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/wall.d.mts +13 -2
- package/src/foundry/client/hooks.d.mts +14 -4
@@ -1,12 +1,224 @@
|
|
1
|
-
import type { Identity } from "#utils";
|
1
|
+
import type { ConcreteKeys, Identity, InexactPartial, ValueOf } from "#utils";
|
2
2
|
import type { PrimarySpriteMesh } from "#client/canvas/primary/_module.d.mts";
|
3
|
+
import type { CanvasAnimation } from "#client/canvas/animation/_module.d.mts";
|
4
|
+
import type { Wall } from "#client/canvas/placeables/_module.d.mts";
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
+
/**
|
7
|
+
* A special subclass of {@linkcode PrimarySpriteMesh} used to render an interactive door.
|
8
|
+
*/
|
9
|
+
declare class DoorMesh extends PrimarySpriteMesh {
|
10
|
+
/**
|
11
|
+
* Construct a DoorMesh by providing {@linkcode PrimarySpriteMesh} constructor options and specific door configuration.
|
12
|
+
* @remarks `options` is required, `texture` and `object` must be passed or construction will throw.
|
13
|
+
*
|
14
|
+
* If no door configuration options are passed, the `"swing"` animation config will be loaded
|
15
|
+
*/
|
16
|
+
constructor(options: DoorMesh.ConstructorOptions);
|
17
|
+
|
18
|
+
/**
|
19
|
+
* The possible rendering styles for a door mesh.
|
20
|
+
* @remarks Frozen.
|
21
|
+
*/
|
22
|
+
static DOOR_STYLES: Readonly<DoorMesh.DoorStyles>;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* The original position of the door in its resting CLOSED state.
|
26
|
+
* @internal
|
27
|
+
*/
|
28
|
+
protected _closedPosition: DoorMesh.StateSnapshot;
|
29
|
+
|
30
|
+
/**
|
31
|
+
* The currently rendered position of the door.
|
32
|
+
* @internal
|
33
|
+
*/
|
34
|
+
protected _animatedPosition: DoorMesh.StateSnapshot;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* An amount of pixel padding surrounding the door texture.
|
38
|
+
*/
|
39
|
+
texturePadding: number;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* The identifier for this door animation.
|
43
|
+
*/
|
44
|
+
get animationId(): string;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Configure and initialize the DoorMesh.
|
48
|
+
* This is called automatically upon construction, but may be called manually later to update the DoorMesh.
|
49
|
+
* @remarks Despite all properties of {@linkcode DoorMesh.AnimationConfiguration} being optional, `options`
|
50
|
+
* lacks a `={}` default, so you must pass at least an empty object
|
51
|
+
*/
|
52
|
+
initialize(animation: DoorMesh.AnimationConfiguration): void;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Animate the door to its current rendered state.
|
56
|
+
* @param open - Is the door now open or closed? (default: {@linkcode Wall.isOpen | this.object.isOpen})
|
57
|
+
*/
|
58
|
+
animate(open?: boolean): Promise<void>;
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Configure the `"swing"` animation.
|
62
|
+
* @remarks A valid {@linkcode CONFIG.Wall.DoorAnimationFunction}
|
63
|
+
*/
|
64
|
+
static animateSwing(this: DoorMesh, open: boolean): CanvasAnimation.Attribute[];
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Configure the `"ascend"` animation.
|
68
|
+
* @remarks A valid {@linkcode CONFIG.Wall.DoorAnimationFunction}
|
69
|
+
*/
|
70
|
+
static animateAscend(this: DoorMesh, open: boolean): CanvasAnimation.Attribute[];
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Special initialization needed for descending door types.
|
74
|
+
* @remarks A valid {@linkcode CONFIG.Wall.DoorAnimationHook}
|
75
|
+
*/
|
76
|
+
static initializeDescend(this: DoorMesh, open: boolean): void;
|
77
|
+
|
78
|
+
/**
|
79
|
+
* When closing a descending door, shift its elevation to the foreground before animation.
|
80
|
+
* @remarks A valid {@linkcode CONFIG.Wall.DoorAnimationHook}
|
81
|
+
*/
|
82
|
+
static preAnimateDescend(this: DoorMesh, open: boolean): Promise<void>;
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Configure the `"descend"` animation.
|
86
|
+
* @remarks A valid {@linkcode CONFIG.Wall.DoorAnimationFunction}
|
87
|
+
*/
|
88
|
+
static animateDescend(this: DoorMesh, open: boolean): CanvasAnimation.Attribute[];
|
89
|
+
|
90
|
+
/**
|
91
|
+
* When opening a descending door, shift its elevation to the background after animation.
|
92
|
+
* @remarks A valid {@linkcode CONFIG.Wall.DoorAnimationHook}
|
93
|
+
*/
|
94
|
+
static postAnimateDescend(this: DoorMesh, open: boolean): Promise<void>;
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Configure the `"slide"` animation.
|
98
|
+
* @remarks A valid {@linkcode CONFIG.Wall.DoorAnimationFunction}
|
99
|
+
*/
|
100
|
+
static animateSlide(this: DoorMesh, open: boolean): CanvasAnimation.Attribute[];
|
101
|
+
|
102
|
+
#DoorMesh: true;
|
103
|
+
}
|
6
104
|
|
7
105
|
declare namespace DoorMesh {
|
8
106
|
interface Any extends AnyDoorMesh {}
|
9
107
|
interface AnyConstructor extends Identity<typeof AnyDoorMesh> {}
|
108
|
+
|
109
|
+
/**
|
110
|
+
* @remarks Foundry types {@linkcode AnimationConfiguration.style | style} as required at construction, but it gets passed
|
111
|
+
* to `##configure` via {@linkcode DoorMesh.initialize | #initialize}, where it has a default applied
|
112
|
+
*/
|
113
|
+
interface ConstructorOptions
|
114
|
+
extends Omit<PrimarySpriteMesh.ConstructorOptions, "object" | "texture">,
|
115
|
+
AnimationConfiguration {
|
116
|
+
/**
|
117
|
+
* Texture passed to the SpriteMesh.
|
118
|
+
* @remarks Required for {@linkcode DoorMesh}, as the constructor calls `##configure` which calls `##getClosedPosition`
|
119
|
+
* which assumes a valid {@linkcode DoorMesh.texture | this.texture}
|
120
|
+
*/
|
121
|
+
texture: PIXI.Texture;
|
122
|
+
|
123
|
+
/**
|
124
|
+
* @remarks This is technically inherited from {@linkcode PrimarySpriteMesh.ConstructorOptions.object}, which is much wider,
|
125
|
+
* but by usage this class requires {@linkcode Wall}s. Required because `##configure` assumes it can call its
|
126
|
+
* {@linkcode Wall.isOpen | isOpen} method.
|
127
|
+
*
|
128
|
+
* See {@linkcode foundry.canvas.primary.PrimaryCanvasObjectMixin.AnyMixed.object | PrimaryCanvasObject#object}
|
129
|
+
*/
|
130
|
+
object: Wall.Implementation;
|
131
|
+
}
|
132
|
+
|
133
|
+
type ConfiguredAnimationType = ConcreteKeys<typeof CONFIG.Wall.animationTypes>;
|
134
|
+
|
135
|
+
/** @internal */
|
136
|
+
type _AnimationConfiguration = InexactPartial<{
|
137
|
+
/**
|
138
|
+
* @defaultValue `1`
|
139
|
+
* @remarks
|
140
|
+
* - For `swing` and `swivel` this is rotation direction: `1` for clockwise, `-1` counter-clockwise (pivoting from the
|
141
|
+
* {@linkcode Wall.edge.a | a} endpoint of the edge for `swing`, and the midpoint for `swivel`)
|
142
|
+
* - For `slide`, `1` slides towards `a` , `-1` away
|
143
|
+
* - For `ascend` and `descend` it has no effect
|
144
|
+
*/
|
145
|
+
direction: -1 | 1;
|
146
|
+
|
147
|
+
/**
|
148
|
+
* @defaultValue `false`
|
149
|
+
* @remarks Is this mesh part of a double door pair?
|
150
|
+
*/
|
151
|
+
double: boolean;
|
152
|
+
|
153
|
+
/**
|
154
|
+
* @defaultValue `500`
|
155
|
+
* @remarks Animation time in milliseconds
|
156
|
+
*
|
157
|
+
* The claimed default is the value in the configs for `swivel`, `slide`, and `swing` in {@linkcode CONFIG.Wall.animationTypes},
|
158
|
+
* but the default of the {@linkcode WallDocument.AnimationData.duration | WallDocument#animation#duration} field is `750`
|
159
|
+
*/
|
160
|
+
duration: number;
|
161
|
+
|
162
|
+
/**
|
163
|
+
* @defaultValue `false`
|
164
|
+
* @remarks Flip the texture along the axis of the door?
|
165
|
+
*/
|
166
|
+
flip: boolean;
|
167
|
+
|
168
|
+
/**
|
169
|
+
* A multiplier between 0 and 2 that modifies how much the door moves when animating.
|
170
|
+
* For example for a swinging door, more strength produces a wider open angle. For a
|
171
|
+
* sliding door, more strength causes the door to slide farther.
|
172
|
+
* @defaultValue `1.0`
|
173
|
+
* @remarks
|
174
|
+
* - For `swing` and `swivel` it's a linear scale from 0 (no movement) to 2 (180 degrees)
|
175
|
+
* - For `slide` it's door-lengths shifted
|
176
|
+
* - For `ascend` and `descend` it affects how much the texture grows/shrinks. For `ascend` there's also code in place that implies it should
|
177
|
+
* affect the texture `alpha` (down to a minimum of `0.6` at strength `2.0`), but it's non-functional as of 13.346: {@link https://github.com/foundryvtt/foundryvtt/issues/13157}
|
178
|
+
*/
|
179
|
+
strength: number;
|
180
|
+
|
181
|
+
/**
|
182
|
+
* @defaultValue `"swing"`
|
183
|
+
* @remarks Will also use `"swing"` as fallback if an invalid value is passed at runtime; {@linkcode WallDocument.AnimationData.type | Wall#animation#type}
|
184
|
+
* is not constrained by `choices`, so it will persist currently-invalid `type`s until updated
|
185
|
+
*/
|
186
|
+
type: ConfiguredAnimationType;
|
187
|
+
|
188
|
+
/** @remarks Default depends on the value of `double`; `"doubleL"` if truthy, `"single"` otherwise */
|
189
|
+
style: DoorStyle;
|
190
|
+
}>;
|
191
|
+
|
192
|
+
/**
|
193
|
+
* @remarks The Foundry typedef has `config` and `style` as required properties, but that is for the type of `DoorMesh##animation`,
|
194
|
+
* after the object's passed through `##configure` and had defaults applied. Since there's no public access to that property, this
|
195
|
+
* interface is typed for input, with everything optional.
|
196
|
+
*
|
197
|
+
* `config` always gets set to {@linkcode CONFIG.Wall.animationTypes | CONFIG.Wall.animationTypes[type]}, regardless of input, so it
|
198
|
+
* is not included here.
|
199
|
+
*
|
200
|
+
* See {@linkcode WallDocument.AnimationData}
|
201
|
+
*/
|
202
|
+
interface AnimationConfiguration extends _AnimationConfiguration {}
|
203
|
+
|
204
|
+
interface DoorStyles {
|
205
|
+
SINGLE: "single";
|
206
|
+
DOUBLE_LEFT: "doubleL";
|
207
|
+
DOUBLE_RIGHT: "doubleR";
|
208
|
+
}
|
209
|
+
|
210
|
+
type DoorStyle = ValueOf<DoorStyles>;
|
211
|
+
|
212
|
+
interface StateSnapshot {
|
213
|
+
x: number;
|
214
|
+
y: number;
|
215
|
+
elevation: number;
|
216
|
+
sort: number;
|
217
|
+
rotation: number;
|
218
|
+
scaleX: number;
|
219
|
+
scaleY: number;
|
220
|
+
tint: number;
|
221
|
+
}
|
10
222
|
}
|
11
223
|
|
12
224
|
export default DoorMesh;
|
@@ -3,13 +3,13 @@ import type { Identity } from "#utils";
|
|
3
3
|
/**
|
4
4
|
* A special Graphics class which handles Grid layer highlighting
|
5
5
|
*/
|
6
|
-
declare class GridHighlight extends PIXI.
|
7
|
-
constructor(name: string, ...args: ConstructorParameters<typeof PIXI.
|
6
|
+
declare class GridHighlight extends PIXI.smooth.SmoothGraphics {
|
7
|
+
constructor(name: string, ...args: ConstructorParameters<typeof PIXI.smooth.SmoothGraphics>);
|
8
8
|
|
9
9
|
/**
|
10
10
|
* Track the Grid Highlight name
|
11
11
|
*/
|
12
|
-
name: string;
|
12
|
+
override name: string;
|
13
13
|
|
14
14
|
/**
|
15
15
|
* Track distinct positions which have already been highlighted
|
@@ -8,9 +8,9 @@ import { QuadMesh } from "#client/canvas/containers/_module.mjs";
|
|
8
8
|
declare class GridMesh extends QuadMesh {
|
9
9
|
/**
|
10
10
|
* The grid mesh constructor.
|
11
|
-
* @param shaderClass - The shader class
|
11
|
+
* @param shaderClass - The shader class (default: {@linkcode GridShader})
|
12
12
|
*/
|
13
|
-
constructor(shaderClass
|
13
|
+
constructor(shaderClass?: GridShader.AnyConstructor);
|
14
14
|
|
15
15
|
/**
|
16
16
|
* The data of this mesh.
|
@@ -52,9 +52,9 @@ declare namespace GridMesh {
|
|
52
52
|
interface MeshData {
|
53
53
|
/**
|
54
54
|
* The type of the grid (see {@linkcode CONST.GRID_TYPES})
|
55
|
-
* @defaultValue
|
55
|
+
* @defaultValue {@linkcode CONST.GRID_TYPES.GRIDLESS}
|
56
56
|
*/
|
57
|
-
type:
|
57
|
+
type: CONST.GRID_TYPES;
|
58
58
|
|
59
59
|
/**
|
60
60
|
* The width of the grid in pixels
|
@@ -6,9 +6,10 @@ import { ParticleEffect } from "#client/canvas/containers/_module.mjs";
|
|
6
6
|
*/
|
7
7
|
declare class AutumnLeavesWeatherEffect extends ParticleEffect {
|
8
8
|
/**
|
9
|
-
* @remarks `options` is completely unused in this subclass, as it gets passed to
|
9
|
+
* @remarks `options` is completely unused in this subclass, as it gets passed to {@linkcode AutumnLeavesWeatherEffect.getParticleEmitters | #getParticleEmitters},
|
10
|
+
* which, unlike {@linkcode ParticleEffect | super}'s method, takes no arguments
|
10
11
|
*/
|
11
|
-
constructor(options?: PIXI.particles.EmitterConfigV3
|
12
|
+
constructor(options?: PIXI.particles.EmitterConfigV3);
|
12
13
|
|
13
14
|
/**
|
14
15
|
* @defaultValue `"WEATHER.AutumnLeaves"`
|
@@ -19,13 +20,13 @@ declare class AutumnLeavesWeatherEffect extends ParticleEffect {
|
|
19
20
|
|
20
21
|
/**
|
21
22
|
* Configuration for the particle emitter for falling leaves
|
22
|
-
* @remarks Not a complete EmitterConfigV3; the `frequency` and `pos` required keys are omitted. `frequency` is set
|
23
|
-
* up in
|
24
|
-
* see https://github.com/pixijs-userland/particle-emitter/issues/219
|
23
|
+
* @remarks Not a complete {@linkcode PIXI.particles.EmitterConfigV3}; the `frequency` and `pos` required keys are omitted. `frequency` is set
|
24
|
+
* up in {@linkcode AutumnLeavesWeatherEffect.getParticleEmitters | #getParticleEmitters}, but `pos` is not; it is erroneously marked as required
|
25
|
+
* in the interface, see https://github.com/pixijs-userland/particle-emitter/issues/219
|
25
26
|
*/
|
26
27
|
static LEAF_CONFIG: AutumnLeavesWeatherEffect.LeafConfig;
|
27
28
|
|
28
|
-
/** @remarks This does not take a config
|
29
|
+
/** @remarks This does not take a config parameter, unlike its parent class; uses {@linkcode AutumnLeavesWeatherEffect.LEAF_CONFIG} instead */
|
29
30
|
override getParticleEmitters(): PIXI.particles.Emitter[];
|
30
31
|
}
|
31
32
|
|
@@ -6,8 +6,7 @@ import { FullCanvasObjectMixin } from "#client/canvas/containers/_module.mjs";
|
|
6
6
|
*/
|
7
7
|
declare class ParticleEffect extends FullCanvasObjectMixin(PIXI.Container) {
|
8
8
|
/**
|
9
|
-
* @param options - Options passed to the getParticleEmitters method which can be used to customize values of the emitter configuration.
|
10
|
-
* (default: `{}`)
|
9
|
+
* @param options - Options passed to the getParticleEmitters method which can be used to customize values of the emitter configuration. (default: `{}`)
|
11
10
|
* @remarks Despite being an `={}` parameter, construction will throw if it is passed (or defaults to via omission) an empty object
|
12
11
|
*/
|
13
12
|
constructor(options: PIXI.particles.EmitterConfigV3);
|
@@ -15,7 +14,7 @@ declare class ParticleEffect extends FullCanvasObjectMixin(PIXI.Container) {
|
|
15
14
|
emitters: PIXI.particles.Emitter[];
|
16
15
|
|
17
16
|
/**
|
18
|
-
* Create an emitter instance which automatically updates using the shared PIXI.Ticker
|
17
|
+
* Create an emitter instance which automatically updates using the shared {@linkcode PIXI.Ticker}
|
19
18
|
* @param config - The emitter configuration
|
20
19
|
* @returns The created Emitter instance
|
21
20
|
*/
|
@@ -26,9 +25,9 @@ declare class ParticleEffect extends FullCanvasObjectMixin(PIXI.Container) {
|
|
26
25
|
* This base class creates a single emitter using the explicitly provided configuration.
|
27
26
|
* Subclasses can override this method for more advanced configurations.
|
28
27
|
* @param options - Options provided to the ParticleEffect constructor which can be used to customize
|
29
|
-
*
|
30
|
-
* @throws If `options` is passed as (or defaults to via omission) an empty object
|
28
|
+
* configuration values for created emitters. (default: `{}`)
|
31
29
|
* @remarks Despite its name, this method only takes a single config object and only returns a single-element array.
|
30
|
+
* @throws If `options` is passed as (or defaults to via omission) an empty object
|
32
31
|
*/
|
33
32
|
getParticleEmitters(options: PIXI.particles.EmitterConfigV3): PIXI.particles.Emitter[];
|
34
33
|
|
@@ -2,7 +2,7 @@ import type { Identity } from "#utils";
|
|
2
2
|
import type { AdaptiveLightingShader } from "#client/canvas/rendering/shaders/_module.d.mts";
|
3
3
|
|
4
4
|
/**
|
5
|
-
* Extension of a PIXI.Mesh
|
5
|
+
* Extension of a PIXI.Mesh for PointEffectSources.
|
6
6
|
* @remarks Foundry only uses this with `AdaptiveLightingShader` subclasses, thus the type param default
|
7
7
|
*/
|
8
8
|
declare class PointSourceMesh<Shader extends PIXI.Shader = AdaptiveLightingShader> extends PIXI.Mesh<Shader> {
|
@@ -12,40 +12,36 @@ declare class PointSourceMesh<Shader extends PIXI.Shader = AdaptiveLightingShade
|
|
12
12
|
constructor(geometry: PIXI.Geometry, shader: Shader, state?: PIXI.State, drawMode?: PIXI.DRAW_MODES);
|
13
13
|
|
14
14
|
/**
|
15
|
-
*
|
16
|
-
* @privateRemarks Despite being `protected`, this is accessed externally in `CanvasIlluminationEffects#render`
|
15
|
+
* @deprecated Removed without replacement in v13 (this warning will be removed in v14)
|
17
16
|
*/
|
18
|
-
protected static _priorBlendMode:
|
17
|
+
protected static _priorBlendMode: never;
|
19
18
|
|
20
|
-
|
21
|
-
* The current texture used by the mesh.
|
22
|
-
* @privateRemarks Despite being `protected`, this is accessed externally in `CanvasIlluminationEffects#render`
|
23
|
-
*/
|
24
|
-
protected static _currentTexture: PIXI.Texture | undefined;
|
19
|
+
protected static _currentTexture: never;
|
25
20
|
|
26
21
|
/**
|
27
|
-
*
|
28
|
-
* @defaultValue `-1`
|
22
|
+
* @deprecated Made hard private in v13 (this warning will be removed in v14)
|
29
23
|
*/
|
30
|
-
_worldID:
|
24
|
+
_worldID: never;
|
31
25
|
|
32
26
|
/**
|
33
|
-
*
|
34
|
-
* @defaultValue `-1`
|
27
|
+
* @deprecated Made hard private in v13 (this warning will be removed in v14)
|
35
28
|
*/
|
36
|
-
_updateID:
|
29
|
+
_updateID: never;
|
37
30
|
|
38
31
|
override get geometry(): PIXI.Geometry;
|
39
32
|
|
40
|
-
set geometry(value: PIXI.Geometry);
|
33
|
+
override set geometry(value: PIXI.Geometry);
|
41
34
|
|
42
|
-
/** @throws You can't add children to a PointSourceMesh. */
|
35
|
+
/** @throws You can't add children to a {@linkcode PointSourceMesh}. */
|
43
36
|
override addChild(): never;
|
44
37
|
|
45
|
-
/** @throws You can't add children to a PointSourceMesh. */
|
38
|
+
/** @throws You can't add children to a {@linkcode PointSourceMesh}. */
|
46
39
|
override addChildAt(): never;
|
47
40
|
|
48
|
-
|
41
|
+
/**
|
42
|
+
* @deprecated Removed without replacement in v13 (this warning will be removed in v14)
|
43
|
+
*/
|
44
|
+
protected override _render(renderer: never): never;
|
49
45
|
|
50
46
|
override calculateBounds(): void;
|
51
47
|
|
@@ -53,12 +49,11 @@ declare class PointSourceMesh<Shader extends PIXI.Shader = AdaptiveLightingShade
|
|
53
49
|
|
54
50
|
/** The local bounds need to be drawn from the underlying geometry. */
|
55
51
|
override getLocalBounds(
|
56
|
-
/**
|
57
|
-
* @defaultValue `new PIXI.Rectangle()`
|
58
|
-
* @remarks Default provided by `??=` in function body. `null` would be allowable here but breaks inheritance
|
59
|
-
*/
|
52
|
+
/** @defaultValue `new PIXI.Rectangle()` */
|
60
53
|
rect?: PIXI.Rectangle,
|
61
54
|
): PIXI.Rectangle;
|
55
|
+
|
56
|
+
#PointSourceMesh: true;
|
62
57
|
}
|
63
58
|
|
64
59
|
declare namespace PointSourceMesh {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Identity, InexactPartial
|
1
|
+
import type { Identity, InexactPartial } from "#utils";
|
2
2
|
|
3
3
|
/**
|
4
4
|
* An extension of the default PIXI.Text object which forces double resolution.
|
@@ -15,7 +15,7 @@ declare class PreciseText extends PIXI.Text {
|
|
15
15
|
|
16
16
|
/**
|
17
17
|
* Prepare a TextStyle object which merges the canvas defaults with user-provided options
|
18
|
-
* @param anchor - A text anchor point from CONST.TEXT_ANCHOR_POINTS
|
18
|
+
* @param anchor - A text anchor point from {@linkcode CONST.TEXT_ANCHOR_POINTS}
|
19
19
|
* @param options - Additional options merged with the default TextStyle
|
20
20
|
* @returns The prepared TextStyle
|
21
21
|
*/
|
@@ -27,16 +27,15 @@ declare namespace PreciseText {
|
|
27
27
|
interface AnyConstructor extends Identity<typeof AnyPreciseText> {}
|
28
28
|
|
29
29
|
/** @internal */
|
30
|
-
type _GetTextStyleOptions =
|
30
|
+
type _GetTextStyleOptions = InexactPartial<{
|
31
31
|
/**
|
32
|
-
* A text anchor point from CONST.TEXT_ANCHOR_POINTS
|
33
|
-
* @remarks Only checked
|
32
|
+
* A text anchor point from {@linkcode CONST.TEXT_ANCHOR_POINTS}
|
33
|
+
* @remarks Only checked against `.RIGHT` and `.LEFT`, and only if an `align` key is omitted
|
34
34
|
*/
|
35
|
-
anchor:
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
|
-
interface GetTextStyleOptions extends _GetTextStyleOptions {}
|
35
|
+
anchor: CONST.TEXT_ANCHOR_POINTS;
|
36
|
+
}>;
|
37
|
+
|
38
|
+
interface GetTextStyleOptions extends _GetTextStyleOptions, InexactPartial<PIXI.ITextStyle> {}
|
40
39
|
}
|
41
40
|
|
42
41
|
export default PreciseText;
|
@@ -4,7 +4,6 @@ import type { AbstractBaseShader } from "#client/canvas/rendering/shaders/_modul
|
|
4
4
|
/**
|
5
5
|
* A basic rectangular mesh with a shader only. Does not natively handle textures (but a bound shader can).
|
6
6
|
* Bounds calculations are simplified and the geometry does not need to handle texture coords.
|
7
|
-
* @privateRemarks Ideally the `shaderClass` passed to the constructor and `get shader()` could be synced up, but `setShaderClass` removes that option
|
8
7
|
*/
|
9
8
|
declare class QuadMesh extends PIXI.Container {
|
10
9
|
/**
|
@@ -26,7 +25,7 @@ declare class QuadMesh extends PIXI.Container {
|
|
26
25
|
|
27
26
|
/**
|
28
27
|
* Initialize shader based on the shader class type.
|
29
|
-
* @param shaderClass - Shader class used. Must inherit from AbstractBaseShader.
|
28
|
+
* @param shaderClass - Shader class used. Must inherit from {@linkcode AbstractBaseShader}.
|
30
29
|
*/
|
31
30
|
setShaderClass(shaderClass: AbstractBaseShader.AnyConstructor): void;
|
32
31
|
|
@@ -1,9 +1,13 @@
|
|
1
|
-
import type { Identity,
|
1
|
+
import type { Identity, InexactPartial } from "#utils";
|
2
2
|
import type { Canvas } from "#client/canvas/_module.d.mts";
|
3
3
|
|
4
|
-
|
4
|
+
/**
|
5
|
+
* A class based on PIXI.Graphics, that allows to create a resize handle in the desired area.
|
6
|
+
*/
|
7
|
+
declare class ResizeHandle extends PIXI.smooth.SmoothGraphics {
|
5
8
|
/**
|
6
|
-
* @param
|
9
|
+
* @param offset - A two-element array [xFactor, yFactor] which defines the normalized position of this handle relative to the bounding box.
|
10
|
+
* @param handlers - An object of optional handler functions.
|
7
11
|
*/
|
8
12
|
constructor(offset: ResizeHandle.Offsets, handlers?: ResizeHandle.Handlers);
|
9
13
|
|
@@ -17,18 +21,30 @@ declare class ResizeHandle extends PIXI.Graphics {
|
|
17
21
|
*/
|
18
22
|
active: boolean;
|
19
23
|
|
24
|
+
/**
|
25
|
+
* Refresh the position and hit area of this handle based on the provided bounding box.
|
26
|
+
* @param bounds - The bounding box in which this handle operates.
|
27
|
+
*/
|
20
28
|
refresh(bounds: Canvas.Rectangle): void;
|
21
29
|
|
22
30
|
/**
|
23
|
-
*
|
31
|
+
* Compute updated dimensions for an object being resized, respecting optional constraints.
|
32
|
+
* @param current - The current geometric state of the object
|
33
|
+
* @param origin - The original position and dimensions used for reference
|
34
|
+
* @param destination - The mouse (or pointer) destination coordinates.
|
35
|
+
* @param options - Additional options.
|
36
|
+
* @returns An object containing the adjusted `{x, y, width, height}`.
|
24
37
|
*/
|
25
38
|
updateDimensions(
|
26
39
|
current: Canvas.Rectangle,
|
27
40
|
origin: Canvas.Rectangle,
|
28
|
-
destination:
|
41
|
+
destination: ResizeHandle.Destination,
|
29
42
|
options?: ResizeHandle.UpdateDimensionsOptions,
|
30
43
|
): Canvas.Rectangle;
|
31
44
|
|
45
|
+
/**
|
46
|
+
* Activate listeners for pointer events, enabling hover and mouse-down behavior on the resize handle.
|
47
|
+
*/
|
32
48
|
activateListeners(): void;
|
33
49
|
|
34
50
|
/**
|
@@ -44,7 +60,7 @@ declare class ResizeHandle extends PIXI.Graphics {
|
|
44
60
|
protected _onHoverOut(event: PIXI.FederatedEvent<PointerEvent>): void;
|
45
61
|
|
46
62
|
/**
|
47
|
-
* When we start a drag event - create a preview copy of the Tile for re-positioning
|
63
|
+
* When we start a drag event - create a preview copy of the `Tile` for re-positioning
|
48
64
|
* @param event - The mousedown event
|
49
65
|
*/
|
50
66
|
protected _onMouseDown(event: PIXI.FederatedEvent<PointerEvent>): void;
|
@@ -57,20 +73,30 @@ declare namespace ResizeHandle {
|
|
57
73
|
type Offsets = [widthOffset: number, heightOffset: number];
|
58
74
|
|
59
75
|
/** @internal */
|
60
|
-
type _Handlers =
|
61
|
-
|
76
|
+
type _Handlers = InexactPartial<{
|
77
|
+
/** A function determining if this handle can initiate a drag. */
|
78
|
+
canDrag: () => boolean;
|
62
79
|
}>;
|
63
80
|
|
64
81
|
interface Handlers extends _Handlers {}
|
65
82
|
|
83
|
+
/** @privateRemarks {@linkcode ResizeHandle.updateDimensions | #updateDimensions} is too cool to just use a Point */
|
84
|
+
interface Destination {
|
85
|
+
/** The x-coordinate where the pointer was released. */
|
86
|
+
x: number;
|
87
|
+
|
88
|
+
/** The y-coordinate where the pointer was released. */
|
89
|
+
y: number;
|
90
|
+
}
|
91
|
+
|
66
92
|
/** @internal */
|
67
|
-
type _UpdateDimensionsOptions =
|
93
|
+
type _UpdateDimensionsOptions = InexactPartial<{
|
68
94
|
/**
|
69
|
-
*
|
95
|
+
* If provided, a numeric aspect ratio to maintain (width/height).
|
70
96
|
* @defaultValue `null`
|
71
97
|
* @remarks If truthy, will enforce the passed ratio, landscape if `width >= height`, portrait otherwise
|
72
98
|
*/
|
73
|
-
aspectRatio: number;
|
99
|
+
aspectRatio: number | null;
|
74
100
|
}>;
|
75
101
|
|
76
102
|
interface UpdateDimensionsOptions extends _UpdateDimensionsOptions {}
|