@league-of-foundry-developers/foundry-vtt-types 9.238.1 → 9.242.0

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 (95) hide show
  1. package/package.json +1 -1
  2. package/src/foundry/common/constants.mjs.d.ts +1 -0
  3. package/src/foundry/common/data/data.mjs/adventureData.d.ts +21 -21
  4. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +3 -3
  5. package/src/foundry/common/data/data.mjs/userData.d.ts +10 -3
  6. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +2 -4
  7. package/src/foundry/common/utils/geometry.mjs.d.ts +148 -0
  8. package/src/foundry/common/utils/helpers.mjs.d.ts +37 -37
  9. package/src/foundry/common/utils/module.mjs.d.ts +1 -0
  10. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +1 -1
  11. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +2 -2
  12. package/src/foundry/foundry.js/audioContainer.d.ts +28 -10
  13. package/src/foundry/foundry.js/canvasAnimation.d.ts +30 -7
  14. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +4 -13
  15. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +2 -2
  16. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +46 -44
  17. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +14 -17
  18. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +2 -2
  19. package/src/foundry/foundry.js/clientKeybindings.d.ts +12 -2
  20. package/src/foundry/foundry.js/clientSettings.d.ts +1 -1
  21. package/src/foundry/foundry.js/collisionResult.d.ts +60 -0
  22. package/src/foundry/foundry.js/config.d.ts +33 -34
  23. package/src/foundry/foundry.js/hooks.d.ts +154 -85
  24. package/src/foundry/foundry.js/imageHelper.d.ts +26 -2
  25. package/src/foundry/foundry.js/keyboardManager.d.ts +2 -2
  26. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +2 -2
  27. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +2 -2
  28. package/src/foundry/foundry.js/pixi/index.d.ts +1 -0
  29. package/src/foundry/foundry.js/pixi/points/index.d.ts +1 -0
  30. package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +92 -0
  31. package/src/foundry/foundry.js/pixi/polygons/index.d.ts +2 -1
  32. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +98 -0
  33. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +388 -0
  34. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/index.d.ts +1 -0
  35. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +11 -37
  36. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShader.d.ts +114 -0
  37. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveBackgroundShader.d.ts +57 -0
  38. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShader.d.ts +47 -0
  39. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/bewitchingWaveColorationShader.d.ts +6 -0
  40. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/chromaColorationShader.d.ts +6 -0
  41. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/emanationColorationShader.d.ts +6 -0
  42. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/energyFieldColorationShader.d.ts +6 -0
  43. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fairyLightColorationShader.d.ts +6 -0
  44. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fogColorationShader.d.ts +6 -0
  45. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/ghostLightColorationShader.d.ts +1 -1
  46. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/hexaDomeColorationShader.d.ts +6 -0
  47. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/index.d.ts +5 -0
  48. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/lightDomeColorationShader.d.ts +6 -0
  49. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/pulseColorationShader.d.ts +1 -1
  50. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/radialRainbowColorationShader.d.ts +6 -0
  51. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/sunburstColorationShader.d.ts +1 -1
  52. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/swirlingRainbowColorationShader.d.ts +6 -0
  53. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/torchColorationShader.d.ts +3 -2
  54. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/vortexColorationShader.d.ts +6 -0
  55. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/waveColorationShader.d.ts +1 -1
  56. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShader.d.ts +63 -0
  57. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/bewitchingWaveIlluminationShader.d.ts +6 -0
  58. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/blackHoleIlluminationShader.d.ts +1 -1
  59. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/fairyLightIlluminationShader.d.ts +6 -0
  60. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/ghostLightIlluminationShader.d.ts +1 -1
  61. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/index.d.ts +3 -0
  62. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/pulseIlluminationShader.d.ts +1 -1
  63. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/roilingIlluminationShader.d.ts +1 -1
  64. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/sunburstIlluminationShader.d.ts +1 -2
  65. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/torchIlluminationShader.d.ts +1 -1
  66. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/vortexIlluminationShader.d.ts +6 -0
  67. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/waveIlluminationShader.d.ts +1 -1
  68. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/index.d.ts +5 -0
  69. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/baseSamplerShader.d.ts +22 -0
  70. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/index.d.ts +3 -4
  71. package/src/foundry/foundry.js/pixi/texts/preciseText.d.ts +10 -2
  72. package/src/foundry/foundry.js/pointSource.d.ts +59 -328
  73. package/src/foundry/foundry.js/pointSources/index.d.ts +3 -0
  74. package/src/foundry/foundry.js/pointSources/lightSource.d.ts +417 -0
  75. package/src/foundry/foundry.js/pointSources/soundSource.d.ts +46 -0
  76. package/src/foundry/foundry.js/pointSources/visionSource.d.ts +125 -0
  77. package/src/foundry/foundry.js/polygonEdge.d.ts +26 -0
  78. package/src/foundry/foundry.js/polygonVertex.d.ts +89 -0
  79. package/src/foundry/foundry.js/quadtreeCulling.d.ts +11 -0
  80. package/src/foundry/foundry.js/ray.d.ts +156 -162
  81. package/src/foundry/foundry.js/rays/index.d.ts +1 -0
  82. package/src/foundry/foundry.js/rays/sightRay.d.ts +34 -0
  83. package/src/foundry/foundry.js/roll.d.ts +27 -32
  84. package/src/foundry/foundry.js/screenCulling.d.ts +19 -0
  85. package/src/foundry/foundry.js/specialEffect.d.ts +1 -1
  86. package/src/foundry/index.d.ts +26 -27
  87. package/src/foundry/foundry.js/pixi/polygons/sourcePolygon.d.ts +0 -25
  88. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShader.d.ts +0 -21
  89. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/chromaColorationShader.d.ts +0 -18
  90. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/emanationColorationShader.d.ts +0 -17
  91. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/energyFieldColorationShader.d.ts +0 -18
  92. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/fogColorationShader.d.ts +0 -17
  93. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/hexaDomeColorationShader.d.ts +0 -17
  94. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/lightDomeColorationShader.d.ts +0 -17
  95. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardIlluminationShader.d.ts +0 -22
@@ -0,0 +1,417 @@
1
+ import type { ConfiguredObjectClassForName } from '../../../types/helperTypes.js';
2
+
3
+ declare global {
4
+ /** @see {@link foundry.data.LightData} */
5
+ interface LightSourceData extends PointSource.Data {
6
+ /** @defaultValue `0` */
7
+ x: number;
8
+
9
+ /** @defaultValue `0` */
10
+ y: number;
11
+
12
+ /**
13
+ * An optional z-index sorting for the source
14
+ * @defaultValue `null`
15
+ */
16
+ z: number | null;
17
+
18
+ /**
19
+ * The angle of rotation for this point source
20
+ * @defaultValue `0`
21
+ */
22
+ rotation: number;
23
+
24
+ /**
25
+ * An opacity for the emitted light, if any
26
+ * @defaultValue `0.5`
27
+ */
28
+ alpha: number;
29
+
30
+ /**
31
+ * An animation configuration for the source
32
+ * @defaultValue `{ type: null }`
33
+ */
34
+ animation: LightAnimationConfiguration;
35
+
36
+ /**
37
+ * The angle of emission for this point source
38
+ * @defaultValue `360`
39
+ */
40
+ angle: number;
41
+
42
+ /**
43
+ * The allowed radius of bright vision or illumination
44
+ * @defaultValue `0`
45
+ */
46
+ bright: number;
47
+
48
+ /**
49
+ * A tint color for the emitted light, if any
50
+ * @defaultValue `null`
51
+ */
52
+ color: number | null;
53
+
54
+ /**
55
+ * The coloration technique applied in the shader
56
+ * @defaultValue `1`
57
+ */
58
+ coloration: number;
59
+
60
+ /**
61
+ * The amount of contrast this light applies to the background texture
62
+ * @defaultValue `0.0`
63
+ */
64
+ contrast: number;
65
+
66
+ /**
67
+ * A darkness range (min and max) for which the source should be active
68
+ * @defaultValue `{ min: 0, max: 1 }`
69
+ */
70
+ darkness: { min: number; max: number };
71
+
72
+ /**
73
+ * The allowed radius of dim vision or illumination
74
+ * @defaultValue `0`
75
+ */
76
+ dim: number;
77
+
78
+ /** Fade the difference between bright, dim, and dark gradually? */
79
+ gradual: boolean;
80
+
81
+ /**
82
+ * The luminosity applied in the shader
83
+ * @defaultValue `0.0`
84
+ */
85
+ luminosity: number;
86
+
87
+ /**
88
+ * The amount of color saturation this light applies to the background texture
89
+ * @defaultValue `0.0`
90
+ */
91
+ saturation: number;
92
+
93
+ /**
94
+ * The depth of shadows this light applies to the background texture
95
+ * @defaultValue `0.0`
96
+ */
97
+ shadows: number;
98
+
99
+ /** @defaultValue `true` */
100
+ walls: boolean;
101
+
102
+ /**
103
+ * Whether or not this source provides a source of vision
104
+ * @defaultValue `false`
105
+ */
106
+ vision: boolean;
107
+
108
+ /** An integer seed to synchronize (or de-synchronize) animations */
109
+ seed: number;
110
+ }
111
+
112
+ interface LightAnimationConfiguration {
113
+ /** The human-readable (localized) label for the animation */
114
+ label: string;
115
+
116
+ /** The animation function that runs every frame */
117
+ animation: (this: LightSource, dt: number, animation: LightAnimationConfiguration) => void;
118
+
119
+ /** A custom illumination shader used by this animation */
120
+ illuminationShader: AdaptiveIlluminationShader;
121
+
122
+ /** A custom coloration shader used by this animation */
123
+ colorationShader: AdaptiveColorationShader;
124
+
125
+ /** A custom background shader used by this animation */
126
+ backgroundShader: AdaptiveBackgroundShader;
127
+
128
+ /** The animation seed */
129
+ seed?: number;
130
+
131
+ /** The animation time */
132
+ time?: number;
133
+
134
+ /** @defaultValue `null` */
135
+ type?: keyof typeof CONFIG.Canvas.lightAnimations | null;
136
+ }
137
+
138
+ /**
139
+ * A specialized subclass of the PointSource abstraction which is used to control the rendering of light sources.
140
+ */
141
+ class LightSource extends PointSource {
142
+ /** @param object - The light-emitting object that generates this light source */
143
+ constructor(object: InstanceType<ConfiguredObjectClassForName<'AmbientLight' | 'Token'>>);
144
+
145
+ /**
146
+ * The light or darkness container for this source
147
+ * @defaultValue `this._createMesh(AdaptiveBackgroundShader)`
148
+ */
149
+ background: PIXI.Mesh;
150
+
151
+ /**
152
+ * The light or darkness container for this source
153
+ * @defaultValue `this._createMesh(AdaptiveIlluminationShader)`
154
+ */
155
+ illumination: PIXI.Mesh;
156
+
157
+ /**
158
+ * This visible color container for this source
159
+ * @defaultValue `this._createMesh(AdaptiveColorationShader)`
160
+ */
161
+ coloration: PIXI.Mesh;
162
+
163
+ /** @override */
164
+ static sourceType: 'light';
165
+
166
+ /**
167
+ * Strength of the blur for light source edges
168
+ * @defaultValue `3`
169
+ */
170
+ static BLUR_STRENGTH: number;
171
+
172
+ /**
173
+ * Keys in the LightSourceData structure which, when modified, change the appearance of the light
174
+ * @internal
175
+ * @defaultValue
176
+ * ```javascript
177
+ * [
178
+ * "dim", "bright", "gradual", "alpha", "coloration", "color",
179
+ * "contrast", "saturation", "shadows", "luminosity"
180
+ * ]
181
+ * ```
182
+ */
183
+ protected static _appearanceKeys: string[];
184
+
185
+ /**
186
+ * The object of data which configures how the source is rendered
187
+ * @defaultValue `{}`
188
+ */
189
+ data: Partial<LightSourceData>;
190
+
191
+ /**
192
+ * The animation configuration applied to this source
193
+ * @defaultValue `{}`
194
+ */
195
+ animation: LightAnimationConfiguration;
196
+
197
+ /**
198
+ * Internal flag for whether this is a darkness source
199
+ * @defaultValue `false`
200
+ */
201
+ isDarkness: boolean;
202
+
203
+ /**
204
+ * The rendered field-of-vision texture for the source for use within shaders.
205
+ * @defaultValue `undefined`
206
+ */
207
+ fovTexture: PIXI.RenderTexture | undefined;
208
+
209
+ /**
210
+ * To know if a light source is a preview or not. False by default.
211
+ * @defaultValue `false`
212
+ */
213
+ preview: boolean;
214
+
215
+ /**
216
+ * The ratio of dim:bright as part of the source radius
217
+ * @defaultValue `undefined`
218
+ */
219
+ ratio: number | undefined;
220
+
221
+ /**
222
+ * Track which uniforms need to be reset
223
+ * @internal
224
+ * @defaultValue
225
+ * ```javascript
226
+ * {
227
+ * background: true,
228
+ * illumination: true,
229
+ * coloration: true
230
+ * }
231
+ * ```
232
+ */
233
+ protected _resetUniforms: {
234
+ background: boolean;
235
+ illumination: boolean;
236
+ coloration: boolean;
237
+ };
238
+
239
+ /**
240
+ * To track if a source is temporarily shutdown to avoid glitches
241
+ * @defaultValue `{ illumination: false }`
242
+ * @internal
243
+ */
244
+ protected _shutdown: { illumination: boolean };
245
+
246
+ /**
247
+ * Initialize the source with provided object data.
248
+ * @param data - Initial data provided to the point source
249
+ * @returns A reference to the initialized source
250
+ */
251
+ initialize(data?: Partial<LightSourceData> & { color?: string | number | null }): this;
252
+
253
+ /**
254
+ * Initialize the PointSource with new input data
255
+ * @param data - Initial data provided to the light source
256
+ * @returns The changes compared to the prior data
257
+ * @internal
258
+ */
259
+ protected _initializeData(
260
+ data: Partial<LightSourceData> & { color?: string | number | null }
261
+ ): Partial<LightSourceData>;
262
+
263
+ /**
264
+ * Initialize the shaders used for this source, swapping to a different shader if the animation has changed.
265
+ * @internal
266
+ */
267
+ protected _initializeShaders(): void;
268
+
269
+ /**
270
+ * Initialize the blend mode and vertical sorting of this source relative to others in the container.
271
+ * @internal
272
+ */
273
+ protected _initializeBlending(): void;
274
+
275
+ /**
276
+ * Render the containers used to represent this light source within the LightingLayer
277
+ */
278
+ drawMeshes(): {
279
+ background: ReturnType<LightSource['drawBackground']>;
280
+ light: ReturnType<LightSource['drawLight']>;
281
+ color: ReturnType<LightSource['drawColor']>;
282
+ };
283
+
284
+ /**
285
+ * Draw the display of this source for background container.
286
+ * @returns The rendered light container
287
+ */
288
+ drawBackground(): PIXI.Container | null;
289
+
290
+ /**
291
+ * Draw the display of this source for the darkness/light container of the SightLayer.
292
+ * @returns The rendered light container
293
+ */
294
+ drawLight(): PIXI.Container | null;
295
+
296
+ /**
297
+ * Draw and return a container used to depict the visible color tint of the light source on the LightingLayer
298
+ * @returns An updated color container for the source
299
+ */
300
+ drawColor(): PIXI.Container | null;
301
+
302
+ /**
303
+ * Update shader uniforms by providing data from this PointSource
304
+ * @param shader - The shader being updated
305
+ * @internal
306
+ */
307
+ protected _updateColorationUniforms(shader: AdaptiveColorationShader): void;
308
+
309
+ /**
310
+ * Update shader uniforms by providing data from this PointSource
311
+ * @param shader - The shader being updated
312
+ * @internal
313
+ */
314
+ protected _updateIlluminationUniforms(shader: AdaptiveIlluminationShader): void;
315
+
316
+ /**
317
+ * Update shader uniforms by providing data from this PointSource
318
+ * @param shader - The shader being updated
319
+ * @internal
320
+ */
321
+ protected _updateBackgroundUniforms(shader: AdaptiveBackgroundShader): void;
322
+
323
+ /**
324
+ * Update shader uniforms shared by all shader types
325
+ * @param shader - The shader being updated
326
+ * @internal
327
+ */
328
+ protected _updateCommonUniforms(shader: AdaptiveLightingShader): void;
329
+
330
+ /**
331
+ * Map luminosity value to exposure value
332
+ * luminosity[-1 , 0 [ =\> Darkness =\> map to exposure ] 0, 1]
333
+ * luminosity[ 0 , 0.5[ =\> Light =\> map to exposure [-0.5, 0[
334
+ * luminosity[ 0.5, 1 ] =\> Light =\> map to exposure [ 0, 1]
335
+ * @param lum - The luminosity value
336
+ * @returns The exposure value
337
+ * @internal
338
+ */
339
+ protected _mapLuminosity(lum: number): number;
340
+
341
+ /**
342
+ * Animate the PointSource, if an animation is enabled and if it currently has rendered containers.
343
+ * @param dt - Delta time
344
+ */
345
+ animate(dt: number): void;
346
+
347
+ /**
348
+ * A torch animation where the luminosity and coloration decays each frame and is revitalized by flashes
349
+ * @param dt - Delta time
350
+ * (unused)
351
+ * @param speed - The animation speed, from 1 to 10
352
+ * (default: `5`)
353
+ * @param intensity - The animation intensity, from 1 to 10
354
+ * (default: `5`)
355
+ */
356
+ animateTorch(dt: number, { speed, intensity }?: { speed: number; intensity: number }): void;
357
+
358
+ /**
359
+ * A basic "pulse" animation which expands and contracts.
360
+ * @param dt - Delta time
361
+ * (unused)
362
+ * @param speed - The animation speed, from 1 to 10
363
+ * (default: `5`)
364
+ * @param intensity - The animation intensity, from 1 to 10
365
+ * (default: `5`)
366
+ * @param reverse - Is the animation reversed?
367
+ * (default: `false`)
368
+ */
369
+ animatePulse(
370
+ dt: number,
371
+ { speed, intensity, reverse }?: { speed?: number; intensity?: number; reverse?: boolean }
372
+ ): void;
373
+
374
+ /**
375
+ * Emanate waves of light from the source origin point
376
+ * @param dt - Delta time
377
+ * (unused)
378
+ * @param speed - The animation speed, from 1 to 10
379
+ * (default: `5`)
380
+ * @param intensity - The animation intensity, from 1 to 10
381
+ * (default: `5`)
382
+ * @param reverse - Is the animation reversed?
383
+ * (default: `false`)
384
+ */
385
+ animateTime(
386
+ dt: number,
387
+ { speed, intensity, reverse }?: { speed?: number; intensity?: number; reverse?: boolean }
388
+ ): void;
389
+
390
+ /**
391
+ * Evolve a value using a stochastic AR(1) process
392
+ * @param y - The current value
393
+ * @param phi - The decay rate of prior values
394
+ * (default: `0.5`)
395
+ * @param center - The stationary mean of the series
396
+ * (default: `0`)
397
+ * @param sigma - The volatility of the process - standard deviation of the error term
398
+ * (default: `0.1`)
399
+ * @param max - The maximum allowed outcome, or null
400
+ * (default: `null`)
401
+ * @param min - The minimum allowed outcome, or null
402
+ * (default: `null`)
403
+ * @returns The new value of the process
404
+ * @internal
405
+ */
406
+ protected _ar1(
407
+ y: number,
408
+ {
409
+ phi,
410
+ center,
411
+ sigma,
412
+ max,
413
+ min
414
+ }?: { phi?: number; center?: number; sigma?: number; max?: number | null; min?: number | null }
415
+ ): number;
416
+ }
417
+ }
@@ -0,0 +1,46 @@
1
+ import type { ConfiguredObjectClassForName } from '../../../types/helperTypes.js';
2
+
3
+ declare global {
4
+ interface SoundSourceData extends PointSource.Data {
5
+ x: number;
6
+
7
+ y: number;
8
+
9
+ /** The radius of the sound effect */
10
+ radius: number;
11
+
12
+ walls: boolean;
13
+ }
14
+
15
+ /**
16
+ * A specialized subclass of the PointSource abstraction which is used to control the rendering of sound sources.
17
+ */
18
+ class SoundSource extends PointSource {
19
+ /** @param object - The AmbientSound object that generates this sound source */
20
+ constructor(object: InstanceType<ConfiguredObjectClassForName<'AmbientSound'>>);
21
+
22
+ /** @override */
23
+ static sourceType: 'sound';
24
+
25
+ /**
26
+ * The object of data which configures how the source is rendered
27
+ * @defaultValue `{}`
28
+ */
29
+ data: Partial<SoundSourceData>;
30
+
31
+ /**
32
+ * Initialize the source with provided object data.
33
+ * @param data - Initial data provided to the point source
34
+ * @returns A reference to the initialized source
35
+ */
36
+ initialize(data?: Partial<SoundSourceData>): this;
37
+
38
+ /**
39
+ * Process new input data provided to the SoundSource.
40
+ * @param data - Initial data provided to the sound source
41
+ * @returns The changes compared to the prior data
42
+ * @internal
43
+ */
44
+ protected _initializeData(data: Partial<SoundSourceData>): void;
45
+ }
46
+ }
@@ -0,0 +1,125 @@
1
+ import type { ConfiguredObjectClassForName } from '../../../types/helperTypes.js';
2
+
3
+ declare global {
4
+ interface VisionSourceData extends Exclude<PointSource.Data, 'walls'> {
5
+ x: number;
6
+
7
+ y: number;
8
+
9
+ /** An optional z-index sorting for the source */
10
+ z: number;
11
+
12
+ /** The angle of rotation for this point source */
13
+ rotation: number;
14
+
15
+ /** The angle of emission for this point source */
16
+ angle: number;
17
+
18
+ /** The allowed radius of bright vision or illumination */
19
+ bright: number;
20
+
21
+ /** The allowed radius of dim vision or illumination */
22
+ dim: number;
23
+ }
24
+
25
+ /**
26
+ * A specialized subclass of the PointSource abstraction which is used to control the rendering of vision sources.
27
+ */
28
+ class VisionSource extends PointSource {
29
+ /** @param object - The Token object that generates this vision source */
30
+ constructor(object: InstanceType<ConfiguredObjectClassForName<'Token'>>);
31
+
32
+ /**
33
+ * The current vision mesh for this source
34
+ * @defaultValue `this._createMesh(AdaptiveIlluminationShader)`
35
+ */
36
+ illumination: PIXI.Mesh;
37
+
38
+ /** @override */
39
+ static sourceType: 'vision';
40
+
41
+ /**
42
+ * Keys in the VisionSourceData structure which, when modified, change the appearance of the source
43
+ * @defaultValue `["dim", "bright"]`
44
+ * @internal
45
+ */
46
+ protected static _appearanceKeys: string[];
47
+
48
+ /**
49
+ * The object of data which configures how the source is rendered
50
+ * @defaultValue `{}`
51
+ */
52
+ data: Partial<VisionSourceData>;
53
+
54
+ /**
55
+ * The ratio of dim:bright as part of the source radius
56
+ * @defaultValue `undefined`
57
+ */
58
+ ratio: number | undefined;
59
+
60
+ /**
61
+ * The rendered field-of-vision texture for the source for use within shaders.
62
+ * @defaultValue `undefined`
63
+ */
64
+ fovTexture: PIXI.RenderTexture | undefined;
65
+
66
+ /**
67
+ * Track which uniforms need to be reset
68
+ * @defaultValue `{ illumination: true }`
69
+ * @internal
70
+ */
71
+ protected _resetUniforms: { illumination: boolean };
72
+
73
+ /**
74
+ * To track if a source is temporarily shutdown to avoid glitches
75
+ * @defaultValue `{ illumination: false }`
76
+ * @internal
77
+ */
78
+ protected _shutdown: { illumination: boolean };
79
+
80
+ /**
81
+ * Initialize the source with provided object data.
82
+ * @param data - Initial data provided to the point source
83
+ * @returns A reference to the initialized source
84
+ */
85
+ initialize(data?: Partial<VisionSourceData>): this;
86
+
87
+ fov?: PIXI.Circle;
88
+
89
+ /**
90
+ * Initialize the blend mode and vertical sorting of this source relative to others in the container.
91
+ * @internal
92
+ */
93
+ protected _initializeBlending(): void;
94
+
95
+ /**
96
+ * Process new input data provided to the LightSource.
97
+ * @param data - Initial data provided to the vision source
98
+ * @returns The changes compared to the prior data
99
+ * @internal
100
+ */
101
+ protected _initializeData(data: Partial<VisionSourceData>): Partial<VisionSourceData>;
102
+
103
+ /**
104
+ * Draw the display of this source to remove darkness from the LightingLayer illumination container.
105
+ * @see LightSource#drawLight
106
+ * @returns The rendered light container
107
+ */
108
+ drawVision(): PIXI.Container | null;
109
+
110
+ /**
111
+ * Draw a Container used for exploring the FOV area of Token sight in the SightLayer
112
+ */
113
+ drawSight(): PIXI.Container;
114
+
115
+ /**
116
+ * Update shader uniforms by providing data from this PointSource
117
+ * @param shader - The shader being updated
118
+ * @internal
119
+ */
120
+ protected _updateIlluminationUniforms(shader: AdaptiveIlluminationShader): void;
121
+
122
+ /** @override */
123
+ protected _drawRenderTextureContainer(): PIXI.Container;
124
+ }
125
+ }
@@ -0,0 +1,26 @@
1
+ import type { ConfiguredObjectClassForName } from '../../types/helperTypes.js';
2
+
3
+ declare global {
4
+ /**
5
+ * An internal data structure for polygon edges
6
+ * @internal
7
+ */
8
+ class PolygonEdge {
9
+ constructor(a: Point, b: Point, type: foundry.CONST.WALL_SENSE_TYPES, wall: Wall);
10
+
11
+ /**
12
+ * Is this edge limited in type?
13
+ */
14
+ get isLimited(): boolean;
15
+
16
+ /**
17
+ * Construct a PolygonEdge instance from a Wall placeable object.
18
+ * @param wall - The Wall from which to construct an edge
19
+ * @param type - The type of polygon being constructed
20
+ */
21
+ static fromWall(
22
+ wall: ConfiguredObjectClassForName<'Wall'> | WallDocument,
23
+ type: foundry.CONST.WALL_RESTRICTION_TYPES
24
+ ): PolygonEdge;
25
+ }
26
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * An internal data structure for polygon vertices
3
+ * @internal
4
+ */
5
+ declare class PolygonVertex {
6
+ constructor(x: number, y: number, { distance, index }?: PolygonVertexOptions);
7
+
8
+ x: number;
9
+
10
+ y: number;
11
+
12
+ key: number;
13
+
14
+ protected _distance: number | undefined;
15
+
16
+ protected _d2: undefined;
17
+
18
+ protected _index: number | undefined;
19
+
20
+ /** @defaultValue `false` */
21
+ protected _inLimitedAngle: boolean;
22
+
23
+ /**
24
+ * The set of edges which connect to this vertex.
25
+ * This set is initially empty and populated later after vertices are de-duplicated.
26
+ * @defaultValue `new Set()`
27
+ */
28
+ edges: EdgeSet;
29
+
30
+ /**
31
+ * The subset of edges which continue clockwise from this vertex.
32
+ * @defaultValue `new Set()`
33
+ */
34
+ cwEdges: EdgeSet;
35
+
36
+ /**
37
+ * The subset of edges which continue counter-clockwise from this vertex.
38
+ * @defaultValue `new Set()`
39
+ */
40
+ ccwEdges: EdgeSet;
41
+
42
+ /**
43
+ * The maximum restriction type of this vertex
44
+ * @defaultValue `null`
45
+ */
46
+ type: number | null;
47
+
48
+ /**
49
+ * Associate an edge with this vertex.
50
+ * @param edge - The edge being attached
51
+ * @param orientation - The orientation of the edge with respect to the origin
52
+ */
53
+ attachEdge(edge: PolygonEdge, orientation: number): void;
54
+
55
+ /**
56
+ * Is this vertex limited in type?
57
+ */
58
+ get isLimited(): boolean;
59
+
60
+ /**
61
+ * Is this vertex terminal (at the maximum radius)
62
+ */
63
+ get isTerminal(): boolean;
64
+
65
+ /**
66
+ * Does this vertex have a limited edge connected to it?
67
+ */
68
+ get hasLimitedEdge(): boolean;
69
+
70
+ /**
71
+ * Is this vertex the same point as some other vertex?
72
+ * @param other - Some other vertex
73
+ * @returns Are they the same point?
74
+ */
75
+ equals(other: PolygonVertex): boolean;
76
+
77
+ /**
78
+ * Construct a PolygonVertex instance from some other Point structure.
79
+ * @param point - The point
80
+ * @param options - Additional options that apply to this vertex
81
+ * @returns The constructed vertex
82
+ */
83
+ static fromPoint(point: Point, options?: PolygonVertexOptions): PolygonVertex;
84
+ }
85
+
86
+ interface PolygonVertexOptions {
87
+ distance: PolygonVertex['_distance'];
88
+ index: PolygonVertex['_index'];
89
+ }