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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/index-lenient.d.ts +10 -0
  2. package/package.json +10 -1
  3. package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
  4. package/src/foundry/common/abstract/document.mjs.d.ts +6 -2
  5. package/src/foundry/common/types.mjs.d.ts +5 -0
  6. package/src/foundry/foundry.js/application.d.ts +2 -5
  7. package/src/foundry/foundry.js/applications/cameraViews.d.ts +36 -31
  8. package/src/foundry/foundry.js/applications/compendium.d.ts +5 -2
  9. package/src/foundry/foundry.js/applications/filePicker.d.ts +115 -115
  10. package/src/foundry/foundry.js/applications/formApplication.d.ts +1 -1
  11. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +20 -27
  12. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +66 -0
  13. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  14. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +5 -2
  15. package/src/foundry/foundry.js/applications/formApplications/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +2 -2
  16. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +3 -0
  17. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +60 -0
  18. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +72 -0
  19. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +190 -148
  20. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +133 -110
  21. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +93 -95
  22. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +163 -147
  23. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -3
  24. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +41 -23
  25. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +95 -86
  26. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +146 -158
  27. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +60 -70
  28. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +25 -17
  29. package/src/foundry/foundry.js/applications/hotbar.d.ts +5 -4
  30. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
  31. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
  32. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/itemDirectory.d.ts +7 -30
  33. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
  34. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
  35. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
  36. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +2 -4
  37. package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
  38. package/src/foundry/foundry.js/canvas.d.ts +2 -1
  39. package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
  40. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
  41. package/src/foundry/foundry.js/clientDocuments/index.d.ts +1 -0
  42. package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
  43. package/src/foundry/foundry.js/clientSettings.d.ts +14 -1
  44. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +44 -11
  45. package/src/foundry/foundry.js/config.d.ts +12 -4
  46. package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
  47. package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
  48. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
  49. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +5 -17
  50. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +1 -1
  51. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +4 -1
  52. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
  53. package/src/foundry/foundry.js/pointSource.d.ts +173 -85
  54. package/src/foundry/foundry.js/textEditor.d.ts +39 -8
  55. package/src/foundry/index.d.ts +1 -0
  56. package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
  57. package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
@@ -1,103 +1,112 @@
1
- /**
2
- * A game settings configuration application
3
- * This form renders the settings defined via the game.settings.register API which have config = true
4
- */
5
- declare class SettingsConfig extends FormApplication<FormApplication.Options, SettingsConfig.Data> {
6
- /**
7
- * @override
8
- * @defaultValue
9
- * ```typescript
10
- * mergeObject(super.defaultOptions, {
11
- * title: game.i18n.localize("SETTINGS.Title"),
12
- * id: "client-settings",
13
- * template: "templates/sidebar/apps/settings-config.html",
14
- * width: 600,
15
- * height: "auto",
16
- * tabs: [
17
- * {navSelector: ".tabs", contentSelector: ".content", initial: "core"}
18
- * ]
19
- * })
20
- * ```
21
- */
22
- static get defaultOptions(): typeof FormApplication['defaultOptions'];
1
+ import type { ConfiguredDocumentClass } from '../../../../types/helperTypes';
23
2
 
3
+ declare global {
24
4
  /**
25
- * @param options - (unused)
26
- * @override
5
+ * The Application responsible for displaying and editing a single Setting document.
6
+ * This form renders the settings defined via the game.settings.register API which have config = true
7
+ * @typeParam Options - The type of the options object
8
+ * @typeParam Data - The data structure used to render the handlebars template.
27
9
  */
28
- getData(options?: Partial<FormApplication.Options>): SettingsConfig.Data;
10
+ class SettingsConfig<
11
+ Options extends FormApplication.Options = FormApplication.Options,
12
+ Data extends object = SettingsConfig.Data
13
+ > extends FormApplication<Options, Data> {
14
+ /**
15
+ * @override
16
+ * @defaultValue
17
+ * ```typescript
18
+ * foundry.utils.mergeObject(super.defaultOptions, {
19
+ * title: game.i18n.localize("SETTINGS.Title"),
20
+ * id: "client-settings",
21
+ * template: "templates/sidebar/apps/settings-config.html",
22
+ * width: 600,
23
+ * height: "auto",
24
+ * tabs: [{ navSelector: ".tabs", contentSelector: ".content", initial: "core" }],
25
+ * })
26
+ * ```
27
+ */
28
+ static get defaultOptions(): typeof FormApplication['defaultOptions'];
29
29
 
30
- /** @override */
31
- activateListeners(html: JQuery): void;
30
+ /**
31
+ * @param options - (unused)
32
+ * @override
33
+ */
34
+ getData(options?: Partial<Options>): Data | Promise<Data>;
32
35
 
33
- /**
34
- * Handle activating the button to configure User Role permissions
35
- * @param event - The initial button click event
36
- */
37
- protected _onClickSubmenu(event: JQuery.ClickEvent): void;
36
+ /** @override */
37
+ activateListeners(html: JQuery): void;
38
38
 
39
- /**
40
- * Handle button click to reset default settings
41
- * @param event - The initial button click event
42
- */
43
- protected _onResetDefaults(event: JQuery.ClickEvent): void;
39
+ /**
40
+ * Handle activating the button to configure User Role permissions
41
+ * @param event - The initial button click event
42
+ * @internal
43
+ */
44
+ protected _onClickSubmenu(event: JQuery.ClickEvent): void;
44
45
 
45
- /**
46
- * @param event - (unused)
47
- * @override
48
- */
49
- protected _updateObject(event: Event, formData: SettingsConfig.FormData): Promise<void>;
50
- }
46
+ /**
47
+ * Handle button click to reset default settings
48
+ * @param event - The initial button click event
49
+ * @internal
50
+ */
51
+ protected _onResetDefaults(event: JQuery.ClickEvent): void;
51
52
 
52
- declare namespace SettingsConfig {
53
- interface Data {
54
- user: User;
55
- canConfigure: boolean;
56
- systemTitle: Game['system']['data']['title'];
57
- data: Data.Data;
53
+ /** @override */
54
+ protected _updateObject(event: Event, formData: SettingsConfig.FormData): Promise<void>;
58
55
  }
59
56
 
60
- namespace Data {
57
+ namespace SettingsConfig {
61
58
  interface Data {
62
- core: {
63
- version: Game['data']['version'];
64
- menus: ClientSettings.CompleteMenuSetting[];
65
- settings: Setting[];
66
- none: boolean;
67
- };
68
- system: {
69
- title: Game['system']['data']['title'];
70
- menus: ClientSettings.CompleteMenuSetting[];
71
- settings: Setting[];
72
- none: boolean;
73
- };
74
- modules: Record<string, { title: string; menus: ClientSettings.CompleteMenuSetting[]; settings: Setting[] }>;
59
+ user: StoredDocument<InstanceType<ConfiguredDocumentClass<typeof User>>>;
60
+ canConfigure: boolean;
61
+ systemTitle: Game['system']['data']['title'];
62
+ data: Data.Data;
75
63
  }
76
64
 
77
- interface Setting extends foundry.utils.Duplicated<ClientSettings.CompleteSetting> {
78
- name: string;
79
- hint: string;
80
- value: ReturnType<ClientSettings['get']>;
81
- type: string;
82
- isCheckbox: boolean;
83
- isSelect: boolean;
84
- isRange: boolean;
65
+ namespace Data {
66
+ interface Data {
67
+ core: {
68
+ version: string;
69
+ menus: ClientSettings.CompleteMenuSetting[];
70
+ settings: Setting[];
71
+ none: boolean;
72
+ };
73
+ system: {
74
+ title: Game['system']['data']['title'];
75
+ menus: ClientSettings.CompleteMenuSetting[];
76
+ settings: Setting[];
77
+ none: boolean;
78
+ };
79
+ modules: { title: string; menus: ClientSettings.CompleteMenuSetting[]; settings: Setting[] }[];
80
+ }
81
+
82
+ interface Setting extends Omit<ClientSettings.CompleteSetting, 'type'> {
83
+ id: string;
84
+ name: string;
85
+ hint: string;
86
+ value: unknown;
87
+ type: string;
88
+ isCheckbox: boolean;
89
+ isSelect: boolean;
90
+ isRange: boolean;
91
+ filePickerType: FilePicker.Type | undefined;
92
+ }
85
93
  }
86
- }
87
94
 
88
- interface FormData {
89
- 'core.animateRollTable': boolean;
90
- 'core.chatBubbles': boolean;
91
- 'core.chatBubblesPan': boolean;
92
- 'core.coneTemplateType': 'round' | 'flat';
93
- 'core.language': string;
94
- 'core.leftClickRelease': boolean;
95
- 'core.lightAnimation': boolean;
96
- 'core.maxFPS': number;
97
- 'core.mipmap': boolean;
98
- 'core.softShadows': boolean;
99
- 'core.tokenDragPreview': boolean;
100
- 'core.visionAnimation': boolean;
101
- [key: string]: unknown;
95
+ interface FormData {
96
+ 'core.animateRollTable': boolean;
97
+ 'core.chatBubbles': boolean;
98
+ 'core.chatBubblesPan': boolean;
99
+ 'core.coneTemplateType': 'round' | 'flat';
100
+ 'core.language': string;
101
+ 'core.leftClickRelease': boolean;
102
+ 'core.lightAnimation': boolean;
103
+ 'core.maxFPS': number;
104
+ 'core.mipmap': boolean;
105
+ 'core.noCanvas': boolean;
106
+ 'core.softShadows': boolean;
107
+ 'core.tokenDragPreview': boolean;
108
+ 'core.visionAnimation': boolean;
109
+ [key: string]: unknown;
110
+ }
102
111
  }
103
112
  }
@@ -1,175 +1,163 @@
1
- // TODO: Remove when updating this class!!!
2
- // eslint-disable-next-line
3
- // @ts-nocheck
4
-
5
- /**
6
- * A Token Configuration Application
7
- * @typeParam P - the type of the options object
8
- */
9
- declare class TokenConfig<P extends TokenConfig.Options = TokenConfig.Options> extends FormApplication<
10
- P,
11
- TokenConfig.Data,
12
- Token
13
- > {
14
- /**
15
- * @param token - The Token object for which settings are being configured
16
- * @param options - TokenConfig ui options (see Application)
17
- */
18
- constructor(token: Token, options?: Partial<P>);
19
-
20
- /**
21
- * @override
22
- * @defaultValue
23
- * ```typescript
24
- * mergeObject(super.defaultOptions, {
25
- * classes: ["sheet", "token-sheet"],
26
- * template: "templates/scene/token-config.html",
27
- * width: 480,
28
- * height: "auto",
29
- * tabs: [{navSelector: ".tabs", contentSelector: "form", initial: "character"}]
30
- * });
31
- * ```
32
- */
33
- static get defaultOptions(): TokenConfig.Options;
34
-
35
- /** @override */
36
- get id(): string;
37
-
38
- /**
39
- * Convenience access for the Token object
40
- */
41
- get token(): this['object'];
42
-
43
- /**
44
- * Convenience access for the Token's linked Actor, if any
45
- */
46
- get actor(): this['token']['actor'];
47
-
48
- /** @override */
49
- get title(): string;
50
-
51
- /**
52
- * @param options - (unused)
53
- * @override
54
- */
55
- getData(options?: Partial<P>): Promise<TokenConfig.Data>;
56
-
57
- /** @override */
58
- render(force?: boolean, options?: Application.RenderOptions<P>): Promise<void>;
59
-
60
- /**
61
- * Inspect the Actor data model and identify the set of attributes which could be used for a Token Bar
62
- */
63
- static getTrackedAttributeChoices(attributes: TokenConfig.Attributes): Partial<Record<string, string[]>>;
64
-
65
- /**
66
- * Test whether an individual data object is a valid attribute - containing both a "value" and "max" field
67
- * @param data - The data object to search
68
- * @param _path - The attribute path being recursed
69
- * (default: `[]`)
70
- * @returns An object containing both bar and value attribute paths
71
- */
72
- protected static getTrackedAttributes(data: object, _path: string[]): TokenConfig.Attributes;
1
+ import type { ConfiguredDocumentClassForName, ConstructorDataType } from '../../../../types/helperTypes';
73
2
 
3
+ declare global {
74
4
  /**
75
- * Get an Object of image paths and filenames to display in the Token sheet
5
+ * The Application responsible for configuring a single Token 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.
76
8
  */
77
- protected _getAlternateTokenImages(): Promise<Partial<Record<string, string>>>;
9
+ class TokenConfig<
10
+ Options extends FormApplication.Options = FormApplication.Options,
11
+ Data extends object = TokenConfig.Data<Options>
12
+ > extends FormApplication<
13
+ Options,
14
+ Data,
15
+ InstanceType<ConfiguredDocumentClassForName<'Token'>> | InstanceType<ConfiguredDocumentClassForName<'Actor'>>
16
+ > {
17
+ constructor(
18
+ object:
19
+ | InstanceType<ConfiguredDocumentClassForName<'Token'>>
20
+ | InstanceType<ConfiguredDocumentClassForName<'Actor'>>,
21
+ options?: Partial<Options>
22
+ );
23
+
24
+ token: InstanceType<ConfiguredDocumentClassForName<'Token'>> | PrototypeTokenDocument;
78
25
 
79
- /** @override */
80
- activateListeners(html: JQuery): void;
26
+ /**
27
+ * @override
28
+ * @defaultValue
29
+ * ```typescript
30
+ * foundry.utils.mergeObject(super.defaultOptions, {
31
+ * classes: ["sheet", "token-sheet"],
32
+ * template: "templates/scene/token-config.html",
33
+ * width: 480,
34
+ * height: "auto",
35
+ * tabs: [{ navSelector: ".tabs", contentSelector: "form", initial: "character" }],
36
+ * })
37
+ * ```
38
+ */
39
+ static get defaultOptions(): FormApplication.Options;
81
40
 
82
- /** @override */
83
- protected _getSubmitData(
84
- updateData?: TokenConfig.FormData
85
- ): ReturnType<FormApplication['_getSubmitData']> & { lightAlpha: number };
41
+ /** @override */
42
+ get id(): string;
86
43
 
87
- /** @override */
88
- protected _updateObject(event: Event, formData: TokenConfig.FormData): Promise<void>;
44
+ /**
45
+ * A convenience accessor to test whether we are configuring the prototype Token for an Actor.
46
+ */
47
+ get isPrototype(): boolean;
89
48
 
90
- /**
91
- * Update certain fields of a linked actor token when token configuration is changed
92
- * @param tokenData - The new token data
93
- */
94
- protected _updateActorData(tokenData: TokenConfig.FormData): ReturnType<Actor['update']> | void;
49
+ /**
50
+ * Convenience access to the Actor document that this Token represents
51
+ */
52
+ get actor(): InstanceType<ConfiguredDocumentClassForName<'Actor'>>;
95
53
 
96
- /**
97
- * Handle Token assignment requests to update the default prototype Token
98
- * @param event - The left-click event on the assign token button
99
- */
100
- protected _onAssignToken(event: JQuery.ClickEvent): Promise<void>;
54
+ /** @override */
55
+ get title(): string;
101
56
 
102
- /**
103
- * Handle changing the attribute bar in the drop-down selector to update the default current and max value
104
- */
105
- protected _onBarChange(ev: JQuery.ChangeEvent): Promise<void>;
106
- }
57
+ /** @override */
58
+ getData(options?: Partial<Options>): Data | Promise<Data>;
107
59
 
108
- declare namespace TokenConfig {
109
- interface Attributes {
110
- bar: string[][];
111
- value: string[][];
112
- }
60
+ /** @override */
61
+ render(force?: boolean, options?: Application.RenderOptions<Options>): Promise<this>;
113
62
 
114
- interface Data {
115
- cssClasses: 'prototype' | '';
116
- isPrototype: Options['configureDefault'];
117
- hasAlternates: boolean;
118
- alternateImages: TokenConfig['_getAlternateTokenImages'] | [];
119
- object: foundry.utils.Duplicated<TokenConfig['token']['data']>;
120
- options: TokenConfig['options'];
121
- gridUnits: Scene['data']['gridUnits'] | Game['system']['gridUnits'];
122
- barAttributes: ReturnType<typeof TokenConfig['getTrackedAttributeChoices']>;
123
- bar1: ReturnType<TokenConfig['object']['getBarAttribute']>;
124
- bar2: ReturnType<TokenConfig['object']['getBarAttribute']>;
125
- displayModes: Record<foundry.CONST.TokenDisplayMode, string>;
126
- actors: Array<Pick<Actor, '_id' | 'name'>>;
127
- dispositions: Record<foundry.CONST.TokenDisposition, string>;
128
- lightAnimations: { [Key in keyof typeof CONFIG['Canvas']['lightAnimations']]: string } & { '': 'None' };
129
- lightAlpha: number;
130
- isGM: User['isGM'];
131
- }
63
+ /**
64
+ * Get an Object of image paths and filenames to display in the Token sheet
65
+ * @internal
66
+ */
67
+ protected _getAlternateTokenImages(): Promise<Record<string, string>>;
68
+
69
+ /** @override */
70
+ activateListeners(html: JQuery): void;
71
+
72
+ /** @override */
73
+ protected _getSubmitData(
74
+ updateData?: ConstructorDataType<foundry.data.TokenData>
75
+ ): Record<string, unknown> & { lightAlpha: number };
76
+
77
+ /** @override */
78
+ protected _updateObject(
79
+ event: Event,
80
+ formData: TokenConfig.FormData
81
+ ): Promise<
82
+ | InstanceType<ConfiguredDocumentClassForName<'Token'>>
83
+ | InstanceType<ConfiguredDocumentClassForName<'Actor'>>
84
+ | undefined
85
+ >;
132
86
 
133
- interface FormData {
134
- actorId: Token.Data['actorId'];
135
- actorLink: Token.Data['actorLink'];
136
- alternateImages?: string;
137
- 'bar1.attribute': Token.Data['bar1']['attribute'];
138
- 'bar2.attribute': Token.Data['bar2']['attribute'];
139
- brightLight: Token.Data['brightLight'] | null;
140
- brightSight: Token.Data['brightSight'] | null;
141
- dimLight: Token.Data['dimLight'] | null;
142
- dimSight: Token.Data['dimSight'] | null;
143
- displayBars: Token.Data['displayBars'];
144
- displayName: Token.Data['displayName'];
145
- disposition: Token.Data['disposition'];
146
- elevation: Token.Data['elevation'] | null;
147
- height: Token.Data['height'] | null;
148
- img: Token.Data['img'];
149
- lightAlpha: Token.Data['lightAlpha'];
150
- lightAngle: Token.Data['lightAngle'] | null;
151
- 'lightAnimation.intensity': Token.Data['lightAnimation']['intensity'];
152
- 'lightAnimation.speed': Token.Data['lightAnimation']['speed'];
153
- 'lightAnimation.type': Token.Data['lightAnimation']['type'];
154
- lightColor: Token.Data['lightColor'];
155
- lockRotation: Token.Data['lockRotation'];
156
- mirrorX: Token.Data['mirrorX'];
157
- mirrorY: Token.Data['mirrorY'];
158
- name: Token.Data['name'];
159
- rotation: Token.Data['rotation'] | null;
160
- scale: Token.Data['scale'];
161
- sightAngle: Token.Data['sightAngle'] | null;
162
- tint: Token.Data['tint'];
163
- vision: Token.Data['vision'];
164
- width: Token.Data['width'] | null;
165
- x: Token.Data['x'] | null;
166
- y: Token.Data['y'] | null;
167
- }
87
+ /**
88
+ * Handle Token assignment requests to update the default prototype Token
89
+ * @param event - The left-click event on the assign token button
90
+ * @internal
91
+ */
92
+ protected _onAssignToken(event: JQuery.ClickEvent): void;
168
93
 
169
- interface Options extends FormApplication.Options {
170
94
  /**
171
- * Configure the default actor token on submit
95
+ * Handle changing the attribute bar in the drop-down selector to update the default current and max value
96
+ * @internal
172
97
  */
173
- configureDefault?: boolean;
98
+ protected _onBarChange(ev: JQuery.ChangeEvent): void;
99
+ }
100
+
101
+ namespace TokenConfig {
102
+ interface Attributes {
103
+ bar: string[][];
104
+ value: string[][];
105
+ }
106
+
107
+ interface Data<Options extends FormApplication.Options = FormApplication.Options> {
108
+ cssClasses: string;
109
+ isPrototype: boolean;
110
+ hasAlternates: boolean;
111
+ alternateImages: Record<string, string> | [];
112
+ object: foundry.data.PrototypeTokenData | foundry.data.TokenData;
113
+ options: Options;
114
+ gridUnits: string | undefined;
115
+ barAttributes: Record<string, string[]>;
116
+ bar1: ReturnType<TokenDocument['getBarAttribute']>;
117
+ bar2: ReturnType<TokenDocument['getBarAttribute']>;
118
+ displayModes: Record<foundry.CONST.TokenDisplayMode, string>;
119
+ actors: { _id: string; name: string }[];
120
+ dispositions: Record<foundry.CONST.TokenDisposition, string>;
121
+ lightAnimations: { [Key in keyof typeof CONFIG.Canvas.lightAnimations]: string } & { '': string };
122
+ lightAlpha: number;
123
+ isGM: boolean;
124
+ }
125
+
126
+ interface FormData {
127
+ actorId: string;
128
+ actorLink: boolean;
129
+ alternateImages?: string;
130
+ alpha: number;
131
+ 'bar1.attribute': string;
132
+ 'bar2.attribute': string;
133
+ brightLight: number | null;
134
+ brightSight: number | null;
135
+ dimLight: number | null;
136
+ dimSight: number | null;
137
+ displayBars: foundry.CONST.TokenDisplayMode;
138
+ displayName: foundry.CONST.TokenDisplayMode;
139
+ disposition: foundry.CONST.TokenDisposition;
140
+ elevation: number | null;
141
+ height: number | null;
142
+ img: string;
143
+ lightAlpha: number;
144
+ lightAngle: number | null;
145
+ 'lightAnimation.intensity': number;
146
+ 'lightAnimation.speed': number;
147
+ 'lightAnimation.type': string;
148
+ lightColor: string;
149
+ lockRotation: boolean;
150
+ mirrorX: boolean;
151
+ mirrorY: boolean;
152
+ name: StringTerm;
153
+ rotation: number | null;
154
+ scale: number;
155
+ sightAngle: number | null;
156
+ tint: string;
157
+ vision: boolean;
158
+ width: number | null;
159
+ x: number | null;
160
+ y: number | null;
161
+ }
174
162
  }
175
163
  }
@@ -1,82 +1,72 @@
1
- /**
2
- * Wall Configuration Sheet
3
- */
4
- declare class WallConfig<P extends WallConfig.Options = WallConfig.Options> extends FormApplication<
5
- P,
6
- WallConfig.Data,
7
- Wall
8
- > {
9
- /**
10
- * @param object - The Wall object for which settings are being configured
11
- * @param options - Additional options which configure the rendering of the configuration sheet.
12
- */
13
- constructor(object: Wall, options?: Partial<P>);
1
+ import type { ConfiguredDocumentClassForName } from '../../../../types/helperTypes';
14
2
 
3
+ declare global {
15
4
  /**
16
- * @defaultValue
17
- * ```typescript
18
- * const options = super.defaultOptions;
19
- * options.id = "wall-config";
20
- * options.title = "Wall Configuration";
21
- * options.template = "templates/scene/wall-config.html";
22
- * options.width = 400;
23
- * options.editTargets = [];
24
- * ```
5
+ * The Application responsible for configuring a single Wall 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.
25
8
  */
26
- static get defaultOptions(): WallConfig.Options;
9
+ class WallConfig<
10
+ Options extends FormApplication.Options = FormApplication.Options,
11
+ Data extends object = WallConfig.Data<Options>
12
+ > extends FormApplication<Options, Data, InstanceType<ConfiguredDocumentClassForName<'Wall'>>> {
13
+ /**
14
+ * @defaultValue
15
+ * ```typescript
16
+ * const options = super.defaultOptions;
17
+ * options.id = "wall-config";
18
+ * options.title = "Wall Configuration";
19
+ * options.template = "templates/scene/wall-config.html";
20
+ * options.width = 400;
21
+ * ```
22
+ */
23
+ static get defaultOptions(): FormApplication.Options;
27
24
 
28
- /**
29
- * Provide a dynamically rendered title for the Wall Configuration sheet
30
- */
31
- get title(): string;
25
+ /** @override */
26
+ get title(): string;
32
27
 
33
- /**
34
- * Construct and return the data object used to render the HTML template for this form application.
35
- */
36
- getData(): WallConfig.Data;
28
+ /** @override */
29
+ render(force?: boolean, options?: Application.RenderOptions<Options>): this;
37
30
 
38
- /**
39
- * This method is called upon form submission after form data is validated
40
- * @param event - The initial triggering submission event
41
- * @param formData - The object of validated form data with which to update the object
42
- */
43
- protected _updateObject(event: Event, formData: WallConfig.FormData): Promise<Wall>;
44
- }
31
+ /** @override */
32
+ getData(): Data | Promise<Data>;
45
33
 
46
- declare namespace WallConfig {
47
- interface Data {
48
- object: foundry.utils.Duplicated<WallConfig['object']['data']>;
49
- options: WallConfig['options'];
50
- moveTypes: {
51
- [Key in keyof typeof foundry.CONST['WALL_MOVEMENT_TYPES'] as typeof foundry.CONST['WALL_MOVEMENT_TYPES'][Key]]: Titlecase<Key>;
52
- };
53
- senseTypes: {
54
- [Key in keyof typeof foundry.CONST['WALL_SENSE_TYPES'] as typeof foundry.CONST['WALL_SENSE_TYPES'][Key]]: Titlecase<Key>;
55
- };
56
- dirTypes: {
57
- [Key in keyof typeof foundry.CONST['WALL_DIRECTIONS'] as typeof foundry.CONST['WALL_DIRECTIONS'][Key]]: Titlecase<Key>;
58
- };
59
- doorTypes: {
60
- [Key in keyof typeof foundry.CONST['WALL_DOOR_TYPES'] as typeof foundry.CONST['WALL_DOOR_TYPES'][Key]]: Titlecase<Key>;
61
- };
62
- doorStates: {
63
- [Key in keyof typeof foundry.CONST['WALL_DOOR_STATES'] as typeof foundry.CONST['WALL_DOOR_STATES'][Key]]: Titlecase<Key>;
64
- };
65
- isDoor: boolean;
34
+ /** @override */
35
+ protected _updateObject(
36
+ event: Event,
37
+ formData: WallConfig.FormData
38
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'Wall'>> | undefined>;
66
39
  }
67
40
 
68
- interface FormData {
69
- dir: foundry.CONST.WallDirection;
70
- door: Wall['data']['door'];
71
- ds?: Wall['data']['ds'];
72
- move: Wall['data']['move'];
73
- sense: Wall['data']['sense'];
74
- }
41
+ namespace WallConfig {
42
+ interface Data<Options extends FormApplication.Options = FormApplication.Options> {
43
+ object: foundry.data.WallData['_source'];
44
+ options: Options;
45
+ moveTypes: {
46
+ [Key in keyof typeof foundry.CONST.WALL_MOVEMENT_TYPES as typeof foundry.CONST.WALL_MOVEMENT_TYPES[Key]]: Titlecase<Key>;
47
+ };
48
+ senseTypes: {
49
+ [Key in keyof typeof foundry.CONST.WALL_SENSE_TYPES as typeof foundry.CONST.WALL_SENSE_TYPES[Key]]: Titlecase<Key>;
50
+ };
51
+ dirTypes: {
52
+ [Key in keyof typeof foundry.CONST.WALL_DIRECTIONS as typeof foundry.CONST.WALL_DIRECTIONS[Key]]: Titlecase<Key>;
53
+ };
54
+ doorTypes: {
55
+ [Key in keyof typeof foundry.CONST.WALL_DOOR_TYPES as typeof foundry.CONST.WALL_DOOR_TYPES[Key]]: Titlecase<Key>;
56
+ };
57
+ doorStates: {
58
+ [Key in keyof typeof foundry.CONST.WALL_DOOR_STATES as typeof foundry.CONST.WALL_DOOR_STATES[Key]]: Titlecase<Key>;
59
+ };
60
+ isDoor: boolean;
61
+ }
75
62
 
76
- interface Options extends FormApplication.Options {
77
- /**
78
- * @defaultValue `[]`
79
- */
80
- editTargets: string[];
63
+ interface FormData {
64
+ dir: foundry.CONST.WallDirection;
65
+ door: foundry.CONST.WallDoorType;
66
+ ds?: foundry.CONST.WallDoorState;
67
+ move: foundry.CONST.WallMovementType;
68
+ sense: foundry.CONST.WallSenseType;
69
+ sound: foundry.CONST.WallSenseType;
70
+ }
81
71
  }
82
72
  }