@league-of-foundry-developers/foundry-vtt-types 9.238.0 → 9.249.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 (173) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/src/foundry/common/constants.mjs.d.ts +1 -0
  4. package/src/foundry/common/data/data.mjs/adventureData.d.ts +21 -21
  5. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +3 -3
  6. package/src/foundry/common/data/data.mjs/userData.d.ts +10 -3
  7. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +2 -4
  8. package/src/foundry/common/utils/geometry.mjs.d.ts +148 -0
  9. package/src/foundry/common/utils/helpers.mjs.d.ts +37 -37
  10. package/src/foundry/common/utils/module.mjs.d.ts +1 -0
  11. package/src/foundry/common/utils/primitives.mjs.d.ts +7 -0
  12. package/src/foundry/foundry.js/application.d.ts +138 -110
  13. package/src/foundry/foundry.js/applications/basePlaceableHUD.d.ts +2 -2
  14. package/src/foundry/foundry.js/applications/basePlaceableHUDs/drawingHUD.d.ts +2 -2
  15. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tileHUD.d.ts +2 -2
  16. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +3 -3
  17. package/src/foundry/foundry.js/applications/cameraViews.d.ts +2 -2
  18. package/src/foundry/foundry.js/applications/chatPopout.d.ts +3 -3
  19. package/src/foundry/foundry.js/applications/compendium.d.ts +2 -2
  20. package/src/foundry/foundry.js/applications/dialog.d.ts +1 -1
  21. package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
  22. package/src/foundry/foundry.js/applications/formApplication.d.ts +45 -14
  23. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +1 -1
  24. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -2
  25. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +1 -1
  26. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +20 -31
  27. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  28. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
  29. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +4 -4
  30. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +4 -4
  31. package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +3 -3
  32. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +2 -2
  33. package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
  34. package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +1 -1
  35. package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +3 -3
  36. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +3 -3
  37. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +3 -3
  38. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +2 -2
  39. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +3 -3
  40. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +3 -3
  41. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +2 -2
  42. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +4 -4
  43. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +2 -2
  44. package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +7 -7
  45. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
  46. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +3 -3
  47. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  48. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  49. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +2 -2
  50. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +2 -2
  51. package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +2 -2
  52. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +1 -1
  53. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +3 -3
  54. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +3 -3
  55. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +1 -1
  56. package/src/foundry/foundry.js/applications/frameViewer.d.ts +1 -1
  57. package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +2 -2
  58. package/src/foundry/foundry.js/applications/hotbar.d.ts +2 -2
  59. package/src/foundry/foundry.js/applications/mainMenu.d.ts +2 -2
  60. package/src/foundry/foundry.js/applications/notifications.d.ts +7 -4
  61. package/src/foundry/foundry.js/applications/pause.d.ts +2 -2
  62. package/src/foundry/foundry.js/applications/playerList.d.ts +2 -2
  63. package/src/foundry/foundry.js/applications/sceneControls.d.ts +2 -2
  64. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +3 -3
  65. package/src/foundry/foundry.js/applications/sidebar.d.ts +2 -2
  66. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +4 -7
  67. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +3 -3
  68. package/src/foundry/foundry.js/applications/sidebarTabs/combatTracker.d.ts +26 -28
  69. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  70. package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +2 -2
  71. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +1 -1
  72. package/src/foundry/foundry.js/audioContainer.d.ts +28 -10
  73. package/src/foundry/foundry.js/canvas.d.ts +5 -0
  74. package/src/foundry/foundry.js/canvasAnimation.d.ts +30 -7
  75. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -1
  76. package/src/foundry/foundry.js/clientDocuments/card.d.ts +2 -1
  77. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +4 -18
  78. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +2 -2
  79. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +46 -44
  80. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +14 -17
  81. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +15 -9
  82. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +2 -2
  83. package/src/foundry/foundry.js/clientKeybindings.d.ts +12 -2
  84. package/src/foundry/foundry.js/clientSettings.d.ts +2 -2
  85. package/src/foundry/foundry.js/collections/documentCollection.d.ts +1 -1
  86. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/folders.d.ts +1 -1
  87. package/src/foundry/foundry.js/collisionResult.d.ts +60 -0
  88. package/src/foundry/foundry.js/config.d.ts +38 -36
  89. package/src/foundry/foundry.js/dragDrop.d.ts +27 -34
  90. package/src/foundry/foundry.js/game.d.ts +89 -43
  91. package/src/foundry/foundry.js/hooks.d.ts +154 -85
  92. package/src/foundry/foundry.js/imageHelper.d.ts +26 -2
  93. package/src/foundry/foundry.js/keyboardManager.d.ts +2 -2
  94. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +2 -2
  95. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +2 -2
  96. package/src/foundry/foundry.js/pixi/index.d.ts +3 -0
  97. package/src/foundry/foundry.js/pixi/meshes/index.d.ts +1 -0
  98. package/src/foundry/foundry.js/pixi/meshes/samplerMesh.d.ts +22 -0
  99. package/src/foundry/foundry.js/pixi/points/index.d.ts +1 -0
  100. package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +92 -0
  101. package/src/foundry/foundry.js/pixi/polygons/index.d.ts +2 -1
  102. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +98 -0
  103. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +396 -0
  104. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/index.d.ts +1 -0
  105. package/src/foundry/foundry.js/pixi/rectangles/normalizedRectangle.d.ts +7 -0
  106. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +11 -37
  107. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShader.d.ts +114 -0
  108. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveBackgroundShader.d.ts +57 -0
  109. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShader.d.ts +47 -0
  110. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/bewitchingWaveColorationShader.d.ts +6 -0
  111. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/chromaColorationShader.d.ts +6 -0
  112. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/emanationColorationShader.d.ts +6 -0
  113. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/energyFieldColorationShader.d.ts +6 -0
  114. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fairyLightColorationShader.d.ts +6 -0
  115. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fogColorationShader.d.ts +6 -0
  116. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/ghostLightColorationShader.d.ts +1 -1
  117. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/hexaDomeColorationShader.d.ts +6 -0
  118. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/index.d.ts +5 -0
  119. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/lightDomeColorationShader.d.ts +6 -0
  120. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/pulseColorationShader.d.ts +1 -1
  121. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/radialRainbowColorationShader.d.ts +6 -0
  122. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/sunburstColorationShader.d.ts +1 -1
  123. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/swirlingRainbowColorationShader.d.ts +6 -0
  124. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/torchColorationShader.d.ts +3 -2
  125. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/vortexColorationShader.d.ts +6 -0
  126. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/waveColorationShader.d.ts +1 -1
  127. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShader.d.ts +63 -0
  128. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/bewitchingWaveIlluminationShader.d.ts +6 -0
  129. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/blackHoleIlluminationShader.d.ts +1 -1
  130. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/fairyLightIlluminationShader.d.ts +6 -0
  131. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/ghostLightIlluminationShader.d.ts +1 -1
  132. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/index.d.ts +3 -0
  133. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/pulseIlluminationShader.d.ts +1 -1
  134. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/roilingIlluminationShader.d.ts +1 -1
  135. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/sunburstIlluminationShader.d.ts +1 -2
  136. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/torchIlluminationShader.d.ts +1 -1
  137. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/vortexIlluminationShader.d.ts +6 -0
  138. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/waveIlluminationShader.d.ts +1 -1
  139. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/index.d.ts +5 -0
  140. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/baseSamplerShader.d.ts +22 -0
  141. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/index.d.ts +3 -4
  142. package/src/foundry/foundry.js/pixi/texts/preciseText.d.ts +10 -2
  143. package/src/foundry/foundry.js/pixi/transforms/index.d.ts +1 -0
  144. package/src/foundry/foundry.js/pixi/transforms/synchronizedTransform.d.ts +38 -0
  145. package/src/foundry/foundry.js/pointSource.d.ts +59 -328
  146. package/src/foundry/foundry.js/pointSources/index.d.ts +3 -0
  147. package/src/foundry/foundry.js/pointSources/lightSource.d.ts +417 -0
  148. package/src/foundry/foundry.js/pointSources/soundSource.d.ts +46 -0
  149. package/src/foundry/foundry.js/pointSources/visionSource.d.ts +125 -0
  150. package/src/foundry/foundry.js/polygonEdge.d.ts +26 -0
  151. package/src/foundry/foundry.js/polygonVertex.d.ts +89 -0
  152. package/src/foundry/foundry.js/quadtree.d.ts +2 -2
  153. package/src/foundry/foundry.js/quadtreeCulling.d.ts +11 -0
  154. package/src/foundry/foundry.js/ray.d.ts +156 -162
  155. package/src/foundry/foundry.js/rays/index.d.ts +1 -0
  156. package/src/foundry/foundry.js/rays/sightRay.d.ts +34 -0
  157. package/src/foundry/foundry.js/roll.d.ts +40 -43
  158. package/src/foundry/foundry.js/screenCulling.d.ts +19 -0
  159. package/src/foundry/foundry.js/searchFilter.d.ts +37 -33
  160. package/src/foundry/foundry.js/specialEffect.d.ts +1 -1
  161. package/src/foundry/foundry.js/textureLoader.d.ts +28 -18
  162. package/src/foundry/foundry.js/textureUtils.d.ts +5 -8
  163. package/src/foundry/foundry.js/videoHelper.d.ts +2 -1
  164. package/src/foundry/index.d.ts +26 -27
  165. package/src/foundry/foundry.js/pixi/polygons/sourcePolygon.d.ts +0 -25
  166. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShader.d.ts +0 -21
  167. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/chromaColorationShader.d.ts +0 -18
  168. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/emanationColorationShader.d.ts +0 -17
  169. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/energyFieldColorationShader.d.ts +0 -18
  170. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/fogColorationShader.d.ts +0 -17
  171. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/hexaDomeColorationShader.d.ts +0 -17
  172. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/lightDomeColorationShader.d.ts +0 -17
  173. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardIlluminationShader.d.ts +0 -22
@@ -97,12 +97,12 @@ declare class Quadtree<T> {
97
97
 
98
98
  /**
99
99
  * Get all the objects which could collide with the provided rectangle
100
- * @param rect - The target rectangle
100
+ * @param rect - The normalized target rectangle
101
101
  * @param _s - The existing result set, for internal use.
102
102
  * (default: `new Set<T>()`)
103
103
  * @returns The objects in the Quadtree which represent potential collisions
104
104
  */
105
- getObjects(rect: Rectangle, _s?: Set<T>): Set<T>;
105
+ getObjects(rect: NormalizedRectangle, _s?: Set<T>): Set<T>;
106
106
 
107
107
  /**
108
108
  * Obtain the leaf nodes to which a target rectangle belongs.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * An experimental approach to culling using the quadtree mapping rather than the screen rectangle.
3
+ * @internal
4
+ */
5
+ declare class QuadtreeCulling {
6
+ constructor();
7
+
8
+ cull(screen: Rectangle): void;
9
+
10
+ protected _getRect(screen: Rectangle): NormalizedRectangle;
11
+ }
@@ -1,171 +1,165 @@
1
- declare interface RayIntersection {
2
- /** The x-coordinate of intersection */
3
- x: number;
1
+ import type { LineIntersection } from '../common/utils/geometry.mjs.js';
4
2
 
5
- /** The y-coordinate of intersection */
6
- y: number;
3
+ declare global {
4
+ interface RayIntersection {
5
+ /** The x-coordinate of intersection */
6
+ x: number;
7
7
 
8
- /** The proximity to the Ray origin, as a ratio of distance */
9
- t0: number;
8
+ /** The y-coordinate of intersection */
9
+ y: number;
10
10
 
11
- /** The proximity to the Ray destination, as a ratio of distance */
12
- t1: number;
13
- }
14
-
15
- /**
16
- * A ray for the purposes of computing sight and collision
17
- * Given points A[x,y] and B[x,y]
18
- *
19
- * Slope-Intercept form:
20
- * y = a + bx
21
- * y = A.y + ((B.y - A.Y) / (B.x - A.x))x
22
- *
23
- * Parametric form:
24
- * R(t) = (1-t)A + tB
25
- */
26
- declare class Ray {
27
- /**
28
- * @param A - The origin of the Ray
29
- * @param B - The destination of the Ray
30
- */
31
- constructor(A: Point, B: Point);
32
-
33
- /**
34
- * The origin point, `{x, y}`
35
- */
36
- A: Point;
37
-
38
- /**
39
- * The destination point, `{x, y}`
40
- */
41
- B: Point;
42
-
43
- /**
44
- * The origin y-coordinate
45
- */
46
- y0: number;
11
+ /** The proximity to the Ray origin, as a ratio of distance */
12
+ t0: number;
47
13
 
48
- /**
49
- * The origin x-coordinate
50
- */
51
- x0: number;
14
+ /** The proximity to the Ray destination, as a ratio of distance */
15
+ t1: number;
16
+ }
52
17
 
53
18
  /**
54
- * The horizontal distance of the ray, x1 - x0
55
- */
56
- dx: number;
57
-
58
- /**
59
- * The vertical distance of the ray, y1 - y0
60
- */
61
- dy: number;
62
-
63
- /**
64
- * The slope of the ray, dy over dx
65
- */
66
- slope: number;
67
-
68
- /**
69
- * The cached angle, computed lazily in Ray#angle
70
- * @defaultValue `undefined`
71
- * @internal
72
- */
73
- protected _angle: number | undefined;
74
-
75
- /**
76
- * The cached distance, computed lazily in Ray#distance
77
- * @defaultValue `undefined`
78
- * @internal
79
- */
80
- protected _distance: number | undefined;
81
-
82
- /**
83
- * The normalized angle of the ray in radians on the range (-PI, PI).
84
- * The angle is computed lazily (only if required) and cached.
85
- */
86
- get angle(): number;
87
- set angle(value: number);
88
-
89
- /**
90
- * A bounding rectangle that encompasses the Ray
91
- */
92
- get bounds(): NormalizedRectangle;
93
-
94
- /**
95
- * The distance (length) of the Ray in pixels.
96
- * The distance is computed lazily (only if required) and cached.
97
- */
98
- get distance(): number;
99
- set distance(value: number);
100
-
101
- /**
102
- * A factory method to construct a Ray from an origin point, an angle, and a distance
103
- * @param x - The origin x-coordinate
104
- * @param y - The origin y-coordinate
105
- * @param radians - The ray angle in radians
106
- * @param distance - The distance of the ray in pixels
107
- * @returns The constructed Ray instance
108
- */
109
- static fromAngle(x: number, y: number, radians: number, distance: number): Ray;
110
-
111
- /**
112
- * A factory method to construct a Ray from points in array format.
113
- * @param A - The origin point [x,y]
114
- * @param B - The destination point [x,y]
115
- * @returns The constructed Ray instance
116
- */
117
- static fromArrays(A: PointArray, B: PointArray): Ray;
118
-
119
- /**
120
- * Project the Array by some proportion of it's initial distance.
121
- * Return the coordinates of that point along the path.
122
- * @param t - The distance along the Ray
123
- * @returns The coordinates of the projected point
124
- */
125
- project(t: number): { x: number; y: number };
126
-
127
- /**
128
- * Reverse the direction of the Ray, returning a second Ray
129
- */
130
- reverse(): Ray;
131
-
132
- /**
133
- * Create a new ray which uses the same origin point, but a slightly offset angle and distance
134
- * @param offset - An offset in radians which modifies the angle of the original Ray
135
- * @param distance - A distance the new ray should project, otherwise uses the same distance.
136
- * @returns A new Ray with an offset angle
137
- */
138
- shiftAngle(angleOffset: number, distance?: number): Ray;
139
-
140
- /**
141
- * Find the point I[x,y] and distance t* on ray R(t) which intersects another ray
142
- * http://paulbourke.net/geometry/pointlineplane/
19
+ * A ray for the purposes of computing sight and collision
20
+ * Given points A[x,y] and B[x,y]
143
21
  *
144
- * @param coords - An array of coordinates [x0, y0, x1, y1] which defines a line segment to test
22
+ * Slope-Intercept form:
23
+ * y = a + bx
24
+ * y = A.y + ((B.y - A.Y) / (B.x - A.x))x
145
25
  *
146
- * @returns
147
- * The point of collision [x,y] the position of that collision point along the Ray (t0) an the tested
148
- * segment (t1). Returns false if no collision occurs.
149
- */
150
- intersectSegment(coords: [x0: number, y0: number, x1: number, y1: number]): RayIntersection | false;
151
-
152
- /**
153
- * An internal helper method for computing the intersection between two lines.
154
- * @internal
155
- */
156
- protected static _getIntersection(
157
- x1: number,
158
- y1: number,
159
- x2: number,
160
- y2: number,
161
- x3: number,
162
- y3: number,
163
- x4: number,
164
- y4: number
165
- ): RayIntersection | false;
166
-
167
- /**
168
- * @deprecated since 0.8.0
169
- */
170
- get normAngle(): number;
26
+ * Parametric form:
27
+ * R(t) = (1-t)A + tB
28
+ */
29
+ class Ray {
30
+ /**
31
+ * @param A - The origin of the Ray
32
+ * @param B - The destination of the Ray
33
+ */
34
+ constructor(A: Point, B: Point);
35
+
36
+ /**
37
+ * The origin point, `{x, y}`
38
+ */
39
+ A: Point;
40
+
41
+ /**
42
+ * The destination point, `{x, y}`
43
+ */
44
+ B: Point;
45
+
46
+ /**
47
+ * The origin y-coordinate
48
+ */
49
+ y0: number;
50
+
51
+ /**
52
+ * The origin x-coordinate
53
+ */
54
+ x0: number;
55
+
56
+ /**
57
+ * The horizontal distance of the ray, x1 - x0
58
+ */
59
+ dx: number;
60
+
61
+ /**
62
+ * The vertical distance of the ray, y1 - y0
63
+ */
64
+ dy: number;
65
+
66
+ /**
67
+ * The slope of the ray, dy over dx
68
+ */
69
+ slope: number;
70
+
71
+ /**
72
+ * The cached angle, computed lazily in Ray#angle
73
+ * @defaultValue `undefined`
74
+ * @internal
75
+ */
76
+ protected _angle: number | undefined;
77
+
78
+ /**
79
+ * The cached distance, computed lazily in Ray#distance
80
+ * @defaultValue `undefined`
81
+ * @internal
82
+ */
83
+ protected _distance: number | undefined;
84
+
85
+ /**
86
+ * The normalized angle of the ray in radians on the range (-PI, PI).
87
+ * The angle is computed lazily (only if required) and cached.
88
+ */
89
+ get angle(): number;
90
+ set angle(value: number);
91
+
92
+ /**
93
+ * A bounding rectangle that encompasses the Ray
94
+ */
95
+ get bounds(): NormalizedRectangle;
96
+
97
+ /**
98
+ * The distance (length) of the Ray in pixels.
99
+ * The distance is computed lazily (only if required) and cached.
100
+ */
101
+ get distance(): number;
102
+ set distance(value: number);
103
+
104
+ /**
105
+ * A factory method to construct a Ray from an origin point, an angle, and a distance
106
+ * @param x - The origin x-coordinate
107
+ * @param y - The origin y-coordinate
108
+ * @param radians - The ray angle in radians
109
+ * @param distance - The distance of the ray in pixels
110
+ * @returns The constructed Ray instance
111
+ */
112
+ static fromAngle(x: number, y: number, radians: number, distance: number): Ray;
113
+
114
+ /**
115
+ * A factory method to construct a Ray from points in array format.
116
+ * @param A - The origin point [x,y]
117
+ * @param B - The destination point [x,y]
118
+ * @returns The constructed Ray instance
119
+ */
120
+ static fromArrays(A: PointArray, B: PointArray): Ray;
121
+
122
+ /**
123
+ * Project the Array by some proportion of it's initial distance.
124
+ * Return the coordinates of that point along the path.
125
+ * @param t - The distance along the Ray
126
+ * @returns The coordinates of the projected point
127
+ */
128
+ project(t: number): { x: number; y: number };
129
+
130
+ /**
131
+ * Create a Ray by projecting a certain distance towards a known point.
132
+ * @param origin - The origin of the Ray
133
+ * @param point - The point towards which to project
134
+ * @param distance - The distance of projection
135
+ */
136
+ static towardsPoint(origin: Point, point: Point, distance: number): Ray;
137
+
138
+ /**
139
+ * Create a Ray by projecting a certain squared-distance towards a known point.
140
+ * @param origin - The origin of the Ray
141
+ * @param point - The point towards which to project
142
+ * @param distance2 - The squared distance of projection
143
+ */
144
+ static towardsPointSquared(origin: Point, point: Point, distance2: number): Ray;
145
+
146
+ /**
147
+ * Reverse the direction of the Ray, returning a second Ray
148
+ */
149
+ reverse(): Ray;
150
+
151
+ /**
152
+ * Create a new ray which uses the same origin point, but a slightly offset angle and distance
153
+ * @param offset - An offset in radians which modifies the angle of the original Ray
154
+ * @param distance - A distance the new ray should project, otherwise uses the same distance.
155
+ * @returns A new Ray with an offset angle
156
+ */
157
+ shiftAngle(angleOffset: number, distance?: number): Ray;
158
+
159
+ /**
160
+ * Find the point I[x,y] and distance t* on ray R(t) which intersects another ray
161
+ * @see foundry.utils.lineLineIntersection
162
+ */
163
+ intersectSegment(coords: [x0: number, y0: number, x1: number, y1: number]): LineIntersection | null;
164
+ }
171
165
  }
@@ -0,0 +1 @@
1
+ import './sightRay';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * A subclass of Ray that is used specifically for computing source polygons
3
+ *
4
+ * This was used for the RadialSweepPolygon but can now be deleted once that is
5
+ * @deprecated since v9d2
6
+ */
7
+ declare class SightRay extends Ray {
8
+ /**
9
+ * The array of sorted collision points which apply for this Ray.
10
+ */
11
+ collisions: WallEndpoint[];
12
+
13
+ /**
14
+ * The target endpoint at which this Ray was fired
15
+ */
16
+ endpoint: WallEndpoint | null;
17
+
18
+ /**
19
+ * The result objects which records the outcome of this Ray
20
+ */
21
+ result: {
22
+ collisions: unknown[];
23
+ continuation: unknown | undefined;
24
+ limitation: number;
25
+ superfluous: boolean;
26
+ stopped: boolean;
27
+ activeWalls: unknown | undefined;
28
+ };
29
+
30
+ /**
31
+ * The final collision point that this SightRay encountered.
32
+ */
33
+ get lastCollision(): WallEndpoint | null;
34
+ }
@@ -147,21 +147,21 @@ declare global {
147
147
  * console.log(r.total); // 11
148
148
  * ```
149
149
  */
150
- evaluate(options?: InexactPartial<Options & { async: false }>): this;
151
- evaluate(options: InexactPartial<Options> & { async: true }): Promise<this>;
152
- evaluate(options?: InexactPartial<Options>): this | Promise<this>;
150
+ evaluate(options?: InexactPartial<Options & { async: false }>): Evaluated<this>;
151
+ evaluate(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
152
+ evaluate(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<this>>;
153
153
 
154
154
  /**
155
155
  * Evaluate the roll asynchronously.
156
156
  * A temporary helper method used to migrate behavior from 0.7.x (sync by default) to 0.9.x (async by default).
157
157
  */
158
- protected _evaluate(options?: InexactPartial<Omit<Options, 'async'>>): Promise<this>;
158
+ protected _evaluate(options?: InexactPartial<Omit<Options, 'async'>>): Promise<Evaluated<this>>;
159
159
 
160
160
  /**
161
161
  * Evaluate the roll synchronously.
162
162
  * A temporary helper method used to migrate behavior from 0.7.x (sync by default) to 0.9.x (async by default).
163
163
  */
164
- protected _evaluateSync(options?: InexactPartial<Omit<Options, 'async'>>): this;
164
+ protected _evaluateSync(options?: InexactPartial<Omit<Options, 'async'>>): Evaluated<this>;
165
165
 
166
166
  /**
167
167
  * Safely evaluate the final total result for the Roll using its component terms.
@@ -173,9 +173,9 @@ declare global {
173
173
  * Alias for evaluate.
174
174
  * @see Roll#evaluate
175
175
  */
176
- roll(options?: InexactPartial<Options & { async: false }>): this;
177
- roll(options: InexactPartial<Options> & { async: true }): Promise<this>;
178
- roll(options?: InexactPartial<Options>): this | Promise<this>;
176
+ roll(options?: InexactPartial<Options & { async: false }>): Evaluated<this>;
177
+ roll(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
178
+ roll(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<this>>;
179
179
 
180
180
  /**
181
181
  * Create a new Roll object using the original provided formula and data.
@@ -183,9 +183,9 @@ declare global {
183
183
  * @param options - Evaluation options passed to Roll#evaluate
184
184
  * @returns A new Roll object, rolled using the same formula and data
185
185
  */
186
- reroll(options?: InexactPartial<Options & { async: false }>): this;
187
- reroll(options: InexactPartial<Options> & { async: true }): Promise<this>;
188
- reroll(options?: InexactPartial<Options>): this | Promise<this>;
186
+ reroll(options?: InexactPartial<Options & { async: false }>): Evaluated<this>;
187
+ reroll(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
188
+ reroll(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<this>>;
189
189
 
190
190
  /**
191
191
  * A factory method which constructs a Roll instance using the default configured Roll class.
@@ -351,11 +351,29 @@ declare global {
351
351
 
352
352
  /**
353
353
  * Render a Roll instance to HTML
354
- * @param chatOptions - An object configuring the behavior of the resulting chat message.
355
- * (default: `{}`)
354
+ * @param options - Options which affect how the Roll is rendered
355
+ * (default: `{}`)
356
356
  * @returns The rendered HTML template as a string
357
357
  */
358
- render(chatOptions?: ChatOptions): Promise<string>;
358
+ render(options?: {
359
+ /**
360
+ * Flavor text to include
361
+ * @defaultValue `undefined`
362
+ */
363
+ flavor?: string;
364
+
365
+ /**
366
+ * A custom HTML template path
367
+ * @defaultValue `this.constructor.CHAT_TEMPLATE`
368
+ */
369
+ template?: string;
370
+
371
+ /**
372
+ * Is the Roll displayed privately?
373
+ * @defaultValue `false`
374
+ */
375
+ isPrivate?: boolean;
376
+ }): Promise<string>;
359
377
 
360
378
  /**
361
379
  * Transform a Roll instance into a ChatMessage, displaying the roll result.
@@ -374,15 +392,15 @@ declare global {
374
392
  */
375
393
  toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
376
394
  messageData?: T,
377
- { rollMode, create }?: { rollMode?: foundry.CONST.DICE_ROLL_MODES; create?: true }
395
+ { rollMode, create }?: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create?: true }
378
396
  ): Promise<InstanceType<ConfiguredDocumentClass<typeof ChatMessage>> | undefined>;
379
397
  toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
380
398
  messageData: T,
381
- { rollMode, create }: { rollMode?: foundry.CONST.DICE_ROLL_MODES; create: false }
399
+ { rollMode, create }: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create: false }
382
400
  ): MessageData<T>;
383
401
  toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
384
402
  messageData: T,
385
- { rollMode, create }: { rollMode?: foundry.CONST.DICE_ROLL_MODES; create: boolean }
403
+ { rollMode, create }: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create: boolean }
386
404
  ): Promise<InstanceType<ConfiguredDocumentClass<typeof ChatMessage>> | undefined> | MessageData<T>;
387
405
 
388
406
  /**
@@ -440,37 +458,14 @@ declare global {
440
458
  * roll.formula; // 4d8 + 8
441
459
  * ```
442
460
  */
443
- static fromTerms(
461
+ static fromTerms<T extends ConstructorOf<Roll<any>>>(
462
+ this: T,
444
463
  terms: RollTerm[],
445
464
  options?: InexactPartial<Options>
446
- ): typeof CONFIG.Dice.rolls extends [infer T] ? T : Roll<{}>;
465
+ ): InstanceType<T>;
447
466
  }
448
467
  }
449
468
 
450
- interface ChatOptions {
451
- /**
452
- * @defaultValue `false`
453
- */
454
- blind?: boolean;
455
-
456
- /**
457
- * @defaultValue `null`
458
- */
459
- flavor?: any;
460
-
461
- /**
462
- * @defaultValue `false`
463
- */
464
- isPrivate?: boolean;
465
-
466
- template?: string;
467
-
468
- /**
469
- * @defaultValue The id of the current user
470
- */
471
- user?: string;
472
- }
473
-
474
469
  type Options = RollTerm.EvaluationOptions;
475
470
 
476
471
  interface SplitGroupOptions {
@@ -496,3 +491,5 @@ type MessageData<T extends DeepPartial<ConstructorParameters<typeof ChatMessage>
496
491
  content: number;
497
492
  sound: typeof CONFIG.sounds.dice;
498
493
  } & T;
494
+
495
+ type Evaluated<T extends Roll> = T & { _evaluated: true; _total: number; get total(): number };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * A tool for culling the renderable state of objects which are outside the current viewport.
3
+ */
4
+ declare class ScreenCulling {
5
+ constructor();
6
+
7
+ /**
8
+ * Toggle the renderable state of objects based on the current viewport rectangle
9
+ */
10
+ cull(rect: Rectangle): void;
11
+
12
+ /**
13
+ * Test whether rectangular bounds intersect
14
+ * @param rect - The target rectangle (the screen)
15
+ * @param bounds - The reference rectangle (the object)
16
+ * @returns Do they intersect?
17
+ */
18
+ intersects(rect: Rectangle, bounds: Rectangle): boolean;
19
+ }
@@ -1,3 +1,33 @@
1
+ /** Options which customize the behavior of the filter */
2
+ interface SearchFilterConfiguration {
3
+ /**
4
+ * The CSS selector used to target the text input element.
5
+ */
6
+ inputSelector: string;
7
+
8
+ /**
9
+ * The CSS selector used to target the content container for these tabs.
10
+ */
11
+ contentSelector: string;
12
+
13
+ /**
14
+ * A callback function which executes when the filter changes.
15
+ */
16
+ callback?: SearchFilter['callback'];
17
+
18
+ /**
19
+ * The initial value of the search query.
20
+ * @defaultValue `""`
21
+ */
22
+ initial?: SearchFilter['query'] | undefined;
23
+
24
+ /**
25
+ * The number of milliseconds to wait for text input before processing.
26
+ * @defaultValue `100`
27
+ */
28
+ delay?: number;
29
+ }
30
+
1
31
  /**
2
32
  * A controller class for managing a text input widget that filters the contents of some other UI element
3
33
  * @see {@link Application}
@@ -6,7 +36,7 @@ declare class SearchFilter {
6
36
  /**
7
37
  * @param options - Options which customize the behavior of the filter
8
38
  */
9
- constructor(options: SearchFilter.Options);
39
+ constructor(options: SearchFilterConfiguration);
10
40
 
11
41
  /**
12
42
  * The value of the current query string
@@ -26,28 +56,33 @@ declare class SearchFilter {
26
56
 
27
57
  /**
28
58
  * The CSS selector used to target the tab navigation element
59
+ * @internal
29
60
  */
30
61
  protected _inputSelector: string;
31
62
 
32
63
  /**
33
64
  * A reference to the HTML navigation element the tab controller is bound to
65
+ * @internal
34
66
  */
35
67
  protected _input: HTMLElement | null;
36
68
 
37
69
  /**
38
70
  * The CSS selector used to target the tab content element
71
+ * @internal
39
72
  */
40
73
  protected _contentSelector: string;
41
74
 
42
75
  /**
43
76
  * A reference to the HTML container element of the tab content
77
+ * @internal
44
78
  */
45
79
  protected _content: HTMLElement | null;
46
80
 
47
81
  /**
48
82
  * A debounced function which applies the search filtering
83
+ * @internal
49
84
  */
50
- protected _filter: this['callback'];
85
+ protected _filter: (...args: Parameters<this['callback']>) => void;
51
86
 
52
87
  /**
53
88
  * Bind the SearchFilter controller to an HTML application
@@ -69,34 +104,3 @@ declare class SearchFilter {
69
104
  */
70
105
  static cleanQuery(query: string): string;
71
106
  }
72
-
73
- declare namespace SearchFilter {
74
- interface Options {
75
- /**
76
- * The CSS selector used to target the text input element.
77
- */
78
- inputSelector: string;
79
-
80
- /**
81
- * The CSS selector used to target the content container for these tabs.
82
- */
83
- contentSelector: string;
84
-
85
- /**
86
- * The initial value of the search query.
87
- * @defaultValue `""`
88
- */
89
- initial?: SearchFilter['query'];
90
-
91
- /**
92
- * A callback function which executes when the filter changes.
93
- */
94
- callback: SearchFilter['callback'];
95
-
96
- /**
97
- * The number of milliseconds to wait for text input before processing.
98
- * @defaultValue `100`
99
- */
100
- delay?: number;
101
- }
102
- }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * I don't know what this will do yet
2
+ * TODO: Document Me
3
3
  */
4
4
  declare class SpecialEffect {
5
5
  constructor(parent: PIXI.Container, options?: DeepPartial<SpecialEffect.Options>);