@league-of-foundry-developers/foundry-vtt-types 9.255.3 → 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.
- package/README.md +5 -4
- package/package.json +3 -2
- package/src/foundry/common/data/data.mjs/index.d.ts +0 -1
- package/src/foundry/common/utils/helpers.mjs.d.ts +1 -0
- package/src/foundry/foundry.js/application.d.ts +0 -1
- package/src/foundry/foundry.js/applications/chatPopout.d.ts +1 -1
- package/src/foundry/foundry.js/applications/compendium.d.ts +20 -11
- package/src/foundry/foundry.js/applications/controlsReference.d.ts +17 -2
- package/src/foundry/foundry.js/applications/filePicker.d.ts +67 -75
- package/src/foundry/foundry.js/applications/formApplication.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -4
- package/src/foundry/foundry.js/applications/formApplications/{entitySheetConfig.d.ts → documentSheetConfig.d.ts} +36 -19
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +1 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +2 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardConfig.d.ts +51 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfig.d.ts +88 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsHand.d.ts +20 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/cardsPile.d.ts +20 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/cardsConfigs/index.d.ts +2 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +2 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +17 -11
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +3 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +3 -9
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +10 -12
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +4 -5
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +2 -6
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +1 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +8 -12
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +2 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +1 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +10 -11
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +28 -15
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +3 -6
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +1 -4
- package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +17 -21
- package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +40 -7
- package/src/foundry/foundry.js/applications/formApplications/index.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +10 -24
- package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +15 -3
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +23 -16
- package/src/foundry/foundry.js/applications/formApplications/{defaultTokenConfig.d.ts → tokenConfigs/defaultTokenConfig.d.ts} +29 -16
- package/src/foundry/foundry.js/applications/formApplications/tokenConfigs/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +22 -15
- package/src/foundry/foundry.js/applications/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/invitationLinks.d.ts +25 -10
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +65 -38
- package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +17 -3
- package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +19 -16
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +0 -3
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +4 -18
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +2 -8
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +38 -5
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -0
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -1
- package/src/foundry/foundry.js/applications/supportDetails.d.ts +78 -0
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +8 -0
- package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +87 -49
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +2 -6
- package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +6 -0
- package/src/foundry/foundry.js/collections/documentCollections/worldCollection.d.ts +2 -2
- package/src/foundry/foundry.js/config.d.ts +21 -21
- package/src/foundry/foundry.js/contextMenu.d.ts +37 -28
- package/src/foundry/foundry.js/game.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/controlsLayer.d.ts +49 -48
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +51 -40
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/lightingLayer.d.ts +63 -20
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayer.d.ts +0 -3
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +4 -4
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +21 -0
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/notesLayer.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/soundsLayer.d.ts +10 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/tokenLayer.d.ts +41 -20
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +50 -121
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/sightLayer.d.ts +125 -107
- package/src/foundry/foundry.js/pixi/containers/controlIcon.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +11 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +34 -27
- package/src/foundry/foundry.js/pixi/filters/abstractFilter.d.ts +42 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/fogColorFilter.d.ts +16 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/forceColorFilter.d.ts +17 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/glowFilter.d.ts +31 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/index.d.ts +4 -0
- package/src/foundry/foundry.js/pixi/filters/abstractFilters/roofMaskFilter.d.ts +20 -0
- package/src/foundry/foundry.js/pixi/filters/index.d.ts +2 -0
- package/src/foundry/foundry.js/roll.d.ts +2 -2
- package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +5 -0
- package/src/types/augments/index.d.ts +2 -0
- package/src/types/augments/pixiGraphicsSmooth.d.ts +7 -0
- package/src/types/augments/pixiLegacyGraphics.d.ts +7 -0
package/README.md
CHANGED
@@ -9,6 +9,8 @@ TypeScript type definitions for [Foundry Virtual Tabletop](https://foundryvtt.co
|
|
9
9
|
[](https://discord.gg/52DNPzqm2Z)
|
10
10
|

|
11
11
|

|
12
|
+

|
13
|
+

|
12
14
|
[](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,
|
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.
|
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.
|
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.
|
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.
|
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';
|
@@ -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
|
|
@@ -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
|
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
|
-
|
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<
|
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
|
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):
|
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
|
-
*
|
83
|
+
* Get Compendium entry context options
|
84
|
+
* @returns The Compendium entry context options
|
85
|
+
* @internal
|
78
86
|
*/
|
79
|
-
protected
|
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
|
-
|
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
|
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():
|
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,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
|
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
|
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():
|
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
|
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
|
-
|
250
|
-
|
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>):
|
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
|
327
|
-
* @internal
|
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
|
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
|
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 {
|
@@ -178,7 +178,7 @@ declare abstract class FormApplication<
|
|
178
178
|
* Do not preventDefault in this handler as other interactions on the form may also be occurring.
|
179
179
|
* @param event - The initial change event
|
180
180
|
*/
|
181
|
-
protected _onChangeInput(event: JQuery.ChangeEvent): void
|
181
|
+
protected _onChangeInput(event: JQuery.ChangeEvent): void;
|
182
182
|
|
183
183
|
/**
|
184
184
|
* Handle the change of a color picker input which enters it's chosen value into a related input field
|
@@ -243,7 +243,7 @@ declare abstract class FormApplication<
|
|
243
243
|
* @param event - The initiating mouse click event which opens the picker
|
244
244
|
* @returns Options passed to the FilePicker constructor
|
245
245
|
*/
|
246
|
-
protected _getFilePickerOptions(event: PointerEvent):
|
246
|
+
protected _getFilePickerOptions(event: PointerEvent): FilePickerOptions;
|
247
247
|
|
248
248
|
/**
|
249
249
|
* @param options - (default: `{}`)
|
@@ -50,7 +50,7 @@ declare class AVConfig<
|
|
50
50
|
protected _onTurnTypeChanged(event: JQuery.ChangeEvent): void;
|
51
51
|
|
52
52
|
/** @override */
|
53
|
-
protected _updateObject(event: Event, formData?: object): Promise<
|
53
|
+
protected _updateObject(event: Event, formData?: object): Promise<unknown>;
|
54
54
|
}
|
55
55
|
|
56
56
|
declare namespace AVConfig {
|
@@ -8,6 +8,7 @@ declare class CombatTrackerConfig<
|
|
8
8
|
Data extends object = CombatTrackerConfig.Data
|
9
9
|
> extends FormApplication<Options, Data, undefined> {
|
10
10
|
/**
|
11
|
+
* @override
|
11
12
|
* @defaultValue
|
12
13
|
* ```typescript
|
13
14
|
* foundry.utils.mergeObject(super.defaultOptions, {
|
@@ -25,10 +26,7 @@ declare class CombatTrackerConfig<
|
|
25
26
|
getData(options?: Partial<Options>): Data | Promise<Data>;
|
26
27
|
|
27
28
|
/** @override */
|
28
|
-
protected _updateObject(
|
29
|
-
event: Event,
|
30
|
-
formData: ClientSettings.Values['core.combatTrackerConfig']
|
31
|
-
): Promise<ClientSettings.Values['core.combatTrackerConfig']>;
|
29
|
+
protected _updateObject(event: Event, formData: ClientSettings.Values['core.combatTrackerConfig']): Promise<unknown>;
|
32
30
|
}
|
33
31
|
|
34
32
|
declare namespace CombatTrackerConfig {
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import type { DocumentConstructor } from '../../../../types/helperTypes';
|
1
|
+
import type { DocumentConstructor, DocumentType } from '../../../../types/helperTypes';
|
2
2
|
|
3
3
|
declare global {
|
4
4
|
/**
|
5
|
-
*
|
5
|
+
* Document Sheet Configuration Application
|
6
6
|
* @typeParam Options - The type of the options object
|
7
7
|
* @typeParam Data - The data structure used to render the handlebars template.
|
8
8
|
* @typeParam ConcreteDocument - The type of the Document which is being managed
|
9
9
|
*/
|
10
|
-
class
|
10
|
+
class DocumentSheetConfig<
|
11
11
|
Options extends FormApplicationOptions = FormApplicationOptions,
|
12
|
-
Data extends object =
|
13
|
-
ConcreteDocument extends foundry.abstract.Document<any, any> = Data extends
|
12
|
+
Data extends object = DocumentSheetConfig.Data<foundry.abstract.Document<any, any>, Options>,
|
13
|
+
ConcreteDocument extends foundry.abstract.Document<any, any> = Data extends DocumentSheetConfig.Data<infer T>
|
14
14
|
? T
|
15
15
|
: foundry.abstract.Document<any, any>
|
16
16
|
> extends FormApplication<Options, Data, ConcreteDocument> {
|
@@ -18,9 +18,9 @@ declare global {
|
|
18
18
|
* @defaultValue
|
19
19
|
* ```typescript
|
20
20
|
* foundry.utils.mergeObject(super.defaultOptions, {
|
21
|
-
*
|
21
|
+
* classes: ["form", "sheet-config"],
|
22
22
|
* template: "templates/sheets/sheet-config.html",
|
23
|
-
* width: 400
|
23
|
+
* width: 400
|
24
24
|
* })
|
25
25
|
* ```
|
26
26
|
*/
|
@@ -30,7 +30,7 @@ declare global {
|
|
30
30
|
* An array of pending sheet assignments which are submitted before other elements of the framework are ready.
|
31
31
|
* @internal
|
32
32
|
*/
|
33
|
-
static _pending: Array<
|
33
|
+
protected static _pending: Array<DocumentSheetConfig.SheetAssignment>;
|
34
34
|
|
35
35
|
/** @override */
|
36
36
|
get title(): string;
|
@@ -39,11 +39,11 @@ declare global {
|
|
39
39
|
getData(options?: Partial<Options>): Data | Promise<Data>;
|
40
40
|
|
41
41
|
/** @override */
|
42
|
-
protected _updateObject(event: Event, formData:
|
42
|
+
protected _updateObject(event: Event, formData: DocumentSheetConfig.FormData): Promise<unknown>;
|
43
43
|
|
44
44
|
/**
|
45
|
-
* Initialize the configured Sheet preferences for
|
46
|
-
* Create the configuration structure for supported
|
45
|
+
* Initialize the configured Sheet preferences for Documents which support dynamic Sheet assignment
|
46
|
+
* Create the configuration structure for supported documents
|
47
47
|
* Process any pending sheet registrations
|
48
48
|
* Update the default values from settings data
|
49
49
|
*/
|
@@ -55,7 +55,7 @@ declare global {
|
|
55
55
|
protected static _getDocumentTypes(cls: DocumentConstructor, types?: string[]): string[];
|
56
56
|
|
57
57
|
/**
|
58
|
-
* Register a sheet class as a candidate which can be used to display
|
58
|
+
* Register a sheet class as a candidate which can be used to display documents of a given type
|
59
59
|
* @param documentClass - The Document class for which to register a new Sheet option
|
60
60
|
* @param scope - Provide a unique namespace scope for this sheet
|
61
61
|
* @param sheetClass - A defined Application class used to render the sheet
|
@@ -65,7 +65,7 @@ declare global {
|
|
65
65
|
documentClass: DocumentConstructor,
|
66
66
|
scope: string,
|
67
67
|
sheetClass: ConstructorOf<FormApplication<FormApplicationOptions, any, any>>,
|
68
|
-
{ label, types, makeDefault }?:
|
68
|
+
{ label, types, makeDefault }?: DocumentSheetConfig.RegisterSheetOptions | undefined
|
69
69
|
): void;
|
70
70
|
|
71
71
|
/**
|
@@ -79,7 +79,7 @@ declare global {
|
|
79
79
|
sheetClass,
|
80
80
|
types,
|
81
81
|
makeDefault
|
82
|
-
}: Omit<
|
82
|
+
}: Omit<DocumentSheetConfig.SheetRegistration, 'action'>): void;
|
83
83
|
|
84
84
|
/**
|
85
85
|
* Unregister a sheet class, removing it from the list of available Applications to use for a Document type
|
@@ -103,15 +103,21 @@ declare global {
|
|
103
103
|
documentClass,
|
104
104
|
id,
|
105
105
|
types
|
106
|
-
}: Omit<
|
106
|
+
}: Omit<DocumentSheetConfig.SheetUnregistration, 'action'>): void;
|
107
107
|
|
108
108
|
/**
|
109
109
|
* Update the currently default Sheets using a new core world setting
|
110
110
|
*/
|
111
|
-
static updateDefaultSheets(setting?: Record<
|
111
|
+
static updateDefaultSheets(setting?: Record<DocumentType, Record<string, string>>): void;
|
112
|
+
|
113
|
+
/**
|
114
|
+
* Initialize default sheet configurations for all document types.
|
115
|
+
* @internal
|
116
|
+
*/
|
117
|
+
protected static _registerDefaultSheets(): void;
|
112
118
|
}
|
113
119
|
|
114
|
-
namespace
|
120
|
+
namespace DocumentSheetConfig {
|
115
121
|
type SheetRegistration = {
|
116
122
|
action: 'register';
|
117
123
|
documentClass: DocumentConstructor;
|
@@ -140,7 +146,7 @@ declare global {
|
|
140
146
|
Options extends FormApplicationOptions = FormApplicationOptions
|
141
147
|
> {
|
142
148
|
isGM: boolean;
|
143
|
-
object:
|
149
|
+
object: ConcreteDocument['data']['_source'];
|
144
150
|
options: Options;
|
145
151
|
sheetClass: string;
|
146
152
|
sheetClasses: Record<string, string>;
|
@@ -157,7 +163,7 @@ declare global {
|
|
157
163
|
/** A human readable label for the sheet name, which will be localized */
|
158
164
|
label?: string;
|
159
165
|
|
160
|
-
/** An array of
|
166
|
+
/** An array of document types for which this sheet should be used */
|
161
167
|
types?: string[];
|
162
168
|
|
163
169
|
/**
|
@@ -167,4 +173,15 @@ declare global {
|
|
167
173
|
makeDefault?: boolean;
|
168
174
|
}
|
169
175
|
}
|
176
|
+
|
177
|
+
/**
|
178
|
+
* @deprecated since v9
|
179
|
+
*/
|
180
|
+
class EntitySheetConfig<
|
181
|
+
Options extends FormApplicationOptions = FormApplicationOptions,
|
182
|
+
Data extends object = DocumentSheetConfig.Data<foundry.abstract.Document<any, any>, Options>,
|
183
|
+
ConcreteDocument extends foundry.abstract.Document<any, any> = Data extends DocumentSheetConfig.Data<infer T>
|
184
|
+
? T
|
185
|
+
: foundry.abstract.Document<any, any>
|
186
|
+
> extends DocumentSheetConfig<Options, Data, ConcreteDocument> {}
|
170
187
|
}
|