@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250803190002 → 13.346.0-beta.20250804213559

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 (53) hide show
  1. package/package.json +1 -1
  2. package/src/configuration/configuration.d.mts +3 -3
  3. package/src/configuration/hooks.d.mts +6 -4
  4. package/src/foundry/client/canvas/board.d.mts +1 -1
  5. package/src/foundry/client/canvas/containers/elements/door-control.d.mts +12 -4
  6. package/src/foundry/client/canvas/groups/canvas-group-mixin.d.mts +45 -23
  7. package/src/foundry/client/canvas/groups/effects.d.mts +136 -41
  8. package/src/foundry/client/canvas/groups/environment.d.mts +191 -48
  9. package/src/foundry/client/canvas/groups/hidden.d.mts +43 -15
  10. package/src/foundry/client/canvas/groups/interface.d.mts +38 -27
  11. package/src/foundry/client/canvas/groups/overlay.d.mts +17 -4
  12. package/src/foundry/client/canvas/groups/primary.d.mts +57 -30
  13. package/src/foundry/client/canvas/groups/rendered.d.mts +17 -4
  14. package/src/foundry/client/canvas/groups/visibility.d.mts +17 -6
  15. package/src/foundry/client/canvas/interaction/ruler/ruler.d.mts +10 -2
  16. package/src/foundry/client/canvas/layers/controls.d.mts +13 -5
  17. package/src/foundry/client/canvas/layers/sounds.d.mts +1 -1
  18. package/src/foundry/client/canvas/perception/detection-mode.d.mts +9 -6
  19. package/src/foundry/client/canvas/perception/detection-modes/darkvision.d.mts +1 -1
  20. package/src/foundry/client/canvas/perception/detection-modes/invisibility-perception.d.mts +1 -1
  21. package/src/foundry/client/canvas/perception/detection-modes/light-perception.d.mts +2 -2
  22. package/src/foundry/client/canvas/perception/detection-modes/super-perception.d.mts +1 -1
  23. package/src/foundry/client/canvas/perception/detection-modes/tremor-perception.d.mts +1 -1
  24. package/src/foundry/client/canvas/perception/fog.d.mts +13 -5
  25. package/src/foundry/client/canvas/perception/vision-mode.d.mts +4 -4
  26. package/src/foundry/client/canvas/placeables/tokens/ring.d.mts +10 -2
  27. package/src/foundry/client/canvas/primary/primary-canvas-object.d.mts +1 -1
  28. package/src/foundry/client/canvas/rendering/filters/effects-masking.d.mts +11 -4
  29. package/src/foundry/client/canvas/rendering/filters/visibility.d.mts +11 -4
  30. package/src/foundry/client/canvas/sources/base-effect-source.d.mts +2 -3
  31. package/src/foundry/client/canvas/sources/point-darkness-source.d.mts +10 -2
  32. package/src/foundry/client/canvas/sources/point-light-source.d.mts +10 -2
  33. package/src/foundry/client/canvas/sources/point-sound-source.d.mts +10 -2
  34. package/src/foundry/client/canvas/sources/point-vision-source.d.mts +10 -2
  35. package/src/foundry/client/config.d.mts +142 -86
  36. package/src/foundry/client/dice/roll.d.mts +18 -7
  37. package/src/foundry/client/documents/chat-message.d.mts +2 -2
  38. package/src/foundry/client/documents/collections/actors.d.mts +10 -2
  39. package/src/foundry/client/documents/collections/card-stacks.d.mts +10 -2
  40. package/src/foundry/client/documents/collections/chat-messages.d.mts +11 -3
  41. package/src/foundry/client/documents/collections/combat-encounters.d.mts +10 -2
  42. package/src/foundry/client/documents/collections/fog-explorations.d.mts +10 -2
  43. package/src/foundry/client/documents/collections/folders.d.mts +10 -2
  44. package/src/foundry/client/documents/collections/items.d.mts +10 -2
  45. package/src/foundry/client/documents/collections/journal.d.mts +10 -2
  46. package/src/foundry/client/documents/collections/macros.d.mts +10 -2
  47. package/src/foundry/client/documents/collections/playlists.d.mts +10 -2
  48. package/src/foundry/client/documents/collections/roll-tables.d.mts +10 -2
  49. package/src/foundry/client/documents/collections/scenes.d.mts +10 -2
  50. package/src/foundry/client/documents/collections/users.d.mts +10 -2
  51. package/src/foundry/client/documents/collections/world-settings.d.mts +10 -2
  52. package/src/foundry/client/documents/scene.d.mts +45 -37
  53. package/src/foundry/client/hooks.d.mts +41 -19
@@ -1,10 +1,14 @@
1
- import type { HandleEmptyObject, Identity, InexactPartial, NullishProps } from "#utils";
1
+ import type { DeepPartial, FixedInstanceType, HandleEmptyObject, Identity, InexactPartial } from "#utils";
2
2
  import type { CanvasGroupMixin } from "#client/canvas/groups/_module.d.mts";
3
+ import type { GlobalLightSource } from "#client/canvas/sources/_module.d.mts";
4
+ // Hooks only used for links
5
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
+ import type { AllHooks } from "#client/hooks.mjs";
3
7
 
4
8
  declare module "#configuration" {
5
9
  namespace Hooks {
6
10
  interface CanvasGroupConfig {
7
- EnvironmentCanvasGroup: EnvironmentCanvasGroup.Any;
11
+ EnvironmentCanvasGroup: EnvironmentCanvasGroup.Implementation;
8
12
  }
9
13
  }
10
14
  }
@@ -16,11 +20,18 @@ declare class EnvironmentCanvasGroup<
16
20
  DrawOptions extends EnvironmentCanvasGroup.DrawOptions = EnvironmentCanvasGroup.DrawOptions,
17
21
  TearDownOptions extends EnvironmentCanvasGroup.TearDownOptions = EnvironmentCanvasGroup.TearDownOptions,
18
22
  > extends CanvasGroupMixin<typeof PIXI.Container, "environment">(PIXI.Container)<DrawOptions, TearDownOptions> {
23
+ // static override groupName is handled by the CanvasGroupMixin type
24
+
25
+ /** @defaultValue `"static"` */
26
+ override eventMode: PIXI.EventMode;
27
+
19
28
  /**
20
29
  * The global light source attached to the environment
21
- * @remarks This is `defineProperty`'d as non-writable and non-configurable at construction
30
+ * @remarks This is `defineProperty`'d at construction with `configurable: false, enumerable: true, writable: false`
31
+ *
32
+ * Is {@linkcode GlobalLightSource.initialize | initialized} as part of {@linkcode initialize | GlobalLightSource#initialize}
22
33
  */
23
- readonly globalLightSource: foundry.canvas.sources.GlobalLightSource.Implementation;
34
+ readonly globalLightSource: GlobalLightSource.Implementation;
24
35
 
25
36
  /**
26
37
  * Should this group tear down its non-layer children?
@@ -30,65 +41,197 @@ declare class EnvironmentCanvasGroup<
30
41
 
31
42
  /**
32
43
  * Colors exposed by the manager.
33
- * @remarks Properties here are only `undefined` prior to `#initialize`ation
44
+ * @remarks Properties here are only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}
34
45
  */
35
46
  colors: EnvironmentCanvasGroup.Colors;
36
47
 
37
48
  /**
38
49
  * Weights used by the manager to compute colors.
39
- * @remarks Properties here are only `undefined` prior to `#initialize`ation
50
+ * @remarks Properties here are only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}
40
51
  */
41
52
  weights: EnvironmentCanvasGroup.Weights;
42
53
 
43
54
  /**
44
55
  * Get the darkness level of this scene.
56
+ * @remarks Only `undefined` prior to initialization
45
57
  */
46
- get darknessLevel(): number;
58
+ get darknessLevel(): number | undefined;
47
59
 
48
60
  protected override _draw(options: HandleEmptyObject<DrawOptions>): Promise<void>;
49
61
 
50
62
  /**
51
63
  * Initialize the scene environment options.
52
- * @remarks `@fires PIXI.FederatedEvent type: "darknessChange" - event: {environmentData: {darknessLevel, priorDarknessLevel}}`
64
+ * @remarks Fires two hooks ({@linkcode AllHooks.configureCanvasEnvironment | configureCanvasEnvironment},
65
+ * {@linkcode AllHooks.initializeCanvasEnvironment | initializeCanvasEnvironment}) and dispatches a
66
+ * {@linkcode Canvas.Event.DarknessChange | DarknessChange} PIXI event.
53
67
  */
54
- initialize(config?: EnvironmentCanvasGroup.InitializeOptions): void;
68
+ initialize(config?: EnvironmentCanvasGroup.Config): void;
55
69
 
56
70
  /**
57
- * @deprecated since v12, will be removed in v14
58
- * @remarks `"EnvironmentCanvasGroup#darknessPenalty is deprecated without replacement. The darkness penalty is no longer applied on light and vision sources."`
71
+ * @deprecated "`EnvironmentCanvasGroup#darknessPenalty` is deprecated without replacement. The darkness penalty is no longer applied on light and vision sources." (since v12, will be removed in v14)
59
72
  */
60
73
  get darknessPenalty(): 0;
74
+
75
+ #EnvironmentCanvasGroup: true;
61
76
  }
62
77
 
63
78
  declare namespace EnvironmentCanvasGroup {
64
- interface Any extends AnyEnvironmentCanvasGroup {}
65
- interface AnyConstructor extends Identity<typeof AnyEnvironmentCanvasGroup> {}
79
+ /** @deprecated There should only be a single implementation of this class in use at one time, use {@linkcode Implementation} instead */
80
+ type Any = Internal.Any;
81
+
82
+ /** @deprecated There should only be a single implementation of this class in use at one time, use {@linkcode ImplementationClass} instead */
83
+ type AnyConstructor = Internal.AnyConstructor;
84
+
85
+ namespace Internal {
86
+ interface Any extends AnyEnvironmentCanvasGroup {}
87
+ interface AnyConstructor extends Identity<typeof AnyEnvironmentCanvasGroup> {}
88
+ }
89
+
90
+ interface ImplementationClass extends Identity<typeof CONFIG.Canvas.groups.environment.groupClass> {}
91
+ interface Implementation extends FixedInstanceType<ImplementationClass> {}
66
92
 
67
93
  interface DrawOptions extends CanvasGroupMixin.DrawOptions {}
68
94
 
69
95
  interface TearDownOptions extends CanvasGroupMixin.TearDownOptions {}
70
96
 
71
- type ColorKeys =
72
- | "darkness"
73
- | "halfdark"
74
- | "background"
75
- | "dim"
76
- | "bright"
77
- | "ambientBrightest"
78
- | "ambientDaylight"
79
- | "ambientDarkness"
80
- | "sceneBackground"
81
- | "fogExplored"
82
- | "fogUnexplored";
97
+ /** @privateRemarks Properties sorted in order of initialization */
98
+ interface Colors {
99
+ /**
100
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
101
+ *
102
+ * Once initialized, the default value is {@linkcode CONFIG.Canvas.darknessColor}`?? EnvironmentCanvasGroup.#fallbackColors.darknessColor`.
103
+ * Foundry provides different values for these, so if `CONFIG.Canvas.darknessColor` becomes nullish for whatever reason, the default would
104
+ * be `0x242448` instead of `0x303030`.
105
+ */
106
+ ambientDarkness: Color | undefined;
107
+
108
+ /**
109
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
110
+ *
111
+ * Once initialized, the default value if the current scene has token vision enabled is {@linkcode CONFIG.Canvas.daylightColor}
112
+ * `?? EnvironmentCanvasGroup.#fallbackColors.daylightColor`, both of which are `0xEEEEE`. If token vision is disabled, then
113
+ * the default is `0xFFFFFF`
114
+ */
115
+ ambientDaylight: Color | undefined;
116
+
117
+ /**
118
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
119
+ *
120
+ * Once initialized, the default value is {@linkcode CONFIG.Canvas.brightestColor}` ?? EnvironmentCanvasGroup.#fallbackColors.daylightColor`,
121
+ * both of which are `0xFFFFFF` (the `CONFIG` property by default, the fallback always).
122
+ */
123
+ ambientBrightest: Color | undefined;
124
+
125
+ /**
126
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
127
+ *
128
+ * Computed by {@linkcode Color.mix | mixing} {@linkcode ambientDarkness} with {@linkcode ambientDaylight} using a
129
+ * weight of `1.0 - `{@linkcode EnvironmentCanvasGroup.darknessLevel | darknessLevel}
130
+ */
131
+ background: Color | undefined;
132
+
133
+ /**
134
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
135
+ *
136
+ * Computed by {@linkcode Color.mix | mixing} {@linkcode ambientDarkness} with {@linkcode background} using a
137
+ * weight of {@linkcode EnvironmentCanvasGroup.Weights.dark | weights.dark}
138
+ */
139
+ darkness: Color | undefined;
140
+
141
+ /**
142
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
143
+ *
144
+ * Computed by {@linkcode Color.mix | mixing} {@linkcode darkness} with {@linkcode background} using a
145
+ * weight of {@linkcode EnvironmentCanvasGroup.Weights.halfdark | weights.halfdark}
146
+ */
147
+ halfdark: Color | undefined;
148
+
149
+ /**
150
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
151
+ *
152
+ * Computed by {@linkcode Color.mix | mixing} {@linkcode background} with {@linkcode ambientBrightest} using a
153
+ * weight of {@linkcode EnvironmentCanvasGroup.Weights.bright | weights.bright}
154
+ */
155
+ bright: Color | undefined;
156
+
157
+ /**
158
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
159
+ *
160
+ * Computed by {@linkcode Color.mix | mixing} {@linkcode background} with {@linkcode bright} using a
161
+ * weight of {@linkcode EnvironmentCanvasGroup.Weights.dim | weights.dim}
162
+ */
163
+ dim: Color | undefined;
164
+
165
+ /**
166
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
167
+ *
168
+ * Computed by {@linkcode Color.multiply | multiplying} {@linkcode background} by {@linkcode Config.fogUnexploredColor | fogUnexploredColor}
169
+ * `?? `{@linkcode Scene.FogColorData.unexplored | canvas.scene.fog.colors.unexplored}` ?? `{@linkcode CONFIG.Canvas.unexploredColor}
170
+ * `?? EnvironmentCanvasGroup.#fallbackColors.fogUnexplored` (that last being `0x000000`)
171
+ */
172
+ fogUnexplored: Color | undefined;
83
173
 
84
- interface Colors extends Record<EnvironmentCanvasGroup.ColorKeys, Color | undefined> {}
174
+ /**
175
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
176
+ *
177
+ * Computed by {@linkcode Color.multiply | multiplying} {@linkcode background} by {@linkcode Config.fogExploredColor | fogExploredColor}
178
+ * `?? `{@linkcode Scene.FogColorData.explored | canvas.scene.fog.colors.explored}` ?? `{@linkcode CONFIG.Canvas.exploredColor}
179
+ * `?? EnvironmentCanvasGroup.#fallbackColors.fogExplored` (that last being `0x000000`)
180
+ */
181
+ fogExplored: Color | undefined;
85
182
 
86
- type WeightKeys = "dark" | "halfdark" | "dim" | "bright";
183
+ /**
184
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
185
+ *
186
+ * Once initialized, the default is {@linkcode Config.backgroundColor | backgroundColor}` ?? `{@linkcode Scene.backgroundColor | canvas.scene.backgroundColor}
187
+ * `?? EnvironmentCanvasGroup.#fallbackColors.backgroundColor` (that last being `0x999999`, matching the field's `initial`)
188
+ */
189
+ sceneBackground: Color | undefined;
87
190
 
88
- interface Weights extends Record<EnvironmentCanvasGroup.WeightKeys, number | undefined> {}
191
+ /**
192
+ * @remarks Not set to `undefined` at construction, unlike the other properties. Only exists after {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
193
+ *
194
+ * Computed by {@linkcode Color.multiply | multiplying} {@linkcode sceneBackground} by {@linkcode background}
195
+ */
196
+ rendererBackground?: Color | undefined;
197
+ }
198
+
199
+ interface Weights {
200
+ /**
201
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
202
+ *
203
+ * Once initialized, the default is {@linkcode CONFIG.Canvas.lightLevels.dark}`?? 0`, mostly. The `??` left operand is the entire `CONFIG.Canvas.lightLevels` object,
204
+ * and the default is by `Object.assign`.
205
+ */
206
+ dark: number | undefined;
207
+
208
+ /**
209
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
210
+ *
211
+ * Once initialized, the default is {@linkcode CONFIG.Canvas.lightLevels.halfdark}`?? 0.5`, mostly. The `??` left operand is the entire `CONFIG.Canvas.lightLevels` object,
212
+ * and the default is by `Object.assign`.
213
+ */
214
+ halfdark: number | undefined;
215
+
216
+ /**
217
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
218
+ *
219
+ * Once initialized, the default is {@linkcode CONFIG.Canvas.lightLevels.halfdark}`?? 0.25`, mostly. The `??` left operand is the entire `CONFIG.Canvas.lightLevels` object,
220
+ * and the default is by `Object.assign`.
221
+ */
222
+ dim: number | undefined;
223
+
224
+ /**
225
+ * @remarks Only `undefined` prior to {@linkcode EnvironmentCanvasGroup.initialize | initialization}.
226
+ *
227
+ * Once initialized, the default is {@linkcode CONFIG.Canvas.lightLevels.halfdark}`?? 1`, mostly. The `??` left operand is the entire `CONFIG.Canvas.lightLevels` object,
228
+ * and the default is by `Object.assign`.
229
+ */
230
+ bright: number | undefined;
231
+ }
89
232
 
90
233
  /** @internal */
91
- type _InitializeOptions = NullishProps<{
234
+ type _Config = InexactPartial<{
92
235
  /** The background canvas color */
93
236
  backgroundColor: Color.Source;
94
237
 
@@ -108,30 +251,30 @@ declare namespace EnvironmentCanvasGroup {
108
251
  fogUnexploredColor: Color.Source;
109
252
 
110
253
  /**
111
- * @deprecated since v12 until v14
112
- * @remarks "config.darknessLevel parameter into EnvironmentCanvasGroup#initialize is deprecated.
113
- * You should pass the darkness level into config.environment.darknessLevel"
114
- * @privateRemarks [sic]
254
+ * The scene environment data
255
+ * @defaultValue `{}`
256
+ * @remarks Default applied during destructuring assignment inside {@linkcode EnvironmentCanvasGroup.initialize | #initialize}
257
+ *
258
+ * Any values not provided will be filled in via {@linkcode foundry.utils.mergeObject} with this as the `original` and `canvas.scene.toObject().environment`
259
+ * as the `other`, with `overwrite: false`, so values here should not be `undefined` unless otherwise allowed by the Scene schema.
260
+ */
261
+ environment: DeepPartial<Scene.EnvironmentData>;
262
+
263
+ /**
264
+ * @deprecated "`config.darknessLevel` parameter into {@linkcode EnvironmentCanvasGroup.initialize | EnvironmentCanvasGroup#initialize} is deprecated.
265
+ * You should pass the darkness level into {@linkcode this.environment | config.environment.darknessLevel}" (since v12 until v14)
115
266
  */
116
267
  darknessLevel: number;
117
- }> &
118
- InexactPartial<{
119
- /**
120
- * The scene environment data
121
- * @defaultValue `{}`
122
- * @remarks Can't be `null` as it only has a parameter default and has properties accessed
123
- */
124
- environment: NullishProps<Scene.EnvironmentData>;
125
- }>;
126
-
127
- interface InitializeOptions extends _InitializeOptions {}
268
+ }>;
269
+
270
+ interface Config extends _Config {}
271
+
272
+ /** @deprecated Use {@linkcode EnvironmentCanvasGroup.Config} instead */
273
+ interface InitializeOptions extends Config {}
128
274
  }
129
275
 
130
276
  export default EnvironmentCanvasGroup;
131
277
 
132
- declare abstract class AnyEnvironmentCanvasGroup extends EnvironmentCanvasGroup<
133
- EnvironmentCanvasGroup.DrawOptions,
134
- EnvironmentCanvasGroup.TearDownOptions
135
- > {
278
+ declare abstract class AnyEnvironmentCanvasGroup extends EnvironmentCanvasGroup {
136
279
  constructor(...args: never);
137
280
  }
@@ -1,10 +1,11 @@
1
- import type { HandleEmptyObject, Identity } from "#utils";
1
+ import type { FixedInstanceType, HandleEmptyObject, Identity } from "#utils";
2
2
  import type { CanvasGroupMixin } from "#client/canvas/groups/_module.d.mts";
3
+ import type { CanvasVisionMask, CanvasOcclusionMask, CanvasDepthMask } from "#client/canvas/layers/_module.d.mts";
3
4
 
4
5
  declare module "#configuration" {
5
6
  namespace Hooks {
6
7
  interface CanvasGroupConfig {
7
- HiddenCanvasGroup: foundry.canvas.groups.HiddenCanvasGroup.Any;
8
+ HiddenCanvasGroup: HiddenCanvasGroup.Implementation;
8
9
  }
9
10
  }
10
11
  }
@@ -16,25 +17,26 @@ declare class HiddenCanvasGroup<
16
17
  DrawOptions extends HiddenCanvasGroup.DrawOptions = HiddenCanvasGroup.DrawOptions,
17
18
  TearDownOptions extends HiddenCanvasGroup.TearDownOptions = HiddenCanvasGroup.TearDownOptions,
18
19
  > extends CanvasGroupMixin<typeof PIXI.Container, "hidden">(PIXI.Container)<DrawOptions, TearDownOptions> {
19
- /**
20
- * @defaultValue `"none"`
21
- */
20
+ // static override groupName is handled by the CanvasGroupMixin type
21
+
22
+ /** @defaultValue `"none"` */
22
23
  override eventMode: PIXI.EventMode;
23
24
 
24
25
  /**
25
26
  * The container which hold masks.
26
27
  */
27
- masks: PIXI.Container;
28
+ masks: HiddenCanvasGroup.MasksContainer;
28
29
 
29
30
  /**
30
31
  * Add a mask to this group.
31
32
  * @param name - Name of the mask.
32
33
  * @param displayObject - Display object to add.
33
34
  * @param position - Position of the mask.
34
- * @throws If `displayObject` doesn't implement a `clear` method, or if `name` is an empty string
35
- * @remarks `position` is not used if fasley
35
+ * @remarks If `position` is passed, uses {@linkcode PIXI.Container.addChildAt | PIXI.Container#addChildAt},
36
+ * replacing an existing child, otherwise simply appends with `addChild`
37
+ * @throws If `name` is an empty string
36
38
  */
37
- addMask(name: string, displayObject: PIXI.DisplayObject, position?: number | null): void;
39
+ addMask(name: string, displayObject: HiddenCanvasGroup.ObjectWithClear, position?: number): void;
38
40
 
39
41
  /**
40
42
  * Invalidate the masks: flag them for rerendering.
@@ -44,11 +46,40 @@ declare class HiddenCanvasGroup<
44
46
  protected override _draw(options: HandleEmptyObject<DrawOptions>): Promise<void>;
45
47
 
46
48
  protected override _tearDown(options: HandleEmptyObject<TearDownOptions>): Promise<void>;
49
+
50
+ #HiddenCanvasGroup: true;
47
51
  }
48
52
 
49
53
  declare namespace HiddenCanvasGroup {
50
- interface Any extends AnyHiddenCanvasGroup {}
51
- interface AnyConstructor extends Identity<typeof AnyHiddenCanvasGroup> {}
54
+ /** @deprecated There should only be a single implementation of this class in use at one time, use {@linkcode Implementation} instead */
55
+ type Any = Internal.Any;
56
+
57
+ /** @deprecated There should only be a single implementation of this class in use at one time, use {@linkcode ImplementationClass} instead */
58
+ type AnyConstructor = Internal.AnyConstructor;
59
+
60
+ namespace Internal {
61
+ interface Any extends AnyHiddenCanvasGroup {}
62
+ interface AnyConstructor extends Identity<typeof AnyHiddenCanvasGroup> {}
63
+ }
64
+
65
+ interface ImplementationClass extends Identity<typeof CONFIG.Canvas.groups.hidden.groupClass> {}
66
+ interface Implementation extends FixedInstanceType<ImplementationClass> {}
67
+
68
+ /**
69
+ * @remarks {@linkcode HiddenCanvasGroup.addMask | addMask} throws if the provided object lacks a
70
+ * `clear` property, and by usage it wants a `() => void` method
71
+ */
72
+ interface ObjectWithClear extends PIXI.DisplayObject {
73
+ clear(): void;
74
+ }
75
+
76
+ interface MasksContainer extends PIXI.Container {
77
+ canvas: PIXI.LegacyGraphics;
78
+ scene: PIXI.LegacyGraphics;
79
+ vision: CanvasVisionMask;
80
+ occlusion: CanvasOcclusionMask;
81
+ depth: CanvasDepthMask;
82
+ }
52
83
 
53
84
  interface DrawOptions extends CanvasGroupMixin.DrawOptions {}
54
85
 
@@ -57,9 +88,6 @@ declare namespace HiddenCanvasGroup {
57
88
 
58
89
  export default HiddenCanvasGroup;
59
90
 
60
- declare abstract class AnyHiddenCanvasGroup extends HiddenCanvasGroup<
61
- HiddenCanvasGroup.DrawOptions,
62
- HiddenCanvasGroup.TearDownOptions
63
- > {
91
+ declare abstract class AnyHiddenCanvasGroup extends HiddenCanvasGroup {
64
92
  constructor(...args: never);
65
93
  }
@@ -1,4 +1,4 @@
1
- import type { HandleEmptyObject, Identity, InexactPartial, NullishProps } from "#utils";
1
+ import type { FixedInstanceType, HandleEmptyObject, Identity, InexactPartial } from "#utils";
2
2
  import type { Canvas } from "#client/canvas/_module.d.mts";
3
3
  import type { PreciseText } from "#client/canvas/containers/_module.mjs";
4
4
  import type { CanvasGroupMixin } from "#client/canvas/groups/_module.d.mts";
@@ -7,7 +7,7 @@ import type { Drawing } from "#client/canvas/placeables/_module.d.mts";
7
7
  declare module "#configuration" {
8
8
  namespace Hooks {
9
9
  interface CanvasGroupConfig {
10
- InterfaceCanvasGroup: InterfaceCanvasGroup.Any;
10
+ InterfaceCanvasGroup: InterfaceCanvasGroup.Implementation;
11
11
  }
12
12
  }
13
13
  }
@@ -19,6 +19,8 @@ declare class InterfaceCanvasGroup<
19
19
  DrawOptions extends InterfaceCanvasGroup.DrawOptions = InterfaceCanvasGroup.DrawOptions,
20
20
  TearDownOptions extends InterfaceCanvasGroup.TearDownOptions = InterfaceCanvasGroup.TearDownOptions,
21
21
  > extends CanvasGroupMixin<typeof PIXI.Container, "interface">(PIXI.Container)<DrawOptions, TearDownOptions> {
22
+ // static override groupName is handled by the CanvasGroupMixin type
23
+
22
24
  /**
23
25
  * Add a PrimaryGraphics to the group.
24
26
  * @param drawing - The Drawing being added
@@ -36,44 +38,56 @@ declare class InterfaceCanvasGroup<
36
38
  protected override _draw(options: HandleEmptyObject<DrawOptions>): Promise<void>;
37
39
 
38
40
  /**
39
- * Display scrolling status text originating from this ObjectHUD container.
41
+ * Display scrolling status text originating from an origin point on the Canvas.
40
42
  * @param origin - An origin point where the text should first emerge
41
43
  * @param content - The text content to display
42
- * @param options - Options which customize the text animation
43
- * @returns The created PreciseText object which is scrolling
44
- * @remarks Only returns `null` if the core `scrollingStatusText` setting is falsey
44
+ * @param options - Options which customize the text animation (default: `{}`)
45
+ * @returns The created {@linkcode PreciseText} object which is scrolling
46
+ * @remarks Only returns `undefined` if the core `scrollingStatusText` setting is falsey
45
47
  */
46
48
  createScrollingText(
47
49
  origin: Canvas.Point,
48
50
  content: string,
49
51
  options?: InterfaceCanvasGroup.CreateScrollingTextOptions,
50
- ): Promise<PreciseText | null>;
52
+ ): Promise<PreciseText | undefined>;
53
+
54
+ #InterfaceCanvasGroup: true;
51
55
  }
52
56
 
53
57
  declare namespace InterfaceCanvasGroup {
54
- interface Any extends AnyInterfaceCanvasGroup {}
55
- interface AnyConstructor extends Identity<typeof AnyInterfaceCanvasGroup> {}
58
+ /** @deprecated There should only be a single implementation of this class in use at one time, use {@linkcode Implementation} instead */
59
+ type Any = Internal.Any;
60
+
61
+ /** @deprecated There should only be a single implementation of this class in use at one time, use {@linkcode ImplementationClass} instead */
62
+ type AnyConstructor = Internal.AnyConstructor;
63
+
64
+ namespace Internal {
65
+ interface Any extends AnyInterfaceCanvasGroup {}
66
+ interface AnyConstructor extends Identity<typeof AnyInterfaceCanvasGroup> {}
67
+ }
68
+
69
+ interface ImplementationClass extends Identity<typeof CONFIG.Canvas.groups.interface.groupClass> {}
70
+ interface Implementation extends FixedInstanceType<ImplementationClass> {}
56
71
 
57
72
  /** @internal */
58
- type _CreateScrollingTextOptions = NullishProps<{
73
+ type _CreateScrollingTextOptions = InexactPartial<{
59
74
  /**
60
75
  * The distance in pixels that the scrolling text should travel
61
76
  * @defaultValue Double the width or height of the text, depending on direction
62
- * @remarks Default provided by `??`
63
77
  */
64
78
  distance: number;
65
79
 
66
80
  /**
67
81
  * The original anchor point where the text appears
68
- * @defaultValue `CONST.TEXT_ANCHOR_POINTS.CENTER`
82
+ * @defaultValue {@linkcode CONST.TEXT_ANCHOR_POINTS.CENTER}
69
83
  */
70
- anchor: foundry.CONST.TEXT_ANCHOR_POINTS;
84
+ anchor: CONST.TEXT_ANCHOR_POINTS;
71
85
 
72
86
  /**
73
87
  * The direction in which the text scrolls
74
- * @defaultValue `CONST.TEXT_ANCHOR_POINTS.TOP`
88
+ * @defaultValue {@linkcode CONST.TEXT_ANCHOR_POINTS.TOP}
75
89
  */
76
- direction: foundry.CONST.TEXT_ANCHOR_POINTS;
90
+ direction: CONST.TEXT_ANCHOR_POINTS;
77
91
 
78
92
  /**
79
93
  * An amount of randomization between [0, 1] applied to the initial position
@@ -81,19 +95,16 @@ declare namespace InterfaceCanvasGroup {
81
95
  * @remarks Only used if truthy
82
96
  */
83
97
  jitter: number;
84
- }> &
85
- InexactPartial<{
86
- /**
87
- * The duration of the scrolling effect in milliseconds
88
- * @defaultValue `2000`
89
- * @remarks Can't be `null` as it only has a parameter default and a duration of `0` is not appropriate
90
- */
91
- duration: number;
92
- }> &
93
- /*
94
- * Additional parameters of PIXI.TextStyle which are applied to the text
95
- * Excess keys are collected as `{...textStyle}` and passed to {@linkcode PreciseText.getTextStyle} which checks for `!== undefined`, so this can't be NullishProps
98
+
99
+ /**
100
+ * The duration of the scrolling effect in milliseconds
101
+ * @defaultValue `2000`
96
102
  */
103
+ duration: number;
104
+ }> &
105
+ // Additional parameters of PIXI.TextStyle which are applied to the text
106
+ // Excess keys are collected as `{...textStyle}` and passed to {@linkcode PreciseText.getTextStyle} which checks for `!== undefined`,
107
+ // so this doesn't fall under the usual 'no InexactPartial on external interfaces' rule
97
108
  InexactPartial<PIXI.ITextStyle>;
98
109
 
99
110
  interface CreateScrollingTextOptions extends _CreateScrollingTextOptions {}
@@ -1,11 +1,11 @@
1
- import type { Identity } from "#utils";
1
+ import type { FixedInstanceType, Identity } from "#utils";
2
2
  import type { CanvasGroupMixin } from "#client/canvas/groups/_module.d.mts";
3
3
  import type { UnboundContainer } from "#client/canvas/containers/_module.d.mts";
4
4
 
5
5
  declare module "#configuration" {
6
6
  namespace Hooks {
7
7
  interface CanvasGroupConfig {
8
- OverlayCanvasGroup: OverlayCanvasGroup.Any;
8
+ OverlayCanvasGroup: OverlayCanvasGroup.Implementation;
9
9
  }
10
10
  }
11
11
  }
@@ -17,6 +17,8 @@ declare class OverlayCanvasGroup<
17
17
  DrawOptions extends OverlayCanvasGroup.DrawOptions = OverlayCanvasGroup.DrawOptions,
18
18
  TearDownOptions extends OverlayCanvasGroup.TearDownOptions = OverlayCanvasGroup.TearDownOptions,
19
19
  > extends CanvasGroupMixin<typeof UnboundContainer, "overlay">(UnboundContainer)<DrawOptions, TearDownOptions> {
20
+ // static override groupName is handled by the CanvasGroupMixin type
21
+
20
22
  /**
21
23
  * Should this group tear down its non-layer children?
22
24
  * @defaultValue `false`
@@ -25,8 +27,19 @@ declare class OverlayCanvasGroup<
25
27
  }
26
28
 
27
29
  declare namespace OverlayCanvasGroup {
28
- interface Any extends AnyOverlayCanvasGroup {}
29
- interface AnyConstructor extends Identity<typeof AnyOverlayCanvasGroup> {}
30
+ /** @deprecated There should only be a single implementation of this class in use at one time, use {@linkcode Implementation} instead */
31
+ type Any = Internal.Any;
32
+
33
+ /** @deprecated There should only be a single implementation of this class in use at one time, use {@linkcode ImplementationClass} instead */
34
+ type AnyConstructor = Internal.AnyConstructor;
35
+
36
+ namespace Internal {
37
+ interface Any extends AnyOverlayCanvasGroup {}
38
+ interface AnyConstructor extends Identity<typeof AnyOverlayCanvasGroup> {}
39
+ }
40
+
41
+ interface ImplementationClass extends Identity<typeof CONFIG.Canvas.groups.overlay.groupClass> {}
42
+ interface Implementation extends FixedInstanceType<ImplementationClass> {}
30
43
 
31
44
  interface DrawOptions extends CanvasGroupMixin.DrawOptions {}
32
45