@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.
- package/README.md +41 -13
- package/index-lenient.d.ts +10 -0
- package/package.json +10 -1
- package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
- package/src/foundry/common/abstract/document.mjs.d.ts +6 -2
- package/src/foundry/common/data/data.mjs/drawingData.d.ts +8 -3
- package/src/foundry/common/data/data.mjs/index.d.ts +2 -0
- package/src/foundry/common/data/data.mjs/playlistData.d.ts +171 -0
- package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +143 -0
- package/src/foundry/common/data/fields.mjs.d.ts +2 -2
- package/src/foundry/common/documents.mjs/basePlaylist.d.ts +11 -1
- package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +21 -2
- package/src/foundry/common/types.mjs.d.ts +5 -0
- package/src/foundry/foundry.js/application.d.ts +2 -5
- package/src/foundry/foundry.js/applications/cameraViews.d.ts +36 -31
- package/src/foundry/foundry.js/applications/compendium.d.ts +5 -2
- package/src/foundry/foundry.js/applications/filePicker.d.ts +114 -114
- package/src/foundry/foundry.js/applications/formApplication.d.ts +3 -11
- package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +20 -27
- package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +66 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +5 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +57 -0
- package/src/foundry/foundry.js/applications/formApplications/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +7 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +84 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +60 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +72 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +54 -60
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +41 -28
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +75 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +190 -148
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +133 -110
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +66 -0
- package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +93 -95
- package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +163 -147
- package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -7
- package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +41 -23
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +95 -86
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +146 -158
- package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +60 -70
- package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +25 -17
- package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +11 -5
- package/src/foundry/foundry.js/applications/hotbar.d.ts +5 -4
- package/src/foundry/foundry.js/applications/sceneControls.d.ts +13 -3
- package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/itemDirectory.d.ts +7 -30
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +249 -139
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -5
- package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
- package/src/foundry/foundry.js/canvas.d.ts +2 -1
- package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/index.d.ts +8 -0
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/index.d.ts +19 -0
- package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +195 -6
- package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +113 -0
- package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
- package/src/foundry/foundry.js/clientSettings.d.ts +14 -1
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +44 -8
- package/src/foundry/foundry.js/config.d.ts +85 -71
- package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
- package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
- package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
- package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +10 -19
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +6 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/doorControl.d.ts +53 -35
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +6 -2
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +38 -40
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +56 -56
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +9 -50
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +166 -47
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/ruler.d.ts +11 -7
- package/src/foundry/foundry.js/pixi/graphics/gridHighlight.d.ts +4 -9
- package/src/foundry/foundry.js/pointSource.d.ts +173 -85
- package/src/foundry/foundry.js/textEditor.d.ts +39 -8
- package/src/foundry/index.d.ts +2 -25
- package/src/foundry/foundry.js/applications/formApplications/ambientSoundConfig.d.ts +0 -68
- package/src/foundry/foundry.js/applications/formApplications/lightConfig.d.ts +0 -98
- package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
- package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
- package/src/foundry/foundry.js/applications/formApplications/playlistSoundConfig.d.ts +0 -70
- package/src/foundry/foundry.js/applications/formApplications/tileConfig.d.ts +0 -73
@@ -0,0 +1,66 @@
|
|
1
|
+
import { ConfiguredDocumentClassForName } from '../../../../../types/helperTypes';
|
2
|
+
import type { TileDataConstructorData } from '../../../../common/data/data.mjs/tileData';
|
3
|
+
|
4
|
+
declare global {
|
5
|
+
/**
|
6
|
+
* The Application responsible for configuring a single Tile document within a parent Scene.
|
7
|
+
* @typeParam Options - the type of the options object
|
8
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
9
|
+
*/
|
10
|
+
class TileConfig<
|
11
|
+
Options extends TileConfig.Options = TileConfig.Options,
|
12
|
+
Data extends object = TileConfig.Data<Options>
|
13
|
+
> extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'Tile'>>> {
|
14
|
+
/**
|
15
|
+
* @override
|
16
|
+
* @defaultValue
|
17
|
+
* ```typescript
|
18
|
+
* mergeObject(super.defaultOptions, {
|
19
|
+
* id: "tile-config",
|
20
|
+
* title: game.i18n.localize("TILE.ConfigTitle"),
|
21
|
+
* template: "templates/scene/tile-config.html",
|
22
|
+
* width: 420,
|
23
|
+
* height: "auto",
|
24
|
+
* submitOnChange: true,
|
25
|
+
* tabs: [{navSelector: ".tabs", contentSelector: "form", initial: "basic"}]
|
26
|
+
* });
|
27
|
+
* ```
|
28
|
+
*/
|
29
|
+
static get defaultOptions(): TileConfig.Options;
|
30
|
+
|
31
|
+
/** @override */
|
32
|
+
close(options: Application.CloseOptions): Promise<void>;
|
33
|
+
|
34
|
+
/** @override */
|
35
|
+
getData(options?: Partial<Options>): Data | Promise<Data>;
|
36
|
+
|
37
|
+
/** @override */
|
38
|
+
protected _onChangeInput(event: JQuery.ChangeEvent): void;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* @param event - (unused)
|
42
|
+
* @override
|
43
|
+
*/
|
44
|
+
protected _updateObject(
|
45
|
+
event: Event,
|
46
|
+
formData: TileConfig.FormData
|
47
|
+
): Promise<InstanceType<ConfiguredDocumentClassForName<'Tile'>> | undefined>;
|
48
|
+
}
|
49
|
+
|
50
|
+
namespace TileConfig {
|
51
|
+
interface Data<Options extends DocumentSheet.Options>
|
52
|
+
extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'Tile'>>, Options> {
|
53
|
+
submitText: string;
|
54
|
+
occlusionModes: Record<foundry.CONST.TileOcclusionModes, string>;
|
55
|
+
}
|
56
|
+
|
57
|
+
type FormData = Pick<TileDataConstructorData, 'height' | 'img' | 'rotation' | 'width' | 'x' | 'y'>;
|
58
|
+
|
59
|
+
interface Options extends DocumentSheet.Options {
|
60
|
+
/**
|
61
|
+
* Configure a preview version of a tile which is not yet saved
|
62
|
+
*/
|
63
|
+
preview?: boolean;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
@@ -1,112 +1,110 @@
|
|
1
|
-
|
2
|
-
* Configuration sheet for the Drawing object
|
3
|
-
* @typeParam P - the type of the options object
|
4
|
-
*/
|
5
|
-
declare class DrawingConfig<P extends DrawingConfig.Options = DrawingConfig.Options> extends FormApplication<
|
6
|
-
P,
|
7
|
-
DrawingConfig.Data,
|
8
|
-
Drawing
|
9
|
-
> {
|
10
|
-
/**
|
11
|
-
* @param drawing - The Drawing object being configured
|
12
|
-
* @param options - Additional application rendering options
|
13
|
-
*/
|
14
|
-
constructor(drawing: Drawing, options?: Partial<P>);
|
1
|
+
import type { ConfiguredDocumentClassForName } from '../../../../types/helperTypes';
|
15
2
|
|
3
|
+
declare global {
|
16
4
|
/**
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
* id: "drawing-config",
|
21
|
-
* classes: ["sheet"],
|
22
|
-
* template: "templates/scene/drawing-config.html",
|
23
|
-
* width: 480,
|
24
|
-
* height: 360,
|
25
|
-
* configureDefault: false,
|
26
|
-
* tabs: [{navSelector: ".tabs", contentSelector: "form", initial: "position"}]
|
27
|
-
* });
|
28
|
-
* ```
|
5
|
+
* The Application responsible for configuring a single Drawing document within a parent Scene.
|
6
|
+
* @typeParam Options - the type of the options object
|
7
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
29
8
|
*/
|
30
|
-
|
9
|
+
class DrawingConfig<
|
10
|
+
Options extends DrawingConfig.Options = DrawingConfig.Options,
|
11
|
+
Data extends object = DrawingConfig.Data<Options>
|
12
|
+
> extends FormApplication<Options, Data, InstanceType<ConfiguredDocumentClassForName<'Drawing'>>> {
|
13
|
+
/**
|
14
|
+
* @defaultValue
|
15
|
+
* ```typescript
|
16
|
+
* foundry.utils.mergeObject(super.defaultOptions, {
|
17
|
+
* id: "drawing-config",
|
18
|
+
* classes: ["sheet"],
|
19
|
+
* template: "templates/scene/drawing-config.html",
|
20
|
+
* width: 480,
|
21
|
+
* height: 360,
|
22
|
+
* configureDefault: false,
|
23
|
+
* tabs: [{ navSelector: ".tabs", contentSelector: "form", initial: "position" }],
|
24
|
+
* });
|
25
|
+
* ```
|
26
|
+
*/
|
27
|
+
static get defaultOptions(): DrawingConfig.Options;
|
31
28
|
|
32
|
-
|
33
|
-
|
29
|
+
/** @override */
|
30
|
+
get title(): string;
|
34
31
|
|
35
|
-
|
36
|
-
|
37
|
-
* @override
|
38
|
-
*/
|
39
|
-
getData(options?: Partial<P>): DrawingConfig.Data;
|
32
|
+
/** @override */
|
33
|
+
getData(options?: Partial<Options>): Data | Promise<Data>;
|
40
34
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
/**
|
47
|
-
* @param event - (unused)
|
48
|
-
* @override
|
49
|
-
*/
|
50
|
-
protected _updateObject<F extends DrawingConfig.FormData>(
|
51
|
-
event: Event,
|
52
|
-
formData: F
|
53
|
-
): Promise<this['options']['configureDefault'] extends true ? F : Drawing>;
|
35
|
+
/**
|
36
|
+
* Get the names and labels of fill type choices which can be applied
|
37
|
+
* @internal
|
38
|
+
*/
|
39
|
+
protected static _getFillTypes(): DrawingConfig.FillTypes;
|
54
40
|
|
55
|
-
|
56
|
-
|
41
|
+
/** @override */
|
42
|
+
protected _updateObject(
|
43
|
+
event: Event,
|
44
|
+
formData: DrawingConfig.FormData
|
45
|
+
): Promise<foundry.data.DrawingData['_source'] | ConfiguredDocumentClassForName<'Drawing'> | undefined>;
|
57
46
|
|
58
|
-
|
59
|
-
|
47
|
+
/** @override */
|
48
|
+
close(options?: FormApplication.CloseOptions): Promise<void>;
|
60
49
|
|
61
|
-
|
62
|
-
|
63
|
-
*/
|
64
|
-
protected _onResetDefaults(event: JQuery.ClickEvent): void;
|
65
|
-
}
|
50
|
+
/** @override */
|
51
|
+
activateListeners(html: JQuery): void;
|
66
52
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
fontFamilies: Record<typeof CONFIG['fontFamilies'][number], typeof CONFIG['fontFamilies'][number]>;
|
73
|
-
object: DrawingConfig['object']['data'];
|
74
|
-
options: DrawingConfig['options'];
|
75
|
-
submitText: string;
|
53
|
+
/**
|
54
|
+
* Reset the user Drawing configuration settings to their default values
|
55
|
+
* @param event - The originating mouse-click event
|
56
|
+
*/
|
57
|
+
protected _onResetDefaults(event: JQuery.ClickEvent): void;
|
76
58
|
}
|
77
59
|
|
78
|
-
|
79
|
-
|
80
|
-
|
60
|
+
namespace DrawingConfig {
|
61
|
+
interface Data<Options extends DrawingConfig.Options = DrawingConfig.Options> {
|
62
|
+
author: string;
|
63
|
+
isDefault: boolean;
|
64
|
+
fillTypes: DrawingConfig.FillTypes;
|
65
|
+
fontFamilies: Record<string, string>;
|
66
|
+
object: foundry.data.DrawingData['_source'];
|
67
|
+
options: Options;
|
68
|
+
submitText: string;
|
69
|
+
}
|
81
70
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
fillColor: foundry.data.DrawingData['_source']['fillColor'];
|
86
|
-
fillType: foundry.data.DrawingData['_source']['fillType'];
|
87
|
-
fontFamily: foundry.data.DrawingData['_source']['fontFamily'];
|
88
|
-
fontSize: foundry.data.DrawingData['_source']['fontSize'] | null;
|
89
|
-
height: foundry.data.DrawingData['_source']['height'] | null;
|
90
|
-
rotation: foundry.data.DrawingData['_source']['rotation'] | null;
|
91
|
-
strokeAlpha: foundry.data.DrawingData['_source']['strokeAlpha'];
|
92
|
-
strokeColor: foundry.data.DrawingData['_source']['strokeColor'];
|
93
|
-
strokeWidth: foundry.data.DrawingData['_source']['strokeWidth'] | null;
|
94
|
-
text: string;
|
95
|
-
textAlpha: foundry.data.DrawingData['_source']['textAlpha'];
|
96
|
-
textColor: foundry.data.DrawingData['_source']['textColor'];
|
97
|
-
texture: string;
|
98
|
-
width: foundry.data.DrawingData['_source']['width'] | null;
|
99
|
-
x: foundry.data.DrawingData['_source']['x'] | null;
|
100
|
-
y: foundry.data.DrawingData['_source']['y'] | null;
|
101
|
-
z: foundry.data.DrawingData['_source']['z'] | null;
|
102
|
-
}
|
71
|
+
type FillTypes = {
|
72
|
+
[Key in keyof typeof foundry.CONST['DRAWING_FILL_TYPES'] as typeof foundry.CONST['DRAWING_FILL_TYPES'][Key]]: `DRAWING.FillType${Titlecase<Key>}`;
|
73
|
+
};
|
103
74
|
|
104
|
-
|
105
|
-
|
75
|
+
interface FormData {
|
76
|
+
bezierFactor: number;
|
77
|
+
fillAlpha: number;
|
78
|
+
fillColor: string;
|
79
|
+
fillType: foundry.CONST.DrawingFillType;
|
80
|
+
fontFamily: string;
|
81
|
+
fontSize: number | null;
|
82
|
+
height: number | null;
|
83
|
+
rotation: number | null;
|
84
|
+
strokeAlpha: number;
|
85
|
+
strokeColor: string;
|
86
|
+
strokeWidth: number | null;
|
87
|
+
text: string;
|
88
|
+
textAlpha: number;
|
89
|
+
textColor: string;
|
90
|
+
texture: string;
|
91
|
+
width: number | null;
|
92
|
+
x: number | null;
|
93
|
+
y: number | null;
|
94
|
+
z: number | null;
|
95
|
+
}
|
106
96
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
97
|
+
interface Options extends FormApplication.Options {
|
98
|
+
/**
|
99
|
+
* Configure the default drawing settings, instead of a specific Drawing
|
100
|
+
* @defaultValue `false`
|
101
|
+
*/
|
102
|
+
configureDefault: boolean;
|
103
|
+
|
104
|
+
/**
|
105
|
+
* Configure a preview version of the Drawing which is not yet saved
|
106
|
+
*/
|
107
|
+
preview?: boolean;
|
108
|
+
}
|
111
109
|
}
|
112
110
|
}
|
@@ -1,154 +1,170 @@
|
|
1
|
-
|
2
|
-
// eslint-disable-next-line
|
3
|
-
// @ts-nocheck
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Entity Sheet Configuration Application
|
7
|
-
* @typeParam P - the type of the options object
|
8
|
-
* @typeParam E - the type of the Entity, this sheet is used to configure
|
9
|
-
*/
|
10
|
-
declare class EntitySheetConfig<
|
11
|
-
P extends FormApplication.Options = FormApplication.Options,
|
12
|
-
E extends Entity = Entity
|
13
|
-
> extends FormApplication<P, EntitySheetConfig.Data, E> {
|
14
|
-
/**
|
15
|
-
* @param entity - The Entity object for which the sheet is being configured
|
16
|
-
* @param options - Additional Application options
|
17
|
-
*/
|
18
|
-
constructor(entity: E, options?: Partial<P>);
|
19
|
-
|
20
|
-
/**
|
21
|
-
* @defaultValue
|
22
|
-
* ```typescript
|
23
|
-
* const options = super.defaultOptions;
|
24
|
-
* options.id = "sheet-config";
|
25
|
-
* options.template = "templates/sheets/sheet-config.html";
|
26
|
-
* options.width = 400;
|
27
|
-
* ```
|
28
|
-
*/
|
29
|
-
static get defaultOptions(): typeof FormApplication['defaultOptions'];
|
30
|
-
|
31
|
-
/**
|
32
|
-
* Add the Entity name into the window title
|
33
|
-
*/
|
34
|
-
get title(): string;
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Construct and return the data object used to render the HTML template for this form application.
|
38
|
-
* @param options - (unused)
|
39
|
-
*/
|
40
|
-
getData(options?: Partial<P>): EntitySheetConfig.Data<E>;
|
41
|
-
|
42
|
-
/**
|
43
|
-
* This method is called upon form submission after form data is validated
|
44
|
-
* @param event - The initial triggering submission event
|
45
|
-
* @param formData - The object of validated form data with which to update the object
|
46
|
-
*/
|
47
|
-
protected _updateObject(event: Event, formData: EntitySheetConfig.FormData): Promise<void>;
|
1
|
+
import type { DocumentConstructor } from '../../../../types/helperTypes';
|
48
2
|
|
3
|
+
declare global {
|
49
4
|
/**
|
50
|
-
*
|
51
|
-
*
|
52
|
-
*
|
53
|
-
*
|
5
|
+
* Entity Sheet Configuration Application
|
6
|
+
* @typeParam Options - The type of the options object
|
7
|
+
* @typeParam Data - The data structure used to render the handlebars template.
|
8
|
+
* @typeParam ConcreteDocument - The type of the Document which is being managed
|
54
9
|
*/
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
10
|
+
class EntitySheetConfig<
|
11
|
+
Options extends FormApplication.Options = FormApplication.Options,
|
12
|
+
Data extends object = EntitySheetConfig.Data<foundry.abstract.Document<any, any>, Options>,
|
13
|
+
ConcreteDocument extends foundry.abstract.Document<any, any> = Data extends EntitySheetConfig.Data<infer T>
|
14
|
+
? T
|
15
|
+
: foundry.abstract.Document<any, any>
|
16
|
+
> extends FormApplication<Options, Data, ConcreteDocument> {
|
17
|
+
/**
|
18
|
+
* @defaultValue
|
19
|
+
* ```typescript
|
20
|
+
* foundry.utils.mergeObject(super.defaultOptions, {
|
21
|
+
* id: "sheet-config",
|
22
|
+
* template: "templates/sheets/sheet-config.html",
|
23
|
+
* width: 400,
|
24
|
+
* })
|
25
|
+
* ```
|
26
|
+
*/
|
27
|
+
static get defaultOptions(): FormApplication.Options;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* An array of pending sheet assignments which are submitted before other elements of the framework are ready.
|
31
|
+
* @internal
|
32
|
+
*/
|
33
|
+
static _pending: Array<EntitySheetConfig.SheetAssignment>;
|
34
|
+
|
35
|
+
/** @override */
|
36
|
+
get title(): string;
|
37
|
+
|
38
|
+
/** @override */
|
39
|
+
getData(options?: Partial<Options>): Data | Promise<Data>;
|
40
|
+
|
41
|
+
/** @override */
|
42
|
+
protected _updateObject(event: Event, formData: EntitySheetConfig.FormData): Promise<void>;
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Initialize the configured Sheet preferences for Entities which support dynamic Sheet assignment
|
46
|
+
* Create the configuration structure for supported entities
|
47
|
+
* Process any pending sheet registrations
|
48
|
+
* Update the default values from settings data
|
49
|
+
*/
|
50
|
+
static initializeSheets(): void;
|
51
|
+
|
52
|
+
/**
|
53
|
+
* @internal
|
54
|
+
*/
|
55
|
+
protected static _getDocumentTypes(cls: DocumentConstructor, types?: string[]): string[];
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Register a sheet class as a candidate which can be used to display entities of a given type
|
59
|
+
* @param documentClass - The Document class for which to register a new Sheet option
|
60
|
+
* @param scope - Provide a unique namespace scope for this sheet
|
61
|
+
* @param sheetClass - A defined Application class used to render the sheet
|
62
|
+
* @param options - Additional options used for sheet registration
|
63
|
+
*/
|
64
|
+
static registerSheet(
|
65
|
+
documentClass: DocumentConstructor,
|
66
|
+
scope: string,
|
67
|
+
sheetClass: ConstructorOf<Application>,
|
68
|
+
{ label, types, makeDefault }?: EntitySheetConfig.RegisterSheetOptions
|
69
|
+
): void;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Perform the sheet registration
|
73
|
+
* @internal
|
74
|
+
*/
|
75
|
+
protected static _registerSheet({
|
76
|
+
documentClass,
|
77
|
+
id,
|
78
|
+
label,
|
79
|
+
sheetClass,
|
80
|
+
types,
|
81
|
+
makeDefault
|
82
|
+
}: Omit<EntitySheetConfig.SheetRegistration, 'action'>): void;
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Unregister a sheet class, removing it from the list of available Applications to use for a Document type
|
86
|
+
* @param documentClass - The Document class for which to register a new Sheet option
|
87
|
+
* @param scope - Provide a unique namespace scope for this sheet
|
88
|
+
* @param sheetClass - A defined Application class used to render the sheet
|
89
|
+
* @param types - An Array of types for which this sheet should be removed
|
90
|
+
*/
|
91
|
+
static unregisterSheet(
|
92
|
+
documentClass: DocumentConstructor,
|
93
|
+
scope: string,
|
94
|
+
sheetClass: ConstructorOf<Application>,
|
95
|
+
{ types }?: { types?: string[] }
|
96
|
+
): void;
|
97
|
+
|
98
|
+
/**
|
99
|
+
* Perform the sheet de-registration
|
100
|
+
* @internal
|
101
|
+
*/
|
102
|
+
protected static _unregisterSheet({
|
103
|
+
documentClass,
|
104
|
+
id,
|
105
|
+
types
|
106
|
+
}: Omit<EntitySheetConfig.SheetUnregistration, 'action'>): void;
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Update the currently default Sheets using a new core world setting
|
110
|
+
*/
|
111
|
+
static updateDefaultSheets(setting?: Record<'Actor' | 'Item', Record<string, string>>): void;
|
142
112
|
}
|
143
113
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
114
|
+
namespace EntitySheetConfig {
|
115
|
+
type SheetRegistration = {
|
116
|
+
action: 'register';
|
117
|
+
documentClass: DocumentConstructor;
|
118
|
+
id: string;
|
119
|
+
label: string;
|
120
|
+
sheetClass: ConstructorOf<Application>;
|
121
|
+
types: string[];
|
122
|
+
makeDefault: boolean;
|
123
|
+
};
|
124
|
+
|
125
|
+
type SheetUnregistration = {
|
126
|
+
action: 'unregister';
|
127
|
+
documentClass: DocumentConstructor;
|
128
|
+
id: string;
|
129
|
+
types: string[];
|
130
|
+
};
|
131
|
+
|
132
|
+
type SheetAssignment = SheetRegistration | SheetUnregistration;
|
133
|
+
|
134
|
+
/**
|
135
|
+
* @typeParam ConcreteDocument - The type of the Document which is being managed
|
136
|
+
* @typeParam Options - The type of the options object
|
137
|
+
*/
|
138
|
+
interface Data<
|
139
|
+
ConcreteDocument extends foundry.abstract.Document<any, any>,
|
140
|
+
Options extends FormApplication.Options = FormApplication.Options
|
141
|
+
> {
|
142
|
+
isGM: boolean;
|
143
|
+
object: foundry.utils.Duplicated<ConcreteDocument['data']>;
|
144
|
+
options: Options;
|
145
|
+
sheetClass: string;
|
146
|
+
sheetClasses: Record<string, string>;
|
147
|
+
defaultClass: string;
|
148
|
+
blankLabel: string;
|
149
|
+
}
|
150
|
+
|
151
|
+
interface FormData {
|
152
|
+
defaultClass: string;
|
153
|
+
sheetClass: string;
|
154
|
+
}
|
155
|
+
|
156
|
+
interface RegisterSheetOptions {
|
157
|
+
/** A human readable label for the sheet name, which will be localized */
|
158
|
+
label?: string;
|
159
|
+
|
160
|
+
/** An array of entity types for which this sheet should be used */
|
161
|
+
types?: string[];
|
162
|
+
|
163
|
+
/**
|
164
|
+
* Whether to make this sheet the default for provided types
|
165
|
+
* @defaultValue `false`
|
166
|
+
*/
|
167
|
+
makeDefault?: boolean;
|
168
|
+
}
|
151
169
|
}
|
152
|
-
|
153
|
-
type SheetClasses = Record<string, Record<string, SheetClass>>;
|
154
170
|
}
|
@@ -1,21 +1,15 @@
|
|
1
|
-
import './ambientSoundConfig';
|
2
1
|
import './avConfig';
|
3
2
|
import './combatTrackerConfig';
|
3
|
+
import './defaultTokenConfig';
|
4
4
|
import './documentSheet';
|
5
5
|
import './documentSheets';
|
6
6
|
import './drawingConfig';
|
7
7
|
import './entitySheetConfig';
|
8
|
-
import './folderConfig';
|
9
8
|
import './gridConfig';
|
10
9
|
import './imagePopout';
|
11
|
-
import './lightConfig';
|
12
|
-
import './measuredTemplateConfig';
|
13
10
|
import './moduleManagement';
|
14
|
-
import './noteConfig';
|
15
11
|
import './permissionConfig';
|
16
|
-
import './playlistSoundConfig';
|
17
12
|
import './settingsConfig';
|
18
|
-
import './tileConfig';
|
19
13
|
import './tokenConfig';
|
20
14
|
import './wallConfig';
|
21
15
|
import './worldConfig';
|