@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
@@ -1,7 +1,7 @@
1
- import { ConfiguredDocumentClass, PropertiesToSource } from '../../../types/helperTypes';
2
- import { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
- import { CombatantDataProperties } from '../../common/data/data.mjs/combatantData';
4
- import type { CombatDataConstructorData } from '../../common/data/data.mjs/combatData.js';
1
+ import type { ConfiguredDocumentClass, PropertiesToSource } from '../../../types/helperTypes';
2
+ import type { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
+ import type { ChatMessageDataConstructorData } from '../../common/data/data.mjs/chatMessageData.js';
4
+ import type { CombatantDataProperties } from '../../common/data/data.mjs/combatantData';
5
5
 
6
6
  declare global {
7
7
  /**
@@ -12,10 +12,11 @@ declare global {
12
12
  * @see {@link documents.Combats} The world-level collection of Combat documents
13
13
  * @see {@link embedded.Combatant} The Combatant embedded document which exists within a Combat document
14
14
  * @see {@link applications.CombatConfig} The Combat configuration application
15
- *
16
- * @param data - Initial data provided to construct the Combat document
17
15
  */
18
16
  class Combat extends ClientDocumentMixin(foundry.documents.BaseCombat) {
17
+ /**
18
+ * @param data - Initial data provided to construct the Combat document
19
+ */
19
20
  constructor(
20
21
  data?: ConstructorParameters<ConstructorOf<foundry.documents.BaseCombat>>[0],
21
22
  context?: ConstructorParameters<ConstructorOf<foundry.documents.BaseCombat>>[1]
@@ -33,6 +34,7 @@ declare global {
33
34
  /**
34
35
  * Track whether a sound notification is currently being played to avoid double-dipping
35
36
  * @defaultValue `false`
37
+ * @internal
36
38
  */
37
39
  protected _soundPlaying: boolean;
38
40
 
@@ -40,7 +42,7 @@ declare global {
40
42
  static CONFIG_SETTING: 'combatTrackerConfig';
41
43
 
42
44
  /** Get the Combatant who has the current turn. */
43
- get combatant(): this['turns'][number];
45
+ get combatant(): this['turns'][number] | undefined;
44
46
 
45
47
  /** The numeric round of the Combat encounter */
46
48
  get round(): number;
@@ -58,10 +60,13 @@ declare global {
58
60
  get started(): boolean;
59
61
 
60
62
  /** The numeric turn of the combat round in the Combat encounter */
61
- get turn(): number;
63
+ get turn(): number | null;
62
64
 
63
65
  get visible(): true;
64
66
 
67
+ /** Is this combat active in the current scene? */
68
+ get isActive(): boolean;
69
+
65
70
  /**
66
71
  * Set the current Combat encounter as active within the Scene.
67
72
  * Deactivate all other Combat encounters within the viewed Scene and set this one as active
@@ -78,7 +83,13 @@ declare global {
78
83
  * Get a Combatant using its Token id
79
84
  * @param tokenId - The id of the Token for which to acquire the combatant
80
85
  */
81
- getCombatantByToken(tokenId: string): ReturnType<this['combatants']['find']>;
86
+ getCombatantByToken(tokenId: string): InstanceType<ConfiguredDocumentClass<typeof Combatant>> | undefined;
87
+
88
+ /**
89
+ * Get a Combatant using its Actor id
90
+ * @param actorId - The id of the Actor for which to acquire the combatant
91
+ */
92
+ getCombatantByActor(actorId: string): InstanceType<ConfiguredDocumentClass<typeof Combatant>> | undefined;
82
93
 
83
94
  /** Advance the combat to the next round */
84
95
  nextRound(): Promise<this | undefined>;
@@ -95,15 +106,18 @@ declare global {
95
106
  /** Rewind the combat to the previous turn */
96
107
  previousTurn(): Promise<this | undefined>;
97
108
 
109
+ /** Toggle whether this combat is linked to the scene or globally available. */
110
+ toggleSceneLink(): Promise<this | undefined>;
111
+
98
112
  /** Reset all combatant initiative scores, setting the turn back to zero */
99
113
  resetAll(): Promise<this | undefined>;
100
114
 
101
115
  /**
102
- * Roll initiative for one or multiple Combatants within the Combat entity
103
- * @param ids - A Combatant id or Array of ids for which to roll
116
+ * Roll initiative for one or multiple Combatants within the Combat document
117
+ * @param ids - A Combatant id or Array of ids for which to roll
104
118
  * @param options - Additional options which modify how initiative rolls are created or presented.
105
119
  * default `{}`
106
- * @returns A promise which resolves to the updated Combat entity once updates are complete.
120
+ * @returns A promise which resolves to the updated Combat document once updates are complete.
107
121
  */
108
122
  rollInitiative(ids: string | string[], options?: InitiativeOptions): Promise<this>;
109
123
 
@@ -112,19 +126,19 @@ declare global {
112
126
  * @param options - Additional options forwarded to the Combat.rollInitiative method
113
127
  * default `{}`
114
128
  */
115
- rollAll(options?: InitiativeOptions): this['rollInitiative'];
129
+ rollAll(options?: InitiativeOptions): Promise<this>;
116
130
 
117
131
  /**
118
132
  * Roll initiative for all non-player actors who have not already rolled
119
133
  * @param options - Additional options forwarded to the Combat.rollInitiative method
120
134
  * default `{}`
121
135
  */
122
- rollNPC(options?: InitiativeOptions): this['rollInitiative'];
136
+ rollNPC(options?: InitiativeOptions): Promise<this>;
123
137
 
124
138
  /**
125
139
  * Assign initiative for a single Combatant within the Combat encounter.
126
140
  * Update the Combat turn order to maintain the same combatant as the current turn.
127
- * @param id - The combatant ID for which to set initiative
141
+ * @param id - The combatant ID for which to set initiative
128
142
  * @param value - A specific initiative value to set
129
143
  */
130
144
  setInitiative(id: string, value: number): Promise<void>;
@@ -139,66 +153,52 @@ declare global {
139
153
  * Define how the array of Combatants is sorted in the displayed list of the tracker.
140
154
  * This method can be overridden by a system or module which needs to display combatants in an alternative order.
141
155
  * By default sort by initiative, next falling back to name, lastly tie-breaking by combatant id.
156
+ * @internal
142
157
  */
143
158
  protected _sortCombatants(
144
159
  a: InstanceType<ConfiguredDocumentClass<typeof Combatant>>,
145
160
  b: InstanceType<ConfiguredDocumentClass<typeof Combatant>>
146
161
  ): number;
147
162
 
163
+ /** @override */
148
164
  protected _onCreate(data: this['data']['_source'], options: DocumentModificationOptions, userId: string): void;
149
165
 
166
+ /** @override */
150
167
  protected _onUpdate(
151
168
  changed: DeepPartial<this['data']['_source']>,
152
169
  options: DocumentModificationOptions,
153
170
  userId: string
154
- ): void; //TODO Returntype could also be CombatTracker.scrollToTurn
171
+ ): void;
155
172
 
173
+ /** @override */
156
174
  protected _onDelete(options: DocumentModificationOptions, userId: string): void;
157
175
 
176
+ /** @override */
158
177
  protected _onCreateEmbeddedDocuments(
159
- embeddedName: string,
160
- documents: Combatant[],
161
- result: DeepPartial<PropertiesToSource<CombatantDataProperties>>[],
178
+ type: string,
179
+ documents: InstanceType<ConfiguredDocumentClass<typeof Combatant>>[],
180
+ result: PropertiesToSource<CombatantDataProperties>[],
162
181
  options: DocumentModificationOptions,
163
182
  userId: string
164
183
  ): void;
165
184
 
185
+ /** @override */
166
186
  protected _onUpdateEmbeddedDocuments(
167
187
  embeddedName: string,
168
- documents: Combatant[],
169
- result: DeepPartial<PropertiesToSource<CombatantDataProperties>>[],
188
+ documents: InstanceType<ConfiguredDocumentClass<typeof Combatant>>[],
189
+ result: PropertiesToSource<CombatantDataProperties>[],
170
190
  options: DocumentModificationOptions,
171
191
  userId: string
172
192
  ): void;
173
193
 
194
+ /** @override */
174
195
  protected _onDeleteEmbeddedDocuments(
175
196
  embeddedName: string,
176
- documents: Combatant[],
197
+ documents: InstanceType<ConfiguredDocumentClass<typeof Combatant>>[],
177
198
  result: string[],
178
199
  options: DocumentModificationContext,
179
200
  userId: string
180
201
  ): void;
181
-
182
- /** @deprecated since 0.8.0 */
183
- getCombatant(id: string): this['combatants']['get'];
184
-
185
- /** @deprecated since 0.8.0 */
186
- createCombatant(
187
- data: CombatDataConstructorData | (CombatDataConstructorData & Record<string, unknown>),
188
- options?: DocumentModificationContext
189
- ): this['createEmbeddedDocuments'];
190
-
191
- /** @deprecated since 0.8.0 */
192
- updateCombatant(
193
- data: DeepPartial<CombatDataConstructorData | (CombatDataConstructorData & Record<string, unknown>)>,
194
- options?: DocumentModificationContext
195
- ): NonNullable<ReturnType<this['combatants']['get']>>['update'];
196
-
197
- /** @deprecated since 0.8.0 */
198
- deleteCombatant(
199
- id: string,
200
- options?: DocumentModificationContext
201
- ): NonNullable<ReturnType<this['combatants']['get']>>['delete'];
202
202
  }
203
203
  }
204
204
 
@@ -208,16 +208,18 @@ interface InitiativeOptions {
208
208
  * @defaultValue `null`
209
209
  */
210
210
  formula?: string | null;
211
+
211
212
  /**
212
213
  * Update the Combat turn after adding new initiative scores to keep the turn on the same Combatant.
213
214
  * @defaultValue `true`
214
215
  */
215
216
  updateTurn?: boolean;
217
+
216
218
  /**
217
219
  * Additional options with which to customize created Chat Messages
218
220
  * @defaultValue `{}`
219
221
  */
220
- messageOptions?: object; //TODO Type properly once ChatMessage is typed
222
+ messageOptions?: ChatMessageDataConstructorData;
221
223
  }
222
224
 
223
225
  interface RoundData {
@@ -1,5 +1,4 @@
1
1
  import { ConfiguredDocumentClass } from '../../../types/helperTypes';
2
- import { BaseUser } from '../../common/documents.mjs';
3
2
 
4
3
  declare global {
5
4
  /**
@@ -22,18 +21,6 @@ declare global {
22
21
  context: ConstructorParameters<typeof foundry.documents.BaseCombatant>[1]
23
22
  );
24
23
 
25
- /**
26
- * A cached reference to the Token which this Combatant represents, if any
27
- * @defaultValue `undefined`
28
- * */
29
- protected _token: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>> | null | undefined;
30
-
31
- /**
32
- * A cached reference to the Actor which this Combatant represents, if any
33
- * @defaultValue `undefined`
34
- * */
35
- protected _actor: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseActor>> | null | undefined;
36
-
37
24
  /** The current value of the special tracked resource which pertains to this Combatant */
38
25
  resource: `${number}` | number | boolean | null;
39
26
 
@@ -54,8 +41,8 @@ declare global {
54
41
  /** @override */
55
42
  get isOwner(): boolean;
56
43
 
57
- /** Is this Combatant entry currently visible in the Combat Tracker? */
58
- get isVisible(): boolean;
44
+ /** @override */
45
+ get visible(): boolean;
59
46
 
60
47
  /** Is this Combatant "hidden", either because they are explicitly marked as hidden or because their token is hidden */
61
48
  get hidden(): boolean;
@@ -72,9 +59,14 @@ declare global {
72
59
  /** An array of User documents who have ownership of this Document */
73
60
  get players(): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseUser>>[];
74
61
 
62
+ /**
63
+ * Has this combatant been marked as defeated?
64
+ */
65
+ get isDefeated(): boolean;
66
+
75
67
  /** @override */
76
68
  testUserPermission(
77
- user: BaseUser,
69
+ user: foundry.documents.BaseUser,
78
70
  permission: keyof typeof foundry.CONST.DOCUMENT_PERMISSION_LEVELS | foundry.CONST.DOCUMENT_PERMISSION_LEVELS,
79
71
  { exact }?: { exact?: boolean }
80
72
  ): boolean;
@@ -89,7 +81,7 @@ declare global {
89
81
  /**
90
82
  * Roll initiative for this particular combatant.
91
83
  * @param formula - A dice formula which overrides the default for this Combatant.
92
- * @returns The Roll instance to use for the combatant.
84
+ * @returns The updated Combatant.
93
85
  */
94
86
  rollInitiative(formula: string): Promise<this | undefined>;
95
87
 
@@ -107,6 +99,11 @@ declare global {
107
99
  * @returns The initiative formula to use for this combatant.
108
100
  */
109
101
  protected _getInitiativeFormula(): string;
102
+
103
+ /**
104
+ * @deprecated since v9
105
+ */
106
+ get isVisible(): boolean;
110
107
  }
111
108
  }
112
109
  export {};
@@ -158,7 +158,7 @@ declare global {
158
158
  /**
159
159
  * The chat roll mode to use when displaying the result
160
160
  */
161
- rollMode: foundry.CONST.DICE_ROLL_MODES;
161
+ rollMode: keyof CONFIG.Dice.RollModes | 'roll';
162
162
  }
163
163
 
164
164
  /**
@@ -180,7 +180,7 @@ declare global {
180
180
  * Additional options which customize the created messages
181
181
  * @defaultValue `{}`
182
182
  */
183
- messageOptions: ConstructorParameters<typeof foundry.documents.BaseChatMessage>[1];
183
+ messageOptions: DocumentModificationContext & { rollMode: keyof CONFIG.Dice.RollModes | 'roll' };
184
184
  }
185
185
 
186
186
  interface RollOptions {
@@ -240,11 +240,21 @@ declare class ClientKeybindings {
240
240
  protected _onPan(context: KeyboardEventContext, movementDirections: ClientKeybindings.MovementDirection[]): boolean;
241
241
 
242
242
  /**
243
- * Handle number key presses
243
+ * Handle Macro executions
244
244
  * @param context - The context data of the event
245
245
  * @internal
246
246
  */
247
- protected static _onMacro(context: KeyboardEventContext): true;
247
+ protected static _onMacroExecute(
248
+ context: KeyboardEventContext,
249
+ number: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
250
+ ): boolean;
251
+
252
+ /**
253
+ * Handle Macro page swaps
254
+ * @param context - The context data of the event
255
+ * @internal
256
+ */
257
+ protected static _onMacroPageSwap(context: KeyboardEventContext, page: number): true;
248
258
 
249
259
  /**
250
260
  * Handle action to copy data to clipboard
@@ -239,7 +239,7 @@ declare namespace ClientSettings {
239
239
  'core.nue.shownTips': boolean;
240
240
  'core.noCanvas': boolean;
241
241
  'core.permissions': Game.Permissions;
242
- 'core.rollMode': foundry.CONST.DICE_ROLL_MODES;
242
+ 'core.rollMode': keyof CONFIG.Dice.RollModes;
243
243
  'core.softShadows': boolean;
244
244
  'core.time': number;
245
245
  'core.tokenDragPreview': boolean;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * An object containing the result of a collision test.
3
+ * @internal
4
+ */
5
+ declare class CollisionResult {
6
+ constructor(values?: {
7
+ target?: PolygonVertex | null;
8
+ collisions?: PolygonVertex[];
9
+ cwEdges?: EdgeSet;
10
+ ccwEdges?: EdgeSet;
11
+ isBehind?: boolean;
12
+ isLimited?: boolean;
13
+ isRequired?: boolean;
14
+ wasLimited?: boolean;
15
+ });
16
+
17
+ /**
18
+ * The vertex that was the target of this result
19
+ * @defaultValue `null`
20
+ */
21
+ target: PolygonVertex | null;
22
+
23
+ /**
24
+ * The array of collision points which apply to this result
25
+ * @defaultValue `[]`
26
+ */
27
+ collisions: PolygonVertex[];
28
+
29
+ /**
30
+ * The set of edges connected to the target vertex that continue clockwise
31
+ * @defaultValue `new Set()`
32
+ */
33
+ cwEdges: EdgeSet;
34
+
35
+ /**
36
+ * The set of edges connected to the target vertex that continue counter-clockwise
37
+ * @defaultValue `new Set()`
38
+ */
39
+ ccwEdges: EdgeSet;
40
+
41
+ /**
42
+ * Is the target vertex for this result behind some closer active edge?
43
+ */
44
+ isBehind: boolean | undefined;
45
+
46
+ /**
47
+ * Does the target vertex for this result impose a limited collision?
48
+ */
49
+ isLimited: boolean | undefined;
50
+
51
+ /**
52
+ * Is this result required due to a limited angle?
53
+ */
54
+ isRequired: boolean | undefined;
55
+
56
+ /**
57
+ * Has the set of collisions for this result encountered a limited edge?
58
+ */
59
+ wasLimited: boolean | undefined;
60
+ }
@@ -328,19 +328,7 @@ declare global {
328
328
  /** @defaultValue `[Die, FateDie]` */
329
329
  types: Array<ConstructorOf<DiceTerm>>;
330
330
 
331
- rollModes: {
332
- /** @defaultValue `'CHAT.RollPublic'` */
333
- roll: string;
334
-
335
- /** @defaultValue `'CHAT.RollPrivate'` */
336
- gmroll: string;
337
-
338
- /** @defaultValue `CHAT.RollBlind'` */
339
- blindroll: string;
340
-
341
- /** @defaultValue `'CHAT.RollSelf'` */
342
- selfroll: string;
343
- } & Record<string, string>;
331
+ rollModes: CONFIG.Dice.RollModes;
344
332
 
345
333
  /** @defaultValue `[Roll]` */
346
334
  rolls: Array<ConstructorOf<Roll>>;
@@ -599,7 +587,7 @@ declare global {
599
587
  blurStrength: number;
600
588
 
601
589
  /** @defaultValue `ScreenCulling` */
602
- cullingBackend: unknown; // FIXME: ConstructorOf<typeof ScreenCulling>
590
+ cullingBackend: ConstructorOf<typeof ScreenCulling | typeof QuadtreeCulling>;
603
591
 
604
592
  /** @defaultValue `0x242448` */
605
593
  darknessColor: number;
@@ -665,8 +653,8 @@ declare global {
665
653
  /** @defaultValue `'LIGHT.AnimationTorch'` */
666
654
  label: string;
667
655
 
668
- /** @defaultValue LightSource.prototype.animateTorch */
669
- animation: PointSource.AnimationFunction;
656
+ /** @defaultValue `LightSource.prototype.animateTorch` */
657
+ animation: CONFIG.Canvas.LightAnimationFunction;
670
658
 
671
659
  /** @defaultValue `TorchIlluminationShader` */
672
660
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -680,7 +668,7 @@ declare global {
680
668
  label: string;
681
669
 
682
670
  /** @defaultValue `LightSource.prototype.animatePulse` */
683
- animation: PointSource.AnimationFunction;
671
+ animation: CONFIG.Canvas.LightAnimationFunction;
684
672
 
685
673
  /** @defaultValue `PulseIlluminationShader` */
686
674
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -694,7 +682,7 @@ declare global {
694
682
  label: string;
695
683
 
696
684
  /** @defaultValue `LightSource.prototype.animateTime` */
697
- animation: PointSource.AnimationFunction;
685
+ animation: CONFIG.Canvas.LightAnimationFunction;
698
686
 
699
687
  /** @defaultValue `ChromaColorationShader` */
700
688
  colorationShader: ConstructorOf<AbstractBaseShader>;
@@ -705,7 +693,7 @@ declare global {
705
693
  label: string;
706
694
 
707
695
  /** @defaultValue `LightSource.prototype.animateTime` */
708
- animation: PointSource.AnimationFunction;
696
+ animation: CONFIG.Canvas.LightAnimationFunction;
709
697
 
710
698
  /** @defaultValue `WaveIlluminationShader` */
711
699
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -719,7 +707,7 @@ declare global {
719
707
  label: string;
720
708
 
721
709
  /** @defaultValue `LightSource.prototype.animateTime` */
722
- animation: PointSource.AnimationFunction;
710
+ animation: CONFIG.Canvas.LightAnimationFunction;
723
711
 
724
712
  /** @defaultValue `FogColorationShader` */
725
713
  colorationShader: ConstructorOf<AbstractBaseShader>;
@@ -730,7 +718,7 @@ declare global {
730
718
  label: string;
731
719
 
732
720
  /** @defaultValue `LightSource.prototype.animateTime` */
733
- animation: PointSource.AnimationFunction;
721
+ animation: CONFIG.Canvas.LightAnimationFunction;
734
722
 
735
723
  /** @defaultValue `SunburstIlluminationShader` */
736
724
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -744,7 +732,7 @@ declare global {
744
732
  label: string;
745
733
 
746
734
  /** @defaultValue `LightSource.prototype.animateTime` */
747
- animation: PointSource.AnimationFunction;
735
+ animation: CONFIG.Canvas.LightAnimationFunction;
748
736
 
749
737
  /** @defaultValue `LightDomeColorationShader` */
750
738
  colorationShader: ConstructorOf<AbstractBaseShader>;
@@ -755,7 +743,7 @@ declare global {
755
743
  label: string;
756
744
 
757
745
  /** @defaultValue `LightSource.prototype.animateTime` */
758
- animation: PointSource.AnimationFunction;
746
+ animation: CONFIG.Canvas.LightAnimationFunction;
759
747
 
760
748
  /** @defaultValue `EmanationColorationShader` */
761
749
  colorationShader: ConstructorOf<AbstractBaseShader>;
@@ -766,7 +754,7 @@ declare global {
766
754
  label: string;
767
755
 
768
756
  /** @defaultValue `LightSource.prototype.animateTime` */
769
- animation: PointSource.AnimationFunction;
757
+ animation: CONFIG.Canvas.LightAnimationFunction;
770
758
 
771
759
  /** @defaultValue `HexaDomeColorationShader` */
772
760
  colorationShader: ConstructorOf<AbstractBaseShader>;
@@ -777,7 +765,7 @@ declare global {
777
765
  label: string;
778
766
 
779
767
  /** @defaultValue `LightSource.prototype.animateTime` */
780
- animation: PointSource.AnimationFunction;
768
+ animation: CONFIG.Canvas.LightAnimationFunction;
781
769
 
782
770
  /** @defaultValue `GhostLightIlluminationShader` */
783
771
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -791,7 +779,7 @@ declare global {
791
779
  label: string;
792
780
 
793
781
  /** @defaultValue `LightSource.prototype.animateTime` */
794
- animation: PointSource.AnimationFunction;
782
+ animation: CONFIG.Canvas.LightAnimationFunction;
795
783
 
796
784
  /** @defaultValue `EnergyFieldColorationShader` */
797
785
  colorationShader: ConstructorOf<AbstractBaseShader>;
@@ -802,7 +790,7 @@ declare global {
802
790
  label: string;
803
791
 
804
792
  /** @defaultValue `LightSource.prototype.animateTime` */
805
- animation: PointSource.AnimationFunction;
793
+ animation: CONFIG.Canvas.LightAnimationFunction;
806
794
 
807
795
  /** @defaultValue `RoilingIlluminationShader` */
808
796
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -813,7 +801,7 @@ declare global {
813
801
  label: string;
814
802
 
815
803
  /** @defaultValue `LightSource.prototype.animateTime` */
816
- animation: PointSource.AnimationFunction;
804
+ animation: CONFIG.Canvas.LightAnimationFunction;
817
805
 
818
806
  /** @defaultValue `BlackHoleIlluminationShader` */
819
807
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -824,7 +812,7 @@ declare global {
824
812
  label: string;
825
813
 
826
814
  /** @defaultValue `LightSource.prototype.animateTime` */
827
- animation: PointSource.AnimationFunction;
815
+ animation: CONFIG.Canvas.LightAnimationFunction;
828
816
 
829
817
  /** @defaultValue `VortexIlluminationShader` */
830
818
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -838,7 +826,7 @@ declare global {
838
826
  label: string;
839
827
 
840
828
  /** @defaultValue `LightSource.prototype.animateTime` */
841
- animation: PointSource.AnimationFunction;
829
+ animation: CONFIG.Canvas.LightAnimationFunction;
842
830
 
843
831
  /** @defaultValue `BewitchingWaveIlluminationShader` */
844
832
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -852,7 +840,7 @@ declare global {
852
840
  label: string;
853
841
 
854
842
  /** @defaultValue `LightSource.prototype.animateTime` */
855
- animation: PointSource.AnimationFunction;
843
+ animation: CONFIG.Canvas.LightAnimationFunction;
856
844
 
857
845
  /** @defaultValue `SwirlingRainbowColorationShader` */
858
846
  colorationShader: ConstructorOf<AbstractBaseShader>;
@@ -863,7 +851,7 @@ declare global {
863
851
  label: string;
864
852
 
865
853
  /** @defaultValue `LightSource.prototype.animateTime` */
866
- animation: PointSource.AnimationFunction;
854
+ animation: CONFIG.Canvas.LightAnimationFunction;
867
855
 
868
856
  /** @defaultValue `RadialRainbowColorationShader` */
869
857
  colorationShader: ConstructorOf<AbstractBaseShader>;
@@ -874,7 +862,7 @@ declare global {
874
862
  label: string;
875
863
 
876
864
  /** @defaultValue `LightSource.prototype.animateTime` */
877
- animation: PointSource.AnimationFunction;
865
+ animation: CONFIG.Canvas.LightAnimationFunction;
878
866
 
879
867
  /** @defaultValue `FairyLightIlluminationShader` */
880
868
  illuminationShader: ConstructorOf<AbstractBaseShader>;
@@ -886,7 +874,7 @@ declare global {
886
874
  string,
887
875
  {
888
876
  label: string;
889
- animation: PointSource.AnimationFunction;
877
+ animation: CONFIG.Canvas.LightAnimationFunction;
890
878
  illuminationShader?: ConstructorOf<AbstractBaseShader>;
891
879
  colorationShader?: ConstructorOf<AbstractBaseShader>;
892
880
  }
@@ -1546,6 +1534,12 @@ declare global {
1546
1534
  layerClass: LayerClass;
1547
1535
  group: keyof CONFIG['Canvas']['groups'];
1548
1536
  }
1537
+
1538
+ type LightAnimationFunction = (
1539
+ this: PointSource,
1540
+ dt: number,
1541
+ properties?: { speed?: number; intensity?: number; reverse?: false }
1542
+ ) => void;
1549
1543
  }
1550
1544
 
1551
1545
  namespace Cards {
@@ -1555,6 +1549,11 @@ declare global {
1555
1549
  src: string;
1556
1550
  }
1557
1551
  }
1552
+
1553
+ namespace Dice {
1554
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
1555
+ interface RollModes extends Record<foundry.CONST.DICE_ROLL_MODES, string> {}
1556
+ }
1558
1557
  }
1559
1558
 
1560
1559
  const CONFIG: CONFIG;