@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
@@ -1,13 +1,17 @@
1
1
  /**
2
2
  * The FilePicker application renders contents of the server-side public directory
3
3
  * This app allows for navigating and uploading files to the public path
4
- * @typeParam P - the type of the options object
4
+ * @typeParam Options - the type of the options object
5
+ * @typeParam Data - The data structure used to render the handlebars template.
5
6
  */
6
- declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> extends Application<P> {
7
+ declare class FilePicker<
8
+ Options extends FilePicker.Options = FilePicker.Options,
9
+ Data extends object = FilePicker.Data
10
+ > extends Application<Options> {
7
11
  /**
8
12
  * @param options - Options that configure the behavior of the FilePicker
9
13
  */
10
- constructor(options?: Partial<P>);
14
+ constructor(options?: Partial<Options>);
11
15
 
12
16
  /**
13
17
  * The full requested path given by the user
@@ -17,13 +21,13 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
17
21
  /**
18
22
  * The file sources which are available for browsing
19
23
  */
20
- sources: Partial<FilePicker.Sources>;
24
+ sources: FilePicker.Sources;
21
25
 
22
26
  /**
23
27
  * Track the active source tab which is being browsed
24
28
  * @defaultValue `'data'`
25
29
  */
26
- activeSource: FilePicker.DataSource;
30
+ activeSource: FilePicker.SourceType;
27
31
 
28
32
  /**
29
33
  * A callback function to trigger once a file has been selected
@@ -95,6 +99,18 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
95
99
 
96
100
  /**
97
101
  * @override
102
+ * @defaultValue
103
+ * ```typescript
104
+ * foundry.utils.mergeObject(super.defaultOptions, {
105
+ * template: "templates/apps/filepicker.html",
106
+ * classes: ["filepicker"],
107
+ * width: 520,
108
+ * tabs: [{navSelector: ".tabs"}],
109
+ * dragDrop: [{dragSelector: ".file", dropSelector: ".filepicker-body"}],
110
+ * tileSize: false,
111
+ * filters: [{inputSelector: 'input[name="filter"]', contentSelector: ".filepicker-body"}]
112
+ * })
113
+ * ```
98
114
  */
99
115
  static get defaultOptions(): FilePicker.Options;
100
116
 
@@ -102,13 +118,13 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
102
118
  * Given a current file path, determine the directory it belongs to
103
119
  * @param target - The currently requested target path
104
120
  * @returns An array of the inferred source and target directory path
121
+ * @internal
105
122
  */
106
123
  protected _inferCurrentDirectory(target: string | undefined): [string, string];
107
124
 
108
125
  /**
109
126
  * Get the valid file extensions for a given named file picker type
110
- * @param type - The general type of file
111
- * @returns A list of file extensions
127
+ * @internal
112
128
  */
113
129
  protected _getExtensions(type: FilePicker.Type): string[] | undefined;
114
130
 
@@ -151,17 +167,17 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
151
167
  static get uploadURL(): string;
152
168
 
153
169
  /**
154
- * @param options - (unused)
155
170
  * @override
171
+ * @param options - (unused)
156
172
  */
157
- getData(options?: Partial<P>): Promise<FilePicker.Data>;
173
+ getData(options?: Partial<Options>): Data | Promise<Data>;
158
174
 
159
175
  /**
160
176
  * Browse to a specific location for this FilePicker instance
161
177
  * @param target - The target within the currently active source location.
162
178
  * @param options - Browsing options (default: `{}`)
163
179
  */
164
- browse(target?: string, options?: FilePicker.BrowsingOptions): Promise<FilePicker.BrowseResult>;
180
+ browse(target: string, options?: FilePicker.BrowseOptions): Promise<FilePicker.BrowseResult | undefined>;
165
181
 
166
182
  /**
167
183
  * Browse files for a certain directory location
@@ -172,9 +188,9 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
172
188
  * @returns A Promise which resolves to the directories and files contained in the location
173
189
  */
174
190
  static browse(
175
- source: FilePicker.DataSource,
176
- target?: string,
177
- options?: FilePicker.BrowsingOptions
191
+ source: FilePicker.SourceType,
192
+ target: string,
193
+ options?: FilePicker.BrowseOptions
178
194
  ): Promise<FilePicker.BrowseResult>;
179
195
 
180
196
  /**
@@ -184,7 +200,7 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
184
200
  * @param options - Optional arguments which modify the request (default: `{}`)
185
201
  */
186
202
  static configurePath(
187
- source: FilePicker.DataSource,
203
+ source: FilePicker.SourceType,
188
204
  target: string,
189
205
  options?: FilePicker.ConfigurePathOptions
190
206
  ): Promise<FilePicker.ConfigurePathResult>;
@@ -196,18 +212,27 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
196
212
  * @param options - Optional arguments which modify the request (default: `{}`)
197
213
  */
198
214
  static createDirectory(
199
- source: FilePicker.DataSource,
215
+ source: FilePicker.SourceType,
200
216
  target: string,
201
217
  options?: FilePicker.CreateDirectoryOptions
202
218
  ): Promise<string>;
203
219
 
204
220
  /**
205
221
  * General dispatcher method to submit file management commands to the server
222
+ * @internal
206
223
  */
207
224
  protected static _manageFiles(
208
- data: FilePicker.ManageData,
209
- options?: Record<string, unknown>
210
- ): Promise<Record<string, unknown>>;
225
+ data: FilePicker.BrowseFilesData,
226
+ options?: FilePicker.BrowseOptions
227
+ ): Promise<FilePicker.BrowseResult>;
228
+ protected static _manageFiles(
229
+ data: FilePicker.ConfigurePathData,
230
+ options?: FilePicker.ConfigurePathOptions
231
+ ): Promise<FilePicker.ConfigurePathResult>;
232
+ protected static _manageFiles(
233
+ data: FilePicker.CreateDirectoryData,
234
+ options?: FilePicker.CreateDirectoryOptions
235
+ ): Promise<string>;
211
236
 
212
237
  /**
213
238
  * Dispatch a POST request to the server containing a directory path and a file to upload
@@ -218,16 +243,17 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
218
243
  * @returns The response object
219
244
  */
220
245
  static upload(
221
- source: FilePicker.DataSource,
246
+ source: FilePicker.SourceType,
222
247
  path: string,
223
248
  file: File,
224
249
  options?: FilePicker.UploadOptions
225
- ): Promise<(Response & { path: string; message?: string }) | false | void>;
250
+ ): Promise<FilePicker.UploadResult | false | void>;
226
251
 
227
252
  /**
253
+ * @override
228
254
  * Additional actions performed when the file-picker UI is rendered
229
255
  */
230
- render(force?: boolean, options?: Application.RenderOptions<P>): ReturnType<this['browse']> | void;
256
+ render(force?: boolean, options?: Application.RenderOptions<Options>): unknown;
231
257
 
232
258
  /** @override */
233
259
  activateListeners(html: JQuery): void;
@@ -235,6 +261,7 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
235
261
  /**
236
262
  * Handle a click event to change the display mode of the File Picker
237
263
  * @param event - The triggering click event
264
+ * @internal
238
265
  */
239
266
  protected _onChangeDisplayMode(event: JQuery.ClickEvent): void;
240
267
 
@@ -242,20 +269,21 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
242
269
  * @param event - (unused)
243
270
  * @param event - (unused)
244
271
  * @override
272
+ * @internal
245
273
  */
246
274
  protected _onChangeTab(event: MouseEvent | null, tabs: Tabs, active: this['activeSource']): void;
247
275
 
248
276
  /**
249
- * @param selector - (unused)
250
277
  * @override
278
+ * @param selector - (unused)
251
279
  */
252
280
  protected _canDragStart(selector: string | null): boolean;
253
281
 
254
282
  /**
255
- * @param selector - (unused)
256
283
  * @override
284
+ * @param selector - (unused)
257
285
  */
258
- protected _canDragDrop(selector: string | null): this['canUpload'];
286
+ protected _canDragDrop(selector: string | null): boolean;
259
287
 
260
288
  /**
261
289
  * @override
@@ -264,51 +292,51 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
264
292
 
265
293
  /**
266
294
  * @override
295
+ * @internal
267
296
  */
268
- protected _onDrop(event: DragEvent): Promise<PromisedType<ReturnType<this['browse']>> | void>;
297
+ protected _onDrop(event: DragEvent): void;
269
298
 
270
299
  /**
271
300
  * Handle user submission of the address bar to request an explicit target
272
301
  * @param event - The originating keydown event
302
+ * @internal
273
303
  */
274
- protected _onRequestTarget(event: KeyboardEvent): ReturnType<this['browse']> | void;
304
+ protected _onRequestTarget(event: KeyboardEvent): void;
275
305
 
276
306
  /**
277
307
  * Handle requests from the IntersectionObserver to lazily load an image file
278
- * @param entries - The entries which are now observed
279
- * @param observer - The intersection observer instance
308
+ * @internal
280
309
  */
281
- protected _onLazyLoadImages(entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;
310
+ protected _onLazyLoadImages(...args: Parameters<SidebarTab['_onLazyLoadImage']>): void;
282
311
 
283
312
  /**
284
313
  * Handle file or folder selection within the file picker
285
314
  * @param event - The originating click event
315
+ * @internal
286
316
  */
287
- protected _onPick(event: JQuery.ClickEvent): ReturnType<this['browse']> | void;
317
+ protected _onPick(event: JQuery.ClickEvent): void;
288
318
 
289
319
  /**
290
320
  * Handle backwards navigation of the fol6der structure
321
+ * @internal
291
322
  */
292
- protected _onClickDirectoryControl(
293
- event: JQuery.ClickEvent
294
- ):
295
- | ReturnType<this['browse']>
296
- | Promise<ReturnType<this['browse']> | void | null>
297
- | ReturnType<typeof FilePicker['configurePath']>;
323
+ protected _onClickDirectoryControl(event: JQuery.ClickEvent): void;
298
324
 
299
325
  /**
300
- * Present the user with a dialog to create a subdirectory within their currently browsed file storate location.
326
+ * Present the user with a dialog to create a subdirectory within their currentl
327
+ * @internal browsed file storate location.
301
328
  */
302
- protected _createDirectoryDialog(source: FilePicker.Source): Promise<ReturnType<this['browse']> | void | null>;
329
+ protected _createDirectoryDialog(source: FilePicker.Source): void;
303
330
 
304
331
  /**
305
332
  * Handle changes to the bucket selector
333
+ * @internal
306
334
  */
307
- protected _onChangeBucket(event: JQuery.ChangeEvent): ReturnType<this['browse']>;
335
+ protected _onChangeBucket(event: JQuery.ChangeEvent): void;
308
336
 
309
337
  /**
310
- * @param event - (unused)
311
338
  * @override
339
+ * @param event - (unused)
312
340
  */
313
341
  protected _onSearchFilter(event: KeyboardEvent, query: string, rgx: RegExp, html: HTMLElement): void;
314
342
 
@@ -320,7 +348,7 @@ declare class FilePicker<P extends FilePicker.Options = FilePicker.Options> exte
320
348
  /**
321
349
  * Handle file upload
322
350
  */
323
- protected _onUpload(ev: Event): Promise<void>;
351
+ protected _onUpload(ev: Event): void;
324
352
 
325
353
  /**
326
354
  * Bind the file picker to a new target field.
@@ -340,14 +368,13 @@ declare namespace FilePicker {
340
368
  dirs: string[];
341
369
  privateDirs: string[];
342
370
  files: string[];
343
- gridSize?: number;
371
+ gridSize: number | null;
344
372
  extensions: [];
345
373
  }
346
374
 
347
- interface BrowsingOptions {
375
+ interface BrowseOptions {
348
376
  /**
349
377
  * A bucket within which to search, if using the S3 source
350
- * @defaultValue `""`
351
378
  */
352
379
  bucket?: string;
353
380
 
@@ -364,43 +391,26 @@ declare namespace FilePicker {
364
391
  wildcard?: boolean;
365
392
  }
366
393
 
367
- /**
368
- * A callback function to trigger once a file has been selected
369
- * @param path - The path that was chosen
370
- */
371
394
  type Callback = (path: string) => void;
372
395
 
373
396
  interface ConfigurePathOptions {
374
- /**
375
- * A bucket to use, if using the S3 source
376
- * @defaultValue `""`
377
- */
378
- bucket?: string;
397
+ bucket?: string | undefined | null;
379
398
 
380
- /**
381
- * Set the privacy mode on this path
382
- * @defaultValue true
383
- */
384
- private?: boolean;
399
+ private?: boolean | undefined;
385
400
 
386
- /**
387
- * Set the grid size
388
- * @defaultValue `undefined`
389
- */
390
- gridSize?: number;
401
+ gridSize?: number | undefined;
391
402
  }
392
403
 
393
404
  interface ConfigurePathResult {
394
- private: boolean;
405
+ private?: boolean;
395
406
  gridSize?: number;
396
407
  }
397
408
 
398
409
  interface CreateDirectoryOptions {
399
410
  /**
400
- * A bucket to use, if using the S3 source
401
411
  * @defaultValue `""`
402
412
  */
403
- bucket?: string;
413
+ bucket?: string | null;
404
414
  }
405
415
 
406
416
  interface Data {
@@ -415,17 +425,16 @@ declare namespace FilePicker {
415
425
  files: File[];
416
426
  isS3: boolean;
417
427
  noResults: boolean;
418
- request: string;
419
428
  selected: string | undefined;
420
429
  source: Source;
421
430
  sources: Sources;
422
431
  target: string;
423
432
  tileSize: number | null;
424
433
  user: Game['user'];
425
- submitText: 'FILES.SelectFolder' | 'FILES.SelectFile';
434
+ submitText: string;
426
435
  }
427
436
 
428
- type DataSource = 'data' | 'public' | 's3';
437
+ type SourceType = 'data' | 'public' | 's3';
429
438
 
430
439
  interface Dir {
431
440
  name: string;
@@ -441,80 +450,68 @@ declare namespace FilePicker {
441
450
  img: string;
442
451
  }
443
452
 
444
- interface ManageData {
445
- action: 'browseFiles' | 'configurePath' | 'createDirectory' | 'manageFiles';
453
+ interface ManageFilesDataBase {
446
454
  source: string;
447
455
  target: string;
448
456
  }
449
457
 
458
+ interface BrowseFilesData extends ManageFilesDataBase {
459
+ action: 'browseFiles';
460
+ }
461
+
462
+ interface ConfigurePathData extends ManageFilesDataBase {
463
+ action: 'configurePath';
464
+ }
465
+
466
+ interface CreateDirectoryData extends ManageFilesDataBase {
467
+ action: 'createDirectory';
468
+ }
469
+
450
470
  /**
451
471
  * Options for configuring FilePicker
452
472
  */
453
473
  interface Options extends Application.Options {
454
- /**
455
- * The current file path being modified, if any
456
- */
457
- current?: FilePicker['request'];
458
-
459
- /**
460
- * A current file source in "data", "public", or "s3"
461
- */
462
- activeSource?: DataSource;
463
-
464
474
  /**
465
475
  * A type of file to target, in "audio", "image", "video", "imagevideo" or "folder"
466
476
  */
467
- type?: FilePicker['type'];
477
+ type?: Type | undefined;
468
478
 
469
479
  /**
470
- * An HTML form field that the result of this selection is applied to
480
+ * The current file path being modified, if any
471
481
  */
472
- field?: FilePicker['field'];
482
+ current?: string | undefined;
473
483
 
474
484
  /**
475
- * An HTML button element which triggers the display of this picker
485
+ * A current file source in "data", "public", or "s3"
476
486
  */
477
- button?: FilePicker['button'];
487
+ activeSource?: SourceType | undefined;
478
488
 
479
489
  /**
480
490
  * A callback function to trigger once a file has been selected
481
491
  */
482
- callback?: Callback;
492
+ callback?: Callback | undefined;
483
493
 
484
494
  /**
485
- * @defaultValue `'templates/apps/filepicker.html'`
495
+ * A flag which permits explicitly disallowing upload, true by default
486
496
  */
487
- template: Application.Options['template'];
497
+ allowUpload?: boolean | undefined;
488
498
 
489
499
  /**
490
- * @defaultValue `['filepicker']`
491
- */
492
- classes: Application.Options['classes'];
493
-
494
- /**
495
- * @defaultValue `520`
496
- */
497
- width: Application.Options['width'];
498
-
499
- /**
500
- * @defaultValue `[{navSelector: ".tabs"}]`
500
+ * An HTML form field that the result of this selection is applied to
501
501
  */
502
- tabs: Application.Options['tabs'];
502
+ field?: HTMLElement | undefined;
503
503
 
504
504
  /**
505
- * @defaultValue `[{dragSelector: '.file', dropSelector: '.filepicker-body'}]`
505
+ * An HTML button element which triggers the display of this picker
506
506
  */
507
- dragDrop: Application.Options['dragDrop'];
507
+ button?: HTMLElement | undefined;
508
508
 
509
509
  /**
510
- * @defaultValue `false`
510
+ * The picker display mode in FilePicker.DISPLAY_MODES
511
511
  */
512
- tileSize: boolean;
512
+ displayMode?: DisplayMode | undefined;
513
513
 
514
- /**
515
- * @defaultValue `[{ inputSelector: 'input[name="filter"]', contentSelector: ".filepicker-body" }]`
516
- */
517
- filters: Application.Options['filters'];
514
+ tileSize?: boolean | undefined;
518
515
  }
519
516
 
520
517
  interface Source {
@@ -526,7 +523,7 @@ declare namespace FilePicker {
526
523
  interface Sources {
527
524
  data: Source;
528
525
  public: Source;
529
- s3: Source & {
526
+ s3?: Source & {
530
527
  buckets: string[];
531
528
  bucket: string;
532
529
  };
@@ -534,14 +531,17 @@ declare namespace FilePicker {
534
531
 
535
532
  type Type = 'audio' | 'image' | 'video' | 'imagevideo' | 'folder';
536
533
 
537
- /**
538
- * Optional arguments for the `upload` method
539
- */
540
534
  interface UploadOptions {
541
535
  /**
542
536
  * A bucket to upload to, if using the S3 source
543
537
  * @defaultValue `""`
544
538
  */
545
- bucket?: string;
539
+ bucket?: string | null;
540
+ }
541
+
542
+ interface UploadResult {
543
+ message: string;
544
+ path: string;
545
+ status: 'success';
546
546
  }
547
547
  }
@@ -128,14 +128,14 @@ declare abstract class FormApplication<
128
128
  * @returns The prepared update data
129
129
  */
130
130
  // TODO: Maybe we can calculate how the flattened `updateData` looks like, then it would be Partial<Record<string, unknown>> & Flattened<T>
131
- protected _getSubmitData(updateData?: object | null): Partial<Record<string, unknown>>;
131
+ protected _getSubmitData(updateData?: object | null): Record<string, unknown>;
132
132
 
133
133
  /**
134
134
  * Handle changes to an input element, submitting the form if options.submitOnChange is true.
135
135
  * Do not preventDefault in this handler as other interactions on the form may also be occurring.
136
136
  * @param event - The initial change event
137
137
  */
138
- protected _onChangeInput(event: JQuery.ChangeEvent): void | Promise<Partial<Record<string, unknown>>>;
138
+ protected _onChangeInput(event: JQuery.ChangeEvent): void | Promise<unknown>;
139
139
 
140
140
  /**
141
141
  * Handle the change of a color picker input which enters it's chosen value into a related input field
@@ -200,7 +200,7 @@ declare abstract class FormApplication<
200
200
  * @param event - The initiating mouse click event which opens the picker
201
201
  * @returns Options passed to the FilePicker constructor
202
202
  */
203
- protected _getFilePickerOptions(event: PointerEvent): FilePickerOptions;
203
+ protected _getFilePickerOptions(event: PointerEvent): FilePicker.Options;
204
204
 
205
205
  /**
206
206
  * @param options - (default: `{}`)
@@ -303,11 +303,3 @@ declare namespace FormApplication {
303
303
  classes: string[];
304
304
  }
305
305
  }
306
-
307
- interface FilePickerOptions {
308
- field: HTMLElement | null;
309
- type: string;
310
- current: string;
311
- button: HTMLElement;
312
- callback: FormApplication['_onSelectFile'];
313
- }
@@ -1,46 +1,39 @@
1
- // TODO: Remove when updating this class!!!
2
- // eslint-disable-next-line
3
- // @ts-nocheck
4
-
5
1
  /**
6
- * Configure the Combat tracker to display additional information as appropriate
2
+ * The Application responsible for configuring the CombatTracker and its contents.
3
+ * @typeParam Options - The type of the options object
4
+ * @typeParam Data - The data structure used to render the handlebars template.
7
5
  */
8
- declare class CombatTrackerConfig extends FormApplication<FormApplication.Options, CombatTrackerConfig.Data> {
6
+ declare class CombatTrackerConfig<
7
+ Options extends FormApplication.Options = FormApplication.Options,
8
+ Data extends object = CombatTrackerConfig.Data
9
+ > extends FormApplication<Options, Data, undefined> {
9
10
  /**
10
11
  * @defaultValue
11
12
  * ```typescript
12
- * mergeObject(super.defaultOptions, {
13
+ * foundry.utils.mergeObject(super.defaultOptions, {
13
14
  * id: "combat-config",
14
15
  * title: game.i18n.localize("COMBAT.Settings"),
15
16
  * classes: ["sheet", "combat-sheet"],
16
17
  * template: "templates/sheets/combat-config.html",
17
- * width: 420
18
- * });
18
+ * width: 420,
19
+ * })
19
20
  * ```
20
21
  */
21
- static get defaultOptions(): typeof FormApplication['defaultOptions'];
22
-
23
- /**
24
- * @param options - (unused)
25
- * @override
26
- */
27
- getData(options?: Partial<FormApplication.Options>): Promise<CombatTrackerConfig.Data>;
22
+ static get defaultOptions(): FormApplication.Options;
28
23
 
29
- /**
30
- * @param event - (unused)
31
- * @override
32
- */
33
- protected _updateObject(event?: Event, formData?: Combat.ConfigValue): Promise<Combat.ConfigValue>;
24
+ /** @override */
25
+ getData(options?: Partial<Options>): Data | Promise<Data>;
34
26
 
35
- /**
36
- * Get an Array of attribute choices which could be tracked for Actors in the Combat Tracker
37
- */
38
- getAttributeChoices(): ReturnType<typeof TokenConfig['getTrackedAttributeChoices']>;
27
+ /** @override */
28
+ protected _updateObject(
29
+ event: Event,
30
+ formData: ClientSettings.Values['core.combatTrackerConfig']
31
+ ): Promise<ClientSettings.Values['core.combatTrackerConfig']>;
39
32
  }
40
33
 
41
34
  declare namespace CombatTrackerConfig {
42
35
  interface Data {
43
- settings: Combat.ConfigValue;
44
- attributeChoices: ReturnType<CombatTrackerConfig['getAttributeChoices']>;
36
+ settings: ClientSettings.Values['core.combatTrackerConfig'];
37
+ attributeChoices: Record<string, string[]>;
45
38
  }
46
39
  }
@@ -0,0 +1,66 @@
1
+ declare global {
2
+ /**
3
+ * A sheet that alters the values of the default Token configuration used when new Token documents are created.
4
+ */
5
+ class DefaultTokenConfig<
6
+ Options extends FormApplication.Options = FormApplication.Options,
7
+ Data extends DefaultTokenConfig.Data = DefaultTokenConfig.Data
8
+ > extends FormApplication<Options, Data, foundry.data.TokenData['_source']> {
9
+ constructor(object: unknown, options: Options);
10
+
11
+ data: foundry.data.TokenData;
12
+
13
+ /**
14
+ * The named world setting that stores the default Token configuration
15
+ */
16
+ static SETTING: string;
17
+
18
+ /**
19
+ * @override
20
+ * @defaultValue
21
+ * ```typescript
22
+ * foundry.utils.mergeObject(super.defaultOptions, {
23
+ * id: "default-token-config",
24
+ * classes: ["sheet"],
25
+ * template: "templates/scene/default-token-config.html",
26
+ * title: "Default Token Configuration",
27
+ * width: 480,
28
+ * height: "auto"
29
+ * })
30
+ * ```
31
+ */
32
+ static get defaultOptions(): typeof FormApplication['defaultOptions'];
33
+
34
+ /** @override */
35
+ getData(options: unknown): Data | Promise<Data>;
36
+
37
+ /** @override */
38
+ _getSubmitData(
39
+ updateData?: Parameters<FormApplication['_getSubmitData']>[0]
40
+ ): ReturnType<FormApplication['_getSubmitData']>;
41
+
42
+ /** @override */
43
+ _updateObject(event: Event, formData?: object): Promise<unknown>;
44
+
45
+ /** @override */
46
+ activateListeners(html: JQuery): void;
47
+
48
+ /**
49
+ * Reset the form to default values
50
+ */
51
+ reset(): void;
52
+ }
53
+
54
+ namespace DefaultTokenConfig {
55
+ interface Data {
56
+ object: DefaultTokenConfig['object'];
57
+ barAttributes: ReturnType<typeof TokenDocument['getTrackedAttributeChoices']>;
58
+ dispositions: Record<ValueOf<typeof CONST.TOKEN_DISPOSITIONS>, string>;
59
+ lightAnimations: Record<string, string>;
60
+ displayModes: Record<ValueOf<typeof CONST.TOKEN_DISPLAY_MODES>, string>;
61
+ lightAlpha: number;
62
+ }
63
+ }
64
+ }
65
+
66
+ export {};
@@ -75,7 +75,7 @@ declare global {
75
75
  * @param event - (unused)
76
76
  * @override
77
77
  */
78
- protected _updateObject(event: Event, formData: object): Promise<ConcreteDocument | undefined>;
78
+ protected _updateObject(event: Event, formData: object): Promise<unknown>;
79
79
 
80
80
  /**
81
81
  * @deprecated since 0.8.0