@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.
- 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/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 +115 -115
- package/src/foundry/foundry.js/applications/formApplication.d.ts +1 -1
- 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/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/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +3 -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/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/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 -3
- 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/hotbar.d.ts +5 -4
- 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/sceneDirectory.d.ts +6 -23
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +2 -4
- 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/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/index.d.ts +1 -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 -11
- package/src/foundry/foundry.js/config.d.ts +12 -4
- 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/canvasLayers/placeablesLayer.d.ts +5 -17
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +4 -1
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
- 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 +1 -0
- package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
- package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
@@ -0,0 +1,210 @@
|
|
1
|
+
import type { ConfiguredDocumentClassForName } from '../../types/helperTypes';
|
2
|
+
import type { Request } from '../common/abstract/backend.mjs';
|
3
|
+
import type Document from '../common/abstract/document.mjs';
|
4
|
+
|
5
|
+
declare global {
|
6
|
+
/**
|
7
|
+
* The client-side database backend implementation which handles Document modification operations.
|
8
|
+
*/
|
9
|
+
class ClientDatabaseBackend extends foundry.abstract.DatabaseBackend {
|
10
|
+
/**
|
11
|
+
* Activate the Socket event listeners used to receive responses from events which modify database documents
|
12
|
+
* @param socket - The active game socket
|
13
|
+
*/
|
14
|
+
activateSocketListeners(socket: io.Socket): void;
|
15
|
+
|
16
|
+
/** @override */
|
17
|
+
protected _getDocuments<T extends Document<any, any>>(
|
18
|
+
documentClass: ConstructorOf<T>,
|
19
|
+
request: Request,
|
20
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>
|
21
|
+
): Promise<T[]>;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @override
|
25
|
+
* @remarks
|
26
|
+
* Get operations for embedded Documents are currently un-supported.
|
27
|
+
* The returned promise always rejects.
|
28
|
+
*/
|
29
|
+
protected _getEmbeddedDocuments<T extends Document<any, any>>(
|
30
|
+
documentClass: ConstructorOf<T>,
|
31
|
+
parent: T extends Document<any, infer U> ? U : never,
|
32
|
+
request: Request,
|
33
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>
|
34
|
+
): Promise<never>;
|
35
|
+
|
36
|
+
/** @override */
|
37
|
+
protected _createDocuments<T extends Document<any, any>>(
|
38
|
+
documentClass: ConstructorOf<T>,
|
39
|
+
request: Request,
|
40
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>
|
41
|
+
): Promise<T[]>;
|
42
|
+
|
43
|
+
/** @override */
|
44
|
+
protected _createEmbeddedDocuments<T extends Document<any, any>>(
|
45
|
+
documentClass: ConstructorOf<T>,
|
46
|
+
parent: T extends Document<any, infer U> ? U : never,
|
47
|
+
request: Request,
|
48
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>
|
49
|
+
): Promise<T[]>;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Perform a standardized pre-creation workflow for all Document types. For internal use only.
|
53
|
+
* @internal
|
54
|
+
*/
|
55
|
+
protected _preCreateDocumentArray<T extends Document<any, any>>(
|
56
|
+
documentClass: ConstructorOf<T>,
|
57
|
+
{
|
58
|
+
data,
|
59
|
+
options,
|
60
|
+
pack,
|
61
|
+
parent,
|
62
|
+
user
|
63
|
+
}: Pick<Request, 'data' | 'pack' | 'parent' | 'options'> & {
|
64
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>;
|
65
|
+
}
|
66
|
+
): Promise<T[]>;
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Handle a SocketResponse from the server when one or multiple documents were created
|
70
|
+
* @param response - The provided Socket response
|
71
|
+
* @returns An Array of created Document instances
|
72
|
+
*/
|
73
|
+
protected _handleCreateDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Handle a SocketResponse from the server when one or multiple documents were created
|
77
|
+
* @param response - The provided Socket response
|
78
|
+
* @returns An Array of created Document instances
|
79
|
+
*/
|
80
|
+
protected _handleCreateEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Perform a standardized post-creation workflow for all Document types. For internal use only.
|
84
|
+
* @returns An array of callback operations to perform once every Document is created
|
85
|
+
* @internal
|
86
|
+
*/
|
87
|
+
protected _postCreateDocumentCallbacks(
|
88
|
+
type: string,
|
89
|
+
collection: Collection<foundry.abstract.Document<any, any>>,
|
90
|
+
result: object[],
|
91
|
+
{ options, userId, parent, pack }: Pick<Request, 'options' | 'parent' | 'pack'> & { userId?: string }
|
92
|
+
): (() => void)[];
|
93
|
+
|
94
|
+
/** @override */
|
95
|
+
protected _updateDocuments<T extends Document<any, any>>(
|
96
|
+
documentClass: ConstructorOf<T>,
|
97
|
+
request: Request,
|
98
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>
|
99
|
+
): Promise<T[]>;
|
100
|
+
|
101
|
+
/** @override */
|
102
|
+
protected _updateEmbeddedDocuments<T extends Document<any, any>>(
|
103
|
+
documentClass: ConstructorOf<T>,
|
104
|
+
parent: T extends Document<any, infer U> ? U : never,
|
105
|
+
request: Request,
|
106
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>
|
107
|
+
): Promise<T[]>;
|
108
|
+
|
109
|
+
/**
|
110
|
+
* Perform a standardized pre-update workflow for all Document types. For internal use only.
|
111
|
+
* @internal
|
112
|
+
*/
|
113
|
+
protected _preUpdateDocumentArray<T extends Document<any, any>>(
|
114
|
+
collection: Collection<T>,
|
115
|
+
{
|
116
|
+
updates,
|
117
|
+
options,
|
118
|
+
user
|
119
|
+
}: Pick<Request, 'updates' | 'options'> & {
|
120
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>;
|
121
|
+
}
|
122
|
+
): Promise<T[]>;
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Handle a SocketResponse from the server when one or multiple documents were updated
|
126
|
+
* @param response - The provided Socket response
|
127
|
+
* @returns An Array of updated Document instances
|
128
|
+
*/
|
129
|
+
protected _handleUpdateDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Handle a SocketResponse from the server when embedded Documents are updated in a parent Document.
|
133
|
+
* @param response - The provided Socket response
|
134
|
+
* @returns An Array of updated Document instances
|
135
|
+
*/
|
136
|
+
protected _handleUpdateEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Perform a standardized post-update workflow for all Document types. For internal use only.
|
140
|
+
* @returns An array of callback operations to perform after every Document is updated
|
141
|
+
* @internal
|
142
|
+
*/
|
143
|
+
protected _postUpdateDocumentCallbacks(
|
144
|
+
collection: Collection<foundry.abstract.Document<any, any>>,
|
145
|
+
result: object[],
|
146
|
+
{ options, userId }: Pick<Request, 'options'> & { userId?: string }
|
147
|
+
): () => void;
|
148
|
+
|
149
|
+
/** @override */
|
150
|
+
protected _deleteDocuments<T extends Document<any, any>>(
|
151
|
+
documentClass: ConstructorOf<T>,
|
152
|
+
request: Request,
|
153
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>
|
154
|
+
): Promise<T[]>;
|
155
|
+
|
156
|
+
/** @override */
|
157
|
+
protected _deleteEmbeddedDocuments<T extends Document<any, any>>(
|
158
|
+
documentClass: ConstructorOf<T>,
|
159
|
+
parent: T extends Document<any, infer U> ? U : never,
|
160
|
+
request: Request,
|
161
|
+
user: InstanceType<ConfiguredDocumentClassForName<'User'>>
|
162
|
+
): Promise<T[]>;
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Perform a standardized pre-delete workflow for all Document types. For internal use only.
|
166
|
+
* @internal
|
167
|
+
*/
|
168
|
+
protected _preDeleteDocumentArray<T extends Document<any, any>>(
|
169
|
+
collection: Collection<T>,
|
170
|
+
{
|
171
|
+
ids,
|
172
|
+
options,
|
173
|
+
user
|
174
|
+
}: Pick<Request, 'ids' | 'options'> & { user: InstanceType<ConfiguredDocumentClassForName<'User'>> }
|
175
|
+
): Promise<T[]>;
|
176
|
+
|
177
|
+
/**
|
178
|
+
* Handle a SocketResponse from the server where Documents are deleted.
|
179
|
+
* @param response - The provided Socket response
|
180
|
+
* @returns An Array of deleted Document instances
|
181
|
+
*/
|
182
|
+
protected _handleDeleteDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
183
|
+
|
184
|
+
/**
|
185
|
+
* Handle a SocketResponse from the server when embedded Documents are deleted from a parent Document.
|
186
|
+
* @param response - The provided Socket response
|
187
|
+
* @returns An Array of deleted Document instances
|
188
|
+
*/
|
189
|
+
protected _handleDeleteEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
190
|
+
|
191
|
+
/**
|
192
|
+
* Perform a standardized post-deletion workflow for all Document types. For internal use only.
|
193
|
+
* @returns An array of callback operations to perform after every Document is deleted
|
194
|
+
* @internal
|
195
|
+
*/
|
196
|
+
protected _postDeleteDocumentCallbacks(
|
197
|
+
collection: Collection<foundry.abstract.Document<any, any>>,
|
198
|
+
result: object[],
|
199
|
+
{ options, userId }: Pick<Request, 'options'> & { userId?: string }
|
200
|
+
): (() => void)[];
|
201
|
+
|
202
|
+
/** @override */
|
203
|
+
getFlagScopes(): string[];
|
204
|
+
|
205
|
+
/** @override */
|
206
|
+
getCompendiumScopes(): string[];
|
207
|
+
}
|
208
|
+
}
|
209
|
+
|
210
|
+
export {};
|
@@ -204,7 +204,7 @@ declare global {
|
|
204
204
|
/**
|
205
205
|
* Inspect the Actor data model and identify the set of attributes which could be used for a Token Bar
|
206
206
|
*/
|
207
|
-
static getTrackedAttributeChoices(attributes?: TrackedAttributes):
|
207
|
+
static getTrackedAttributeChoices(attributes?: TrackedAttributes): Record<string, string[]>;
|
208
208
|
}
|
209
209
|
}
|
210
210
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* An extended Document definition used specifically
|
3
|
+
* This ensures that the PrototypeTokenData schema is used instead of the standard TokenData.
|
4
|
+
* This exists specifically for prototype Token configuration in the TokenConfig app and should not be used otherwise.
|
5
|
+
* @internal
|
6
|
+
* @remarks The types for this are incorrect, in particular everything related to the data should use
|
7
|
+
* {@link foundry.data.PrototypeTokenData} instead of {@link foundry.data.TokenData}. However, with the current approach
|
8
|
+
* to type documents, we don't see a way to do this. This class is just added for reference. As the documentation above
|
9
|
+
* says, don't use it (there really shouldn't be a need to do so).
|
10
|
+
*/
|
11
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
12
|
+
// @ts-ignore
|
13
|
+
declare class PrototypeTokenDocument extends TokenDocument {
|
14
|
+
static get schema(): typeof foundry.data.PrototypeTokenData;
|
15
|
+
}
|
@@ -219,7 +219,7 @@ declare namespace ClientSettings {
|
|
219
219
|
}
|
220
220
|
|
221
221
|
interface Values {
|
222
|
-
'core.combatTrackerConfig': { resource: string; skipDefeated: boolean };
|
222
|
+
'core.combatTrackerConfig': { resource: string; skipDefeated: boolean } | {};
|
223
223
|
'core.compendiumConfiguration': Partial<Record<string, CompendiumCollection.Configuration>>;
|
224
224
|
'core.rollMode': foundry.CONST.DiceRollMode;
|
225
225
|
'core.animateRollTable': boolean;
|
@@ -229,6 +229,19 @@ declare namespace ClientSettings {
|
|
229
229
|
'core.globalPlaylistVolume': number;
|
230
230
|
'core.globalAmbientVolume': number;
|
231
231
|
'core.globalInterfaceVolume': number;
|
232
|
+
'core.moduleConfiguration': Record<string, boolean>;
|
233
|
+
'core.chatBubbles': boolean;
|
234
|
+
'core.chatBubblesPan': boolean;
|
235
|
+
'core.coneTemplateType': 'round' | 'flat';
|
236
|
+
'core.language': string;
|
237
|
+
'core.leftClickRelease': boolean;
|
238
|
+
'core.lightAnimation': boolean;
|
239
|
+
'core.maxFPS': number;
|
240
|
+
'core.mipmap': boolean;
|
241
|
+
'core.noCanvas': boolean;
|
242
|
+
'core.softShadows': boolean;
|
243
|
+
'core.tokenDragPreview': boolean;
|
244
|
+
'core.visionAnimation': boolean;
|
232
245
|
[key: string]: unknown;
|
233
246
|
}
|
234
247
|
}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { ConfiguredDocumentClassForName, ConstructorDataType } from '../../../../types/helperTypes';
|
2
|
-
import { IdQuery } from '../../../common/abstract/backend.mjs';
|
3
2
|
import { DocumentModificationOptions } from '../../../common/abstract/document.mjs';
|
4
3
|
|
5
4
|
declare global {
|
@@ -25,6 +24,12 @@ declare global {
|
|
25
24
|
/** A debounced function which will clear the contents of the Compendium pack if it is not accessed frequently. */
|
26
25
|
_flush: () => void;
|
27
26
|
|
27
|
+
/**
|
28
|
+
* Has this Compendium pack been fully indexed?
|
29
|
+
* @defaultValue `false`
|
30
|
+
*/
|
31
|
+
indexed: boolean;
|
32
|
+
|
28
33
|
/**
|
29
34
|
* The amount of time that Document instances within this CompendiumCollection are held in memory.
|
30
35
|
* Accessing the contents of the Compendium pack extends the duration of this lifetime.
|
@@ -37,6 +42,32 @@ declare global {
|
|
37
42
|
*/
|
38
43
|
static CONFIG_SETTING: 'compendiumConfiguration';
|
39
44
|
|
45
|
+
/**
|
46
|
+
* The default index fields which should be retrieved for each Compendium document type
|
47
|
+
*/
|
48
|
+
static INDEX_FIELDS: {
|
49
|
+
/** @defaultValue `["name", "img", "type"]` */
|
50
|
+
Actor: (keyof foundry.data.ActorData['_source'])[];
|
51
|
+
|
52
|
+
/** @defaultValue `["name", "img", "type"]` */
|
53
|
+
Item: (keyof foundry.data.ItemData['_source'])[];
|
54
|
+
|
55
|
+
/** @defaultValue `["name", "thumb"]` */
|
56
|
+
Scene: (keyof foundry.data.SceneData['_source'])[];
|
57
|
+
|
58
|
+
/** @defaultValue `["name", "img"]` */
|
59
|
+
JournalEntry: (keyof foundry.data.JournalEntryData['_source'])[];
|
60
|
+
|
61
|
+
/** @defaultValue `["name", "img"]` */
|
62
|
+
Macro: (keyof foundry.data.MacroData['_source'])[];
|
63
|
+
|
64
|
+
/** @defaultValue `["name", "img"]` */
|
65
|
+
RollTable: (keyof foundry.data.RollTableData['_source'])[];
|
66
|
+
|
67
|
+
/** @defaultValue `["name"]` */
|
68
|
+
Playlist: (keyof foundry.data.PlaylistData['_source'])[];
|
69
|
+
};
|
70
|
+
|
40
71
|
/** The canonical Compendium name - comprised of the originating package and the pack name */
|
41
72
|
get collection(): string;
|
42
73
|
|
@@ -64,8 +95,11 @@ declare global {
|
|
64
95
|
|
65
96
|
delete: (id: string) => boolean;
|
66
97
|
|
67
|
-
/**
|
68
|
-
|
98
|
+
/**
|
99
|
+
* Load the Compendium index and cache it as the keys and values of the Collection.
|
100
|
+
* @param options - Options which customize how the index is created
|
101
|
+
*/
|
102
|
+
getIndex(options?: CompendiumCollection.GetIndexOptions<T>): Promise<this['index']>;
|
69
103
|
|
70
104
|
/**
|
71
105
|
* Get a single Document from this Compendium by ID.
|
@@ -81,7 +115,7 @@ declare global {
|
|
81
115
|
* default: `{}`
|
82
116
|
* @returns The retrieved Document instances
|
83
117
|
*/
|
84
|
-
getDocuments(query?:
|
118
|
+
getDocuments(query?: Record<string, unknown>): Promise<StoredDocument<DocumentInstanceForCompendiumMetadata<T>>[]>;
|
85
119
|
|
86
120
|
/**
|
87
121
|
* Import a Document into this Compendium Collection.
|
@@ -236,6 +270,11 @@ declare global {
|
|
236
270
|
package: string;
|
237
271
|
system?: string;
|
238
272
|
}
|
273
|
+
|
274
|
+
interface GetIndexOptions<T extends CompendiumCollection.Metadata> {
|
275
|
+
/** An array of fields to return as part of the index */
|
276
|
+
fields?: (keyof DocumentInstanceForCompendiumMetadata<T>['data']['_source'])[];
|
277
|
+
}
|
239
278
|
}
|
240
279
|
}
|
241
280
|
|
@@ -266,11 +305,5 @@ type DocumentInstanceForCompendiumMetadata<T extends CompendiumCollection.Metada
|
|
266
305
|
>;
|
267
306
|
|
268
307
|
type IndexTypeForMetadata<T extends CompendiumCollection.Metadata> = foundry.utils.Collection<
|
269
|
-
|
270
|
-
StoredDocument<DocumentInstanceForCompendiumMetadata<T>>['data'],
|
271
|
-
| '_id'
|
272
|
-
| 'name'
|
273
|
-
| ('img' extends keyof StoredDocument<DocumentInstanceForCompendiumMetadata<T>>['data'] ? 'img' : never)
|
274
|
-
| ('type' extends keyof StoredDocument<DocumentInstanceForCompendiumMetadata<T>>['data'] ? 'type' : never)
|
275
|
-
>
|
308
|
+
{ _id: string } & Partial<DocumentInstanceForCompendiumMetadata<T>['data']['_source']>
|
276
309
|
>;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { DocumentConstructor, PlaceableObjectConstructor } from '../../types/helperTypes';
|
2
|
-
import DatabaseBackend from '../common/abstract/backend.mjs';
|
3
2
|
|
4
3
|
type ConfiguredDocumentClassOrDefault<Fallback extends DocumentConstructor> =
|
5
4
|
Fallback['metadata']['name'] extends keyof DocumentClassConfig
|
@@ -230,7 +229,7 @@ declare global {
|
|
230
229
|
* Configure the DatabaseBackend used to perform Document operations
|
231
230
|
* @defaultValue `new ClientDatabaseBackend()`
|
232
231
|
*/
|
233
|
-
DatabaseBackend:
|
232
|
+
DatabaseBackend: ClientDatabaseBackend;
|
234
233
|
|
235
234
|
/**
|
236
235
|
* Configuration for the Actor document
|
@@ -249,7 +248,7 @@ declare global {
|
|
249
248
|
/**
|
250
249
|
* @defaultValue `{}`
|
251
250
|
*/
|
252
|
-
sheetClasses:
|
251
|
+
sheetClasses: CONFIG.SheetClasses;
|
253
252
|
|
254
253
|
/**
|
255
254
|
* @defaultValue `'fas fa-user'`
|
@@ -444,7 +443,7 @@ declare global {
|
|
444
443
|
/**
|
445
444
|
* @defaultValue `{}`
|
446
445
|
*/
|
447
|
-
sheetClasses:
|
446
|
+
sheetClasses: CONFIG.SheetClasses;
|
448
447
|
|
449
448
|
/**
|
450
449
|
* @defaultValue `'fas fa-suitcase'`
|
@@ -1983,6 +1982,15 @@ declare global {
|
|
1983
1982
|
[key: string]: ConstructorOf<CanvasLayer>;
|
1984
1983
|
}
|
1985
1984
|
}
|
1985
|
+
|
1986
|
+
interface SheetClass {
|
1987
|
+
id: string;
|
1988
|
+
cls: ConstructorOf<FormApplication>;
|
1989
|
+
label: string;
|
1990
|
+
default: boolean;
|
1991
|
+
}
|
1992
|
+
|
1993
|
+
type SheetClasses = Record<string, Record<string, SheetClass>>;
|
1986
1994
|
}
|
1987
1995
|
|
1988
1996
|
const CONFIG: CONFIG;
|
@@ -8,7 +8,7 @@
|
|
8
8
|
* const dragDrop = new DragDrop({
|
9
9
|
* dragSelector: ".item",
|
10
10
|
* dropSelector: ".items",
|
11
|
-
* permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }
|
11
|
+
* permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) },
|
12
12
|
* callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDragDrop.bind(this) }
|
13
13
|
* });
|
14
14
|
* dragDrop.bind(html);
|
@@ -17,9 +17,9 @@
|
|
17
17
|
declare class DragDrop {
|
18
18
|
/**
|
19
19
|
* @param dragSelector - The CSS selector used to target draggable elements.
|
20
|
-
* (default: `
|
20
|
+
* (default: `undefined`)
|
21
21
|
* @param dropSelector - The CSS selector used to target viable drop targets.
|
22
|
-
* (default: `
|
22
|
+
* (default: `undefined`)
|
23
23
|
* @param permissions - An object of permission test functions for each action
|
24
24
|
* (default: `{}`)
|
25
25
|
* @param callbacks - An object of callback functions for each action
|
@@ -29,27 +29,27 @@ declare class DragDrop {
|
|
29
29
|
|
30
30
|
/**
|
31
31
|
* The HTML selector which identifies draggable elements
|
32
|
-
* @defaultValue `
|
32
|
+
* @defaultValue `undefined`
|
33
33
|
*/
|
34
|
-
dragSelector: string |
|
34
|
+
dragSelector: string | undefined;
|
35
35
|
|
36
36
|
/**
|
37
37
|
* The HTML selector which identifies drop targets
|
38
|
-
* @defaultValue `
|
38
|
+
* @defaultValue `undefined`
|
39
39
|
*/
|
40
|
-
dropSelector: string |
|
40
|
+
dropSelector: string | undefined;
|
41
41
|
|
42
42
|
/**
|
43
43
|
* A set of permission checking functions for each action of the Drag and Drop workflow
|
44
44
|
* @defaultValue `{}`
|
45
45
|
*/
|
46
|
-
permissions: Partial<Record<
|
46
|
+
permissions: Partial<Record<DragDrop.Action, (selector: string | undefined) => boolean>>;
|
47
47
|
|
48
48
|
/**
|
49
49
|
* A set of callback functions for each action of the Drag and Drop workflow
|
50
50
|
* @defaultValue `{}`
|
51
51
|
*/
|
52
|
-
callbacks: Partial<Record<
|
52
|
+
callbacks: Partial<Record<DragDrop.Action, (event: DragEvent) => void>>;
|
53
53
|
|
54
54
|
/**
|
55
55
|
* Bind the DragDrop controller to an HTML application
|
@@ -62,7 +62,7 @@ declare class DragDrop {
|
|
62
62
|
* @param event - The drag event being handled
|
63
63
|
* @param action - The action being attempted
|
64
64
|
*/
|
65
|
-
callback(event: DragEvent, action:
|
65
|
+
callback(event: DragEvent, action: DragDrop.Action): void;
|
66
66
|
|
67
67
|
/**
|
68
68
|
* Test whether the current user has permission to perform a step of the workflow
|
@@ -70,40 +70,41 @@ declare class DragDrop {
|
|
70
70
|
* @param selector - The selector being targeted
|
71
71
|
* @returns Can the action be performed?
|
72
72
|
*/
|
73
|
-
can(action:
|
73
|
+
can(action: DragDrop.Action, selector: string | undefined): boolean;
|
74
74
|
|
75
75
|
/**
|
76
76
|
* Handle the start of a drag workflow
|
77
77
|
* @param event - The drag event being handled
|
78
|
+
* @internal
|
78
79
|
*/
|
79
80
|
protected _handleDragStart(event: DragEvent): void;
|
80
81
|
|
81
82
|
/**
|
82
83
|
* Handle a dragged element over a droppable target
|
83
84
|
* @param event - The drag event being handled
|
85
|
+
* @internal
|
84
86
|
*/
|
85
87
|
protected _handleDragOver(event: DragEvent): false;
|
86
88
|
|
87
89
|
/**
|
88
90
|
* Handle a dragged element dropped on a droppable target
|
89
91
|
* @param event - The drag event being handled
|
92
|
+
* @internal
|
90
93
|
*/
|
91
94
|
protected _handleDrop(event: DragEvent): unknown;
|
92
95
|
|
93
|
-
static createDragImage(img: HTMLImageElement, width: number, height: number): HTMLDivElement
|
96
|
+
static createDragImage(img: HTMLImageElement, width: number, height: number): HTMLDivElement;
|
94
97
|
}
|
95
98
|
|
96
99
|
declare namespace DragDrop {
|
97
100
|
interface Options {
|
98
101
|
/**
|
99
102
|
* The CSS selector used to target draggable elements.
|
100
|
-
* @defaultValue `null`
|
101
103
|
*/
|
102
104
|
dragSelector?: DragDrop['dragSelector'];
|
103
105
|
|
104
106
|
/**
|
105
107
|
* The CSS selector used to target viable drop targets.
|
106
|
-
* @defaultValue `null`
|
107
108
|
*/
|
108
109
|
dropSelector?: DragDrop['dropSelector'];
|
109
110
|
|
@@ -119,4 +120,6 @@ declare namespace DragDrop {
|
|
119
120
|
*/
|
120
121
|
callbacks?: DragDrop['callbacks'];
|
121
122
|
}
|
123
|
+
|
124
|
+
type Action = 'dragstart' | 'dragover' | 'drop';
|
122
125
|
}
|
@@ -15,6 +15,7 @@ declare global {
|
|
15
15
|
* The currently supported variables are:
|
16
16
|
* - {@link game}
|
17
17
|
* - {@link socket}
|
18
|
+
* - {@link ui}
|
18
19
|
* - {@link canvas}
|
19
20
|
*
|
20
21
|
* @example
|
@@ -64,9 +65,7 @@ declare global {
|
|
64
65
|
* @defaultValue `{}`
|
65
66
|
*/
|
66
67
|
windows: Record<number, Application>;
|
67
|
-
} &
|
68
|
-
[Key in keyof CONFIG['ui']]?: InstanceType<CONFIG['ui'][Key]>;
|
69
|
-
};
|
68
|
+
} & ('ui' extends keyof LenientGlobalVariableTypes ? UiApplications : Partial<UiApplications>);
|
70
69
|
|
71
70
|
/** The client-side console is the default logger */
|
72
71
|
let logger: typeof console;
|
@@ -115,7 +114,7 @@ declare global {
|
|
115
114
|
let _token: InstanceType<CONFIG['Token']['objectClass']> | null;
|
116
115
|
|
117
116
|
/*
|
118
|
-
* Global
|
117
|
+
* Global Variables
|
119
118
|
* The following variables are declared directly in foundry's HTML file (or more concretely, in `main.hbs`)
|
120
119
|
*/
|
121
120
|
|
@@ -128,4 +127,8 @@ declare global {
|
|
128
127
|
| null;
|
129
128
|
}
|
130
129
|
|
130
|
+
type UiApplications = {
|
131
|
+
[Key in keyof CONFIG['ui']]: InstanceType<CONFIG['ui'][Key]>;
|
132
|
+
};
|
133
|
+
|
131
134
|
export {};
|