@league-of-foundry-developers/foundry-vtt-types 9.255.0 → 9.255.3

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 (64) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/foundry/common/types.mjs.d.ts +122 -10
  4. package/src/foundry/common/utils/http.mjs.d.ts +52 -0
  5. package/src/foundry/common/utils/module.mjs.d.ts +1 -0
  6. package/src/foundry/common/utils/semaphore.mjs.d.ts +6 -3
  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/dialog.d.ts +14 -29
  10. package/src/foundry/foundry.js/applications/formApplication.d.ts +5 -0
  11. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +18 -57
  12. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +8 -6
  13. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +4 -4
  14. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +23 -12
  15. package/src/foundry/foundry.js/applications/hotbar.d.ts +7 -3
  16. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +16 -1
  17. package/src/foundry/foundry.js/applications/sidebar.d.ts +7 -0
  18. package/src/foundry/foundry.js/avClient.d.ts +15 -1
  19. package/src/foundry/foundry.js/avClients/index.d.ts +0 -1
  20. package/src/foundry/foundry.js/avClients/simplePeerAVClient.d.ts +31 -4
  21. package/src/foundry/foundry.js/avMaster.d.ts +21 -48
  22. package/src/foundry/foundry.js/avSettings.d.ts +19 -46
  23. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +4 -4
  24. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +28 -6
  25. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +13 -70
  26. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +42 -9
  27. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +2 -2
  28. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +23 -21
  29. package/src/foundry/foundry.js/clientDocuments/item.d.ts +5 -23
  30. package/src/foundry/foundry.js/clientDocuments/macro.d.ts +10 -0
  31. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +6 -13
  32. package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +1 -1
  33. package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +24 -14
  34. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +16 -14
  35. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +12 -7
  36. package/src/foundry/foundry.js/clientDocuments/user.d.ts +2 -12
  37. package/src/foundry/foundry.js/clientSettings.d.ts +38 -86
  38. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
  39. package/src/foundry/foundry.js/gamepadManager.d.ts +12 -0
  40. package/src/foundry/foundry.js/globalVariables.d.ts +0 -31
  41. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +26 -4
  42. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +1 -1
  43. package/src/foundry/foundry.js/perceptionManager.d.ts +1 -1
  44. package/src/foundry/foundry.js/pixi/containers/baseGrid.d.ts +21 -6
  45. package/src/foundry/foundry.js/pixi/containers/baseGrids/hexagonalGrid.d.ts +13 -8
  46. package/src/foundry/foundry.js/pixi/containers/baseGrids/squareGrid.d.ts +5 -3
  47. package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +14 -5
  48. package/src/foundry/foundry.js/pixi/containers/index.d.ts +1 -0
  49. package/src/foundry/foundry.js/pixi/containers/objectHUD.d.ts +82 -0
  50. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +9 -55
  51. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +27 -6
  52. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +29 -4
  53. package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +37 -20
  54. package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +55 -15
  55. package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +12 -2
  56. package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +42 -12
  57. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +219 -62
  58. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +107 -16
  59. package/src/foundry/foundry.js/textEditor.d.ts +266 -231
  60. package/src/foundry/index.d.ts +0 -4
  61. package/src/types/utils.d.ts +5 -0
  62. package/src/foundry/foundry.js/avClients/easyRTCClient.d.ts +0 -392
  63. package/src/foundry/foundry.js/features.d.ts +0 -0
  64. package/src/foundry/foundry.js/fonts.d.ts +0 -24
@@ -90,7 +90,7 @@ declare global {
90
90
 
91
91
  /**
92
92
  * Assign a Macro to a numbered hotbar slot between 1 and 50
93
- * @param macro - The Macro entity to assign
93
+ * @param macro - The Macro document to assign
94
94
  * @param slot - A specific numbered hotbar slot to fill
95
95
  * @param fromSlot - An optional origin slot from which the Macro is being shifted
96
96
  * @returns A Promise which resolves once the User update is complete
@@ -120,7 +120,7 @@ declare global {
120
120
  broadcastActivity(activityData?: ActivityData): void;
121
121
 
122
122
  /**
123
- * Get an Array of Macro Entities on this User's Hotbar by page
123
+ * Get an Array of Macro Documents on this User's Hotbar by page
124
124
  * @param page - The hotbar page number
125
125
  * (default: `1`)
126
126
  */
@@ -145,16 +145,6 @@ declare global {
145
145
  /** @override */
146
146
  _onDelete(options: DocumentModificationOptions, userId: string): void;
147
147
 
148
- /**
149
- * @deprecated since 0.8.0
150
- */
151
- isRole(role: Parameters<User['hasRole']>[0]): boolean;
152
-
153
- /**
154
- * @deprecated since 0.8.0
155
- */
156
- setPermission(permission: keyof typeof CONST.USER_PERMISSIONS, allowed: boolean): Promise<this>;
157
-
158
148
  /** @remarks This property is set by PlayerList.getData() */
159
149
  charname?: string;
160
150
 
@@ -20,12 +20,12 @@ declare global {
20
20
  /**
21
21
  * A object of registered game settings for this scope
22
22
  */
23
- settings: Map<string, ClientSettings.CompleteSetting>;
23
+ settings: Map<string, SettingConfig>;
24
24
 
25
25
  /**
26
26
  * Registered settings menus which trigger secondary applications
27
27
  */
28
- menus: Map<string, ClientSettings.CompleteMenuSetting>;
28
+ menus: Map<string, SettingSubmenuConfig>;
29
29
 
30
30
  /**
31
31
  * The storage interfaces used for persisting settings
@@ -47,12 +47,12 @@ declare global {
47
47
  /**
48
48
  * Register a new game setting under this setting scope
49
49
  *
50
- * @param module - The namespace under which the setting is registered
51
- * @param key - The key name for the setting under the namespace module
52
- * @param data - Configuration for setting data
53
- * @typeParam M - The module name to register the setting for
54
- * @typeParam K - The key to register the setting for
55
- * @typeParam T - The type of the setting value
50
+ * @param namespace - The namespace under which the setting is registered
51
+ * @param key - The key name for the setting under the namespace module
52
+ * @param data - Configuration for setting data
53
+ * @typeParam N - The namespace under which the setting is registered, as a type
54
+ * @typeParam K - The key name for the setting under the namespace module, as a type
55
+ * @typeParam T - The type of the setting value
56
56
  *
57
57
  * @example
58
58
  * ```typescript
@@ -95,22 +95,22 @@ declare global {
95
95
  * });
96
96
  * ```
97
97
  */
98
- register<M extends string, K extends string, T>(
99
- module: M,
98
+ register<N extends string, K extends string, T>(
99
+ namespace: N,
100
100
  key: K,
101
- data: ClientSettings.Values[`${M}.${K}`] extends boolean | number | bigint | string | symbol | object
102
- ? ClientSettings.PartialSetting<ClientSettings.Values[`${M}.${K}`]>
103
- : ClientSettings.PartialSetting<T>
101
+ data: ClientSettings.Values[`${N}.${K}`] extends string | number | boolean | Array<any> | object
102
+ ? ClientSettings.PartialSettingConfig<ClientSettings.Values[`${N}.${K}`]>
103
+ : ClientSettings.PartialSettingConfig<T>
104
104
  ): void;
105
105
 
106
106
  /**
107
107
  * Register a new sub-settings menu
108
108
  *
109
- * @param module - The namespace under which the menu is registered
110
- * @param key - The key name for the setting under the namespace module
111
- * @param data - Configuration for setting data
112
- * @typeParam M - The module name to register the menu setting for
113
- * @typeParam K - The key to register the menu setting for
109
+ * @param namespace - The namespace under which the menu is registered
110
+ * @param key - The key name for the setting under the namespace module
111
+ * @param data - Configuration for setting data
112
+ * @typeParam N - The namespace under which the menu is registered, as a type
113
+ * @typeParam K - The key name for the setting under the namespace module, as a type
114
114
  *
115
115
  * @example
116
116
  * ```typescript
@@ -125,19 +125,19 @@ declare global {
125
125
  * });
126
126
  * ```
127
127
  */
128
- registerMenu<M extends string, K extends string>(
129
- module: M,
128
+ registerMenu<N extends string, K extends string>(
129
+ namespace: N,
130
130
  key: K,
131
- data: ClientSettings.RegisteredMenuSettings[`${M}.${K}`]
131
+ data: ClientSettings.PartialSettingSubmenuConfig
132
132
  ): void;
133
133
 
134
134
  /**
135
- * Get the value of a game setting for a certain module and setting key
135
+ * Get the value of a game setting for a certain namespace and setting key
136
136
  *
137
- * @param module - The module namespace under which the setting is registered
138
- * @param key - The setting key to retrieve
139
- * @typeParam M - The module name to register the get for
140
- * @typeParam K - The key to get the setting for
137
+ * @param namespace - The namespace under which the setting is registered
138
+ * @param key - The setting key to retrieve
139
+ * @typeParam N - The namespace under which the setting is registered, as a type
140
+ * @typeParam K - The setting key to retrieve, as a type
141
141
  *
142
142
  * @example
143
143
  * ```typescript
@@ -145,17 +145,17 @@ declare global {
145
145
  * game.settings.get("myModule", "myClientSetting");
146
146
  * ```
147
147
  */
148
- get<M extends string, K extends string>(module: M, key: K): ClientSettings.Values[`${M}.${K}`];
148
+ get<N extends string, K extends string>(namespace: N, key: K): ClientSettings.Values[`${N}.${K}`];
149
149
 
150
150
  /**
151
- * Set the value of a game setting for a certain module and setting key
151
+ * Set the value of a game setting for a certain namespace and setting key
152
152
  *
153
- * @param module - The module namespace under which the setting is registered
154
- * @param key - The setting key to retrieve
155
- * @param value - The data to assign to the setting key
156
- * @typeParam M - The module name to register the get for
157
- * @typeParam K - The key to get the setting for
158
- * @typeParam V - The value type to get the value for
153
+ * @param namespace - The namespace under which the setting is registered
154
+ * @param key - The setting key to retrieve
155
+ * @param value - The data to assign to the setting key
156
+ * @typeParam N - The namespace under which the setting is registered, as a type
157
+ * @typeParam K - The setting key to retrieve, as a type
158
+ * @typeParam V - The type of the value being set
159
159
  *
160
160
  * @example
161
161
  * ```typescript
@@ -163,65 +163,17 @@ declare global {
163
163
  * game.settings.set("myModule", "myClientSetting", "b");
164
164
  * ```
165
165
  */
166
- set<M extends string, K extends string, V extends ClientSettings.Values[`${M}.${K}`]>(
167
- module: M,
166
+ set<N extends string, K extends string, V extends ClientSettings.Values[`${N}.${K}`]>(
167
+ namespace: N,
168
168
  key: K,
169
169
  value: V
170
170
  ): Promise<V>;
171
171
  }
172
172
 
173
173
  namespace ClientSettings {
174
- interface CompleteSetting<T = unknown> extends PartialSetting<T> {
175
- key: string;
176
- module: string;
177
- }
178
-
179
- interface CompleteMenuSetting extends PartialMenuSetting {
180
- key: string;
181
- module: string;
182
- }
183
-
184
- interface PartialSetting<T = unknown> {
185
- choices?: Record<string, string>;
186
- config?: boolean;
187
- default?: T;
188
- hint?: string;
189
- name?: string;
190
- onChange?: (value: T) => void;
191
- range?: T extends number
192
- ? {
193
- max: number;
194
- min: number;
195
- step: number;
196
- }
197
- : undefined;
198
- filePicker?: T extends string ? true | 'audio' | 'image' | 'video' | 'imagevideo' | 'folder' : undefined;
199
- scope: string;
200
- type?: T extends boolean
201
- ? typeof Boolean
202
- : T extends number
203
- ? typeof Number
204
- : T extends bigint
205
- ? typeof BigInt
206
- : T extends string
207
- ? typeof String
208
- : T extends symbol
209
- ? typeof Symbol
210
- : ConstructorOf<T>;
211
- }
212
-
213
- interface PartialMenuSetting {
214
- hint?: string;
215
- icon?: string;
216
- label?: string;
217
- name?: string;
218
- restricted: boolean;
219
- type: ConstructorOf<FormApplication<FormApplicationOptions, object, undefined>>;
220
- }
174
+ type PartialSettingConfig<T = unknown> = InexactPartial<Omit<SettingConfig<T>, 'key' | 'namespace'>>;
221
175
 
222
- interface RegisteredMenuSettings {
223
- [key: string]: PartialMenuSetting;
224
- }
176
+ type PartialSettingSubmenuConfig = Omit<SettingSubmenuConfig, 'key' | 'namespace'>;
225
177
 
226
178
  interface Values {
227
179
  'core.animateRollTable': boolean;
@@ -169,7 +169,7 @@ declare global {
169
169
  * null if the dialog was closed without making a choice.
170
170
  */
171
171
  importDialog(
172
- options?: Dialog.Options | undefined
172
+ options?: DialogOptions | undefined
173
173
  ): Promise<StoredDocument<DocumentInstanceForCompendiumMetadata<T>>[] | null | false>;
174
174
 
175
175
  /**
@@ -2,6 +2,18 @@
2
2
  declare class GamepadManager {
3
3
  constructor();
4
4
 
5
+ /**
6
+ * @defaultValue `null`
7
+ * @internal
8
+ */
9
+ protected _gamepadPoller: number | null;
10
+
11
+ /**
12
+ * The connected Gamepads
13
+ * @internal
14
+ */
15
+ protected _connectedGamepads: Map<string, ConnectedGamepad>;
16
+
5
17
  /**
6
18
  * How often Gamepad polling should check for button presses
7
19
  * @defaultValue `100`
@@ -70,37 +70,6 @@ declare global {
70
70
  /** The client-side console is the default logger */
71
71
  let logger: typeof console;
72
72
 
73
- /**
74
- * @deprecated since 0.8.0
75
- * You are referencing the FEATURES object which has been deprecated as it is no longer an agreed-upon method for how to track evolution of the Foundry Virtual Tabletop API. Discussion about alternate approaches is actively ongoing within the League of Developers community. For the time being the recommendation is to test against game.data.version to understand the current Foundry VTT version which is active. The FEATURES object will be removed in 0.9.0.
76
- */
77
- let FEATURES: {
78
- readonly ACTIVE_EFFECTS: 2;
79
- readonly ACTORS: 3;
80
- readonly AUDIO_VIDEO: 2;
81
- readonly CHAT: 3;
82
- readonly COMBAT: 3;
83
- readonly COMPENDIUM: 3;
84
- readonly DICE: 2;
85
- readonly DRAWINGS: 3;
86
- readonly ENTITIES: 5;
87
- readonly GRID: 2;
88
- readonly ITEMS: 3;
89
- readonly JOURNAL: 2;
90
- readonly LIGHTING: 3;
91
- readonly LOCALIZATION: 2;
92
- readonly MACROS: 2;
93
- readonly NOTES: 2;
94
- readonly PLAYLISTS: 2;
95
- readonly ROLL_TABLES: 2;
96
- readonly SETTINGS: 3;
97
- readonly SOUND: 2;
98
- readonly TEMPLATES: 2;
99
- readonly TILES: 3;
100
- readonly TOKENS: 4;
101
- readonly WALLS: 3;
102
- };
103
-
104
73
  /**
105
74
  * @defaultValue `undefined`
106
75
  * Initialized between the `'DOMContentLoaded'` event and the `'init'` hook event.
@@ -7,6 +7,23 @@ declare class HandlebarsHelpers {
7
7
  */
8
8
  static checked(value: unknown): string;
9
9
 
10
+ /**
11
+ * For use in form inputs. If the supplied value is truthy, add the "disabled" property, otherwise add nothing.
12
+ */
13
+ static disabled(value: unknown): string;
14
+
15
+ /**
16
+ * Concatenate a number of string terms into a single string.
17
+ * This is useful for passing arguments with variable names.
18
+ * @param values - The values to concatenate
19
+ *
20
+ * @example <caption>Concatenate several string parts to create a dynamic variable</caption>
21
+ * ```handlebars
22
+ * {{filePicker target=(concat "faces." i ".img") type="image"}}
23
+ * ```
24
+ */
25
+ static concat(...values: string[]): Handlebars.SafeString;
26
+
10
27
  /**
11
28
  * Render a pair of inputs for selecting a color.
12
29
  * @param options - Helper options
@@ -31,12 +48,15 @@ declare class HandlebarsHelpers {
31
48
  * @example <caption>Translate a provided localization string, optionally including formatting parameters</caption>
32
49
  * ```handlebars
33
50
  * <label>{{localize "ACTOR.Create"}}</label> <!-- "Create Actor" -->
34
- * <label>{{localize "CHAT.InvalidCommand", command=foo}}</label> <!-- "foo is not a valid chat message command." -->
51
+ * <label>{{localize "CHAT.InvalidCommand" command=foo}}</label> <!-- "foo is not a valid chat message command." -->
35
52
  * ```
36
53
  */
37
54
  static localize(value: string, options: HandlebarsHelpers.LocalizeOptions): string;
38
55
 
39
56
  /**
57
+ * @param value - A numeric value to format
58
+ * @param options - Additional options which customize the resulting format
59
+ * @returns The formatted string to be included in a template
40
60
  * A string formatting helper to display a number with a certain fixed number of decimals and an explicit sign.
41
61
  */
42
62
  static numberFormat(value: string, options: HandlebarsHelpers.NumberFormatOptions): string;
@@ -78,7 +98,7 @@ declare class HandlebarsHelpers {
78
98
  ): Handlebars.SafeString;
79
99
 
80
100
  /**
81
- * Render a pair of inputs for selecting a color.
101
+ * Render a pair of inputs for selecting a value in a range.
82
102
  * @param options - Helper options
83
103
  */
84
104
  static rangePicker(options: HandlebarsHelpers.RangePickerOptions): Handlebars.SafeString;
@@ -206,10 +226,10 @@ declare namespace HandlebarsHelpers {
206
226
  editable?: boolean;
207
227
 
208
228
  /**
209
- * Replace dynamic entity links?
229
+ * Replace dynamic document links?
210
230
  * @defaultValue `true`
211
231
  */
212
- entities?: boolean;
232
+ documents?: boolean;
213
233
 
214
234
  /**
215
235
  * The data object providing context for inline rolls
@@ -245,11 +265,13 @@ declare namespace HandlebarsHelpers {
245
265
  interface NumberFormatOptions extends Handlebars.HelperOptions {
246
266
  hash: {
247
267
  /**
268
+ * The number of decimal places to include in the resulting string
248
269
  * @defaultValue `0`
249
270
  */
250
271
  decimals?: number;
251
272
 
252
273
  /**
274
+ * Whether to include an explicit "+" sign for positive numbers
253
275
  * @defaultValue `false`
254
276
  */
255
277
  sign?: boolean;
@@ -96,7 +96,7 @@ declare class MouseInteractionManager<Object extends PIXI.Container = PIXI.Conta
96
96
 
97
97
  /**
98
98
  * The throttling time below which a mouse move event will not be handled
99
- * @defaultValue `Math.ceil(1000 / canvas.app.ticker.maxFPS)`
99
+ * @defaultValue `Math.ceil(1000 / (canvas.app.ticker.maxFPS || 60));`
100
100
  * @internal
101
101
  */
102
102
  protected _dragThrottleMS: number;
@@ -92,7 +92,7 @@ declare namespace PerceptionManager {
92
92
  sight: {
93
93
  initialize: boolean;
94
94
  refresh: boolean;
95
- noUpdateFog: boolean;
95
+ skipUpdateFog: boolean;
96
96
  forceUpdateFog: boolean;
97
97
  };
98
98
  sounds: {
@@ -22,7 +22,12 @@ declare class BaseGrid extends PIXI.Container {
22
22
  */
23
23
  highlight: PIXI.Container;
24
24
 
25
- draw(): this;
25
+ /**
26
+ * Draw the grid. Subclasses are expected to override this method to perform their type-specific drawing logic.
27
+ * @param preview - Override settings used in place of those saved to the scene data.
28
+ * (default: `{}`)
29
+ */
30
+ draw(preview?: BaseGrid.Preview | undefined): this;
26
31
 
27
32
  /**
28
33
  * Highlight a grid position for a certain coordinates
@@ -94,7 +99,7 @@ declare class BaseGrid extends PIXI.Container {
94
99
  * (default: `{}`)
95
100
  * @returns An Array of distance measurements for each segment
96
101
  */
97
- measureDistances(segments: GridLayer.Segment[], options?: BaseGrid.MeasureDistancesOptions): number[];
102
+ measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions | undefined): number[];
98
103
 
99
104
  /**
100
105
  * Get the grid row and column positions which are neighbors of a certain position
@@ -114,6 +119,20 @@ declare namespace BaseGrid {
114
119
  even?: boolean;
115
120
  }
116
121
 
122
+ interface Preview {
123
+ /**
124
+ * The grid color.
125
+ * @defaultValue `null`
126
+ */
127
+ gridColor?: string | null | undefined;
128
+
129
+ /**
130
+ * The grid transparency.
131
+ * @defaultValue `null`
132
+ */
133
+ gridAlpha?: number | null | undefined;
134
+ }
135
+
117
136
  interface HighlightGridPositionOptions {
118
137
  /**
119
138
  * The x-coordinate of the highlighted position
@@ -149,8 +168,4 @@ declare namespace BaseGrid {
149
168
  */
150
169
  shape?: PIXI.Polygon | null;
151
170
  }
152
-
153
- interface MeasureDistancesOptions {
154
- gridSpaces?: boolean;
155
- }
156
171
  }
@@ -28,7 +28,7 @@ declare class HexagonalGrid extends BaseGrid {
28
28
  get hexPoints(): PointArray[];
29
29
 
30
30
  /** @override */
31
- draw(): this;
31
+ draw(preview?: BaseGrid.Preview | undefined): this;
32
32
 
33
33
  /**
34
34
  * A convenience method for getting all the polygon points relative to a top-left [x,y] coordinate pair
@@ -39,10 +39,17 @@ declare class HexagonalGrid extends BaseGrid {
39
39
  */
40
40
  getPolygon(x: number, y: number, w?: number, h?: number): PointArray[];
41
41
 
42
- protected _drawGrid(): PIXI.Graphics;
42
+ /**
43
+ * Draw the grid lines.
44
+ * @param preview - Override settings used in place of those saved to the scene data.
45
+ * @internal
46
+ */
47
+ protected _drawGrid(preview?: BaseGrid.Preview | undefined): PIXI.Graphics;
43
48
 
49
+ /** @internal */
44
50
  protected _drawRows(grid: PIXI.Graphics, nrows: number, ncols: number): void;
45
51
 
52
+ /** @internal */
46
53
  protected _drawColumns(grid: PIXI.Graphics, nrows: number, ncols: number): void;
47
54
 
48
55
  /**
@@ -67,7 +74,8 @@ declare class HexagonalGrid extends BaseGrid {
67
74
  */
68
75
  getSnappedPosition(x: number, y: number, interval?: number | null): { x: number; y: number };
69
76
 
70
- _getClosestVertex(xc: number, yc: number, ox: number, oy: number): { x: number; y: number };
77
+ /** @internal */
78
+ protected _getClosestVertex(xc: number, yc: number, ox: number, oy: number): { x: number; y: number };
71
79
 
72
80
  /** @override */
73
81
  shiftPosition(x: number, y: number, dx: number, dy: number): PointArray;
@@ -81,11 +89,8 @@ declare class HexagonalGrid extends BaseGrid {
81
89
  /** @override */
82
90
  getNeighbors(row: number, col: number): PointArray[];
83
91
 
84
- /**
85
- * @override
86
- * @param options - (default: `{}`)
87
- */
88
- measureDistances(segments: GridLayer.Segment[], options?: BaseGrid.MeasureDistancesOptions): number[];
92
+ /** @override */
93
+ measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions): number[];
89
94
 
90
95
  /**
91
96
  * Convert an offset coordinate (row, col) into a cube coordinate (q, r, s).
@@ -3,9 +3,10 @@
3
3
  */
4
4
  declare class SquareGrid extends BaseGrid {
5
5
  /** @override */
6
- draw(): this;
6
+ draw(preview?: BaseGrid.Preview | undefined): this;
7
7
 
8
- _drawLine(
8
+ /** @internal */
9
+ protected _drawLine(
9
10
  points: [x1: number, y1: number, x2: number, y2: number],
10
11
  lineColor: number,
11
12
  lineAlpha: number
@@ -35,6 +36,7 @@ declare class SquareGrid extends BaseGrid {
35
36
  */
36
37
  shiftPosition(x: number, y: number, dx: number, dy: number): PointArray;
37
38
 
39
+ /** @internal */
38
40
  protected _getNearestVertex(x: number, y: number): PointArray;
39
41
 
40
42
  /**
@@ -47,7 +49,7 @@ declare class SquareGrid extends BaseGrid {
47
49
  * @override
48
50
  * @param options - (default: `{}`)
49
51
  */
50
- measureDistances(segments: GridLayer.Segment[], options?: BaseGrid.MeasureDistancesOptions): number[];
52
+ measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions): number[];
51
53
 
52
54
  /** @override */
53
55
  getNeighbors(row: number, col: number): PointArray[];
@@ -92,9 +92,11 @@ declare class GridLayer extends CanvasLayer<GridLayer.LayerOptions> {
92
92
  getCenter(x: number, y: number): PointArray;
93
93
 
94
94
  /**
95
- * Measure the grid-wise distance between two point coordinates.
96
- * @param origin - The origin point
97
- * @param target - The target point
95
+ * Measure the distance between two point coordinates.
96
+ * @param origin - The origin point
97
+ * @param target - The target point
98
+ * @param options - Additional options which modify the measurement
99
+ * (default: `{}`)
98
100
  * @returns The measured distance between these points
99
101
  *
100
102
  * @example
@@ -110,15 +112,17 @@ declare class GridLayer extends CanvasLayer<GridLayer.LayerOptions> {
110
112
  target: {
111
113
  x: number;
112
114
  y: number;
113
- }
115
+ },
116
+ options?: MeasureDistancesOptions | undefined
114
117
  ): number;
115
118
 
116
119
  /**
117
120
  * Measure the distance traveled over an array of distance segments.
118
121
  * @param segments - An array of measured segments
119
122
  * @param options - Additional options which modify the measurement
123
+ * (default: `{}`)
120
124
  */
121
- measureDistances(segments: GridLayer.Segment[], options?: { gridSpaces?: boolean }): number[];
125
+ measureDistances(segments: GridLayer.Segment[], options?: MeasureDistancesOptions | undefined): number[];
122
126
 
123
127
  /**
124
128
  * Define a new Highlight graphic
@@ -194,3 +198,8 @@ interface DrawOptions {
194
198
  */
195
199
  gridAlpha?: number | null;
196
200
  }
201
+
202
+ interface MeasureDistancesOptions {
203
+ /** Return the distance in grid increments rather than the co-ordinate distance. */
204
+ gridSpaces?: boolean;
205
+ }
@@ -9,6 +9,7 @@ import './cursor';
9
9
  import './doorControl';
10
10
  import './effectsCanvasGroup';
11
11
  import './interfaceCanvasGroup';
12
+ import './objectHUD';
12
13
  import './placeableObject';
13
14
  import './placeableObjects';
14
15
  import './ruler';
@@ -0,0 +1,82 @@
1
+ /**
2
+ * An extension of PIXI.Container used as the interface frame for a PlaceableObject on the ControlsLayer
3
+ *
4
+ * @see {@link PlaceableObject}
5
+ * @see {@link ControlsLayer}
6
+ */
7
+ declare class ObjectHUD extends PIXI.Container {
8
+ constructor(object: PIXI.DisplayObject);
9
+
10
+ /**
11
+ * The object that this HUD container is linked to
12
+ */
13
+ object: PIXI.DisplayObject;
14
+
15
+ /**
16
+ * Use the linked object's transform matrix to easily synchronize position
17
+ */
18
+ transform: PIXI.Transform;
19
+
20
+ /** @override */
21
+ // @ts-expect-error this is a property in `PIXI.Container` but foundry overrides it as an accessor.
22
+ get visible(): boolean;
23
+ set visible(value: boolean);
24
+
25
+ /** @override */
26
+ // @ts-expect-error this is a property in `PIXI.Container` but foundry overrides it as an accessor.
27
+ get renderable(): boolean;
28
+ set renderable(value: boolean);
29
+
30
+ /**
31
+ * Display scrolling status text originating from this ObjectHUD container.
32
+ * @param content - The text content to display
33
+ * @param options - (default: `{}`)
34
+ * @returns The created PreciseText object which is scrolling
35
+ */
36
+ createScrollingText(
37
+ content: string,
38
+ options?: ObjectHUD.CreateScrollingTextOptions | undefined
39
+ ): Promise<PreciseText | null>;
40
+
41
+ /**
42
+ * Orchestrate the animation of the scrolling text in this HUD
43
+ * @param text - The PrecisText instance to animate
44
+ * @param duration - A desired duration of animation
45
+ * @param dx - A horizontal distance to animate the text
46
+ * (default: `0`)
47
+ * @param dy - A vertical distance to animate the text
48
+ * (default: `0`)
49
+ * @internal
50
+ */
51
+ protected _animateScrollText(text: PreciseText, duration: number, dx?: number, dy?: number): Promise<void>;
52
+ }
53
+
54
+ type TextStyleProperties = Exclude<ConstructorParameters<typeof PIXI.TextStyle>[0], undefined>;
55
+
56
+ declare namespace ObjectHUD {
57
+ interface CreateScrollingTextOptions extends TextStyleProperties {
58
+ /**
59
+ * The original anchor point where the text first appears
60
+ * @defaultValue `CONST.TEXT_ANCHOR_POINTS.CENTER`
61
+ */
62
+ anchor?: foundry.CONST.TEXT_ANCHOR_POINTS | undefined;
63
+
64
+ /**
65
+ * The direction in which the text scrolls
66
+ * @defaultValue `CONST.TEXT_ANCHOR_POINTS.TOP`
67
+ */
68
+ direction?: foundry.CONST.TEXT_ANCHOR_POINTS | undefined;
69
+
70
+ /**
71
+ * The duration of the scrolling effect in milliseconds
72
+ * @defaultValue `2000`
73
+ */
74
+ duration?: number | undefined;
75
+
76
+ /**
77
+ * An amount of randomization between 0 and 1 to apply to the initial Position
78
+ * @defaultValue `0`
79
+ */
80
+ jitter?: number | undefined;
81
+ }
82
+ }