@league-of-foundry-developers/foundry-vtt-types 0.8.9-9 → 9.238.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -27
- package/index.d.ts +2 -2
- package/package.json +34 -15
- package/src/foundry/common/abstract/document.mjs.d.ts +24 -10
- package/src/foundry/common/config.mjs/index.d.ts +1 -0
- package/src/foundry/common/config.mjs/releaseData.d.ts +98 -0
- package/src/foundry/common/constants.mjs.d.ts +402 -213
- package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +36 -29
- package/src/foundry/common/data/data.mjs/actorData.d.ts +32 -21
- package/src/foundry/common/data/data.mjs/adventureData.d.ts +165 -0
- package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +45 -124
- package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +49 -77
- package/src/foundry/common/data/data.mjs/animationData.d.ts +17 -9
- package/src/foundry/common/data/data.mjs/cardData.d.ts +265 -0
- package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +66 -0
- package/src/foundry/common/data/data.mjs/cardsData.d.ts +238 -0
- package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +51 -39
- package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +18 -11
- package/src/foundry/common/data/data.mjs/combatData.d.ts +51 -25
- package/src/foundry/common/data/data.mjs/combatantData.d.ts +48 -30
- package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +8 -7
- package/src/foundry/common/data/data.mjs/drawingData.d.ts +68 -67
- package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +21 -25
- package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +24 -23
- package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +23 -16
- package/src/foundry/common/data/data.mjs/folderData.d.ts +28 -25
- package/src/foundry/common/data/data.mjs/index.d.ts +5 -0
- package/src/foundry/common/data/data.mjs/itemData.d.ts +26 -18
- package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +21 -20
- package/src/foundry/common/data/data.mjs/lightData.d.ts +228 -0
- package/src/foundry/common/data/data.mjs/macroData.d.ts +52 -35
- package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +41 -38
- package/src/foundry/common/data/data.mjs/noteData.d.ts +47 -37
- package/src/foundry/common/data/data.mjs/playlistData.d.ts +55 -26
- package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +32 -16
- package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +7 -11
- package/src/foundry/common/data/data.mjs/rollTableData.d.ts +30 -24
- package/src/foundry/common/data/data.mjs/sceneData.d.ts +132 -111
- package/src/foundry/common/data/data.mjs/settingData.d.ts +11 -8
- package/src/foundry/common/data/data.mjs/tableResultData.d.ts +30 -26
- package/src/foundry/common/data/data.mjs/tileData.d.ts +43 -36
- package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +10 -9
- package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +6 -3
- package/src/foundry/common/data/data.mjs/tokenData.d.ts +105 -157
- package/src/foundry/common/data/data.mjs/userData.d.ts +111 -33
- package/src/foundry/common/data/data.mjs/videoData.d.ts +9 -8
- package/src/foundry/common/data/data.mjs/wallData.d.ts +67 -39
- package/src/foundry/common/data/fields.mjs.d.ts +180 -83
- package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +9 -3
- package/src/foundry/common/documents.mjs/baseActor.d.ts +17 -45
- package/src/foundry/common/documents.mjs/baseAdventure.d.ts +38 -0
- package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +3 -1
- package/src/foundry/common/documents.mjs/baseCard.d.ts +62 -0
- package/src/foundry/common/documents.mjs/baseCards.d.ts +39 -0
- package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseCombat.d.ts +5 -2
- package/src/foundry/common/documents.mjs/baseCombatant.d.ts +10 -1
- package/src/foundry/common/documents.mjs/baseDrawing.d.ts +11 -1
- package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +4 -3
- package/src/foundry/common/documents.mjs/baseFolder.d.ts +10 -1
- package/src/foundry/common/documents.mjs/baseItem.d.ts +11 -29
- package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseMacro.d.ts +16 -14
- package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +4 -1
- package/src/foundry/common/documents.mjs/baseNote.d.ts +2 -2
- package/src/foundry/common/documents.mjs/basePlaylist.d.ts +1 -0
- package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +2 -1
- package/src/foundry/common/documents.mjs/baseRollTable.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseScene.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseSetting.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseTableResult.d.ts +10 -3
- package/src/foundry/common/documents.mjs/baseTile.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseToken.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseUser.d.ts +7 -1
- package/src/foundry/common/documents.mjs/baseWall.d.ts +7 -10
- package/src/foundry/common/documents.mjs/index.d.ts +3 -0
- package/src/foundry/common/module.mjs.d.ts +3 -0
- package/src/foundry/common/packages.mjs/moduleData.d.ts +12 -9
- package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +24 -24
- package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +27 -21
- package/src/foundry/common/packages.mjs/packageData.d.ts +108 -82
- package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +18 -11
- package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +16 -15
- package/src/foundry/common/packages.mjs/systemData.d.ts +21 -20
- package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +3 -3
- package/src/foundry/common/packages.mjs/worldData.d.ts +29 -18
- package/src/foundry/common/types.mjs.d.ts +95 -0
- package/src/foundry/common/utils/helpers.mjs.d.ts +27 -2
- package/src/foundry/common/utils/primitives.mjs.d.ts +99 -16
- package/src/foundry/foundry.js/application.d.ts +2 -2
- package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplication.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +5 -5
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +5 -8
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +8 -9
- package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +6 -6
- package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
- package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/avSettings.d.ts +7 -7
- package/src/foundry/foundry.js/canvas.d.ts +148 -46
- package/src/foundry/foundry.js/canvasAnimation.d.ts +1 -1
- package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
- package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +384 -0
- package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
- package/src/foundry/foundry.js/clientDocuments/combat.d.ts +4 -8
- package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
- package/src/foundry/foundry.js/clientDocuments/index.d.ts +2 -0
- package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
- package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
- package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
- package/src/foundry/foundry.js/clientKeybindings.d.ts +299 -0
- package/src/foundry/foundry.js/clientSettings.d.ts +11 -9
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
- package/src/foundry/foundry.js/config.d.ts +465 -887
- package/src/foundry/foundry.js/game.d.ts +86 -11
- package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
- package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
- package/src/foundry/foundry.js/hooks.d.ts +57 -0
- package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
- package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
- package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +3 -3
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
- package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
- package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
- package/src/foundry/foundry.js/pointSource.d.ts +2 -2
- package/src/foundry/foundry.js/roll.d.ts +25 -36
- package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
- package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
- package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
- package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
- package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
- package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
- package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
- package/src/foundry/foundry.js/textEditor.d.ts +1 -1
- package/src/foundry/index.d.ts +4 -0
- package/src/types/utils.d.ts +11 -3
@@ -0,0 +1,29 @@
|
|
1
|
+
/**
|
2
|
+
* A container group which contains visual effects rendered above the primary group.
|
3
|
+
*/
|
4
|
+
declare class EffectsCanvasGroup extends PIXI.Container {
|
5
|
+
constructor();
|
6
|
+
|
7
|
+
walls: WallsLayer;
|
8
|
+
|
9
|
+
lighting: LightingLayer;
|
10
|
+
|
11
|
+
weather: WeatherLayer;
|
12
|
+
|
13
|
+
sight: SightLayer;
|
14
|
+
|
15
|
+
/** @defaultValue `true` */
|
16
|
+
sortableChildren: boolean;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* The name of this canvas group
|
20
|
+
* @defaultValue `"effects"`
|
21
|
+
*/
|
22
|
+
static groupName: string;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Create the member layers of the scene container
|
26
|
+
* @internal
|
27
|
+
*/
|
28
|
+
protected _createLayers(): void;
|
29
|
+
}
|
@@ -1,11 +1,14 @@
|
|
1
1
|
import './baseGrid';
|
2
2
|
import './baseGrids';
|
3
3
|
import './cachedContainer';
|
4
|
+
import './cachedContainers';
|
4
5
|
import './canvasLayer';
|
5
6
|
import './canvasLayers';
|
6
7
|
import './controlIcon';
|
7
8
|
import './cursor';
|
8
9
|
import './doorControl';
|
10
|
+
import './effectsCanvasGroup';
|
11
|
+
import './interfaceCanvasGroup';
|
9
12
|
import './placeableObject';
|
10
13
|
import './placeableObjects';
|
11
14
|
import './ruler';
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* A container group which displays interface elements rendered above other canvas groups.
|
3
|
+
*/
|
4
|
+
declare class InterfaceCanvasGroup extends PIXI.Container {
|
5
|
+
constructor();
|
6
|
+
|
7
|
+
sounds: SoundsLayer;
|
8
|
+
|
9
|
+
notes: NotesLayer;
|
10
|
+
|
11
|
+
controls: ControlsLayer;
|
12
|
+
|
13
|
+
/** @defaultValue `true` */
|
14
|
+
sortableChildren: boolean;
|
15
|
+
|
16
|
+
/**
|
17
|
+
* The name of this canvas group
|
18
|
+
* @defaultValue `"interface"`
|
19
|
+
*/
|
20
|
+
static groupName: string;
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Create the member layers of the scene container
|
24
|
+
* @internal
|
25
|
+
*/
|
26
|
+
protected _createLayers(): void;
|
27
|
+
}
|
@@ -258,7 +258,7 @@ declare global {
|
|
258
258
|
* @param mode - The mode from CONST.TOKEN_DISPLAY_MODES
|
259
259
|
* @returns Is the attribute viewable?
|
260
260
|
*/
|
261
|
-
protected _canViewMode(mode: foundry.CONST.
|
261
|
+
protected _canViewMode(mode: foundry.CONST.TOKEN_DISPLAY_MODES): boolean;
|
262
262
|
|
263
263
|
/**
|
264
264
|
* Animate Token movement along a certain path which is defined by a Ray object
|
@@ -178,7 +178,7 @@ declare class PointSource {
|
|
178
178
|
* The source type from CONST.SOURCE_TYPES
|
179
179
|
* @defaultValue `undefined`
|
180
180
|
*/
|
181
|
-
type?: foundry.CONST.
|
181
|
+
type?: foundry.CONST.SOURCE_TYPES;
|
182
182
|
|
183
183
|
/**
|
184
184
|
* An animation configuration for the source
|
@@ -366,7 +366,7 @@ declare namespace PointSource {
|
|
366
366
|
* The source type from CONST.SOURCE_TYPES
|
367
367
|
* @defaultValue `CONST.SOURCE_TYPES.LOCAL`
|
368
368
|
*/
|
369
|
-
type?: foundry.CONST.
|
369
|
+
type?: foundry.CONST.SOURCE_TYPES;
|
370
370
|
|
371
371
|
/**
|
372
372
|
* An animation configuration for the source
|
@@ -42,7 +42,7 @@ declare global {
|
|
42
42
|
/**
|
43
43
|
* Options which modify or describe the Roll
|
44
44
|
*/
|
45
|
-
options:
|
45
|
+
options: InexactPartial<Options>;
|
46
46
|
|
47
47
|
/**
|
48
48
|
* The identified terms of the Roll
|
@@ -72,10 +72,8 @@ declare global {
|
|
72
72
|
*/
|
73
73
|
protected _total: number | undefined;
|
74
74
|
|
75
|
-
/**
|
76
|
-
|
77
|
-
*/
|
78
|
-
static MATH_PROXY: MathProxy;
|
75
|
+
/** A Proxy environment for safely evaluating a string using only available Math functions */
|
76
|
+
static MATH_PROXY: Math;
|
79
77
|
|
80
78
|
/**
|
81
79
|
* The HTML template path used to render a complete Roll object to the chat log
|
@@ -117,6 +115,9 @@ declare global {
|
|
117
115
|
*/
|
118
116
|
get total(): number | undefined;
|
119
117
|
|
118
|
+
/** Whether this Roll contains entirely deterministic terms or whether there is some randomness. */
|
119
|
+
get isDeterministic(): boolean;
|
120
|
+
|
120
121
|
/**
|
121
122
|
* Alter the Roll expression by adding or multiplying the number of dice which are rolled
|
122
123
|
* @param multiply - A factor to multiply. Dice are multiplied before any additions.
|
@@ -146,21 +147,21 @@ declare global {
|
|
146
147
|
* console.log(r.total); // 11
|
147
148
|
* ```
|
148
149
|
*/
|
149
|
-
evaluate(options?:
|
150
|
-
evaluate(options:
|
151
|
-
evaluate(options?:
|
150
|
+
evaluate(options?: InexactPartial<Options & { async: false }>): this;
|
151
|
+
evaluate(options: InexactPartial<Options> & { async: true }): Promise<this>;
|
152
|
+
evaluate(options?: InexactPartial<Options>): this | Promise<this>;
|
152
153
|
|
153
154
|
/**
|
154
155
|
* Evaluate the roll asynchronously.
|
155
156
|
* A temporary helper method used to migrate behavior from 0.7.x (sync by default) to 0.9.x (async by default).
|
156
157
|
*/
|
157
|
-
protected _evaluate(options?:
|
158
|
+
protected _evaluate(options?: InexactPartial<Omit<Options, 'async'>>): Promise<this>;
|
158
159
|
|
159
160
|
/**
|
160
161
|
* Evaluate the roll synchronously.
|
161
162
|
* A temporary helper method used to migrate behavior from 0.7.x (sync by default) to 0.9.x (async by default).
|
162
163
|
*/
|
163
|
-
protected _evaluateSync(options?:
|
164
|
+
protected _evaluateSync(options?: InexactPartial<Omit<Options, 'async'>>): this;
|
164
165
|
|
165
166
|
/**
|
166
167
|
* Safely evaluate the final total result for the Roll using its component terms.
|
@@ -172,9 +173,9 @@ declare global {
|
|
172
173
|
* Alias for evaluate.
|
173
174
|
* @see Roll#evaluate
|
174
175
|
*/
|
175
|
-
roll(options?:
|
176
|
-
roll(options:
|
177
|
-
roll(options?:
|
176
|
+
roll(options?: InexactPartial<Options & { async: false }>): this;
|
177
|
+
roll(options: InexactPartial<Options> & { async: true }): Promise<this>;
|
178
|
+
roll(options?: InexactPartial<Options>): this | Promise<this>;
|
178
179
|
|
179
180
|
/**
|
180
181
|
* Create a new Roll object using the original provided formula and data.
|
@@ -182,9 +183,9 @@ declare global {
|
|
182
183
|
* @param options - Evaluation options passed to Roll#evaluate
|
183
184
|
* @returns A new Roll object, rolled using the same formula and data
|
184
185
|
*/
|
185
|
-
reroll(options?:
|
186
|
-
reroll(options:
|
187
|
-
reroll(options?:
|
186
|
+
reroll(options?: InexactPartial<Options & { async: false }>): this;
|
187
|
+
reroll(options: InexactPartial<Options> & { async: true }): Promise<this>;
|
188
|
+
reroll(options?: InexactPartial<Options>): this | Promise<this>;
|
188
189
|
|
189
190
|
/**
|
190
191
|
* A factory method which constructs a Roll instance using the default configured Roll class.
|
@@ -197,7 +198,7 @@ declare global {
|
|
197
198
|
static create<D extends Record<string, unknown> = {}>(
|
198
199
|
formula: string,
|
199
200
|
data?: D,
|
200
|
-
options?:
|
201
|
+
options?: InexactPartial<Options>
|
201
202
|
): typeof CONFIG.Dice.rolls extends [infer T] ? T : Roll<D>;
|
202
203
|
|
203
204
|
/**
|
@@ -229,7 +230,7 @@ declare global {
|
|
229
230
|
* (default: `10000`)
|
230
231
|
* @returns The rolled totals
|
231
232
|
*/
|
232
|
-
static simulate(formula: string, n?: number): number[]
|
233
|
+
static simulate(formula: string, n?: number): Promise<number[]>;
|
233
234
|
|
234
235
|
/**
|
235
236
|
* Parse a formula by following an order of operations:
|
@@ -302,7 +303,7 @@ declare global {
|
|
302
303
|
* (default: `{}`)
|
303
304
|
* @returns An array of terms, split on dice pool terms
|
304
305
|
*/
|
305
|
-
protected _splitGroup(_formula: string, options?:
|
306
|
+
protected _splitGroup(_formula: string, options?: InexactPartial<SplitGroupOptions>): string[];
|
306
307
|
|
307
308
|
/**
|
308
309
|
* Split a formula by identifying arithmetic terms
|
@@ -373,15 +374,15 @@ declare global {
|
|
373
374
|
*/
|
374
375
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
375
376
|
messageData?: T,
|
376
|
-
{ rollMode, create }?: { rollMode?: foundry.CONST.
|
377
|
+
{ rollMode, create }?: { rollMode?: foundry.CONST.DICE_ROLL_MODES; create?: true }
|
377
378
|
): Promise<InstanceType<ConfiguredDocumentClass<typeof ChatMessage>> | undefined>;
|
378
379
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
379
380
|
messageData: T,
|
380
|
-
{ rollMode, create }: { rollMode?: foundry.CONST.
|
381
|
+
{ rollMode, create }: { rollMode?: foundry.CONST.DICE_ROLL_MODES; create: false }
|
381
382
|
): MessageData<T>;
|
382
383
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
383
384
|
messageData: T,
|
384
|
-
{ rollMode, create }: { rollMode?: foundry.CONST.
|
385
|
+
{ rollMode, create }: { rollMode?: foundry.CONST.DICE_ROLL_MODES; create: boolean }
|
385
386
|
): Promise<InstanceType<ConfiguredDocumentClass<typeof ChatMessage>> | undefined> | MessageData<T>;
|
386
387
|
|
387
388
|
/**
|
@@ -441,13 +442,8 @@ declare global {
|
|
441
442
|
*/
|
442
443
|
static fromTerms(
|
443
444
|
terms: RollTerm[],
|
444
|
-
options?:
|
445
|
+
options?: InexactPartial<Options>
|
445
446
|
): typeof CONFIG.Dice.rolls extends [infer T] ? T : Roll<{}>;
|
446
|
-
|
447
|
-
/**
|
448
|
-
* @deprecated since 0.8.1
|
449
|
-
*/
|
450
|
-
get _rolled(): boolean;
|
451
447
|
}
|
452
448
|
}
|
453
449
|
|
@@ -488,19 +484,12 @@ interface SplitGroupOptions {
|
|
488
484
|
interface Data {
|
489
485
|
formula: string;
|
490
486
|
results: Array<number | string>;
|
491
|
-
terms: Array<
|
487
|
+
terms: Array<PoolTerm.TermData | DiceTerm.Data>;
|
492
488
|
total: number | null;
|
493
489
|
}
|
494
490
|
|
495
491
|
type Flavor = Record<`%F${number}%`, string>;
|
496
492
|
|
497
|
-
/**
|
498
|
-
* @deprecated since 0.8.1
|
499
|
-
*/
|
500
|
-
interface MathProxy extends Math {
|
501
|
-
safeEval: (arg: Parameters<typeof Roll['safeEval']>) => ReturnType<typeof Roll['safeEval']>;
|
502
|
-
}
|
503
|
-
|
504
493
|
type MessageData<T extends DeepPartial<ConstructorParameters<typeof ChatMessage>[0]>> = {
|
505
494
|
user: string;
|
506
495
|
type: typeof foundry.CONST.CHAT_MESSAGE_TYPES['ROLL'];
|
@@ -41,14 +41,17 @@ declare abstract class RollTerm {
|
|
41
41
|
/** Optional flavor text which modifies and describes this term. */
|
42
42
|
get flavor(): string;
|
43
43
|
|
44
|
+
/** Whether this term is entirely deterministic or contains some randomness. */
|
45
|
+
get isDeterministic(): boolean;
|
46
|
+
|
44
47
|
/**
|
45
48
|
* Evaluate the roll term, populating the results Array.
|
46
49
|
* @param options - (default: `{}`)
|
47
50
|
* @returns The evaluated dice term
|
48
51
|
*/
|
49
|
-
evaluate(options?:
|
50
|
-
evaluate(options:
|
51
|
-
evaluate(options?:
|
52
|
+
evaluate(options?: InexactPartial<RollTerm.EvaluationOptions & { async: false }>): this;
|
53
|
+
evaluate(options: InexactPartial<RollTerm.EvaluationOptions> & { async: true }): Promise<this>;
|
54
|
+
evaluate(options?: InexactPartial<RollTerm.EvaluationOptions>): this | Promise<this>;
|
52
55
|
|
53
56
|
protected _evaluate({ minimize, maximize }?: { minimize?: boolean; maximize?: boolean }): Promise<this>;
|
54
57
|
|
@@ -107,7 +110,7 @@ declare namespace RollTerm {
|
|
107
110
|
/**
|
108
111
|
* Evaluate the roll asynchronously, receiving a Promise as the returned value.
|
109
112
|
* This will become the default behavior in version 10.x
|
110
|
-
* @defaultValue `
|
113
|
+
* @defaultValue `true`
|
111
114
|
*/
|
112
115
|
async: boolean;
|
113
116
|
}
|
@@ -65,11 +65,12 @@ declare abstract class DiceTerm extends RollTerm {
|
|
65
65
|
/* Dice Term Attributes */
|
66
66
|
/* -------------------------------------------- */
|
67
67
|
|
68
|
-
/**
|
69
|
-
* Return an array of rolled values which are still active within this term
|
70
|
-
*/
|
68
|
+
/** Return an array of rolled values which are still active within this term */
|
71
69
|
get values(): number[];
|
72
70
|
|
71
|
+
/** @override */
|
72
|
+
get isDeterministic(): boolean;
|
73
|
+
|
73
74
|
/* -------------------------------------------- */
|
74
75
|
|
75
76
|
/**
|
@@ -218,13 +219,6 @@ declare abstract class DiceTerm extends RollTerm {
|
|
218
219
|
/* Factory Methods */
|
219
220
|
/* -------------------------------------------- */
|
220
221
|
|
221
|
-
/**
|
222
|
-
* @deprecated since 0.8.1
|
223
|
-
*/
|
224
|
-
static fromExpression(expression: string, options: DiceTerm.Options): DiceTerm | null;
|
225
|
-
|
226
|
-
/* -------------------------------------------- */
|
227
|
-
|
228
222
|
/**
|
229
223
|
* Determine whether a string expression matches this type of term
|
230
224
|
* @param expression - The expression to parse
|
@@ -242,18 +236,6 @@ declare abstract class DiceTerm extends RollTerm {
|
|
242
236
|
* @returns The constructed term
|
243
237
|
*/
|
244
238
|
static fromMatch(match: RegExpMatchArray): DiceTerm;
|
245
|
-
|
246
|
-
/* -------------------------------------------- */
|
247
|
-
|
248
|
-
/**
|
249
|
-
* @deprecated since 0.8.1
|
250
|
-
*/
|
251
|
-
static fromResults(options: Partial<DiceTerm.TermData>, results: DiceTerm.Result[]): DiceTerm;
|
252
|
-
|
253
|
-
/**
|
254
|
-
* @deprecated since 0.8.1
|
255
|
-
*/
|
256
|
-
static getResultLabel(): string;
|
257
239
|
}
|
258
240
|
|
259
241
|
declare namespace DiceTerm {
|
@@ -44,6 +44,9 @@ declare global {
|
|
44
44
|
|
45
45
|
get expression(): string;
|
46
46
|
|
47
|
+
/** @override */
|
48
|
+
get isDeterministic(): boolean;
|
49
|
+
|
47
50
|
protected _evaluateSync({ minimize, maximize }?: { minimize?: boolean; maximize?: boolean }): this;
|
48
51
|
|
49
52
|
protected _evaluate({ minimize, maximize }?: { minimize?: boolean; maximize?: boolean }): Promise<this>;
|
@@ -22,6 +22,9 @@ declare class ParentheticalTerm extends RollTerm {
|
|
22
22
|
/** An array of evaluated DiceTerm instances that should be bubbled up to the parent Roll */
|
23
23
|
get dice(): DiceTerm[];
|
24
24
|
|
25
|
+
/** @override */
|
26
|
+
get isDeterministic(): boolean;
|
27
|
+
|
25
28
|
/**
|
26
29
|
* Construct a ParentheticalTerm from an Array of component terms which should be wrapped inside the parentheses.
|
27
30
|
* @param terms - The array of terms to use as internal parts of the parenthetical
|
@@ -177,11 +177,6 @@ declare global {
|
|
177
177
|
countFailures(modifier: string): ReturnType<Die['countFailures']>;
|
178
178
|
}
|
179
179
|
|
180
|
-
/**
|
181
|
-
* @deprecated since 0.8.1
|
182
|
-
*/
|
183
|
-
const DicePool: typeof PoolTerm;
|
184
|
-
|
185
180
|
namespace PoolTerm {
|
186
181
|
/**
|
187
182
|
* @remarks This interface is not defined by foundry itself. It only exists
|
@@ -209,6 +204,9 @@ interface PoolTermConstructorData {
|
|
209
204
|
*/
|
210
205
|
terms?: string[];
|
211
206
|
|
207
|
+
/** @override */
|
208
|
+
get isDeterministic(): boolean;
|
209
|
+
|
212
210
|
/**
|
213
211
|
* @defaultValue `[]`
|
214
212
|
*/
|
@@ -16,7 +16,10 @@ declare global {
|
|
16
16
|
|
17
17
|
get total(): string;
|
18
18
|
|
19
|
-
|
19
|
+
/** @override */
|
20
|
+
get isDeterministic(): boolean;
|
21
|
+
|
22
|
+
evaluate(options?: InexactPartial<RollTerm.EvaluationOptions>): never;
|
20
23
|
}
|
21
24
|
}
|
22
25
|
|
@@ -6,7 +6,7 @@ declare class TextEditor {
|
|
6
6
|
* Create a Rich Text Editor. The current implementation uses TinyMCE
|
7
7
|
* @param options - Configuration options provided to the Editor init
|
8
8
|
* @param content - Initial HTML or text content to populate the editor with
|
9
|
-
* (default: `
|
9
|
+
* (default: `""`)
|
10
10
|
* @returns The editor instance.
|
11
11
|
*/
|
12
12
|
static create(options: TextEditor.Options, content: string): Promise<tinyMCE.Editor>;
|
package/src/foundry/index.d.ts
CHANGED
@@ -14,6 +14,7 @@ import './foundry.js/chatBubbles';
|
|
14
14
|
import './foundry.js/clientDatabaseBackend';
|
15
15
|
import './foundry.js/clientDocuments';
|
16
16
|
import './foundry.js/clientDocumentMixin';
|
17
|
+
import './foundry.js/clientKeybindings';
|
17
18
|
import './foundry.js/clientSettings';
|
18
19
|
import './foundry.js/config';
|
19
20
|
import './foundry.js/constants';
|
@@ -24,6 +25,7 @@ import './foundry.js/features';
|
|
24
25
|
import './foundry.js/fonts';
|
25
26
|
import './foundry.js/formDataExtended';
|
26
27
|
import './foundry.js/game';
|
28
|
+
import './foundry.js/gamepadManager';
|
27
29
|
import './foundry.js/gameTime';
|
28
30
|
import './foundry.js/globalVariables';
|
29
31
|
import './foundry.js/handlebarsHelpers';
|
@@ -33,6 +35,8 @@ import './foundry.js/keyboardManager';
|
|
33
35
|
import './foundry.js/localization';
|
34
36
|
import './foundry.js/mersenneTwister';
|
35
37
|
import './foundry.js/mouseInteractionManager';
|
38
|
+
import './foundry.js/mouseManager';
|
39
|
+
import './foundry.js/newUserExperience';
|
36
40
|
import './foundry.js/perceptionManager';
|
37
41
|
import './foundry.js/pointSource';
|
38
42
|
import './foundry.js/quadtree';
|
package/src/types/utils.d.ts
CHANGED
@@ -2,10 +2,18 @@
|
|
2
2
|
* Recursively sets keys of an object to optional. Used primarily for update methods
|
3
3
|
* @internal
|
4
4
|
*/
|
5
|
-
|
5
|
+
type DeepPartial<T> = {
|
6
6
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
7
7
|
};
|
8
8
|
|
9
|
+
/**
|
10
|
+
* Make all properties in T optional and explicitly allow `undefined`
|
11
|
+
* @internal
|
12
|
+
*/
|
13
|
+
type InexactPartial<T> = {
|
14
|
+
[P in keyof T]?: T[P] | undefined;
|
15
|
+
};
|
16
|
+
|
9
17
|
/**
|
10
18
|
* References the constructor of type `T`
|
11
19
|
* @internal
|
@@ -75,7 +83,7 @@ type Expanded<O> = O extends Record<string, unknown>
|
|
75
83
|
* Union type of the types of the values in `T`
|
76
84
|
* @internal
|
77
85
|
*/
|
78
|
-
type ValueOf<T> = T extends Array<unknown> ? T[number] : T[keyof T];
|
86
|
+
type ValueOf<T> = T extends Array<unknown> | ReadonlyArray<unknown> ? T[number] : T[keyof T];
|
79
87
|
|
80
88
|
/**
|
81
89
|
* Transforms a string to lowercase and the first character to uppercase.
|
@@ -96,7 +104,7 @@ type Titlecase<S extends string> = S extends `${infer A} ${infer B}`
|
|
96
104
|
* @typeParam U - The type that will be merged into `T`.
|
97
105
|
*/
|
98
106
|
type Merge<T, U> = T extends object
|
99
|
-
? U extends Array<any>
|
107
|
+
? U extends Array<any> | ReadonlyArray<any>
|
100
108
|
? U
|
101
109
|
: U extends object
|
102
110
|
? {
|