@league-of-foundry-developers/foundry-vtt-types 9.255.1 → 9.268.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 (117) hide show
  1. package/README.md +5 -4
  2. package/package.json +3 -2
  3. package/src/foundry/common/data/data.mjs/index.d.ts +0 -1
  4. package/src/foundry/common/types.mjs.d.ts +4 -4
  5. package/src/foundry/common/utils/helpers.mjs.d.ts +1 -0
  6. package/src/foundry/foundry.js/application.d.ts +0 -1
  7. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +7 -3
  8. package/src/foundry/foundry.js/applications/cameraViews.d.ts +3 -3
  9. package/src/foundry/foundry.js/applications/chatPopout.d.ts +1 -1
  10. package/src/foundry/foundry.js/applications/compendium.d.ts +20 -11
  11. package/src/foundry/foundry.js/applications/controlsReference.d.ts +17 -2
  12. package/src/foundry/foundry.js/applications/dialog.d.ts +14 -29
  13. package/src/foundry/foundry.js/applications/filePicker.d.ts +67 -75
  14. package/src/foundry/foundry.js/applications/formApplication.d.ts +7 -2
  15. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +19 -58
  16. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -4
  17. package/src/foundry/foundry.js/applications/formApplications/{entitySheetConfig.d.ts → documentSheetConfig.d.ts} +36 -19
  18. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +1 -4
  19. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +2 -4
  20. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardConfig.d.ts +51 -0
  21. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfig.d.ts +88 -0
  22. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsHand.d.ts +20 -0
  23. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsPile.d.ts +20 -0
  24. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/index.d.ts +2 -0
  25. package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +2 -4
  26. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +17 -11
  27. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +3 -0
  28. package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +3 -9
  29. package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +10 -12
  30. package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +4 -5
  31. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +2 -6
  32. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +1 -4
  33. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +8 -12
  34. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +2 -1
  35. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +1 -4
  36. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +10 -11
  37. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +28 -15
  38. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +3 -6
  39. package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +1 -4
  40. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +17 -21
  41. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +3 -3
  42. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +40 -7
  43. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +2 -2
  44. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +10 -24
  45. package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +1 -1
  46. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +15 -3
  47. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +23 -16
  48. package/src/foundry/foundry.js/applications/formApplications/{defaultTokenConfig.d.ts → tokenConfigs/defaultTokenConfig.d.ts} +29 -16
  49. package/src/foundry/foundry.js/applications/formApplications/tokenConfigs/index.d.ts +1 -0
  50. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +22 -15
  51. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +23 -12
  52. package/src/foundry/foundry.js/applications/hotbar.d.ts +7 -3
  53. package/src/foundry/foundry.js/applications/index.d.ts +1 -0
  54. package/src/foundry/foundry.js/applications/invitationLinks.d.ts +25 -10
  55. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +16 -1
  56. package/src/foundry/foundry.js/applications/sidebar.d.ts +7 -0
  57. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +65 -38
  58. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +17 -3
  59. package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +19 -16
  60. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +0 -3
  61. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +4 -18
  62. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +2 -8
  63. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +38 -5
  64. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -0
  65. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -1
  66. package/src/foundry/foundry.js/applications/supportDetails.d.ts +78 -0
  67. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -2
  68. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +10 -2
  69. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +87 -49
  70. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +3 -7
  71. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +6 -13
  72. package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +6 -0
  73. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
  74. package/src/foundry/foundry.js/collections/documentCollections/worldCollection.d.ts +2 -2
  75. package/src/foundry/foundry.js/config.d.ts +21 -21
  76. package/src/foundry/foundry.js/contextMenu.d.ts +37 -28
  77. package/src/foundry/foundry.js/game.d.ts +2 -2
  78. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +26 -4
  79. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +1 -1
  80. package/src/foundry/foundry.js/perceptionManager.d.ts +1 -1
  81. package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
  82. package/src/foundry/foundry.js/pixi/containers/canvasLayers/controlsLayer.d.ts +49 -48
  83. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +51 -40
  84. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/lightingLayer.d.ts +63 -20
  85. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayer.d.ts +0 -3
  86. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +4 -4
  87. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +21 -0
  88. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/notesLayer.d.ts +1 -1
  89. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/soundsLayer.d.ts +10 -2
  90. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/tokenLayer.d.ts +41 -20
  91. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +50 -121
  92. package/src/foundry/foundry.js/pixi/containers/canvasLayers/sightLayer.d.ts +125 -107
  93. package/src/foundry/foundry.js/pixi/containers/controlIcon.d.ts +3 -0
  94. package/src/foundry/foundry.js/pixi/containers/index.d.ts +1 -0
  95. package/src/foundry/foundry.js/pixi/containers/objectHUD.d.ts +82 -0
  96. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +27 -6
  97. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +26 -4
  98. package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +34 -20
  99. package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +52 -15
  100. package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +9 -2
  101. package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +50 -12
  102. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +248 -87
  103. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +107 -16
  104. package/src/foundry/foundry.js/pixi/filters/abstractFilter.d.ts +42 -0
  105. package/src/foundry/foundry.js/pixi/filters/abstractFilters/fogColorFilter.d.ts +16 -0
  106. package/src/foundry/foundry.js/pixi/filters/abstractFilters/forceColorFilter.d.ts +17 -0
  107. package/src/foundry/foundry.js/pixi/filters/abstractFilters/glowFilter.d.ts +31 -0
  108. package/src/foundry/foundry.js/pixi/filters/abstractFilters/index.d.ts +4 -0
  109. package/src/foundry/foundry.js/pixi/filters/abstractFilters/roofMaskFilter.d.ts +20 -0
  110. package/src/foundry/foundry.js/pixi/filters/index.d.ts +2 -0
  111. package/src/foundry/foundry.js/roll.d.ts +2 -2
  112. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +5 -0
  113. package/src/foundry/foundry.js/textEditor.d.ts +266 -231
  114. package/src/types/augments/index.d.ts +2 -0
  115. package/src/types/augments/pixiGraphicsSmooth.d.ts +7 -0
  116. package/src/types/augments/pixiLegacyGraphics.d.ts +7 -0
  117. package/src/types/utils.d.ts +5 -0
@@ -9,6 +9,12 @@ declare class SoundsLayer extends PlaceablesLayer<'AmbientSound', SoundsLayer.La
9
9
  */
10
10
  livePreview: boolean;
11
11
 
12
+ /**
13
+ * A mapping of ambient audio sources which are active within the rendered Scene
14
+ * @defaultValue `new foundry.utils.Collection()`
15
+ */
16
+ sources: foundry.utils.Collection<SoundSource>;
17
+
12
18
  /**
13
19
  * @remarks This is not overridden in foundry but reflects the real behavior.
14
20
  */
@@ -97,9 +103,11 @@ declare class SoundsLayer extends PlaceablesLayer<'AmbientSound', SoundsLayer.La
97
103
  protected _onDragLeftCancel(event: PointerEvent): void;
98
104
 
99
105
  /**
100
- * @deprecated since 0.8.2
106
+ * Handle PlaylistSound document drop data.
107
+ * @param event - The drag drop event
108
+ * @param data - The dropped transfer data.
101
109
  */
102
- update(options?: { fade?: number }): ReturnType<this['refresh']>;
110
+ protected _onDropData(event: DragEvent, data: unknown): Promise<void>;
103
111
  }
104
112
 
105
113
  declare namespace SoundsLayer {
@@ -75,18 +75,36 @@ declare global {
75
75
 
76
76
  /**
77
77
  * Target all Token instances which fall within a coordinate rectangle.
78
- *
79
- * @param x - The top-left x-coordinate of the selection rectangle
80
- * @param y - The top-left y-coordinate of the selection rectangle
81
- * @param width - The width of the selection rectangle
82
- * @param height - The height of the selection rectangle
83
- * @param releaseOthers - Whether or not to release other targeted tokens
84
- * (default: `true`)
85
78
  * @returns The number of Token instances which were targeted.
86
79
  */
87
80
  targetObjects(
88
- { x, y, width, height }: { x: number; y: number; width: number; height: number },
89
- { releaseOthers }?: { releaseOthers?: boolean }
81
+ {
82
+ x,
83
+ y,
84
+ width,
85
+ height
86
+ }: {
87
+ /** The top-left x-coordinate of the selection rectangle */
88
+ x: number;
89
+
90
+ /** The top-left y-coordinate of the selection rectangle */
91
+ y: number;
92
+
93
+ /** The width of the selection rectangle */
94
+ width: number;
95
+
96
+ /** The height of the selection rectangle */
97
+ height: number;
98
+ },
99
+ {
100
+ releaseOthers
101
+ }?: {
102
+ /**
103
+ * Whether or not to release other targeted tokens
104
+ * @defaultValue `true`
105
+ */
106
+ releaseOthers?: boolean;
107
+ }
90
108
  ): number;
91
109
 
92
110
  /**
@@ -105,21 +123,21 @@ declare global {
105
123
  * (default: `true`)
106
124
  * @param combat - A Combat encounter from which to add or remove the Token
107
125
  * (default: `null`)
108
- * @param token - A specific Token which is the origin of the group toggle request
109
- * (default: `null`)
110
- * @returns The updated Combat encounter
111
- * @remarks Returns the created Combatants or undefined if there is no combat and one can't be created
112
- * or the combat if the user is no GM and wants to remove combatants.
126
+ * @returns The Combatants added or removed
113
127
  */
114
128
  toggleCombat(
115
129
  state?: boolean,
116
130
  combat?: InstanceType<ConfiguredDocumentClass<typeof Combat>> | null,
117
- { token }?: { token?: InstanceType<ConfiguredObjectClassForName<'Token'>> | null }
118
- ): Promise<
119
- | InstanceType<ConfiguredDocumentClass<typeof Combat>>
120
- | InstanceType<ConfiguredDocumentClass<typeof Combatant>>[]
121
- | void
122
- >;
131
+ {
132
+ token
133
+ }?: {
134
+ /**
135
+ * A specific Token which is the origin of the group toggle request
136
+ * @defaultValue `null`
137
+ */
138
+ token?: InstanceType<ConfiguredObjectClassForName<'Token'>> | null;
139
+ }
140
+ ): Promise<InstanceType<ConfiguredDocumentClass<typeof Combatant>>[]>;
123
141
 
124
142
  /**
125
143
  * Get the tab cycle order for tokens by sorting observable tokens based on their distance from top-left.
@@ -138,6 +156,9 @@ declare global {
138
156
  event: DragEvent,
139
157
  data: TokenLayer.DropData
140
158
  ): Promise<void | false | InstanceType<ConfiguredObjectClassForName<'Token'>>>;
159
+
160
+ /** @override */
161
+ protected _onClickLeft(event: PIXI.InteractionEvent): void;
141
162
  }
142
163
 
143
164
  namespace TokenLayer {
@@ -11,17 +11,16 @@ declare global {
11
11
  constructor();
12
12
 
13
13
  /**
14
- * A graphics layer used to display chained Wall selection
15
- * @defaultValue `null`
14
+ * An array of Wall objects which represent the boundaries of the canvas.
15
+ * @defaultValue `new Set()`
16
16
  */
17
- chain: PIXI.Graphics | null;
17
+ boundaries: Set<Wall>;
18
18
 
19
19
  /**
20
- * An array of all the unique perception-blocking endpoints which are present in the layer
21
- * We keep this array cached for faster sight polygon computations
22
- * @defaultValue `[]`
20
+ * A graphics layer used to display chained Wall selection
21
+ * @defaultValue `null`
23
22
  */
24
- endpoints: PointArray[];
23
+ chain: PIXI.Graphics | null;
25
24
 
26
25
  /**
27
26
  * Track whether we are currently within a chained placement workflow
@@ -47,13 +46,11 @@ declare global {
47
46
  * @defaultValue
48
47
  * ```
49
48
  * {
50
- * id: null,
51
49
  * point: null,
52
50
  * }
53
51
  * ```
54
52
  */
55
53
  protected last: {
56
- id: string | null;
57
54
  point: PointArray | null;
58
55
  };
59
56
 
@@ -69,9 +66,6 @@ declare global {
69
66
  * mergeObject(super.layerOptions, {
70
67
  * name: "walls"
71
68
  * controllableObjects: true,
72
- * objectClass: Wall,
73
- * quadtree: true,
74
- * sheetClass: WallConfig,
75
69
  * sortActiveTop: true,
76
70
  * zIndex: 40
77
71
  * })
@@ -107,6 +101,12 @@ declare global {
107
101
  */
108
102
  initialize(): void;
109
103
 
104
+ /**
105
+ * Initialization to identify all intersections between walls.
106
+ * These intersections are cached and used later when computing point source polygons.
107
+ */
108
+ identifyWallIntersections(): void;
109
+
110
110
  /**
111
111
  * Identify walls which are treated as "interior" because they are contained fully within a roof tile.
112
112
  */
@@ -120,31 +120,21 @@ declare global {
120
120
  */
121
121
  static getClosestEndpoint(point: Point, wall: InstanceType<ConfiguredObjectClassForName<'Wall'>>): PointArray;
122
122
 
123
- /**
124
- * Given an array of Wall instances, identify the unique endpoints across all walls.
125
- * @param walls - An array of Wall instances
126
- * @param options - Additional options which modify the set of endpoints identified
127
- * (defaultValue: `{}`)
128
- * @returns An array of endpoints
129
- */
130
- static getUniqueEndpoints(
131
- walls:
132
- | InstanceType<ConfiguredObjectClassForName<'Wall'>>[]
133
- | Set<InstanceType<ConfiguredObjectClassForName<'Wall'>>>,
134
- options?: EndpointOptions
135
- ): PointArray[];
136
-
137
123
  /**
138
124
  * Test whether movement along a given Ray collides with a Wall.
139
125
  * @param ray - The attempted movement
140
126
  * @param options - Options which customize how collision is tested
141
- * @returns Does a collision occur?
127
+ * @returns False if there are no Walls
128
+ * True if the Ray is outside the Canvas
129
+ * Whether any collision occurred if mode is "any"
130
+ * An array of collisions, if mode is "all"
131
+ * The closest collision, if mode is "closest"
142
132
  */
143
- checkCollision(ray: Ray, options: CollisionOptions & { mode: 'all' }): boolean | RayIntersection[];
144
- checkCollision(ray: Ray, options: CollisionOptions & { mode: 'closest' }): boolean | RayIntersection | null;
133
+ checkCollision(ray: Ray, options: CollisionOptions & { mode: 'all' }): boolean | PolygonVertex[];
134
+ checkCollision(ray: Ray, options: CollisionOptions & { mode: 'closest' }): boolean | PolygonVertex;
145
135
  checkCollision(ray: Ray, options: CollisionOptions & { mode: 'any' }): boolean;
146
136
  checkCollision(ray: Ray, options: Omit<CollisionOptions, 'mode'>): boolean;
147
- checkCollision(ray: Ray, options: CollisionOptions): boolean | RayIntersection | null;
137
+ checkCollision(ray: Ray, options: CollisionOptions): boolean | PolygonVertex;
148
138
  checkCollision(ray: Ray, options?: CollisionOptions): boolean;
149
139
 
150
140
  /**
@@ -164,6 +154,12 @@ declare global {
164
154
  options?: PasteOptions
165
155
  ): Promise<InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseWall>>[]>;
166
156
 
157
+ /**
158
+ * Create temporary WallDocument instances which represent the rectangular boundaries of the canvas.
159
+ * @internal
160
+ */
161
+ protected _createBoundaries(): void;
162
+
167
163
  /**
168
164
  * Pan the canvas view when the cursor position gets close to the edge of the frame
169
165
  * @param event - The originating mouse movement event
@@ -189,8 +185,10 @@ declare global {
189
185
  */
190
186
  protected _getWallDataFromActiveTool(tool: string):
191
187
  | {
192
- move: foundry.CONST.WALL_MOVEMENT_TYPES;
193
- sense: foundry.CONST.WALL_SENSE_TYPES;
188
+ light: foundry.CONST.WALL_SENSE_TYPES;
189
+ sight: foundry.CONST.WALL_SENSE_TYPES;
190
+ sound: foundry.CONST.WALL_SENSE_TYPES;
191
+ move: foundry.CONST.WALL_SENSE_TYPES;
194
192
  door?: foundry.CONST.WALL_DOOR_TYPES;
195
193
  }
196
194
  | this['_cloneType'];
@@ -210,32 +208,14 @@ declare global {
210
208
  /** @override */
211
209
  protected _onClickRight(event: PIXI.InteractionEvent): void;
212
210
 
213
- /**
214
- * Compute source polygons of a requested type for a given origin position and maximum radius.
215
- * This method returns two polygons, one which is unrestricted by the provided radius, and one that is constrained
216
- * by the maximum radius.
217
- *
218
- * @param origin - An point with coordinates x and y representing the origin of the test
219
- * @param radius - A distance in canvas pixels which reflects the visible range
220
- * @param options - Additional options which modify the sight computation
221
- * (default: `{}`)
222
- * @returns The computed rays and polygons
223
- */
211
+ /** @deprecated since v9 */
224
212
  computePolygon(
225
213
  origin: Point,
226
214
  radius: number,
227
215
  options?: ComputePolygonOptions
228
216
  ): { rays: Ray[]; los: PIXI.Polygon; fov: PIXI.Polygon };
229
217
 
230
- /**
231
- * Get the set of wall collisions for a given Ray
232
- * @param ray - The Ray being tested
233
- * @param options - Options which customize how collision is tested
234
- * (default: `{}`)
235
- * @returns An array of collisions, if mode is "all"
236
- * The closest collision, if mode is "closest"
237
- * Whether any collision occurred if mode is "any"
238
- */
218
+ /** @deprecated since v9 */
239
219
  getRayCollisions(ray: Ray, options: RayCollisionsOptions & { mode: 'all' }): RayIntersection[];
240
220
  getRayCollisions(ray: Ray, options: RayCollisionsOptions & { mode: 'closest' }): RayIntersection | null;
241
221
  getRayCollisions(ray: Ray, options: RayCollisionsOptions & { mode: 'any' }): boolean;
@@ -243,77 +223,26 @@ declare global {
243
223
  getRayCollisions(ray: Ray, options?: RayCollisionsOptions): RayIntersection[] | RayIntersection | boolean | null;
244
224
 
245
225
  /**
246
- * A helper method responsible for casting rays at wall endpoints.
247
- * Rays are restricted by limiting angles.
248
- *
249
- * @param x - The origin x-coordinate
250
- * @param y - The origin y-coordinate
251
- * @param distance - The ray distance
252
- * @param density - The desired radial density
253
- * (default: `4`)
254
- * @param endpoints - An array of endpoints to target
255
- * @param limitAngle - Whether the rays should be cast subject to a limited angle of emission
256
- * (default: `false`)
257
- * @param aMin - The minimum bounding angle
258
- * @param aMax - The maximum bounding angle
259
- *
260
- * @returns An array of Ray objects
261
- */
262
- static castRays(
263
- x: number,
264
- y: number,
265
- distance: number,
266
- {
267
- density,
268
- endpoints,
269
- limitAngle,
270
- aMin,
271
- aMax
272
- }?: { density?: number; endpoints?: PointArray[]; limitAngle?: boolean; aMin?: number; aMax?: number }
273
- ): Ray[];
274
-
275
- /**
276
- * Test a single Ray against a single Wall
277
- * @param ray - The Ray being tested
278
- * @param wall - The Wall against which to test
279
- * @returns A RayIntersection if a collision occurred, or null
280
- */
281
- static testWall(ray: Ray, wall: InstanceType<ConfiguredObjectClassForName<'Wall'>>): RayIntersection | null;
282
-
283
- /**
284
- * Identify the closest collision point from an array of collisions
285
- * @param collisions - An array of intersection points
286
- * @returns The closest blocking intersection or null if no collision occurred
287
- */
288
- static getClosestCollision(collisions: RayIntersection[]): RayIntersection | null;
289
-
290
- /**
291
- * Normalize an angle to ensure it is baselined to be the smallest angle that is greater than a minimum.
292
- * @param aMin - The lower-bound minimum angle
293
- * @param angle - The angle to adjust
294
- * @returns The adjusted angle which is greater than or equal to aMin.
295
- */
296
- protected static _normalizeAngle(aMin: number, angle: number): number;
297
-
298
- /**
299
- * Map source types to wall collision types
300
- * @param type - The source polygon type
301
- * @returns The wall collision attribute
302
- */
303
- protected static _mapCollisionType(type: 'movement'): 'move';
304
- protected static _mapCollisionType(type: 'light'): 'sense';
305
- protected static _mapCollisionType(type: 'sight'): 'sense';
306
- protected static _mapCollisionType(type: 'sound'): 'sound';
307
-
308
- /**
309
- * @deprecated since 0.8.0
226
+ * An array of all the unique perception-blocking endpoints which are present in the layer
227
+ * We keep this array cached for faster sight polygon computations
228
+ * @deprecated since v9
310
229
  */
311
- get blockVision(): InstanceType<ConfiguredObjectClassForName<'Wall'>>[];
230
+ get endpoints(): PointArray[];
312
231
 
313
232
  /**
314
- * @deprecated since 0.8.0
233
+ * Given an array of Wall instances, identify the unique endpoints across all walls.
234
+ * @param walls - An array of Wall instances
235
+ * @param options - Additional options which modify the set of endpoints identified
236
+ * (defaultValue: `{}`)
237
+ * @returns An array of endpoints
238
+ * @deprecated since v9
315
239
  */
316
- get blockMovement(): InstanceType<ConfiguredObjectClassForName<'Wall'>>[];
240
+ static getUniqueEndpoints(
241
+ walls:
242
+ | InstanceType<ConfiguredObjectClassForName<'Wall'>>[]
243
+ | Set<InstanceType<ConfiguredObjectClassForName<'Wall'>>>,
244
+ options?: EndpointOptions
245
+ ): PointArray[];
317
246
  }
318
247
 
319
248
  namespace WallsLayer {
@@ -345,9 +274,9 @@ interface EndpointOptions {
345
274
  interface CollisionOptions {
346
275
  /**
347
276
  * Which collision type to check: movement, sight, sound
348
- * @defaultValue `'movement'`
277
+ * @defaultValue `'move'`
349
278
  */
350
- type?: 'movement' | 'sight' | 'sound';
279
+ type?: 'move' | 'sight' | 'sound';
351
280
 
352
281
  /**
353
282
  * Which type of collisions are returned: any, closest, all