@league-of-foundry-developers/foundry-vtt-types 0.8.9-4 → 0.8.9-8

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 (93) hide show
  1. package/README.md +41 -13
  2. package/index-lenient.d.ts +10 -0
  3. package/package.json +10 -1
  4. package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
  5. package/src/foundry/common/abstract/document.mjs.d.ts +6 -2
  6. package/src/foundry/common/data/data.mjs/drawingData.d.ts +8 -3
  7. package/src/foundry/common/data/data.mjs/index.d.ts +2 -0
  8. package/src/foundry/common/data/data.mjs/playlistData.d.ts +171 -0
  9. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +143 -0
  10. package/src/foundry/common/data/fields.mjs.d.ts +2 -2
  11. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +11 -1
  12. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +21 -2
  13. package/src/foundry/common/types.mjs.d.ts +5 -0
  14. package/src/foundry/foundry.js/application.d.ts +2 -5
  15. package/src/foundry/foundry.js/applications/cameraViews.d.ts +36 -31
  16. package/src/foundry/foundry.js/applications/compendium.d.ts +5 -2
  17. package/src/foundry/foundry.js/applications/filePicker.d.ts +114 -114
  18. package/src/foundry/foundry.js/applications/formApplication.d.ts +3 -11
  19. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +20 -27
  20. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +66 -0
  21. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
  22. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  23. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +5 -2
  24. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +57 -0
  25. package/src/foundry/foundry.js/applications/formApplications/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +2 -2
  26. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +7 -0
  27. package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +84 -0
  28. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +60 -0
  29. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +72 -0
  30. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +54 -60
  31. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +41 -28
  32. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +75 -0
  33. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +190 -148
  34. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +133 -110
  35. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +66 -0
  36. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +93 -95
  37. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +163 -147
  38. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -7
  39. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +41 -23
  40. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +95 -86
  41. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +146 -158
  42. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +60 -70
  43. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +25 -17
  44. package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +11 -5
  45. package/src/foundry/foundry.js/applications/hotbar.d.ts +5 -4
  46. package/src/foundry/foundry.js/applications/sceneControls.d.ts +13 -3
  47. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
  48. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
  49. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/itemDirectory.d.ts +7 -30
  50. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
  51. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
  52. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +249 -139
  53. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
  54. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -5
  55. package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
  56. package/src/foundry/foundry.js/canvas.d.ts +2 -1
  57. package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
  58. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +1 -1
  59. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/index.d.ts +8 -0
  60. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
  61. package/src/foundry/foundry.js/clientDocuments/index.d.ts +19 -0
  62. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +195 -6
  63. package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +113 -0
  64. package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
  65. package/src/foundry/foundry.js/clientSettings.d.ts +14 -1
  66. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +44 -8
  67. package/src/foundry/foundry.js/config.d.ts +85 -71
  68. package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
  69. package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
  70. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
  71. package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
  72. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +10 -19
  73. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +6 -2
  74. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +2 -2
  75. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +1 -1
  76. package/src/foundry/foundry.js/pixi/containers/doorControl.d.ts +53 -35
  77. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +6 -2
  78. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +38 -40
  79. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +56 -56
  80. package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +9 -50
  81. package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +166 -47
  82. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
  83. package/src/foundry/foundry.js/pixi/containers/ruler.d.ts +11 -7
  84. package/src/foundry/foundry.js/pixi/graphics/gridHighlight.d.ts +4 -9
  85. package/src/foundry/foundry.js/pointSource.d.ts +173 -85
  86. package/src/foundry/foundry.js/textEditor.d.ts +39 -8
  87. package/src/foundry/index.d.ts +2 -25
  88. package/src/foundry/foundry.js/applications/formApplications/ambientSoundConfig.d.ts +0 -68
  89. package/src/foundry/foundry.js/applications/formApplications/lightConfig.d.ts +0 -98
  90. package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
  91. package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
  92. package/src/foundry/foundry.js/applications/formApplications/playlistSoundConfig.d.ts +0 -70
  93. package/src/foundry/foundry.js/applications/formApplications/tileConfig.d.ts +0 -73
@@ -22,7 +22,7 @@ declare global {
22
22
  /**
23
23
  * @remarks Type is `MouseInteractionManager<this, this['endpoints']>`
24
24
  */
25
- mouseInteractionManager: MouseInteractionManager<this, any> | null;
25
+ mouseInteractionManager: MouseInteractionManager<this> | null;
26
26
 
27
27
  constructor(document: ConcreteWallDocument);
28
28
 
@@ -82,13 +82,7 @@ declare global {
82
82
  * @param gridSpaces - Restrict measurement only to grid spaces
83
83
  * (default: `true`)
84
84
  */
85
- measure(
86
- destination: Point,
87
- { gridSpaces }?: { gridSpaces?: boolean }
88
- ): {
89
- ray: Ray;
90
- label: PIXI.DisplayObject;
91
- }[];
85
+ measure(destination: Point, { gridSpaces }?: { gridSpaces?: boolean }): Ruler.Segment[];
92
86
 
93
87
  /**
94
88
  * Get the text label for a segment of the measured path
@@ -189,4 +183,14 @@ declare global {
189
183
  */
190
184
  update(data: ReturnType<Ruler['toJSON']>): void;
191
185
  }
186
+
187
+ namespace Ruler {
188
+ interface Segment {
189
+ distance: number;
190
+ label: PIXI.DisplayObject;
191
+ last: boolean;
192
+ ray: Ray;
193
+ text: string;
194
+ }
195
+ }
192
196
  }
@@ -22,14 +22,9 @@ declare class GridHighlight extends PIXI.Graphics {
22
22
  */
23
23
  highlight(x: number, y: number): boolean;
24
24
 
25
- /**
26
- * Extend the Graphics clear logic to also reset the highlighted positions
27
- * @remarks Returns `void`, see https://gitlab.com/foundrynet/foundryvtt/-/issues/4732
28
- */
29
- clear(): any;
25
+ /** @override */
26
+ clear(): this;
30
27
 
31
- /**
32
- * Extend how this Graphics container is destroyed to also remove parent layer references
33
- */
34
- destroy(options?: { children?: boolean; texture?: boolean; baseTexture?: boolean }): void;
28
+ /** @override */
29
+ destroy(...args: Parameters<PIXI.Graphics['destroy']>): void;
35
30
  }
@@ -2,7 +2,20 @@
2
2
  * A helper class used by the Sight Layer to represent a source of vision or illumination.
3
3
  */
4
4
  declare class PointSource {
5
- constructor();
5
+ /**
6
+ * @param object - The object responsible for the PointSource
7
+ */
8
+ constructor(object: PlaceableObject, sourceType: PointSource.SourceType);
9
+
10
+ /**
11
+ * The object responsible for the PointSource
12
+ */
13
+ object: PlaceableObject;
14
+
15
+ /**
16
+ * The type of source
17
+ */
18
+ sourceType: PointSource.SourceType;
6
19
 
7
20
  /**
8
21
  * The light or darkness container for this source
@@ -20,11 +33,17 @@ declare class PointSource {
20
33
  */
21
34
  active: boolean;
22
35
 
36
+ /**
37
+ * The range of Scene darkness values for which this Source should be active
38
+ * @defaultValue `{ min: 0, max: 0 }`
39
+ */
40
+ darkness: { min: number; max: number };
41
+
23
42
  /**
24
43
  * Internal flag for whether this is a darkness source
25
44
  * @defaultValue `false`
26
45
  */
27
- darkness: boolean;
46
+ isDarkness: boolean;
28
47
 
29
48
  /**
30
49
  * Is the light source limited by an angle of emission?
@@ -41,27 +60,66 @@ declare class PointSource {
41
60
  /**
42
61
  * Internal flag for animation throttling time
43
62
  * @defaultValue `0`
63
+ * @internal
44
64
  */
45
65
  protected _animateTime: number;
46
66
 
47
67
  /**
48
68
  * An integer seed which de-synchronizes otherwise similar animations
49
69
  * @defaultValue `null`
70
+ * @internal
50
71
  */
51
72
  protected _animateSeed: number | null;
52
73
 
74
+ /**
75
+ * A flag for the lighting channels version that this source is using.
76
+ * @defaultValue `0`
77
+ * @internal
78
+ */
79
+ protected _lightingVersion: number;
80
+
53
81
  /**
54
82
  * A flag for whether to re-initialize illumination shader uniforms the next time the light is rendered.
55
83
  * @defaultValue `true`
84
+ * @internal
56
85
  */
57
86
  protected _resetIlluminationUniforms: boolean;
58
87
 
59
88
  /**
60
89
  * A flag for whether to re-initialize coloration shader uniforms the next time the light is rendered.
61
90
  * @defaultValue `true`
91
+ *@internal
62
92
  */
63
93
  protected _resetColorationUniforms: boolean;
64
94
 
95
+ /**
96
+ * An internal flag for whether to render coloration for this source
97
+ * @defaultValue `false`
98
+ * @internal
99
+ */
100
+ protected _hasColor: boolean;
101
+
102
+ /**
103
+ * The default Geometry stored in the GPU for all Point Source meshes.
104
+ */
105
+ static GEOMETRY: PIXI.Geometry;
106
+
107
+ /**
108
+ * Create the structure of a source Container which can be rendered to the sight layer shadow-map
109
+ * @returns The constructed light source container
110
+ * @internal
111
+ */
112
+ protected _createContainer(shaderCls: ConstructorOf<AbstractBaseShader>): PIXI.Container;
113
+
114
+ /**
115
+ * Initialize the source with provided object data.
116
+ *
117
+ * @param data - Input data which configures the source.
118
+ *
119
+ * @returns A reference to the initialized source
120
+ */
121
+ initialize(data?: PointSource.Data): PointSource.Initialized<this>;
122
+
65
123
  /**
66
124
  * The x-coordinate of the source location
67
125
  * @defaultValue `undefined`
@@ -117,13 +175,7 @@ declare class PointSource {
117
175
  alpha?: number;
118
176
 
119
177
  /**
120
- * A level of darkness beyond which this light is active
121
- * @defaultValue `undefined`
122
- */
123
- darknessThreshold?: number;
124
-
125
- /**
126
- * The source type from {@link SOURCE_TYPES}
178
+ * The source type from CONST.SOURCE_TYPES
127
179
  * @defaultValue `undefined`
128
180
  */
129
181
  type?: foundry.CONST.SourceType;
@@ -143,7 +195,7 @@ declare class PointSource {
143
195
  /**
144
196
  * @defaultValue `undefined`
145
197
  */
146
- colorRGB?: [number, number, number];
198
+ colorRGB?: [r: number, g: number, b: number];
147
199
 
148
200
  /**
149
201
  * @defaultValue `undefined`
@@ -160,92 +212,25 @@ declare class PointSource {
160
212
  */
161
213
  los?: PIXI.Polygon;
162
214
 
163
- /**
164
- * Create the structure of a source Container which can be rendered to the sight layer shadow-map
165
- * @returns The constructed light source container
166
- */
167
- protected _createContainer(shaderCls: ConstructorOf<AbstractBaseShader>): PIXI.Container;
168
-
169
- /**
170
- * Initialize the source with provided object data.
171
- *
172
- * @param x - The x-coordinate of the source location
173
- * (default: `0`)
174
- * @param y - The y-coordinate of the source location
175
- * (default: `0`)
176
- * @param z - An optional z-index sorting for the source
177
- * (default: `null`)
178
- * @param dim - The allowed radius of dim vision or illumination
179
- * (default: `0`)
180
- * @param bright - The allowed radius of bright vision or illumination
181
- * (default: `0`)
182
- * @param angle - The angle of emission for this point source
183
- * (default: `360`)
184
- * @param rotation - The angle of rotation for this point source
185
- * (default: `0`)
186
- * @param color - A tint color for the emitted light, if any
187
- * (default: `null`)
188
- * @param alpha - An opacity for the emitted light, if any
189
- * (default: `0.5`)
190
- * @param darknessThreshold - A level of darkness beyond which this light is active
191
- * (default: `0`)
192
- * @param type - The source type from SOURCE_TYPES
193
- * (default: `SOURCE_TYPES.LOCAL`)
194
- * @param animation - An animation configuration for the source
195
- * (default: `{type: null}`)
196
- * @param seed - An integer seed to synchronize (or de-synchronize) animations
197
- * (default: `undefined`)
198
- *
199
- * @returns A reference to the initialized source
200
- */
201
- initialize({
202
- x,
203
- y,
204
- z,
205
- dim,
206
- bright,
207
- angle,
208
- rotation,
209
- color,
210
- alpha,
211
- darknessThreshold,
212
- type,
213
- animation,
214
- seed
215
- }?: {
216
- x?: number;
217
- y?: number;
218
- z?: number | null;
219
- dim?: number;
220
- bright?: number;
221
- angle?: number;
222
- rotation?: number;
223
- color?: number | string | null;
224
- alpha?: number;
225
- darknessThreshold?: number;
226
- type?: string;
227
- animation?: PointSource.Animation;
228
- seed?: number;
229
- }): this;
230
-
231
215
  /**
232
216
  * Initialize the shaders used for this animation.
233
217
  * Reset the current shader values back to defaults.
234
218
  * Swap to a different Shader instance if necessary.
219
+ * @internal
235
220
  */
236
221
  protected _initializeShaders(): void;
237
222
 
238
223
  /**
239
224
  * Initialize the blend mode and vertical sorting of this source relative to others in the container.
225
+ * @internal
240
226
  */
241
227
  protected _initializeBlending(): void;
242
228
 
243
229
  /**
244
230
  * Draw the display of this source for the darkness/light container of the SightLayer.
245
- * @param updateChannels - Is this drawing initiated because lighting channels have changed?
246
231
  * @returns The rendered light container
247
232
  */
248
- drawLight({ updateChannels }?: { updateChannels?: boolean }): PIXI.Container;
233
+ drawLight(): PIXI.Container;
249
234
 
250
235
  /**
251
236
  * Draw and return a container used to depict the visible color tint of the light source on the LightingLayer
@@ -256,6 +241,7 @@ declare class PointSource {
256
241
  /**
257
242
  * A common helper function for updating the display of a source container.
258
243
  * Assign the container position, dimensions, and polygons.
244
+ * @internal
259
245
  */
260
246
  protected _drawContainer(c: PIXI.Container): PIXI.Container;
261
247
 
@@ -269,25 +255,31 @@ declare class PointSource {
269
255
  * A torch animation where the luminosity and coloration decays each frame and is revitalized by flashes
270
256
  * @param dt - Delta time
271
257
  * @param speed - The animation speed, from 1 to 10
258
+ * (default: `5`)
272
259
  * @param intensity - The animation intensity, from 1 to 10
260
+ * (default: `5`)
273
261
  */
274
- animateTorch: PointSource.AnimationFunction;
262
+ animateTorch(dt: number, { speed, intensity }?: PointSource.AnimationProperties): void;
275
263
 
276
264
  /**
277
265
  * A basic "pulse" animation which expands and contracts.
278
266
  * @param dt - Delta time
279
267
  * @param speed - The animation speed, from 1 to 10
268
+ * (default: `5`)
280
269
  * @param intensity - The animation intensity, from 1 to 10
270
+ * (default: `5`)
281
271
  */
282
- animatePulse: PointSource.AnimationFunction;
272
+ animatePulse(dt: number, { speed, intensity }?: PointSource.AnimationProperties): void;
283
273
 
284
274
  /**
285
275
  * Emanate waves of light from the source origin point
286
276
  * @param dt - Delta time
287
277
  * @param speed - The animation speed, from 1 to 10
278
+ * (default: `5`)
288
279
  * @param intensity - The animation intensity, from 1 to 10
280
+ * (default: `5`)
289
281
  */
290
- animateTime: PointSource.AnimationFunction;
282
+ animateTime(dt: number, { speed, intensity }?: PointSource.AnimationProperties): void;
291
283
 
292
284
  /**
293
285
  * Evolve a value using a stochastic AR(1) process
@@ -298,6 +290,7 @@ declare class PointSource {
298
290
  * @param max - The maximum allowed outcome, or null
299
291
  * @param min - The minimum allowed outcome, or null
300
292
  * @returns The new value of the process
293
+ * @internal
301
294
  */
302
295
  protected _ar1(
303
296
  y: number,
@@ -309,11 +302,106 @@ declare class PointSource {
309
302
  min
310
303
  }: { phi?: number; center?: number; sigma?: number; max?: number | null; min?: number | null }
311
304
  ): number;
312
-
313
- static GEOMETRY: PIXI.Geometry;
314
305
  }
315
306
 
316
307
  declare namespace PointSource {
308
+ type SourceType = 'light' | 'sight';
309
+
310
+ interface Data {
311
+ /**
312
+ * The x-coordinate of the source location
313
+ * @defaultValue `0`
314
+ */
315
+ x?: number;
316
+
317
+ /** The y-coordinate of the source location
318
+ * @defaultValue `0`
319
+ */
320
+ y?: number;
321
+
322
+ /** An optional z-index sorting for the source
323
+ * @defaultValue `null`
324
+ */
325
+ z?: number | null;
326
+
327
+ /** The allowed radius of dim vision or illumination
328
+ * @defaultValue `0`
329
+ */
330
+ dim?: number;
331
+
332
+ /** The allowed radius of bright vision or illumination
333
+ * @defaultValue `0`
334
+ */
335
+ bright?: number;
336
+
337
+ /** The angle of emission for this point source
338
+ * @defaultValue `360`
339
+ */
340
+ angle?: number;
341
+
342
+ /**
343
+ * The angle of rotation for this point source
344
+ * @defaultValue `0`
345
+ */
346
+ rotation?: number;
347
+
348
+ /**
349
+ * A tint color for the emitted light, if any
350
+ * @defaultValue `null`
351
+ */
352
+ color?: number | string | null;
353
+
354
+ /** An opacity for the emitted light, if any
355
+ * @defaultValue `0.5`
356
+ */
357
+ alpha: number;
358
+
359
+ /**
360
+ * A darkness range (min and max) for which the source should be active
361
+ * @defaultValue `{ min: 0, max: 1 }`
362
+ */
363
+ darkness?: { min: number; max: number };
364
+
365
+ /**
366
+ * The source type from CONST.SOURCE_TYPES
367
+ * @defaultValue `CONST.SOURCE_TYPES.LOCAL`
368
+ */
369
+ type?: foundry.CONST.SourceType;
370
+
371
+ /**
372
+ * An animation configuration for the source
373
+ * @defaultValue `{ type: null }`
374
+ */
375
+ animation?: PointSource.Animation;
376
+
377
+ /**
378
+ * An integer seed to synchronize (or de-synchronize) animations
379
+ */
380
+ seed?: number;
381
+ }
382
+
383
+ type Initialized<P extends PointSource> = P &
384
+ Required<
385
+ Pick<
386
+ P,
387
+ | 'animation'
388
+ | 'angle'
389
+ | 'alpha'
390
+ | 'bright'
391
+ | 'color'
392
+ | 'dim'
393
+ | 'rotation'
394
+ | 'type'
395
+ | 'x'
396
+ | 'y'
397
+ | 'z'
398
+ | 'colorRGB'
399
+ | 'ratio'
400
+ | 'fov'
401
+ | 'los'
402
+ >
403
+ >;
404
+
317
405
  interface AnimationProperties {
318
406
  speed?: number;
319
407
  intensity?: number;
@@ -34,7 +34,22 @@ declare class TextEditor {
34
34
  * (default: `250`)
35
35
  * @returns The previewed HTML
36
36
  */
37
- static previewHTML(content: string, length: number): string;
37
+ static previewHTML(content: string, length?: number): string;
38
+
39
+ /**
40
+ * Truncate an HTML fragment to a maximum number of text content characters, removing any unused elements.
41
+ * @param html - The root HTML element.
42
+ * @param maxLength - The maximum allowed length of the text content.
43
+ * (default: `50`)
44
+ * @param splitWords - Whether to truncate by splitting on white space (if true) or breaking words.
45
+ * (default: `true`)
46
+ * @param suffix - A suffix string to append to denote that the text was truncated.
47
+ * (default: `'…'`)
48
+ */
49
+ static truncateHTML(
50
+ html: HTMLElement,
51
+ { maxLength, splitWords, suffix }: { maxLength?: number; splitWords?: boolean; suffix?: string }
52
+ ): HTMLElement;
38
53
 
39
54
  /**
40
55
  * Truncate a fragment of text to a maximum number of characters.
@@ -55,11 +70,13 @@ declare class TextEditor {
55
70
  * Recursively identify the text nodes within a parent HTML node for potential content replacement.
56
71
  * @param parent - The parent HTML Element
57
72
  * @returns An array of contained Text nodes
73
+ * @internal
58
74
  */
59
75
  protected static _getTextNodes(parent: HTMLElement): Text[];
60
76
 
61
77
  /**
62
78
  * Facilitate the replacement of text node content using a matching regex rule and a provided replacement function.
79
+ * @internal
63
80
  */
64
81
  protected static _replaceTextContent(
65
82
  text: Text[],
@@ -69,6 +86,7 @@ declare class TextEditor {
69
86
 
70
87
  /**
71
88
  * Replace a matched portion of a Text node with a replacement Node
89
+ * @internal
72
90
  */
73
91
  protected static _replaceTextNode(text: Text, match: RegExpMatchArray, replacement: Node): void;
74
92
 
@@ -79,13 +97,15 @@ declare class TextEditor {
79
97
  * @param target - The requested match target (_id or name)
80
98
  * @param name - A customized or over-ridden display name for the link
81
99
  * @returns An HTML element for the entity link
100
+ * @internal
82
101
  */
83
- protected static _createEntityLink(match: string, type: string, target: string, name: string): HTMLAnchorElement;
102
+ protected static _createContentLink(match: string, type: string, target: string, name: string): HTMLAnchorElement;
84
103
 
85
104
  /**
86
105
  * Replace a hyperlink-like string with an actual HTML <a> tag
87
106
  * @param match - The full matched string
88
107
  * @returns An HTML element for the entity link
108
+ * @internal
89
109
  */
90
110
  protected static _createHyperlink(match: string): HTMLAnchorElement;
91
111
 
@@ -95,47 +115,58 @@ declare class TextEditor {
95
115
  * @param command - An optional command
96
116
  * @param formula - The matched formula
97
117
  * @param closing - The closing brackets for the inline roll
118
+ * @param label - An optional label which configures the button text
98
119
  * @returns The replaced match
120
+ * @internal
99
121
  */
100
122
  protected static _createInlineRoll(
101
123
  match: string,
102
124
  command: string,
103
125
  formula: string,
104
126
  closing: string,
127
+ label?: string,
105
128
  ...args: object[]
106
- ): string;
129
+ ): HTMLAnchorElement | null;
107
130
 
108
131
  static activateListeners(): void;
109
132
 
110
133
  /**
111
134
  * Handle click events on Entity Links
135
+ * @internal
112
136
  */
113
- protected static _onClickEntityLink(event: Event): Promise<void>;
137
+ protected static _onClickContentLink(event: JQuery.ClickEvent): void;
114
138
 
115
139
  /**
116
140
  * Handle left-mouse clicks on an inline roll, dispatching the formula or displaying the tooltip
117
141
  * @param event - The initiating click event
142
+ * @internal
118
143
  */
119
- protected static _onClickInlineRoll(event: MouseEvent): Promise<void | Promise<void> | Promise<ChatMessage> | object>;
144
+ protected static _onClickInlineRoll(event: JQuery.ClickEvent): void;
120
145
 
121
146
  /**
122
147
  * Begin a Drag+Drop workflow for a dynamic content link
123
148
  * @param event - The originating drag event
149
+ * @internal
124
150
  */
125
- protected static _onDragEntityLink(event: Event): void;
151
+ protected static _onDragEntityLink(event: JQuery.DragStartEvent): void;
126
152
 
127
153
  /**
128
154
  * Begin a a data transfer drag event with default handling
155
+ * @internal
129
156
  */
130
- protected _onDragStart(event: Event): void;
157
+ protected _onDragStart(event: DragEvent): void;
131
158
 
132
159
  /**
133
160
  * Handle dropping of transferred data onto the active rich text editor
134
161
  * @param event - The originating drop event which triggered the data transfer
135
162
  * @param editor - The TinyMCE editor instance being dropped on
136
163
  */
137
- protected static _onDropEditorData(event: Event, editor: tinyMCE.Editor): Promise<void>;
164
+ protected static _onDropEditorData(event: DragEvent, editor: tinyMCE.Editor): void;
138
165
 
166
+ /**
167
+ * Singleton decoder area
168
+ * @internal
169
+ */
139
170
  protected static _decoder: HTMLTextAreaElement;
140
171
  }
141
172
 
@@ -11,6 +11,8 @@ import './foundry.js/canvas';
11
11
  import './foundry.js/canvasAnimation';
12
12
  import './foundry.js/canvasDocumentMixin';
13
13
  import './foundry.js/chatBubbles';
14
+ import './foundry.js/clientDatabaseBackend';
15
+ import './foundry.js/clientDocuments';
14
16
  import './foundry.js/clientDocumentMixin';
15
17
  import './foundry.js/clientSettings';
16
18
  import './foundry.js/config';
@@ -56,31 +58,6 @@ import './foundry.js/applications';
56
58
 
57
59
  import './foundry.js/avClients';
58
60
 
59
- import './foundry.js/clientDocuments/activeEffect';
60
- import './foundry.js/clientDocuments/actor';
61
- import './foundry.js/clientDocuments/canvasDocuments/ambientLightDocument';
62
- import './foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument';
63
- import './foundry.js/clientDocuments/canvasDocuments/drawingDocument';
64
- import './foundry.js/clientDocuments/canvasDocuments/measuredTemplateDocument';
65
- import './foundry.js/clientDocuments/canvasDocuments/noteDocument';
66
- import './foundry.js/clientDocuments/canvasDocuments/tileDocument';
67
- import './foundry.js/clientDocuments/canvasDocuments/tokenDocument';
68
- import './foundry.js/clientDocuments/canvasDocuments/wallDocument';
69
- import './foundry.js/clientDocuments/chatMessage';
70
- import './foundry.js/clientDocuments/combat';
71
- import './foundry.js/clientDocuments/combatant';
72
- import './foundry.js/clientDocuments/fogExploration';
73
- import './foundry.js/clientDocuments/folder';
74
- import './foundry.js/clientDocuments/item';
75
- import './foundry.js/clientDocuments/journalEntry';
76
- import './foundry.js/clientDocuments/macro';
77
- import './foundry.js/clientDocuments/playlist';
78
- import './foundry.js/clientDocuments/rollTable';
79
- import './foundry.js/clientDocuments/scene';
80
- import './foundry.js/clientDocuments/setting';
81
- import './foundry.js/clientDocuments/tableResult';
82
- import './foundry.js/clientDocuments/user';
83
-
84
61
  import './foundry.js/collections';
85
62
 
86
63
  import './foundry.js/rollTerm';
@@ -1,68 +0,0 @@
1
- /**
2
- * Ambient Sound Config Sheet
3
- * @typeParam P - the type of the options object
4
- */
5
- declare class AmbientSoundConfig<
6
- P extends AmbientSoundConfig.Options = AmbientSoundConfig.Options
7
- > extends FormApplication<AmbientSoundConfig.Options, AmbientSoundConfig.Data, AmbientSound> {
8
- /**
9
- * @param sound - The sound object being configured
10
- * @param options - Additional application rendering options
11
- */
12
- constructor(sound: AmbientSound, options?: Partial<P>);
13
-
14
- /**
15
- * @override
16
- * @defaultValue
17
- * ```typescript
18
- * mergeObject(super.defaultOptions, {
19
- * id: "sound-config",
20
- * classes: ["sheet", "sound-sheet"],
21
- * title: "SOUND.ConfigTitle",
22
- * template: "templates/scene/sound-config.html",
23
- * width: 480
24
- * });
25
- * ```
26
- */
27
- static get defaultOptions(): AmbientSoundConfig.Options;
28
-
29
- /**
30
- * @param options - (unused)
31
- * @override
32
- */
33
- getData(options?: Partial<P>): AmbientSoundConfig.Data;
34
-
35
- /**
36
- * @param event - (unused)
37
- * @override
38
- */
39
- protected _updateObject(event: Event, formData: AmbientSoundConfig.FormData): Promise<AmbientSound>;
40
-
41
- /** @override */
42
- close(options?: Application.CloseOptions): Promise<void>;
43
- }
44
-
45
- declare namespace AmbientSoundConfig {
46
- interface Data {
47
- object: foundry.utils.Duplicated<AmbientSoundConfig['object']['data']>;
48
- options: AmbientSoundConfig['options'];
49
- submitText: string;
50
- }
51
-
52
- interface FormData {
53
- easing: AmbientSound.Data['easing'];
54
- path: AmbientSound.Data['path'];
55
- radius: AmbientSound.Data['radius'] | null;
56
- type: AmbientSound.Data['type'];
57
- volume: AmbientSound.Data['volume'];
58
- x: AmbientSound.Data['x'] | null;
59
- y: AmbientSound.Data['y'] | null;
60
- }
61
-
62
- interface Options extends FormApplication.Options {
63
- /**
64
- * Configure a preview version of a sound which is not yet saved
65
- */
66
- preview?: boolean;
67
- }
68
- }