@league-of-foundry-developers/foundry-vtt-types 9.255.1 → 9.268.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +5 -4
  2. package/package.json +3 -2
  3. package/src/foundry/common/data/data.mjs/index.d.ts +0 -1
  4. package/src/foundry/common/types.mjs.d.ts +4 -4
  5. package/src/foundry/common/utils/helpers.mjs.d.ts +1 -0
  6. package/src/foundry/foundry.js/application.d.ts +0 -1
  7. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +7 -3
  8. package/src/foundry/foundry.js/applications/cameraViews.d.ts +3 -3
  9. package/src/foundry/foundry.js/applications/chatPopout.d.ts +1 -1
  10. package/src/foundry/foundry.js/applications/compendium.d.ts +20 -11
  11. package/src/foundry/foundry.js/applications/controlsReference.d.ts +17 -2
  12. package/src/foundry/foundry.js/applications/dialog.d.ts +14 -29
  13. package/src/foundry/foundry.js/applications/filePicker.d.ts +67 -75
  14. package/src/foundry/foundry.js/applications/formApplication.d.ts +7 -2
  15. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +19 -58
  16. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -4
  17. package/src/foundry/foundry.js/applications/formApplications/{entitySheetConfig.d.ts → documentSheetConfig.d.ts} +36 -19
  18. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +1 -4
  19. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +2 -4
  20. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardConfig.d.ts +51 -0
  21. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfig.d.ts +88 -0
  22. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsHand.d.ts +20 -0
  23. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsPile.d.ts +20 -0
  24. package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/index.d.ts +2 -0
  25. package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +2 -4
  26. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +17 -11
  27. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +3 -0
  28. package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +3 -9
  29. package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +10 -12
  30. package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +4 -5
  31. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +2 -6
  32. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +1 -4
  33. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +8 -12
  34. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +2 -1
  35. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +1 -4
  36. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +10 -11
  37. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +28 -15
  38. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +3 -6
  39. package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +1 -4
  40. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +17 -21
  41. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +3 -3
  42. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +40 -7
  43. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +2 -2
  44. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +10 -24
  45. package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +1 -1
  46. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +15 -3
  47. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +23 -16
  48. package/src/foundry/foundry.js/applications/formApplications/{defaultTokenConfig.d.ts → tokenConfigs/defaultTokenConfig.d.ts} +29 -16
  49. package/src/foundry/foundry.js/applications/formApplications/tokenConfigs/index.d.ts +1 -0
  50. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +22 -15
  51. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +23 -12
  52. package/src/foundry/foundry.js/applications/hotbar.d.ts +7 -3
  53. package/src/foundry/foundry.js/applications/index.d.ts +1 -0
  54. package/src/foundry/foundry.js/applications/invitationLinks.d.ts +25 -10
  55. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +16 -1
  56. package/src/foundry/foundry.js/applications/sidebar.d.ts +7 -0
  57. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +65 -38
  58. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +17 -3
  59. package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +19 -16
  60. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +0 -3
  61. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +4 -18
  62. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +2 -8
  63. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +38 -5
  64. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -0
  65. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -1
  66. package/src/foundry/foundry.js/applications/supportDetails.d.ts +78 -0
  67. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -2
  68. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +10 -2
  69. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +87 -49
  70. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +3 -7
  71. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +6 -13
  72. package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +6 -0
  73. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
  74. package/src/foundry/foundry.js/collections/documentCollections/worldCollection.d.ts +2 -2
  75. package/src/foundry/foundry.js/config.d.ts +21 -21
  76. package/src/foundry/foundry.js/contextMenu.d.ts +37 -28
  77. package/src/foundry/foundry.js/game.d.ts +2 -2
  78. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +26 -4
  79. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +1 -1
  80. package/src/foundry/foundry.js/perceptionManager.d.ts +1 -1
  81. package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
  82. package/src/foundry/foundry.js/pixi/containers/canvasLayers/controlsLayer.d.ts +49 -48
  83. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +51 -40
  84. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/lightingLayer.d.ts +63 -20
  85. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayer.d.ts +0 -3
  86. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +4 -4
  87. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +21 -0
  88. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/notesLayer.d.ts +1 -1
  89. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/soundsLayer.d.ts +10 -2
  90. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/tokenLayer.d.ts +41 -20
  91. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +50 -121
  92. package/src/foundry/foundry.js/pixi/containers/canvasLayers/sightLayer.d.ts +125 -107
  93. package/src/foundry/foundry.js/pixi/containers/controlIcon.d.ts +3 -0
  94. package/src/foundry/foundry.js/pixi/containers/index.d.ts +1 -0
  95. package/src/foundry/foundry.js/pixi/containers/objectHUD.d.ts +82 -0
  96. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +27 -6
  97. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +26 -4
  98. package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +34 -20
  99. package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +52 -15
  100. package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +9 -2
  101. package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +50 -12
  102. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +248 -87
  103. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +107 -16
  104. package/src/foundry/foundry.js/pixi/filters/abstractFilter.d.ts +42 -0
  105. package/src/foundry/foundry.js/pixi/filters/abstractFilters/fogColorFilter.d.ts +16 -0
  106. package/src/foundry/foundry.js/pixi/filters/abstractFilters/forceColorFilter.d.ts +17 -0
  107. package/src/foundry/foundry.js/pixi/filters/abstractFilters/glowFilter.d.ts +31 -0
  108. package/src/foundry/foundry.js/pixi/filters/abstractFilters/index.d.ts +4 -0
  109. package/src/foundry/foundry.js/pixi/filters/abstractFilters/roofMaskFilter.d.ts +20 -0
  110. package/src/foundry/foundry.js/pixi/filters/index.d.ts +2 -0
  111. package/src/foundry/foundry.js/roll.d.ts +2 -2
  112. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +5 -0
  113. package/src/foundry/foundry.js/textEditor.d.ts +266 -231
  114. package/src/types/augments/index.d.ts +2 -0
  115. package/src/types/augments/pixiGraphicsSmooth.d.ts +7 -0
  116. package/src/types/augments/pixiLegacyGraphics.d.ts +7 -0
  117. package/src/types/utils.d.ts +5 -0
package/README.md CHANGED
@@ -9,6 +9,8 @@ TypeScript type definitions for [Foundry Virtual Tabletop](https://foundryvtt.co
9
9
  [![League Discord Server](https://img.shields.io/discord/732325252788387980?label=League%20of%20Extraordinary%20Foundry%20VTT%20Developers)](https://discord.gg/52DNPzqm2Z)
10
10
  ![GitHub V9 issues by-label](https://img.shields.io/github/issues-raw/League-of-Foundry-Developers/foundry-vtt-types/foundry%20V9?color=%23fe631d)
11
11
  ![GitHub closed V9 issues by-label](https://img.shields.io/github/issues-closed-raw/League-of-Foundry-Developers/foundry-vtt-types/foundry%20V9?color=%23fe631d)
12
+ ![GitHub V10 issues by-label](https://img.shields.io/github/issues-raw/League-of-Foundry-Developers/foundry-vtt-types/foundry%20V10?color=%23fe631d)
13
+ ![GitHub closed V10 issues by-label](https://img.shields.io/github/issues-closed-raw/League-of-Foundry-Developers/foundry-vtt-types/foundry%20V10?color=%23fe631d)
12
14
  [![npm (tag)](https://img.shields.io/npm/v/@league-of-foundry-developers/foundry-vtt-types/latest)](https://www.npmjs.com/package/@league-of-foundry-developers/foundry-vtt-types)
13
15
 
14
16
  </div>
@@ -17,8 +19,7 @@ TypeScript type definitions for [Foundry Virtual Tabletop](https://foundryvtt.co
17
19
 
18
20
  We aim to support the latest release of each Foundry VTT version (0.7, 0.8, 9, etc.), starting with 0.7.
19
21
 
20
- At the moment, both version 0.7 and 0.8 are fully supported. Version 9 is already partially supported, but there is still a lot to be done. See the [open foundry V9 issues](https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues?q=is%3Aopen+is%3Aissue+label%3A%22foundry+V9%22) to keep track of the progress.
21
-
22
+ At the moment, versions 0.7, 0.8, and 9 are fully supported. Work on support for version 10 is just starting out. See the [open foundry V10 issues](https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues?q=is%3Aopen+is%3Aissue+label%3A%22foundry+V10%22) to keep track of the progress.
22
23
 
23
24
  ## Installation
24
25
 
@@ -36,10 +37,10 @@ In order to install a specific version run
36
37
  npm install --save-dev @league-of-foundry-developers/foundry-vtt-types@<version>
37
38
  ```
38
39
 
39
- For example, to install version `9.238.0`, run
40
+ For example, to install version `9.268.0`, run
40
41
 
41
42
  ```sh
42
- npm install --save-dev @league-of-foundry-developers/foundry-vtt-types@9.238.0
43
+ npm install --save-dev @league-of-foundry-developers/foundry-vtt-types@9.268.0
43
44
  ```
44
45
 
45
46
  You can then update foundry-vtt-types using the regular update mechanism for npm
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@league-of-foundry-developers/foundry-vtt-types",
3
- "version": "9.255.1",
3
+ "version": "9.268.0",
4
4
  "description": "TypeScript type definitions for Foundry VTT",
5
5
  "exports": {
6
6
  ".": {
@@ -55,6 +55,7 @@
55
55
  "typscript"
56
56
  ],
57
57
  "dependencies": {
58
+ "@pixi/graphics-smooth": "0.0.22",
58
59
  "@types/jquery": "~3.5.9",
59
60
  "@types/simple-peer": "~9.11.1",
60
61
  "handlebars": "4.7.7",
@@ -73,7 +74,7 @@
73
74
  "husky": "^7.0.4",
74
75
  "lint-staged": "^12.1.2",
75
76
  "prettier": "^2.5.1",
76
- "tsd": "^0.19.1",
77
+ "tsd": "^0.20.0",
77
78
  "typescript": "~4.6.2"
78
79
  },
79
80
  "husky": {
@@ -26,7 +26,6 @@ export { SceneData } from './sceneData';
26
26
  export { SettingData } from './settingData';
27
27
  export { TableResultData } from './tableResultData';
28
28
  export { TileData } from './tileData';
29
- export { TokenBarData } from './tokenBarData';
30
29
  export { TokenData } from './tokenData';
31
30
  export { UserData } from './userData';
32
31
  export { WallData } from './wallData';
@@ -55,7 +55,7 @@ interface SettingConfig<T = unknown> {
55
55
  : ConstructorOf<T>;
56
56
 
57
57
  /** For string Types, defines the allowable values */
58
- choices?: (T extends string ? Record<string, string> : never) | undefined;
58
+ choices?: (T extends number | string ? Record<T, string> : never) | undefined;
59
59
 
60
60
  /** For numeric Types, defines the allowable range */
61
61
  range?:
@@ -95,7 +95,7 @@ interface SettingSubmenuConfig {
95
95
  icon?: string | undefined;
96
96
 
97
97
  /** The FormApplication to render */
98
- type: ConstructorOf<FormApplication<FormApplicationOptions, object, undefined>>;
98
+ type: new () => FormApplication<any, any, any>;
99
99
 
100
100
  /** If true, only a GM can edit this Setting */
101
101
  restricted?: boolean | undefined;
@@ -119,10 +119,10 @@ interface KeybindingActionConfig {
119
119
  editable?: KeybindingActionBinding[];
120
120
 
121
121
  /** A function to execute when a key down event occurs. If True is returned, the event is consumed and no further keybinds execute. */
122
- onDown?: () => boolean | void;
122
+ onDown?: (ctx: KeyboardEventContext) => boolean | void;
123
123
 
124
124
  /** A function to execute when a key up event occurs. If True is returned, the event is consumed and no further keybinds execute. */
125
- onUp?: () => boolean | void;
125
+ onUp?: (ctx: KeyboardEventContext) => boolean | void;
126
126
 
127
127
  /** If True, allows Repeat events to execute the Action's onDown. Defaults to false. */
128
128
  repeat?: boolean;
@@ -198,6 +198,7 @@ export declare function getParentClasses(cls: ConstructorOf<any>): Array<Constru
198
198
  * @param object - The object to traverse
199
199
  * @param key - An object property with notation a.b.c
200
200
  * @returns The value of the found property
201
+ * @throws {@link Error} Throws an Error if the object is not in fact an object
201
202
  */
202
203
  export declare function getProperty(object: object, key: string): any;
203
204
 
@@ -441,7 +441,6 @@ declare abstract class Application<Options extends ApplicationOptions = Applicat
441
441
  * @param event - The originating DragEvent
442
442
  * (unused)
443
443
  * @internal
444
- * @internal
445
444
  */
446
445
  protected _onDrop(event: DragEvent): void;
447
446
 
@@ -98,7 +98,7 @@ declare global {
98
98
  * Handle attribute bar update
99
99
  * @internal
100
100
  */
101
- protected _onAttributeUpdate(event: JQuery.ChangeEvent): void;
101
+ protected _onAttributeUpdate(event: JQuery.FocusOutEvent): void;
102
102
 
103
103
  /**
104
104
  * Toggle Token combat state
@@ -126,12 +126,16 @@ declare global {
126
126
 
127
127
  /**
128
128
  * Handle toggling a token status effect icon
129
- * @param overlay - (default: `false`)
130
129
  * @internal
131
130
  */
132
131
  protected _onToggleEffect(
133
132
  event: JQuery.ClickEvent | JQuery.ContextMenuEvent,
134
- { overlay }?: { overlay?: boolean }
133
+ {
134
+ overlay
135
+ }?: {
136
+ /** @defaultValue `@false` */
137
+ overlay?: boolean;
138
+ }
135
139
  ): Promise<boolean>;
136
140
 
137
141
  /**
@@ -14,7 +14,7 @@ declare class CameraViews<
14
14
  * return foundry.utils.mergeObject(super.defaultOptions, {
15
15
  * id: "camera-views",
16
16
  * template: "templates/hud/camera-views.html",
17
- * popOut: false,
17
+ * popOut: false
18
18
  * })
19
19
  * ```
20
20
  */
@@ -27,14 +27,14 @@ declare class CameraViews<
27
27
 
28
28
  /**
29
29
  * Obtain a reference to the div.camera-view which is used to portray a given Foundry User.
30
- * @param userId - The ID of the User entity
30
+ * @param userId - The ID of the User document
31
31
  */
32
32
  getUserCameraView(userId: string): HTMLElement | null;
33
33
 
34
34
  /**
35
35
  * Obtain a reference to the video.user-camera which displays the video channel for a requested Foundry User.
36
36
  * If the user is not broadcasting video this will return null.
37
- * @param userId - The ID of the User entity
37
+ * @param userId - The ID of the User document
38
38
  */
39
39
  getUserVideoElement(userId: string): HTMLVideoElement | null;
40
40
 
@@ -9,7 +9,7 @@ declare global {
9
9
  constructor(message: InstanceType<ConfiguredDocumentClass<typeof ChatMessage>>, options?: Partial<Options>);
10
10
 
11
11
  /**
12
- * The displayed Chat Message entity
12
+ * The displayed Chat Message document
13
13
  */
14
14
  message: InstanceType<ConfiguredDocumentClass<typeof ChatMessage>>;
15
15
 
@@ -2,12 +2,18 @@
2
2
  * An interface for displaying the content of a CompendiumCollection.
3
3
  * @typeParam Metadata - The metadata of the compendium
4
4
  * @typeParam Options - The type of the options object
5
+ * @typeParam Data - The data structure used to render the handlebars template.
5
6
  */
6
7
  declare class Compendium<
7
8
  Metadata extends CompendiumCollection.Metadata,
8
- Options extends ApplicationOptions = ApplicationOptions
9
+ Options extends ApplicationOptions = ApplicationOptions,
10
+ Data extends object = Compendium.Data<Metadata>
9
11
  > extends Application<Options> {
10
- constructor(collection: CompendiumCollection<Metadata>, options?: Partial<Options>);
12
+ /**
13
+ * @param collection - The {@link CompendiumCollection} object represented by this interface.
14
+ * @param options - Application configuration options.
15
+ */
16
+ constructor(collection: CompendiumCollection<Metadata>, options?: Partial<Options> | undefined);
11
17
 
12
18
  collection: CompendiumCollection<Metadata>;
13
19
 
@@ -38,7 +44,7 @@ declare class Compendium<
38
44
  get metadata(): this['collection']['metadata'];
39
45
 
40
46
  /** @override */
41
- getData(options?: Partial<Options>): Promise<Compendium.Data<Metadata>>;
47
+ getData(options?: Partial<Options>): Promise<Data> | Data;
42
48
 
43
49
  /** @override */
44
50
  close(options?: Application.CloseOptions): Promise<void>;
@@ -47,13 +53,10 @@ declare class Compendium<
47
53
  activateListeners(html: JQuery): void;
48
54
 
49
55
  /**
50
- * Handle opening a single compendium entry by invoking the configured entity class and its sheet
56
+ * Handle opening a single compendium entry by invoking the configured document class and its sheet
51
57
  * @param event - The originating click event
52
- * @remarks
53
- * This actually returns a promise of {@link FormApplication} but the return type is not meant to be used, so it is
54
- * typed as `unknown` to give deriving classes more freedom.
55
58
  */
56
- protected _onClickEntry(event: JQuery.ClickEvent): Promise<unknown>;
59
+ protected _onClickEntry(event: JQuery.ClickEvent): void;
57
60
 
58
61
  /** @override */
59
62
  protected _onSearchFilter(event: KeyboardEvent, query: string, rgx: RegExp, html: HTMLElement): void;
@@ -73,16 +76,22 @@ declare class Compendium<
73
76
  */
74
77
  protected _onDrop(event: DragEvent): void;
75
78
 
79
+ /** @override */
80
+ protected _contextMenu(html: JQuery): void;
81
+
76
82
  /**
77
- * Render the ContextMenu which applies to each compendium Document
83
+ * Get Compendium entry context options
84
+ * @returns The Compendium entry context options
85
+ * @internal
78
86
  */
79
- protected _contextMenu(html: JQuery): void;
87
+ protected _getEntryContextOptions(): ContextMenuEntry;
80
88
  }
81
89
 
82
90
  declare namespace Compendium {
83
91
  interface Data<Metadata extends CompendiumCollection.Metadata> {
84
92
  collection: CompendiumCollection<Metadata>;
85
- cssClass: string;
93
+ documentCls: string;
86
94
  index: CompendiumCollection<Metadata>['index'];
95
+ documentPartial: string;
87
96
  }
88
97
  }
@@ -1,7 +1,13 @@
1
1
  /**
2
2
  * Keyboard Controls Reference Sheet
3
+ * @typeParam Options - the type of the options object
4
+ * @typeParam Data - The data structure used to render the handlebars template.
5
+ * @deprecated since v9
3
6
  */
4
- declare class ControlsReference extends Application {
7
+ declare class ControlsReference<
8
+ Options extends ApplicationOptions = ApplicationOptions,
9
+ Data extends object = ControlsReference.Data
10
+ > extends Application<Options> {
5
11
  /**
6
12
  * @defaultValue
7
13
  * ```typescript
@@ -12,5 +18,14 @@ declare class ControlsReference extends Application {
12
18
  * options.width = 600;
13
19
  * ```
14
20
  */
15
- static get defaultOptions(): typeof Application['defaultOptions'];
21
+ static get defaultOptions(): ApplicationOptions;
22
+
23
+ /** @override */
24
+ getData(options?: Partial<Options>): Data | Promise<Data>;
25
+ }
26
+
27
+ declare namespace ControlsReference {
28
+ interface Data {
29
+ controlKey: '⌘' | 'Control';
30
+ }
16
31
  }
@@ -1,3 +1,13 @@
1
+ interface DialogOptions extends ApplicationOptions {
2
+ /**
3
+ * Whether to provide jQuery objects to callback functions (if true) or plain
4
+ * HTMLElement instances (if false). This is currently true by default but in the
5
+ * future will become false by default.
6
+ * @defaultValue `true`
7
+ */
8
+ jQuery: boolean;
9
+ }
10
+
1
11
  /**
2
12
  * Create a modal dialog window displaying a title, a message, and a set of buttons which trigger callback functions.
3
13
  *
@@ -26,7 +36,7 @@
26
36
  * ```
27
37
  * @typeParam Options - the type of the options object
28
38
  */
29
- declare class Dialog<Options extends Dialog.Options = Dialog.Options> extends Application<Options> {
39
+ declare class Dialog<Options extends DialogOptions = DialogOptions> extends Application<Options> {
30
40
  /**
31
41
  * @param data - An object of dialog data which configures how the modal window is rendered
32
42
  * @param options - Dialog rendering options, see {@link Application}
@@ -47,7 +57,7 @@ declare class Dialog<Options extends Dialog.Options = Dialog.Options> extends Ap
47
57
  * })
48
58
  * ```
49
59
  */
50
- static get defaultOptions(): Dialog.Options;
60
+ static get defaultOptions(): DialogOptions;
51
61
 
52
62
  /**
53
63
  * @override
@@ -192,31 +202,6 @@ declare namespace Dialog {
192
202
  */
193
203
  default: string;
194
204
  }
195
-
196
- interface Options extends ApplicationOptions {
197
- /**
198
- * @defaultValue `400`
199
- */
200
- width: number;
201
-
202
- /**
203
- * @defaultValue `['dialog']`
204
- */
205
- classes: string[];
206
-
207
- /**
208
- * @defaultValue `'templates/hud/dialog.html'`
209
- */
210
- template: string;
211
-
212
- /**
213
- * Whether to provide jQuery objects to callback functions (if true) or plain
214
- * HTMLElement instances (if false). This is currently true by default but in the
215
- * future will become false by default.
216
- * @defaultValue `true`
217
- */
218
- jQuery: boolean;
219
- }
220
205
  }
221
206
 
222
207
  /**
@@ -266,7 +251,7 @@ interface ConfirmConfig<Yes, No, JQueryOrHtml> {
266
251
  * Additional rendering options passed to the Dialog
267
252
  * @defaultValue `{}`
268
253
  */
269
- options?: Partial<Dialog.Options>;
254
+ options?: Partial<DialogOptions>;
270
255
  }
271
256
 
272
257
  /**
@@ -310,5 +295,5 @@ interface PromptConfig<Value, JQueryOrHtml> {
310
295
  * Additional rendering options
311
296
  * @defaultValue `{}`
312
297
  */
313
- options?: Partial<Dialog.Options>;
298
+ options?: Partial<DialogOptions>;
314
299
  }
@@ -1,3 +1,32 @@
1
+ interface FilePickerOptions extends ApplicationOptions {
2
+ /** A type of file to target, in "audio", "image", "video", "imagevideo" or "folder" */
3
+ type?: FilePicker.Type | undefined;
4
+
5
+ /** The current file path being modified, if any */
6
+ current?: string | undefined;
7
+
8
+ /** A current file source in "data", "public", or "s3" */
9
+ activeSource?: FilePicker.SourceType | undefined;
10
+
11
+ /** A callback function to trigger once a file has been selected */
12
+ callback?: FilePicker.Callback | undefined;
13
+
14
+ /** A flag which permits explicitly disallowing upload, true by default */
15
+ allowUpload?: boolean | undefined;
16
+
17
+ /** An HTML form field that the result of this selection is applied to */
18
+ field?: HTMLElement | undefined;
19
+
20
+ /** An HTML button element which triggers the display of this picker */
21
+ button?: HTMLElement | undefined;
22
+
23
+ /** The picker display mode in FilePicker.DISPLAY_MODES */
24
+ displayMode?: FilePicker.DisplayMode | undefined;
25
+
26
+ /** Display the tile size configuration. */
27
+ tileSize?: boolean | undefined;
28
+ }
29
+
1
30
  /**
2
31
  * The FilePicker application renders contents of the server-side public directory
3
32
  * This app allows for navigating and uploading files to the public path
@@ -5,13 +34,13 @@
5
34
  * @typeParam Data - The data structure used to render the handlebars template.
6
35
  */
7
36
  declare class FilePicker<
8
- Options extends FilePicker.Options = FilePicker.Options,
37
+ Options extends FilePickerOptions = FilePickerOptions,
9
38
  Data extends object = FilePicker.Data
10
39
  > extends Application<Options> {
11
40
  /**
12
41
  * @param options - Options that configure the behavior of the FilePicker
13
42
  */
14
- constructor(options?: Partial<Options>);
43
+ constructor(options?: Partial<Options> | undefined);
15
44
 
16
45
  /**
17
46
  * The full requested path given by the user
@@ -43,7 +72,7 @@ declare class FilePicker<
43
72
  /**
44
73
  * The general file type which controls the set of extensions which will be accepted
45
74
  */
46
- type: FilePicker.Type | undefined;
75
+ type: FilePicker.Type;
47
76
 
48
77
  /**
49
78
  * The target HTML element this file picker is bound to
@@ -112,7 +141,7 @@ declare class FilePicker<
112
141
  * })
113
142
  * ```
114
143
  */
115
- static get defaultOptions(): FilePicker.Options;
144
+ static get defaultOptions(): FilePickerOptions;
116
145
 
117
146
  /**
118
147
  * Given a current file path, determine the directory it belongs to
@@ -170,14 +199,14 @@ declare class FilePicker<
170
199
  * @override
171
200
  * @param options - (unused)
172
201
  */
173
- getData(options?: Partial<Options>): Data | Promise<Data>;
202
+ getData(options?: Partial<Options> | undefined): Data | Promise<Data>;
174
203
 
175
204
  /**
176
205
  * Browse to a specific location for this FilePicker instance
177
206
  * @param target - The target within the currently active source location.
178
207
  * @param options - Browsing options (default: `{}`)
179
208
  */
180
- browse(target: string, options?: FilePicker.BrowseOptions): Promise<FilePicker.BrowseResult | undefined>;
209
+ browse(target: string, options?: FilePicker.BrowseOptions | undefined): Promise<FilePicker.BrowseResult | undefined>;
181
210
 
182
211
  /**
183
212
  * Browse files for a certain directory location
@@ -190,7 +219,7 @@ declare class FilePicker<
190
219
  static browse(
191
220
  source: FilePicker.SourceType,
192
221
  target: string,
193
- options?: FilePicker.BrowseOptions
222
+ options?: FilePicker.BrowseOptions | undefined
194
223
  ): Promise<FilePicker.BrowseResult>;
195
224
 
196
225
  /**
@@ -202,7 +231,7 @@ declare class FilePicker<
202
231
  static configurePath(
203
232
  source: FilePicker.SourceType,
204
233
  target: string,
205
- options?: FilePicker.ConfigurePathOptions
234
+ options?: FilePicker.ConfigurePathOptions | undefined
206
235
  ): Promise<FilePicker.ConfigurePathResult>;
207
236
 
208
237
  /**
@@ -214,7 +243,7 @@ declare class FilePicker<
214
243
  static createDirectory(
215
244
  source: FilePicker.SourceType,
216
245
  target: string,
217
- options?: FilePicker.CreateDirectoryOptions
246
+ options?: FilePicker.CreateDirectoryOptions | undefined
218
247
  ): Promise<string>;
219
248
 
220
249
  /**
@@ -223,15 +252,15 @@ declare class FilePicker<
223
252
  */
224
253
  protected static _manageFiles(
225
254
  data: FilePicker.BrowseFilesData,
226
- options?: FilePicker.BrowseOptions
255
+ options?: FilePicker.BrowseOptions | undefined
227
256
  ): Promise<FilePicker.BrowseResult>;
228
257
  protected static _manageFiles(
229
258
  data: FilePicker.ConfigurePathData,
230
- options?: FilePicker.ConfigurePathOptions
259
+ options?: FilePicker.ConfigurePathOptions | undefined
231
260
  ): Promise<FilePicker.ConfigurePathResult>;
232
261
  protected static _manageFiles(
233
262
  data: FilePicker.CreateDirectoryData,
234
- options?: FilePicker.CreateDirectoryOptions
263
+ options?: FilePicker.CreateDirectoryOptions | undefined
235
264
  ): Promise<string>;
236
265
 
237
266
  /**
@@ -239,21 +268,25 @@ declare class FilePicker<
239
268
  * @param source - The data source to which the file should be uploaded
240
269
  * @param path - The destination path
241
270
  * @param file - The File object to upload
242
- * @param options - Additional file upload options passed as form data (default `{}`)
271
+ * @param body - Additional file upload options sent in the POST body
272
+ * (default: `{}`)
273
+ * @param options - Additional options to configure how the method behaves
274
+ * (default `{}`)
243
275
  * @returns The response object
244
276
  */
245
277
  static upload(
246
278
  source: FilePicker.SourceType,
247
279
  path: string,
248
280
  file: File,
249
- options?: FilePicker.UploadOptions
250
- ): Promise<FilePicker.UploadResult | false | void>;
281
+ body?: FilePicker.UploadBody | undefined,
282
+ options?: FilePicker.UploadOptions | undefined
283
+ ): Promise<FilePicker.UploadResult | false | void | {}>;
251
284
 
252
285
  /**
253
286
  * @override
254
287
  * Additional actions performed when the file-picker UI is rendered
255
288
  */
256
- render(force?: boolean, options?: Application.RenderOptions<Options>): unknown;
289
+ render(force?: boolean | undefined, options?: Application.RenderOptions<Options> | undefined): this;
257
290
 
258
291
  /** @override */
259
292
  activateListeners(html: JQuery): void;
@@ -323,8 +356,8 @@ declare class FilePicker<
323
356
  protected _onClickDirectoryControl(event: JQuery.ClickEvent): void;
324
357
 
325
358
  /**
326
- * Present the user with a dialog to create a subdirectory within their currentl
327
- * @internal browsed file storate location.
359
+ * Present the user with a dialog to create a subdirectory within their currently browsed file storate location.
360
+ * @internal
328
361
  */
329
362
  protected _createDirectoryDialog(source: FilePicker.Source): void;
330
363
 
@@ -335,18 +368,16 @@ declare class FilePicker<
335
368
  protected _onChangeBucket(event: JQuery.ChangeEvent): void;
336
369
 
337
370
  /**
338
- * @override
339
- * @param event - (unused)
340
- */
371
+ * @override */
341
372
  protected _onSearchFilter(event: KeyboardEvent, query: string, rgx: RegExp, html: HTMLElement): void;
342
373
 
343
- /**
344
- * Handle file picker form submission
345
- */
374
+ /** @override */
346
375
  protected _onSubmit(ev: Event): void;
347
376
 
348
377
  /**
349
378
  * Handle file upload
379
+ * @param ev - The file upload event
380
+ * @internal
350
381
  */
351
382
  protected _onUpload(ev: Event): void;
352
383
 
@@ -356,7 +387,7 @@ declare class FilePicker<
356
387
  * The data-target attribute should provide the name of the input field which should receive the selected file
357
388
  * The data-type attribute is a string in ["image", "audio"] which sets the file extensions which will be accepted
358
389
  *
359
- * @param button - The button element
390
+ * @param button - The button element
360
391
  */
361
392
  static fromButton(button: HTMLButtonElement): FilePicker;
362
393
  }
@@ -467,53 +498,6 @@ declare namespace FilePicker {
467
498
  action: 'createDirectory';
468
499
  }
469
500
 
470
- /**
471
- * Options for configuring FilePicker
472
- */
473
- interface Options extends ApplicationOptions {
474
- /**
475
- * A type of file to target, in "audio", "image", "video", "imagevideo" or "folder"
476
- */
477
- type?: Type | undefined;
478
-
479
- /**
480
- * The current file path being modified, if any
481
- */
482
- current?: string | undefined;
483
-
484
- /**
485
- * A current file source in "data", "public", or "s3"
486
- */
487
- activeSource?: SourceType | undefined;
488
-
489
- /**
490
- * A callback function to trigger once a file has been selected
491
- */
492
- callback?: Callback | undefined;
493
-
494
- /**
495
- * A flag which permits explicitly disallowing upload, true by default
496
- */
497
- allowUpload?: boolean | undefined;
498
-
499
- /**
500
- * An HTML form field that the result of this selection is applied to
501
- */
502
- field?: HTMLElement | undefined;
503
-
504
- /**
505
- * An HTML button element which triggers the display of this picker
506
- */
507
- button?: HTMLElement | undefined;
508
-
509
- /**
510
- * The picker display mode in FilePicker.DISPLAY_MODES
511
- */
512
- displayMode?: DisplayMode | undefined;
513
-
514
- tileSize?: boolean | undefined;
515
- }
516
-
517
501
  interface Source {
518
502
  target: string;
519
503
  label: string;
@@ -529,14 +513,22 @@ declare namespace FilePicker {
529
513
  };
530
514
  }
531
515
 
532
- type Type = 'audio' | 'image' | 'video' | 'imagevideo' | 'folder';
516
+ type Type = 'any' | 'audio' | 'image' | 'video' | 'imagevideo' | 'folder';
533
517
 
534
- interface UploadOptions {
518
+ interface UploadBody {
535
519
  /**
536
520
  * A bucket to upload to, if using the S3 source
537
521
  * @defaultValue `""`
538
522
  */
539
- bucket?: string | null;
523
+ bucket?: string | null | undefined;
524
+ }
525
+
526
+ interface UploadOptions {
527
+ /**
528
+ * Display a UI notification when the upload is processed
529
+ * @defaultValue `true`
530
+ */
531
+ notify?: string | undefined;
540
532
  }
541
533
 
542
534
  interface UploadResult {
@@ -59,6 +59,11 @@ declare abstract class FormApplication<
59
59
  * @remarks Foundry allows passing no value to the constructor at all.
60
60
  */
61
61
  constructor(object: ConcreteObject, options?: Partial<Options>);
62
+ constructor(
63
+ ...args: ConcreteObject extends undefined
64
+ ? [ConcreteObject?, Partial<Options>?]
65
+ : [ConcreteObject, Partial<Options>?]
66
+ );
62
67
 
63
68
  /**
64
69
  * The object target which we are using this form to modify
@@ -173,7 +178,7 @@ declare abstract class FormApplication<
173
178
  * Do not preventDefault in this handler as other interactions on the form may also be occurring.
174
179
  * @param event - The initial change event
175
180
  */
176
- protected _onChangeInput(event: JQuery.ChangeEvent): void | Promise<unknown>;
181
+ protected _onChangeInput(event: JQuery.ChangeEvent): void;
177
182
 
178
183
  /**
179
184
  * Handle the change of a color picker input which enters it's chosen value into a related input field
@@ -238,7 +243,7 @@ declare abstract class FormApplication<
238
243
  * @param event - The initiating mouse click event which opens the picker
239
244
  * @returns Options passed to the FilePicker constructor
240
245
  */
241
- protected _getFilePickerOptions(event: PointerEvent): FilePicker.Options;
246
+ protected _getFilePickerOptions(event: PointerEvent): FilePickerOptions;
242
247
 
243
248
  /**
244
249
  * @param options - (default: `{}`)