@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250801022737 → 13.346.0-beta.20250801172911

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 (40) hide show
  1. package/package.json +1 -1
  2. package/src/configuration/hooks.d.mts +2 -1
  3. package/src/foundry/client/canvas/animation/_types.d.mts +1 -1
  4. package/src/foundry/client/canvas/animation/canvas-animation.d.mts +95 -44
  5. package/src/foundry/client/canvas/animation/chat-bubbles.d.mts +79 -8
  6. package/src/foundry/client/canvas/animation/smooth-noise.d.mts +23 -8
  7. package/src/foundry/client/canvas/board.d.mts +180 -31
  8. package/src/foundry/client/canvas/groups/canvas-group-mixin.d.mts +4 -3
  9. package/src/foundry/client/canvas/groups/visibility.d.mts +104 -60
  10. package/src/foundry/client/canvas/interaction/mouse-handler.d.mts +143 -85
  11. package/src/foundry/client/canvas/interaction/ping/alert.d.mts +14 -11
  12. package/src/foundry/client/canvas/interaction/ping/arrow.d.mts +5 -5
  13. package/src/foundry/client/canvas/interaction/ping/chevron.d.mts +27 -56
  14. package/src/foundry/client/canvas/interaction/ping/ping.d.mts +22 -17
  15. package/src/foundry/client/canvas/interaction/ping/pulse.d.mts +15 -44
  16. package/src/foundry/client/canvas/interaction/render-flags.d.mts +29 -15
  17. package/src/foundry/client/canvas/interaction/ruler/base-ruler.d.mts +230 -3
  18. package/src/foundry/client/canvas/interaction/ruler/ruler.d.mts +139 -434
  19. package/src/foundry/client/canvas/layers/controls.d.mts +1 -1
  20. package/src/foundry/client/canvas/layers/masks/vision.d.mts +28 -40
  21. package/src/foundry/client/canvas/perception/detection-mode.d.mts +62 -30
  22. package/src/foundry/client/canvas/perception/detection-modes/darkvision.d.mts +3 -2
  23. package/src/foundry/client/canvas/perception/detection-modes/invisibility-perception.d.mts +8 -3
  24. package/src/foundry/client/canvas/perception/detection-modes/light-perception.d.mts +6 -5
  25. package/src/foundry/client/canvas/perception/detection-modes/super-perception.d.mts +8 -3
  26. package/src/foundry/client/canvas/perception/detection-modes/tremor-perception.d.mts +8 -3
  27. package/src/foundry/client/canvas/perception/fog.d.mts +43 -42
  28. package/src/foundry/client/canvas/perception/perception-manager.d.mts +21 -23
  29. package/src/foundry/client/canvas/perception/vision-mode.d.mts +73 -62
  30. package/src/foundry/client/canvas/placeables/tokens/ring.d.mts +2 -2
  31. package/src/foundry/client/canvas/placeables/tokens/ruler.d.mts +5 -40
  32. package/src/foundry/client/canvas/sources/base-light-source.d.mts +4 -0
  33. package/src/foundry/client/canvas/sources/point-light-source.d.mts +2 -2
  34. package/src/foundry/client/canvas/sources/rendered-effect-source.d.mts +12 -5
  35. package/src/foundry/client/config.d.mts +4 -0
  36. package/src/foundry/client/documents/user.d.mts +2 -2
  37. package/src/foundry/client/hooks.d.mts +7 -0
  38. package/src/foundry/common/grid/base.d.mts +7 -1
  39. package/src/foundry/common/utils/color.d.mts +2 -1
  40. package/src/foundry/common/utils/event-emitter.d.mts +2 -1
@@ -59,14 +59,6 @@ declare class CanvasVisionMask extends CachedContainer {
59
59
  * @returns The detached vision container.
60
60
  */
61
61
  detachVision(): CanvasVisionMask.CanvasVisionContainer;
62
-
63
- /**
64
- * @deprecated since v11, will be removed in v13
65
- * @remarks "CanvasVisionMask#filter has been renamed to blurFilter."
66
- */
67
- get filter(): this["blurFilter"];
68
-
69
- set filter(f: AlphaBlurFilter);
70
62
  }
71
63
 
72
64
  declare namespace CanvasVisionMask {
@@ -75,18 +67,18 @@ declare namespace CanvasVisionMask {
75
67
 
76
68
  /**
77
69
  * The sight part of {@linkcode CanvasVisionContainer}.
78
- * The blend mode is MAX_COLOR.
70
+ * The blend mode is {@linkcode PIXI.BLEND_MODES.MAX_COLOR | MAX_COLOR}.
79
71
  */
80
72
  interface CanvasVisionContainerSight extends PIXI.LegacyGraphics {
81
73
  /**
82
74
  * FOV that should not be committed to fog exploration.
83
- * @remarks `blendMode` set to `PIXI.BLEND_MODES.MAX_COLOR`
75
+ * @remarks `blendMode` set to {@linkcode PIXI.BLEND_MODES.MAX_COLOR}
84
76
  */
85
77
  preview: PIXI.LegacyGraphics;
86
78
  }
87
79
 
88
80
  interface GlobalLightContainer extends PIXI.Container {
89
- /** @remarks `blendMode` set to `PIXI.BLEND_MODES.MAX_COLOR` */
81
+ /** @remarks `blendMode` set to {@linkcode PIXI.BLEND_MODES.MAX_COLOR} */
90
82
  source: PIXI.LegacyGraphics;
91
83
 
92
84
  meshes: PIXI.Container;
@@ -98,22 +90,24 @@ declare namespace CanvasVisionMask {
98
90
 
99
91
  /**
100
92
  * The light part of {@linkcode CanvasVisionContainer}.
101
- * The blend mode is MAX_COLOR.
93
+ * The blend mode is {@linkcode PIXI.BLEND_MODES.MAX_COLOR | MAX_COLOR}.
102
94
  */
103
95
  interface CanvasVisionContainerLight extends PIXI.LegacyGraphics {
104
96
  /**
105
97
  * FOV that should not be committed to fog exploration.
106
- * @remarks `blendMode` set to `PIXI.BLEND_MODES.MAX_COLOR`
98
+ * @remarks `blendMode` set to {@linkcode PIXI.BLEND_MODES.MAX_COLOR}
107
99
  */
108
100
  preview: PIXI.LegacyGraphics;
109
101
 
110
102
  /**
111
103
  * The sprite with the texture of FOV of cached light sources.
112
- * @remarks `blendMode` set to `PIXI.BLEND_MODES.MAX_COLOR`
104
+ * @remarks `blendMode` set to {@linkcode PIXI.BLEND_MODES.MAX_COLOR}
113
105
  */
114
106
  cached: SpriteMesh;
115
107
 
116
- /** The light perception polygons of vision sources and the FOV of vision sources that provide vision. */
108
+ /**
109
+ * The light perception polygons of vision sources and the FOV of vision sources that provide vision.
110
+ */
117
111
  mask: LightMaskGraphics;
118
112
 
119
113
  /**
@@ -123,32 +117,30 @@ declare namespace CanvasVisionMask {
123
117
 
124
118
  /**
125
119
  * The light sources
126
- * @remarks `blendMode` set to `PIXI.BLEND_MODES.MAX_COLOR`
120
+ * @remarks `blendMode` set to {@linkcode PIXI.BLEND_MODES.MAX_COLOR}
127
121
  */
128
122
  sources: PIXI.LegacyGraphics;
129
123
 
130
124
  /**
131
- * @deprecated since v12, until 14
132
- * @remarks "CanvasVisibility#vision#fov#lights is deprecated without replacement."
125
+ * @deprecated "`CanvasVisibility#vision#fov#lights` is deprecated without replacement." (since v12, until v14)
126
+ * @privateRemarks Returns `CanvasVisibility##cachedLights`
133
127
  */
134
- readonly lights: PIXI.LegacyGraphics;
128
+ get lights(): PIXI.LegacyGraphics;
135
129
 
136
130
  /**
137
- * @deprecated since v12, until 14
138
- * @remarks "CanvasVisibility#vision#fov#lightsSprite is deprecated in favor of CanvasVisibility#vision#light#cached."
131
+ * @deprecated "`CanvasVisibility#vision#fov#lightsSprite` is deprecated in favor of {@linkcode CanvasVisionContainerLight.cached | CanvasVisibility#vision#light#cached}." (since v12, until v14)
139
132
  */
140
- readonly lightsSprite: SpriteMesh;
133
+ get lightsSprite(): this["cached"];
141
134
 
142
135
  /**
143
- * @deprecated since v12, until 14
144
- * @remarks "CanvasVisibility#vision#fov#tokens is deprecated in favor of CanvasVisibility#vision#light."d
136
+ * @deprecated "`CanvasVisibility#vision#fov#tokens` is deprecated in favor of {@linkcode CanvasVisionContainer.light | CanvasVisibility#vision#light}." (since v12, until v14)
145
137
  */
146
- readonly tokens: this;
138
+ get tokens(): this;
147
139
  }
148
140
 
149
141
  /**
150
142
  * The sight part of {@linkcode CanvasVisionContainer}.
151
- * The blend mode is ERASE.
143
+ * The blend mode is {@linkcode PIXI.BLEND_MODES.ERASE | ERASE}.
152
144
  */
153
145
  interface CanvasVisionContainerDarkness extends PIXI.LegacyGraphics {
154
146
  /** Darkness source erasing fog of war. */
@@ -158,9 +150,8 @@ declare namespace CanvasVisionMask {
158
150
  /** The currently visible areas. */
159
151
  interface CanvasVisionContainer extends PIXI.Container {
160
152
  /**
161
- * @remarks A void filter necessary when committing fog on a texture for dynamic illumination; disabled by default
162
- *
163
- * `blendMode` set to `PIXI.BLEND_MODES.MAX_COLOR`
153
+ * A void filter necessary when committing fog on a texture for dynamic illumination; disabled by default, used only when writing on textures
154
+ * @remarks `blendMode` set to {@linkcode PIXI.BLEND_MODES.MAX_COLOR}
164
155
  */
165
156
  containmentFilter: VoidFilter;
166
157
 
@@ -169,33 +160,30 @@ declare namespace CanvasVisionMask {
169
160
 
170
161
  /**
171
162
  * Areas visible because of FOV of vision sources.
172
- * @remarks `blendMode` set to `PIXI.BLEND_MODES.MAX_COLOR`
163
+ * @remarks `blendMode` set to {@linkcode PIXI.BLEND_MODES.MAX_COLOR}
173
164
  */
174
165
  sight: CanvasVisionContainerSight;
175
166
 
176
167
  /**
177
168
  * Areas erased by darkness sources.
178
- * @remarks `blendMode` set to `PIXI.BLEND_MODES.ERASE`
169
+ * @remarks `blendMode` set to {@linkcode PIXI.BLEND_MODES.ERASE}
179
170
  */
180
171
  darkness: CanvasVisionContainerDarkness;
181
172
 
182
173
  /**
183
- * @deprecated since v12, until 14
184
- * @remarks "CanvasVisibility#vision#base is deprecated in favor of CanvasVisibility#vision#light#preview."
174
+ * @deprecated "`CanvasVisibility#vision#base` is deprecated in favor of {@linkcode CanvasVisionContainerLight.preview | CanvasVisibility#vision#light#preview}." (since v12, until v14)
185
175
  */
186
- readonly base: CanvasVisionContainerLight["preview"];
176
+ get base(): this["light"]["preview"];
187
177
 
188
178
  /**
189
- * @deprecated since v12, until 14
190
- * @remarks "CanvasVisibility#vision#fov is deprecated in favor of CanvasVisibility#vision#light."
179
+ * @deprecated "`CanvasVisibility#vision#fov` is deprecated in favor of {@linkcode CanvasVisionContainer.light | CanvasVisibility#vision#light}." (since v12, until v14)
191
180
  */
192
- readonly fov: CanvasVisionContainerLight;
181
+ get fov(): this["light"];
193
182
 
194
183
  /**
195
- * @deprecated since v12, until 14
196
- * @remarks "CanvasVisibility#vision#los is deprecated in favor of CanvasVisibility#vision#light#mask."
184
+ * @deprecated "`CanvasVisibility#vision#los` is deprecated in favor of {@linkcode CanvasVisionContainerLight.mask | CanvasVisibility#vision#light#mask}." (since v12, until v14)
197
185
  */
198
- readonly los: CanvasVisionContainerLight["mask"];
186
+ get los(): this["light"]["mask"];
199
187
  }
200
188
  }
201
189
 
@@ -1,61 +1,68 @@
1
- import type { Brand, Identity, NullishProps } from "#utils";
1
+ import type { Brand, Identity } from "#utils";
2
2
  import type { fields } from "#common/data/_module.d.mts";
3
3
  import type { DataSchema } from "#common/data/fields.d.mts";
4
+ import type { DataModel } from "#common/abstract/_module.d.mts";
4
5
  import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
6
+ import type { PointVisionSource } from "../sources/_module.d.mts";
5
7
 
6
8
  /**
7
9
  * A Detection Mode which can be associated with any kind of sense/vision/perception.
8
10
  * A token could have multiple detection modes.
9
11
  */
10
- declare class DetectionMode extends foundry.abstract.DataModel<DetectionMode.Schema> {
12
+ declare class DetectionMode extends DataModel<DetectionMode.Schema> {
11
13
  static override defineSchema(): DetectionMode.Schema;
12
14
 
13
15
  /**
14
16
  * Get the detection filter pertaining to this mode.
17
+ * @remarks Always `undefined` in {@linkcode DetectionMode}
15
18
  */
16
19
  static getDetectionFilter(): PIXI.Filter | undefined;
17
20
 
18
21
  /**
19
22
  * An optional filter to apply on the target when it is detected with this mode.
23
+ * @remarks Never set in {@linkcode DetectionMode}; Core subclasses that use one set it in {@linkcode getDetectionFilter} overrides.
20
24
  */
21
- static _detectionFilter: PIXI.Filter | undefined;
25
+ protected static _detectionFilter: PIXI.Filter | undefined;
22
26
 
23
27
  /**
24
28
  * The type of the detection mode.
25
29
  * @see {@linkcode CONST.WALL_RESTRICTION_TYPES}
26
- * @remarks Set via `Object.defineProperty` with a frozen object, so `readonly` is justified both here and for the interface properties
30
+ * @remarks Returns a reference to a private, frozen object
27
31
  */
28
- static readonly DETECTION_TYPES: DetectionMode.DetectionTypes;
32
+ static get DETECTION_TYPES(): DetectionMode.DetectionTypes;
29
33
 
30
34
  /**
31
35
  * The identifier of the basic sight detection mode.
36
+ * @remarks A subclass could override this in reality, but `"basicSight"` is used as a magic string without checking here in both
37
+ * {@linkcode foundry.canvas.placeables.Token._prepareDetectionModes | Token#_prepareDetectionModes} and
38
+ * {@linkcode foundry.canvas.groups.CanvasVisibility.testVisibility | CanvasVisibility#testVisibility}, so it's been typed as the
39
+ * literal to avoid accidental breakage.
32
40
  */
33
- static readonly BASIC_MODE_ID: "basicSight";
41
+ static get BASIC_MODE_ID(): "basicSight";
34
42
 
35
43
  /**
36
44
  * Test visibility of a target object or array of points for a specific vision source.
37
45
  * @param visionSource - The vision source being tested
38
46
  * @param mode - The detection mode configuration
39
47
  * @param config - The visibility test configuration
40
- * @returns Is the test target visible?
48
+ * @returns Is the test target visible?
41
49
  */
42
50
  testVisibility(
43
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
51
+ visionSource: PointVisionSource.Any,
44
52
  mode: TokenDocument.DetectionModeData,
45
- { object, tests }: DetectionMode.TestConfig, // not:null (destructured)
53
+ config: CanvasVisibility.TestConfig,
46
54
  ): boolean;
47
55
 
48
56
  /**
49
- * Can this VisionSource theoretically detect a certain object based on its properties?
57
+ * Can this {@linkcode PointVisionSource} theoretically detect a certain object based on its properties?
50
58
  * This check should not consider the relative positions of either object, only their state.
51
59
  * @param visionSource - The vision source being tested
52
60
  * @param target - The target object being tested
53
61
  * @returns Can the target object theoretically be detected by this vision source?
62
+ * @remarks Will always be passed a `target` when called by {@linkcode testVisibility | DetectionMode#testVisibility}, it just might possibly be `undefined`.
63
+ * All use is gated behind an `instanceof Token` check, so that's fine.
54
64
  */
55
- protected _canDetect(
56
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
57
- target: CanvasVisibility.TestObject,
58
- ): boolean;
65
+ protected _canDetect(visionSource: PointVisionSource.Any, target: CanvasVisibility.TestObject | undefined): boolean;
59
66
 
60
67
  /**
61
68
  * Evaluate a single test point to confirm whether it is visible.
@@ -64,11 +71,15 @@ declare class DetectionMode extends foundry.abstract.DataModel<DetectionMode.Sch
64
71
  * @param mode - The detection mode configuration
65
72
  * @param target - The target object being tested
66
73
  * @param test - The test case being evaluated
74
+ * @remarks As of 13.346, Foundry's implementation does not use `target` at all, neither directly, because the whole method is calling two subsidiary methods, nor in said
75
+ * subsidiary methods.
76
+ *
77
+ * See {@linkcode _canDetect} remarks.
67
78
  */
68
79
  protected _testPoint(
69
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
80
+ visionSource: PointVisionSource.Any,
70
81
  mode: TokenDocument.DetectionModeData,
71
- target: CanvasVisibility.TestObject,
82
+ target: CanvasVisibility.TestObject | undefined,
72
83
  test: CanvasVisibility.Test,
73
84
  ): boolean;
74
85
 
@@ -81,11 +92,14 @@ declare class DetectionMode extends foundry.abstract.DataModel<DetectionMode.Sch
81
92
  * @param target - The target object being tested
82
93
  * @param test - The test case being evaluated
83
94
  * @returns Is the LOS requirement satisfied for this test?
95
+ * @remarks As of 13.346, Foundry's implementation does not use `target` at all.
96
+ *
97
+ * See {@linkcode _canDetect} remarks.
84
98
  */
85
99
  protected _testLOS(
86
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
100
+ visionSource: PointVisionSource.Any,
87
101
  mode: TokenDocument.DetectionModeData,
88
- target: CanvasVisibility.TestObject,
102
+ target: CanvasVisibility.TestObject | undefined,
89
103
  test: CanvasVisibility.Test,
90
104
  ): boolean;
91
105
 
@@ -96,11 +110,14 @@ declare class DetectionMode extends foundry.abstract.DataModel<DetectionMode.Sch
96
110
  * @param target - The target object being tested
97
111
  * @param test - The test case being evaluated
98
112
  * @returns Is the point within the vision angle?
113
+ * @remarks As of 13.346, Foundry's implementation does not use `target` at all
114
+ *
115
+ * See {@linkcode _canDetect} remarks.
99
116
  */
100
117
  protected _testAngle(
101
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
118
+ visionSource: PointVisionSource.Any,
102
119
  mode: TokenDocument.DetectionModeData,
103
- target: CanvasVisibility.TestObject,
120
+ target: CanvasVisibility.TestObject | undefined,
104
121
  test: CanvasVisibility.Test,
105
122
  ): boolean;
106
123
 
@@ -111,13 +128,22 @@ declare class DetectionMode extends foundry.abstract.DataModel<DetectionMode.Sch
111
128
  * @param target - The target object being tested
112
129
  * @param test - The test case being evaluated
113
130
  * @returns Is the target within range?
131
+ * @remarks As of 13.346, Foundry's implementation does not use `target` at all
132
+ *
133
+ * See {@linkcode _canDetect} remarks.
114
134
  */
115
135
  protected _testRange(
116
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
136
+ visionSource: PointVisionSource.Any,
117
137
  mode: TokenDocument.DetectionModeData,
118
- target: CanvasVisibility.TestObject,
138
+ target: CanvasVisibility.TestObject | undefined,
119
139
  test: CanvasVisibility.Test,
120
140
  ): boolean;
141
+
142
+ /**
143
+ * @deprecated "`DetectionMode#BASIC_MODE_ID` is deprecated. Please use {@linkcode DetectionMode.BASIC_MODE_ID} instead." (since v13, until v15)
144
+ * @privateRemarks This was not previously typed by us, as it had been erroneously marked static in v12
145
+ */
146
+ get BASIC_MODE_ID(): typeof DetectionMode.BASIC_MODE_ID;
121
147
  }
122
148
 
123
149
  declare namespace DetectionMode {
@@ -138,16 +164,22 @@ declare namespace DetectionMode {
138
164
  /** If this DM is constrained by the vision angle */
139
165
  angle: fields.BooleanField<{ initial: true }>;
140
166
 
141
- type: fields.NumberField<{
142
- initial: DetectionMode.DETECTION_TYPES;
143
- choices: DetectionMode.DETECTION_TYPES[];
144
- }>;
167
+ type: fields.NumberField<
168
+ {
169
+ initial: typeof DetectionMode.DETECTION_TYPES.SIGHT;
170
+ choices: DetectionMode.DETECTION_TYPES[];
171
+ },
172
+ DetectionMode.DETECTION_TYPES,
173
+ DetectionMode.DETECTION_TYPES,
174
+ DetectionMode.DETECTION_TYPES
175
+ >;
145
176
  }
146
177
 
147
- /** @see CanvasVisibility.TestConfig */
148
- interface TestConfig
149
- extends CanvasVisibility._TestConfigRequired,
150
- NullishProps<CanvasVisibility._TestConfigOptional> {}
178
+ interface CreateData extends fields.SchemaField.CreateData<Schema> {}
179
+
180
+ interface UpdateData extends fields.SchemaField.UpdateData<Schema> {}
181
+
182
+ interface SourceData extends fields.SchemaField.SourceData<Schema> {}
151
183
 
152
184
  type DETECTION_TYPES = Brand<number, "DetectionMode.DETECTION_TYPES">;
153
185
 
@@ -1,6 +1,7 @@
1
1
  import type { Identity } from "#utils";
2
2
  import type { DetectionMode } from "../_module.d.mts";
3
3
  import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
4
+ import type { PointVisionSource } from "#client/canvas/sources/_module.d.mts";
4
5
 
5
6
  /**
6
7
  * A special detection mode which models a form of darkvision (night vision).
@@ -9,8 +10,8 @@ import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
9
10
  */
10
11
  declare class DetectionModeDarkvision extends DetectionMode {
11
12
  protected override _canDetect(
12
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
13
- target: CanvasVisibility.TestObject,
13
+ visionSource: PointVisionSource.Any,
14
+ target: CanvasVisibility.TestObject | undefined,
14
15
  ): boolean;
15
16
  }
16
17
 
@@ -1,6 +1,8 @@
1
1
  import type { Identity } from "#utils";
2
2
  import type { DetectionMode } from "../_module.d.mts";
3
3
  import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
4
+ import type { PointVisionSource } from "#client/canvas/sources/_module.d.mts";
5
+ import type { GlowOverlayFilter } from "#client/canvas/rendering/filters/_module.d.mts";
4
6
 
5
7
  /**
6
8
  * Detection mode that see invisible creatures.
@@ -9,11 +11,14 @@ import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
9
11
  * - The "See" version needs sight and is affected by blindness
10
12
  */
11
13
  declare class DetectionModeInvisibility extends DetectionMode {
12
- static override getDetectionFilter(): PIXI.Filter;
14
+ static override getDetectionFilter(): GlowOverlayFilter;
15
+
16
+ /** @privateRemarks Fake override */
17
+ protected static override _detectionFilter: GlowOverlayFilter | undefined;
13
18
 
14
19
  protected override _canDetect(
15
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
16
- target: CanvasVisibility.TestObject,
20
+ visionSource: PointVisionSource.Any,
21
+ target: CanvasVisibility.TestObject | undefined,
17
22
  ): boolean;
18
23
  }
19
24
 
@@ -1,22 +1,23 @@
1
1
  import type { Identity } from "#utils";
2
2
  import type { DetectionMode } from "../_module.d.mts";
3
3
  import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
4
+ import type { PointVisionSource } from "#client/canvas/sources/_module.d.mts";
4
5
 
5
6
  /**
6
7
  * This detection mode tests whether the target is visible due to being illuminated by a light source.
7
- * By default tokens have light perception with an infinite range if light perception isn't explicitely
8
+ * By default tokens have light perception with an infinite range if light perception isn't explicitly
8
9
  * configured.
9
10
  */
10
11
  declare class DetectionModeLightPerception extends DetectionMode {
11
12
  protected override _canDetect(
12
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
13
- target: CanvasVisibility.TestObject,
13
+ visionSource: PointVisionSource.Any,
14
+ target: CanvasVisibility.TestObject | undefined,
14
15
  ): boolean;
15
16
 
16
17
  protected override _testPoint(
17
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
18
+ visionSource: PointVisionSource.Any,
18
19
  mode: TokenDocument.DetectionModeData,
19
- target: CanvasVisibility.TestObject,
20
+ target: CanvasVisibility.TestObject | undefined,
20
21
  test: CanvasVisibility.Test,
21
22
  ): boolean;
22
23
  }
@@ -1,17 +1,22 @@
1
1
  import type { Identity } from "#utils";
2
2
  import type { DetectionMode } from "../_module.d.mts";
3
3
  import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
4
+ import type { PointVisionSource } from "#client/canvas/sources/_module.d.mts";
5
+ import type { OutlineOverlayFilter } from "#client/canvas/rendering/filters/_module.d.mts";
4
6
 
5
7
  /**
6
8
  * Detection mode that see ALL creatures (no blockers).
7
9
  * If not constrained by walls, see everything within the range.
8
10
  */
9
11
  declare class DetectionModeAll extends DetectionMode {
10
- static override getDetectionFilter(): PIXI.Filter;
12
+ static override getDetectionFilter(): OutlineOverlayFilter;
13
+
14
+ /** @privateRemarks Fake override */
15
+ protected static override _detectionFilter: OutlineOverlayFilter | undefined;
11
16
 
12
17
  protected override _canDetect(
13
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
14
- target: CanvasVisibility.TestObject,
18
+ visionSource: PointVisionSource.Any,
19
+ target: CanvasVisibility.TestObject | undefined,
15
20
  ): boolean;
16
21
  }
17
22
 
@@ -1,16 +1,21 @@
1
1
  import type { Identity } from "#utils";
2
2
  import type { DetectionMode } from "../_module.d.mts";
3
3
  import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
4
+ import type { PointVisionSource } from "#client/canvas/sources/_module.d.mts";
5
+ import type { OutlineOverlayFilter } from "#client/canvas/rendering/filters/_module.d.mts";
4
6
 
5
7
  /**
6
8
  * Detection mode that see creatures in contact with the ground.
7
9
  */
8
10
  declare class DetectionModeTremor extends DetectionMode {
9
- static override getDetectionFilter(): PIXI.Filter;
11
+ static override getDetectionFilter(): OutlineOverlayFilter;
12
+
13
+ /** @privateRemarks Fake override */
14
+ protected static override _detectionFilter: OutlineOverlayFilter | undefined;
10
15
 
11
16
  protected override _canDetect(
12
- visionSource: foundry.canvas.sources.PointVisionSource.Any,
13
- target: CanvasVisibility.TestObject,
17
+ visionSource: PointVisionSource.Any,
18
+ target: CanvasVisibility.TestObject | undefined,
14
19
  ): boolean;
15
20
  }
16
21
 
@@ -1,13 +1,19 @@
1
1
  import type EventEmitterMixin from "#common/utils/event-emitter.mjs";
2
2
  import type { FixedInstanceType, Identity } from "#utils";
3
- import type TextureExtractor from "#client/canvas/texture-extractor.d.mts";
4
3
  import type { SpriteMesh } from "#client/canvas/containers/_module.mjs";
5
4
  import type { CanvasVisibility } from "#client/canvas/groups/_module.d.mts";
5
+ import type { Canvas, TextureExtractor } from "#client/canvas/_module.d.mts";
6
6
 
7
7
  /**
8
- * A fog of war management class which is the singleton canvas.fog instance.
8
+ * A fog of war management class which is the singleton {@linkcode Canvas.fog | canvas.fog} instance.
9
9
  */
10
10
  declare class FogManager extends EventEmitterMixin() {
11
+ /**
12
+ * @defaultValue `["explored"]`
13
+ * @remarks Frozen
14
+ */
15
+ static override emittedEvents: readonly string[];
16
+
11
17
  /**
12
18
  * The FogExploration document which applies to this canvas view
13
19
  * @defaultValue `null`
@@ -17,13 +23,13 @@ declare class FogManager extends EventEmitterMixin() {
17
23
  /**
18
24
  * Track whether we have pending fog updates which have not yet been saved to the database
19
25
  * @defaultValue `false`
20
- * @remarks Foundry marked `@internal`
26
+ * @internal
21
27
  */
22
28
  protected _updated: boolean;
23
29
 
24
30
  /**
25
31
  * Texture extractor
26
- * @remarks Only `undefined` before first `#initialize()`ation. Set to `null` if {@linkcode TextureExtractor} creation fails, and will not retry from that state.
32
+ * @remarks Only `undefined` before first {@linkcode initialize} call. Set to `null` if {@linkcode TextureExtractor} creation fails, and will not retry from that state.
27
33
  */
28
34
  get extractor(): TextureExtractor | undefined | null;
29
35
 
@@ -42,25 +48,29 @@ declare class FogManager extends EventEmitterMixin() {
42
48
  * The configured options used for the saved fog-of-war texture.
43
49
  * @remarks Only `undefined` prior to the first time the canvas visibility layer is `#draw()`n
44
50
  */
45
- get textureConfiguration(): CanvasVisibility.TextureConfiguration | undefined;
51
+ get textureConfiguration(): CanvasVisibility["textureConfiguration"];
46
52
 
47
53
  /**
48
54
  * Does the currently viewed Scene support Token field of vision?
49
55
  */
50
- // TODO: make `Scene.Implementation["tokenVision"]` when docsv2 is done
51
- get tokenVision(): boolean;
56
+ get tokenVision(): Scene.Implementation["tokenVision"];
52
57
 
53
58
  /**
54
59
  * Does the currently viewed Scene support fog of war exploration?
55
60
  */
56
- // TODO: make `Scene.Implementation["fog"]["exploration"]` when docsv2 is done
57
- get fogExploration(): boolean;
61
+ get fogExploration(): Scene.Implementation["fog"]["exploration"];
62
+
63
+ /**
64
+ * Is this position explored?
65
+ * @param position - The position to be tested
66
+ * @returns Is this position explored?
67
+ */
68
+ isPointExplored(position: Canvas.Point): boolean;
58
69
 
59
70
  /**
60
71
  * Create the exploration display object with or without a provided texture.
61
- * @privateRemarks Despite Foundry only typing this as returning `DisplayObject` in 12.331, it always returns a `SpriteMesh`
62
72
  */
63
- protected _createExplorationObject(tex?: PIXI.Texture | PIXI.RenderTexture | null): SpriteMesh;
73
+ protected _createExplorationObject(tex?: PIXI.Texture | PIXI.RenderTexture): SpriteMesh;
64
74
 
65
75
  /**
66
76
  * Initialize fog of war - resetting it when switching scenes or re-drawing the canvas
@@ -72,9 +82,14 @@ declare class FogManager extends EventEmitterMixin() {
72
82
  */
73
83
  clear(): Promise<void>;
74
84
 
85
+ /**
86
+ * Destroy this FogManager.
87
+ */
88
+ destroy(): void;
89
+
75
90
  /**
76
91
  * Once a new Fog of War location is explored, composite the explored container with the current staging sprite.
77
- * Once the number of refresh is \> to the commit threshold, save the fog texture to the database.
92
+ * Once the number of refresh is greater than the commit threshold, save the fog texture to the database.
78
93
  */
79
94
  commit(): void;
80
95
 
@@ -84,8 +99,8 @@ declare class FogManager extends EventEmitterMixin() {
84
99
  load(): Promise<PIXI.Texture | void>;
85
100
 
86
101
  /**
87
- * Dispatch a request to reset the fog of war exploration status for all users within this Scene.
88
- * Once the server has deleted existing FogExploration documents, the _onReset handler will re-draw the canvas.
102
+ * Dispatch a request to reset the fog of war exploration status for all users within this {@linkcode Scene}. Once the server has deleted
103
+ * existing {@linkcode FogExploration} documents, the {@linkcode _handleReset} handler will re-draw the canvas.
89
104
  */
90
105
  reset(): Promise<void>;
91
106
 
@@ -95,6 +110,17 @@ declare class FogManager extends EventEmitterMixin() {
95
110
  */
96
111
  save(): Promise<void>;
97
112
 
113
+ /**
114
+ * Synchronize one user's version of the Fog of War for this scene to other users.
115
+ * Note: This API is experimental and may be removed in later versions *without deprecation*. It is intended for
116
+ * one-time corrections of users' fog explorations, and should not be used for real-time synchronization of fog
117
+ * exploration.
118
+ * @param from - The user whose Fog of War to use as the source of truth.
119
+ * @param to - A list of users that should have their Fog of War synced. If none are specified then all users will be synced.
120
+ * @returns A promise that resolves when synchronization has been completed.
121
+ */
122
+ sync(from: User.Implementation, to?: User.Implementation[]): Promise<void>;
123
+
98
124
  /**
99
125
  * Extract fog data as a base64 string
100
126
  */
@@ -109,37 +135,12 @@ declare class FogManager extends EventEmitterMixin() {
109
135
 
110
136
  /**
111
137
  * If fog of war data is reset from the server, deactivate the current fog and initialize the exploration.
112
- * @remarks Foundry marked `@internal`, called externally in the `fogReset` socket handler
138
+ * @internal
139
+ * @remarks Called externally in the `fogReset` socket handler
113
140
  */
114
141
  protected _handleReset(): Promise<void>;
115
142
 
116
- /**
117
- * @deprecated since v11, will be removed in v13
118
- * @remarks "pending is deprecated and redirected to the exploration container"
119
- */
120
- get pending(): CanvasVisibility["explored"];
121
-
122
- /**
123
- * @deprecated since v11, will be removed in v13
124
- * @remarks "revealed is deprecated and redirected to the exploration container"
125
- */
126
- get revealed(): CanvasVisibility["explored"];
127
-
128
- /**
129
- * @deprecated since v11, will be removed in v13
130
- * @remarks "update is obsolete and always returns true. The fog exploration does not record position anymore."
131
- *
132
- * Both parameters are unused
133
- */
134
- update(source: any, force?: boolean | null): true;
135
-
136
- /**
137
- * @deprecated since v11, will be removed in v13
138
- * @remarks "resolution is deprecated and redirected to CanvasVisibility#textureConfiguration"
139
- *
140
- * Probable Bug Note: Returns the entire `textureConfiguration` object, not just its `resolution` property
141
- */
142
- get resolution(): CanvasVisibility["textureConfiguration"];
143
+ #FogManager: true;
143
144
  }
144
145
 
145
146
  declare namespace FogManager {