@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,129 +1,152 @@
1
- // TODO: Remove when updating this class!!!
2
- // eslint-disable-next-line
3
- // @ts-nocheck
1
+ import type { ConfiguredDocumentClassForName, DocumentConstructor } from '../../../../../types/helperTypes';
4
2
 
5
- /**
6
- * A Scene configuration sheet
7
- * @see {@link Scene} The Scene Entity which is being configured
8
- */
9
- declare class SceneConfig extends DocumentSheet<DocumentSheet.Options, SceneConfig.Data, Scene> {
3
+ declare global {
10
4
  /**
11
- * @override
12
- * @defaultValue
13
- * ```typescript
14
- * mergeObject(super.defaultOptions, {
15
- * classes: ["sheet", "scene-sheet"],
16
- * template: "templates/scene/config.html",
17
- * width: 680,
18
- * height: "auto"
19
- * });
20
- * ```
5
+ * The Application responsible for configuring a single Scene document.
6
+ * @see {@link Scene} The Scene Document which is being configured
7
+ *
8
+ * @typeParam Options - the type of the options object
9
+ * @typeParam Data - The data structure used to render the handlebars template.
21
10
  */
22
- static get defaultOptions(): typeof DocumentSheet['defaultOptions'];
11
+ class SceneConfig<
12
+ Options extends DocumentSheet.Options = DocumentSheet.Options,
13
+ Data extends object = SceneConfig.Data<Options>
14
+ > extends DocumentSheet<Options, Data, InstanceType<ConfiguredDocumentClassForName<'Scene'>>> {
15
+ /**
16
+ * @override
17
+ * @defaultValue
18
+ * ```typescript
19
+ * foundry.utils.mergeObject(super.defaultOptions, {
20
+ * id: "scene-config",
21
+ * classes: ["sheet", "scene-sheet"],
22
+ * template: "templates/scene/config.html",
23
+ * width: 680,
24
+ * height: "auto",
25
+ * });
26
+ * ```
27
+ */
28
+ static get defaultOptions(): DocumentSheet.Options;
23
29
 
24
- /**
25
- * @override
26
- */
27
- get id(): string;
30
+ /**
31
+ * @override
32
+ */
33
+ get title(): string;
28
34
 
29
- /**
30
- * @override
31
- */
32
- get title(): string;
35
+ /**
36
+ * @override
37
+ * @remarks This incorrectly overrides `Application#render` by potentially returning `void`, see https://gitlab.com/foundrynet/foundryvtt/-/issues/6026.
38
+ */
39
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
40
+ // @ts-expect-error
41
+ render(force?: boolean, options?: Application.RenderOptions<Options>): this | void;
33
42
 
34
- /**
35
- * @param options - (unused)
36
- * @override
37
- */
38
- getData(options?: Partial<DocumentSheet.Options>): SceneConfig.Data;
43
+ /**
44
+ * @param options - (unused)
45
+ * @override
46
+ */
47
+ getData(options?: Partial<DocumentSheet.Options>): Data | Promise<Data>;
39
48
 
40
- /**
41
- * Get an enumeration of the available grid types which can be applied to this Scene
42
- */
43
- protected static _getGridTypes(): Record<foundry.CONST.GridType, string>;
49
+ /**
50
+ * Get an enumeration of the available grid types which can be applied to this Scene
51
+ * @internal
52
+ */
53
+ protected static _getGridTypes(): Record<foundry.CONST.GridType, string>;
44
54
 
45
- /**
46
- * Get the available weather effect types which can be applied to this Scene
47
- */
48
- protected _getWeatherTypes(): Record<string, string>;
55
+ /**
56
+ * Get the available weather effect types which can be applied to this Scene
57
+ * @internal
58
+ */
59
+ protected _getWeatherTypes(): Record<string, string>;
49
60
 
50
- /**
51
- * Get the alphabetized entities which can be chosen as a configuration for the scene
52
- */
53
- protected _getEntities(collection: EntityCollection): { _id: string; name: string }[];
61
+ /**
62
+ * Get the alphabetized Documents which can be chosen as a configuration for the Scene
63
+ * @internal
64
+ */
65
+ protected _getDocuments(collection: WorldCollection<DocumentConstructor, string>): { _id: string; name: string }[];
54
66
 
55
- /**
56
- * @override
57
- */
58
- activateListeners(html: JQuery): void;
67
+ /** @override */
68
+ activateListeners(html: JQuery): void;
59
69
 
60
- /**
61
- * Capture the current Scene position and zoom level as the initial view in the Scene config
62
- * @param event - The originating click event
63
- */
64
- protected _onCapturePosition(event: JQuery.ClickEvent): void;
70
+ /**
71
+ * Capture the current Scene position and zoom level as the initial view in the Scene config
72
+ * @param event - The originating click event
73
+ * @internal
74
+ */
75
+ protected _onCapturePosition(event: JQuery.ClickEvent): void;
65
76
 
66
- /**
67
- * @override
68
- */
69
- protected _onChangeRange(event: JQuery.ChangeEvent): void;
77
+ /** @override */
78
+ protected _onChangeRange(event: JQuery.ChangeEvent): void;
70
79
 
71
- /**
72
- * Handle click events to open the grid configuration application
73
- * @param event - The originating click event
74
- */
75
- protected _onGridConfig(event: JQuery.ClickEvent): SceneConfig['minimize'];
80
+ /**
81
+ * Handle updating the select menu of PlaylistSound options when the Playlist is changed
82
+ * @param event - The initiating select change event
83
+ * @internal
84
+ */
85
+ _onChangePlaylist(event: JQuery.ChangeEvent): void;
76
86
 
77
- /**
78
- * @override
79
- */
80
- protected _updateObject(event: Event, formData: SceneConfig.FormData): Promise<Scene>;
81
- }
87
+ /**
88
+ * Handle click events to open the grid configuration application
89
+ * @param event - The originating click event
90
+ */
91
+ protected _onGridConfig(event: JQuery.ClickEvent): void;
92
+
93
+ /**
94
+ * @override
95
+ */
96
+ protected _updateObject(
97
+ event: Event,
98
+ formData: SceneConfig.FormData
99
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'Scene'>> | undefined>;
100
+ }
101
+
102
+ namespace SceneConfig {
103
+ interface Data<Options extends DocumentSheet.Options = DocumentSheet.Options>
104
+ extends DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'Scene'>>, Options> {
105
+ gridTypes: ReturnType<typeof SceneConfig['_getGridTypes']>;
106
+ weatherTypes: ReturnType<SceneConfig['_getWeatherTypes']>;
107
+ playlists: ReturnType<SceneConfig['_getDocuments']>;
108
+ sounds: ReturnType<SceneConfig['_getDocuments']>;
109
+ journals: ReturnType<SceneConfig['_getDocuments']>;
110
+ hasGlobalThreshold: boolean;
111
+ data: DocumentSheet.Data<InstanceType<ConfiguredDocumentClassForName<'Scene'>>, Options>['data'] & {
112
+ /**
113
+ * @defaultValue `0`
114
+ */
115
+ globalLightThreshold: number;
116
+ };
117
+ }
82
118
 
83
- declare namespace SceneConfig {
84
- interface Data extends DocumentSheet.Data {
85
- gridTypes: ReturnType<typeof SceneConfig['_getGridTypes']>;
86
- weatherTypes: ReturnType<SceneConfig['_getWeatherTypes']>;
87
- playlists: ReturnType<SceneConfig['_getEntities']>;
88
- journals: ReturnType<SceneConfig['_getEntities']>;
89
- hasGlobalThreshold: boolean;
90
- document: DocumentSheet.Data['document'] & {
91
- /**
92
- * @defaultValue `0`
93
- */
119
+ type FormData = {
120
+ backgroundColor: string;
121
+ darkness: number;
122
+ fogExploration: boolean;
123
+ foreground: string;
124
+ globalLight: boolean;
94
125
  globalLightThreshold: number;
126
+ grid: number | null;
127
+ gridAlpha: number;
128
+ gridColor: string;
129
+ gridDistance: number | null;
130
+ gridType: foundry.CONST.GridType;
131
+ gridUnits: string;
132
+ hasGlobalThreshold: boolean;
133
+ height: number | null;
134
+ img: string;
135
+ 'initial.scale': number | null;
136
+ 'initial.x': number | null;
137
+ 'initial.y': number | null;
138
+ journal: string;
139
+ name: string;
140
+ navName: string;
141
+ navigation: boolean;
142
+ padding: number;
143
+ 'permission.default': foundry.CONST.EntityPermission;
144
+ playlist: string;
145
+ shiftX: number | null;
146
+ shiftY: number | null;
147
+ tokenVision: boolean;
148
+ weather: string;
149
+ width: number | null;
95
150
  };
96
151
  }
97
-
98
- type FormData = {
99
- backgroundColor: Scene.Data['backgroundColor'];
100
- darkness: Scene.Data['darkness'];
101
- fogExploration: Scene.Data['fogExploration'];
102
- globalLight: Scene.Data['globalLight'];
103
- globalLightThreshold: Scene.Data['globalLightThreshold'];
104
- grid: GridConfig.FormData['grid'];
105
- gridAlpha: Scene.Data['gridAlpha'];
106
- gridColor: Scene.Data['gridColor'];
107
- gridDistance: Scene.Data['gridDistance'] | null;
108
- gridType: foundry.CONST.GridType;
109
- gridUnits: Scene.Data['gridUnits'];
110
- hasGlobalThreshold: boolean;
111
- height: Scene.Data['height'] | null;
112
- img: Scene.Data['img'];
113
- 'initial.scale': number | null;
114
- 'initial.x': number | null;
115
- 'initial.y': number | null;
116
- journal: Scene.Data['journal'];
117
- name: string;
118
- navName: Scene.Data['navName'];
119
- navigation: Scene.Data['navigation'];
120
- padding: Scene.Data['padding'];
121
- 'permission.default': Scene.Data['permission'];
122
- playlist: Scene.Data['playlist'];
123
- shiftX: GridConfig.FormData['shiftX'];
124
- shiftY: GridConfig.FormData['shiftY'];
125
- tokenVision: Scene.Data['tokenVision'];
126
- weather: Scene.Data['weather'];
127
- width: Scene.Data['width'] | null;
128
- };
129
152
  }
@@ -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
- * @defaultValue
18
- * ```typescript
19
- * mergeObject(super.defaultOptions, {
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
- static get defaultOptions(): DrawingConfig.Options;
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
- /** @override */
33
- get title(): string;
29
+ /** @override */
30
+ get title(): string;
34
31
 
35
- /**
36
- * @param options - (unused)
37
- * @override
38
- */
39
- getData(options?: Partial<P>): DrawingConfig.Data;
32
+ /** @override */
33
+ getData(options?: Partial<Options>): Data | Promise<Data>;
40
34
 
41
- /**
42
- * Get the names and labels of fill type choices which can be applied
43
- */
44
- protected static _getFillTypes(): DrawingConfig.FillTypes;
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
- /** @override */
56
- close(options?: FormApplication.CloseOptions): Promise<void>;
41
+ /** @override */
42
+ protected _updateObject(
43
+ event: Event,
44
+ formData: DrawingConfig.FormData
45
+ ): Promise<foundry.data.DrawingData['_source'] | ConfiguredDocumentClassForName<'Drawing'> | undefined>;
57
46
 
58
- /** @override */
59
- activateListeners(html: JQuery): void;
47
+ /** @override */
48
+ close(options?: FormApplication.CloseOptions): Promise<void>;
60
49
 
61
- /**
62
- * Reset the user Drawing configuration settings to their default values
63
- */
64
- protected _onResetDefaults(event: JQuery.ClickEvent): void;
65
- }
50
+ /** @override */
51
+ activateListeners(html: JQuery): void;
66
52
 
67
- declare namespace DrawingConfig {
68
- interface Data {
69
- author: string;
70
- isDefault: Options['configureDefault'];
71
- fillTypes: ReturnType<typeof DrawingConfig['_getFillTypes']>;
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
- type FillTypes = {
79
- [Key in keyof typeof foundry.CONST['DRAWING_FILL_TYPES'] as typeof foundry.CONST['DRAWING_FILL_TYPES'][Key]]: `DRAWING.FillType${Titlecase<Key>}`;
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
- interface FormData {
83
- bezierFactor: foundry.data.DrawingData['_source']['bezierFactor'];
84
- fillAlpha: foundry.data.DrawingData['_source']['fillAlpha'];
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
- interface Options extends FormApplication.Options {
105
- configureDefault: boolean;
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
- * Configure a preview version of the Drawing which is not yet saved
109
- */
110
- preview?: boolean;
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
  }