@league-of-foundry-developers/foundry-vtt-types 0.8.9-6 → 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-lenient.d.ts +10 -0
- package/index.d.ts +2 -2
- package/package.json +43 -15
- package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
- package/src/foundry/common/abstract/document.mjs.d.ts +30 -12
- 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 +72 -66
- 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 +100 -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 +4 -7
- 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 +116 -116
- package/src/foundry/foundry.js/applications/formApplication.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +20 -27
- package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +66 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +6 -3
- 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/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +4 -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 +60 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +72 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +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 +187 -148
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +133 -110
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +1 -1
- 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/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 +2 -3
- package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
- 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 +142 -155
- 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/sceneControls.d.ts +13 -3
- package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
- 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/actorDirectory.d.ts +13 -56
- 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/itemDirectory.d.ts +7 -30
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +4 -6
- package/src/foundry/foundry.js/avSettings.d.ts +7 -7
- package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
- package/src/foundry/foundry.js/canvas.d.ts +150 -47
- 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/clientDatabaseBackend.d.ts +210 -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/canvasDocuments/tokenDocument.d.ts +1 -1
- 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 +3 -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/prototypeToken.d.ts +15 -0
- 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 +21 -6
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +45 -12
- 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 +494 -902
- package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
- 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/globalVariables.d.ts +7 -4
- 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/mouseInteractionManager.d.ts +78 -34
- 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/canvasLayer.d.ts +2 -1
- 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/placeablesLayer.d.ts +10 -19
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +6 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +4 -4
- 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/placeableObject.d.ts +4 -1
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
- package/src/foundry/foundry.js/pointSource.d.ts +174 -86
- 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 +40 -9
- package/src/foundry/index.d.ts +5 -0
- package/src/types/utils.d.ts +11 -3
- package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
- package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
package/README.md
CHANGED
@@ -2,47 +2,64 @@
|
|
2
2
|
|
3
3
|
<div align=center>
|
4
4
|
|
5
|
+
<img align=center src="./media/img/league-logo-ts.svg" alt="League Logo TS" width="150"/>
|
6
|
+
|
5
7
|
TypeScript type definitions for [Foundry Virtual Tabletop](https://foundryvtt.com/) (unofficial)
|
6
8
|
|
7
9
|
[](https://discord.gg/52DNPzqm2Z)
|
8
|
-

|
11
|
-

|
10
|
+

|
11
|
+

|
12
12
|
[](https://www.npmjs.com/package/@league-of-foundry-developers/foundry-vtt-types)
|
13
13
|
|
14
14
|
</div>
|
15
15
|
|
16
16
|
## Supported Foundry VTT versions
|
17
17
|
|
18
|
-
We aim to support the latest
|
18
|
+
We aim to support the latest release of each Foundry VTT version (0.7, 0.8, 9, etc.), starting with 0.7.
|
19
|
+
|
20
|
+
At the moment, both version 0.7 and 0.8 are supported. Work on support for version 9 is in progress.
|
19
21
|
|
20
|
-
At the moment, the latest 0.7.x and 0.8.x versions are supported. However, note that work on 0.8.x has not been
|
21
|
-
completed yet, so there are still quite a few things which are either missing or typed incorrectly. Take a look at
|
22
|
-
[0.8.x issues](https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues?q=is%3Aopen+is%3Aissue+label%3A%22foundry+0.8.x%22)
|
23
|
-
to see what still needs to be done.
|
24
22
|
|
25
23
|
## Installation
|
26
24
|
|
27
|
-
You can install foundry-vtt-types from the [npm registry](https://npmjs.org/).
|
28
|
-
different supported Foundry VTT versions that have the form `fvtt-<foundry-version>`. For example, the distribution tag
|
29
|
-
for Foundry VTT 0.8.8 is `fvtt-0.8.8`.
|
25
|
+
You can install foundry-vtt-types from the [npm registry](https://npmjs.org/).
|
30
26
|
|
31
|
-
In order to install the
|
27
|
+
In order to install the latest version, run
|
32
28
|
|
33
29
|
```sh
|
34
|
-
npm install --save-dev @league-of-foundry-developers/foundry-vtt-types
|
30
|
+
npm install --save-dev @league-of-foundry-developers/foundry-vtt-types
|
35
31
|
```
|
36
32
|
|
37
|
-
|
33
|
+
In order to install a specific version run
|
38
34
|
|
39
35
|
```sh
|
40
|
-
npm install --save-dev @league-of-foundry-developers/foundry-vtt-types
|
36
|
+
npm install --save-dev @league-of-foundry-developers/foundry-vtt-types@<version>
|
37
|
+
```
|
38
|
+
|
39
|
+
For example, to install version `0.8.9-9`, run
|
40
|
+
|
41
|
+
```sh
|
42
|
+
npm install --save-dev @league-of-foundry-developers/foundry-vtt-types@0.8.9-9
|
41
43
|
```
|
42
44
|
|
43
45
|
You can then update foundry-vtt-types using the regular update mechanism for npm
|
44
46
|
(see [npm update](https://docs.npmjs.com/cli/v7/commands/npm-update)).
|
45
47
|
|
48
|
+
## Versioning scheme
|
49
|
+
|
50
|
+
The versions of the foundry-vtt-types correspond to the releases of Foundry VTT. The versioning scheme of Foundry VTT
|
51
|
+
changed with version 9, so the versioning scheme for the foundry-vtt-types also changes with that version:
|
52
|
+
* For Foundry VTT version 0.7 and 0.8, the versioning scheme is
|
53
|
+
```
|
54
|
+
0.<foundy-minor-version>.<foundry-patch-version>-<increment>
|
55
|
+
```
|
56
|
+
* For Foundry VTT version 9 and onwards, the versioning scheme is
|
57
|
+
```
|
58
|
+
<foundry-version>.<foundry-build>.<increment>
|
59
|
+
```
|
60
|
+
In both cases, `increment` is a number that increases with every individual release of the foundry-vtt-types for that
|
61
|
+
Foundry VTT release.
|
62
|
+
|
46
63
|
## Usage
|
47
64
|
|
48
65
|
Add foundry-vtt-types to your types section in your `tsconfig.json`:
|
@@ -62,13 +79,13 @@ This will make the type definitions available globally in your project.
|
|
62
79
|
Make sure you are using `"moduleResolution": "node"`, too. It is required for some dependencies to be resolved
|
63
80
|
correctly.
|
64
81
|
|
65
|
-
Also make sure to set `"strictNullChecks": true` because otherwise, some
|
66
|
-
|
82
|
+
Also make sure to set `"strictNullChecks": true` because otherwise, some conditional types used in the type definitions
|
83
|
+
resolve incorrectly, and you will see a lot of errors. Alternatively, you can just set `"strict": true`, which
|
84
|
+
implicitly sets `strictNullChecks`. This is actually what we **recommend**, but it's not required.
|
67
85
|
|
68
86
|
You can find some information about how to actually work with the type definitions in the
|
69
|
-
[Wiki](https://github.com/League-of-Foundry-Developers/foundry-vtt-types/wiki).
|
70
|
-
|
71
|
-
[[0.8.x] FAQ](https://github.com/League-of-Foundry-Developers/foundry-vtt-types/wiki/%5B0.8.x%5D-FAQ).
|
87
|
+
[Wiki](https://github.com/League-of-Foundry-Developers/foundry-vtt-types/wiki). A good starting point is
|
88
|
+
the [FAQ](https://github.com/League-of-Foundry-Developers/foundry-vtt-types/wiki/FAQ).
|
72
89
|
|
73
90
|
## Acknowledgments
|
74
91
|
|
@@ -80,10 +97,10 @@ by [@NickEastNL](https://gitlab.com/NvanOosten)
|
|
80
97
|
Contributions are very welcome in order to decrease the individual workload. Filing issues for wrong / missing types is
|
81
98
|
also a great way to help us improve the type definitions.
|
82
99
|
|
83
|
-
|
84
|
-
|
85
|
-
`foundry-0.8.x`. All work to improve the type
|
86
|
-
to the
|
100
|
+
Development on the current version of Foundry VTT is done on the `main` branch. Additionally, we keep branches for the
|
101
|
+
older version of Foundry VTT that we still support. These branches are named according to the Foundry VTT version they
|
102
|
+
correspond to. For example, the branch for Foundry VTT 0.8 is called `foundry-0.8.x`. All work to improve the type
|
103
|
+
definitions needs to be done through Pull Requests to the relevant branch.
|
87
104
|
|
88
105
|
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for more details on how to contribute.
|
89
106
|
|
@@ -92,7 +109,7 @@ If you have any specific questions, feel free to contact us in the
|
|
92
109
|
|
93
110
|
## Type-Checking, Linting, Testing
|
94
111
|
|
95
|
-
When contributing, make sure
|
112
|
+
When contributing, make sure that the type checks pass, the linter is green and the tests are green. We _do_ have
|
96
113
|
checks in the CI but running this locally also helps you while developing and saves you time as you don't have to wait
|
97
114
|
for the CI.
|
98
115
|
|
@@ -114,7 +131,7 @@ To create a release, you have to create a new release commit, tag it and create
|
|
114
131
|
handle the rest.
|
115
132
|
|
116
133
|
```
|
117
|
-
npm version
|
134
|
+
npm version <release-type>
|
118
135
|
git push --follow-tags
|
119
136
|
```
|
120
137
|
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@league-of-foundry-developers/foundry-vtt-types",
|
3
|
-
"version": "
|
3
|
+
"version": "9.238.0",
|
4
4
|
"description": "TypeScript type definitions for Foundry VTT",
|
5
|
+
"exports": {
|
6
|
+
".": {
|
7
|
+
"types": "./index.d.ts"
|
8
|
+
},
|
9
|
+
"./lenient": {
|
10
|
+
"types": "./index-lenient.d.ts"
|
11
|
+
}
|
12
|
+
},
|
5
13
|
"scripts": {
|
6
14
|
"lint": "./node_modules/typescript/bin/tsc && eslint --ext .d.ts,.test-d.ts .",
|
7
15
|
"lint:fix": "eslint --fix --ext .d.ts,.test-d.ts .",
|
@@ -15,7 +23,26 @@
|
|
15
23
|
"type": "git",
|
16
24
|
"url": "https://github.com/League-of-Foundry-Developers/foundry-vtt-types"
|
17
25
|
},
|
18
|
-
"
|
26
|
+
"contributors": [
|
27
|
+
{
|
28
|
+
"name": "Kai Moschcau"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"name": "Johannes Loher"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"name": "Oskar Pfeifer-Bley"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"name": "FloRad"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"name": "NickEastNL"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"name": "BoltsJ"
|
44
|
+
}
|
45
|
+
],
|
19
46
|
"license": "MIT",
|
20
47
|
"bugs": {
|
21
48
|
"url": "https://github.com/League-of-Foundry-Developers/foundry-vtt-types/issues"
|
@@ -28,26 +55,26 @@
|
|
28
55
|
"typscript"
|
29
56
|
],
|
30
57
|
"dependencies": {
|
31
|
-
"@types/jquery": "~3.5.
|
58
|
+
"@types/jquery": "~3.5.9",
|
32
59
|
"@types/simple-peer": "~9.11.1",
|
33
60
|
"handlebars": "4.7.7",
|
34
61
|
"pixi-particles": "4.3.1",
|
35
|
-
"pixi.js": "5.3.
|
36
|
-
"socket.io-client": "4.
|
37
|
-
"tinymce": "5.
|
62
|
+
"pixi.js": "5.3.11",
|
63
|
+
"socket.io-client": "4.3.2",
|
64
|
+
"tinymce": "5.10.1"
|
38
65
|
},
|
39
66
|
"devDependencies": {
|
40
|
-
"@typescript-eslint/eslint-plugin": "^
|
41
|
-
"@typescript-eslint/parser": "^
|
42
|
-
"eslint": "^
|
67
|
+
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
68
|
+
"@typescript-eslint/parser": "^5.5.0",
|
69
|
+
"eslint": "^8.4.0",
|
43
70
|
"eslint-config-prettier": "^8.3.0",
|
44
71
|
"eslint-plugin-prettier": "^4.0.0",
|
45
72
|
"eslint-plugin-tsdoc": "^0.2.14",
|
46
|
-
"husky": "^7.0.
|
47
|
-
"lint-staged": "^
|
48
|
-
"prettier": "^2.
|
49
|
-
"tsd": "
|
50
|
-
"typescript": "
|
73
|
+
"husky": "^7.0.4",
|
74
|
+
"lint-staged": "^12.1.2",
|
75
|
+
"prettier": "^2.5.1",
|
76
|
+
"tsd": "~0.18.0",
|
77
|
+
"typescript": "~4.5.3"
|
51
78
|
},
|
52
79
|
"husky": {
|
53
80
|
"hooks": {
|
@@ -56,10 +83,11 @@
|
|
56
83
|
},
|
57
84
|
"lint-staged": {
|
58
85
|
"*.(d.ts|test-d.ts)": "eslint --fix",
|
59
|
-
"*.(js|json)": "prettier --write"
|
86
|
+
"*.(js|json|yml)": "prettier --write"
|
60
87
|
},
|
61
88
|
"files": [
|
62
89
|
"index.d.ts",
|
90
|
+
"index-lenient.d.ts",
|
63
91
|
"src"
|
64
92
|
],
|
65
93
|
"publishConfig": {
|
@@ -27,22 +27,28 @@ declare abstract class DatabaseBackend {
|
|
27
27
|
|
28
28
|
/**
|
29
29
|
* Get primary Document instances
|
30
|
+
* @remarks
|
31
|
+
* foundry actually declares this function to take parameters `documentClass`, `query`, `options`, and `user` but
|
32
|
+
* that's not how it is called and also not how the subclasses implement it.
|
33
|
+
* See https://gitlab.com/foundrynet/foundryvtt/-/issues/6177
|
30
34
|
*/
|
31
35
|
protected abstract _getDocuments<T extends Document<any, any>>(
|
32
36
|
documentClass: ConstructorOf<T>,
|
33
|
-
|
34
|
-
options: RequestOptions,
|
37
|
+
request: Request,
|
35
38
|
user: BaseUser
|
36
39
|
): Promise<T[]>;
|
37
40
|
|
38
41
|
/**
|
39
42
|
* Get embedded Document instances
|
43
|
+
* @remarks
|
44
|
+
* foundry actually declares this function to take parameters `documentClass`, `parent`, `query`, `options`, and
|
45
|
+
* `user` but that's not how it is called and also not how the subclasses implement it.
|
46
|
+
* See https://gitlab.com/foundrynet/foundryvtt/-/issues/6177
|
40
47
|
*/
|
41
48
|
protected abstract _getEmbeddedDocuments<T extends Document<any, any>>(
|
42
49
|
documentClass: ConstructorOf<T>,
|
43
50
|
parent: T extends Document<any, infer U> ? U : never,
|
44
|
-
|
45
|
-
options: RequestOptions,
|
51
|
+
request: Request,
|
46
52
|
user: BaseUser
|
47
53
|
): Promise<T[]>;
|
48
54
|
|
@@ -198,7 +204,8 @@ declare abstract class DatabaseBackend {
|
|
198
204
|
* @param action - The action performed
|
199
205
|
* @param type - The document type
|
200
206
|
* @param documents - The documents modified
|
201
|
-
* @param
|
207
|
+
* @param level - The logging level
|
208
|
+
* (default: `'info'`)
|
202
209
|
* @param parent - A parent document
|
203
210
|
* @param pack - A compendium pack within which the operation occurred
|
204
211
|
*/
|
@@ -225,24 +232,16 @@ declare abstract class DatabaseBackend {
|
|
225
232
|
protected _logContext({ parent, pack }?: { parent?: Document<any, any>; pack?: string }): string;
|
226
233
|
}
|
227
234
|
|
228
|
-
interface Request {
|
235
|
+
export interface Request {
|
229
236
|
data?: AnyDocumentData[];
|
230
237
|
updates?: AnyDocumentData[];
|
231
238
|
ids?: string[];
|
232
239
|
parent?: Document<any, any>;
|
233
|
-
query?:
|
240
|
+
query?: Record<string, unknown>;
|
234
241
|
options?: RequestOptions;
|
235
242
|
pack?: string;
|
236
243
|
}
|
237
244
|
|
238
|
-
export interface IdQuery {
|
239
|
-
_id: string;
|
240
|
-
}
|
241
|
-
export interface SceneIdUserQuery {
|
242
|
-
sceneId: string;
|
243
|
-
user: string;
|
244
|
-
}
|
245
|
-
|
246
245
|
export interface RequestOptions {
|
247
246
|
index?: boolean;
|
248
247
|
broadcast?: boolean;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { BaseUser } from '../documents.mjs';
|
2
|
-
import DatabaseBackend from './backend.mjs';
|
3
2
|
import { AnyDocumentData } from './data.mjs';
|
4
3
|
import {
|
5
4
|
ConfiguredDocumentClass,
|
@@ -82,7 +81,7 @@ declare abstract class Document<
|
|
82
81
|
/**
|
83
82
|
* The database backend used to execute operations and handle results
|
84
83
|
*/
|
85
|
-
static get database(): DatabaseBackend;
|
84
|
+
static get database(): CONFIG['DatabaseBackend'];
|
86
85
|
|
87
86
|
/**
|
88
87
|
* Return a reference to the implemented subclass of this base document type.
|
@@ -125,7 +124,7 @@ declare abstract class Document<
|
|
125
124
|
get name(): string | null;
|
126
125
|
|
127
126
|
/**
|
128
|
-
* Test whether a given User has a sufficient role in order to create Documents of this type.
|
127
|
+
* Test whether a given User has a sufficient role in order to create Documents of this type in general.
|
129
128
|
* @param user - The User being tested
|
130
129
|
* @returns Does the User have a sufficient role to create?
|
131
130
|
*/
|
@@ -138,35 +137,35 @@ declare abstract class Document<
|
|
138
137
|
* (default: `{}`)
|
139
138
|
* @param save - Save the clone to the World database?
|
140
139
|
* (default: `false`)
|
141
|
-
* @param
|
142
|
-
* (default: `
|
140
|
+
* @param context - Additional context options passed to the create method
|
141
|
+
* (default: `{}`)
|
143
142
|
* @returns The cloned Document instance
|
144
143
|
*/
|
145
144
|
clone(
|
146
145
|
data?: DeepPartial<
|
147
146
|
ConstructorDataType<ConcreteDocumentData> | (ConstructorDataType<ConcreteDocumentData> & Record<string, unknown>)
|
148
147
|
>,
|
149
|
-
{ save,
|
148
|
+
{ save, ...context }?: { save: boolean } & DocumentModificationContext
|
150
149
|
): TemporaryDocument<this> | Promise<TemporaryDocument<this> | undefined>;
|
151
150
|
|
152
151
|
/**
|
153
|
-
* Get the permission level that a specific User has over this Document, a value in CONST.
|
152
|
+
* Get the permission level that a specific User has over this Document, a value in CONST.DOCUMENT_PERMISSION_LEVELS.
|
154
153
|
* @param user - The User being tested
|
155
|
-
* @returns A numeric permission level from CONST.
|
154
|
+
* @returns A numeric permission level from CONST.DOCUMENT_PERMISSION_LEVELS or null
|
156
155
|
*/
|
157
|
-
getUserLevel(user: BaseUser): foundry.CONST.
|
156
|
+
getUserLevel(user: BaseUser): foundry.CONST.DOCUMENT_PERMISSION_LEVELS | null;
|
158
157
|
|
159
158
|
/**
|
160
159
|
* Test whether a certain User has a requested permission level (or greater) over the Document
|
161
160
|
* @param user - The User being tested
|
162
|
-
* @param permission - The permission level from
|
161
|
+
* @param permission - The permission level from DOCUMENT_PERMISSION_LEVELS to test
|
163
162
|
* @param exact - Require the exact permission level requested?
|
164
163
|
* (default: `false`)
|
165
164
|
* @returns Does the user have this permission level over the Document?
|
166
165
|
*/
|
167
166
|
testUserPermission(
|
168
167
|
user: BaseUser,
|
169
|
-
permission: keyof typeof foundry.CONST.
|
168
|
+
permission: keyof typeof foundry.CONST.DOCUMENT_PERMISSION_LEVELS | foundry.CONST.DOCUMENT_PERMISSION_LEVELS,
|
170
169
|
{ exact }?: { exact?: boolean }
|
171
170
|
): boolean;
|
172
171
|
|
@@ -688,6 +687,13 @@ declare abstract class Document<
|
|
688
687
|
toJSON(): this['id'] extends string
|
689
688
|
? ReturnType<ConcreteDocumentData['toJSON']> & { _id: string }
|
690
689
|
: ReturnType<ConcreteDocumentData['toJSON']>;
|
690
|
+
|
691
|
+
/**
|
692
|
+
* For Documents which include game system data, migrate the system data object to conform to its latest data model.
|
693
|
+
* The data model is defined by the template.json specification included by the game system.
|
694
|
+
* @returns The migrated system data object
|
695
|
+
*/
|
696
|
+
migrateSystemData(): object;
|
691
697
|
}
|
692
698
|
|
693
699
|
export interface DocumentModificationOptions {
|
@@ -703,12 +709,23 @@ export interface DocumentModificationOptions {
|
|
703
709
|
*/
|
704
710
|
index?: boolean;
|
705
711
|
|
712
|
+
/**
|
713
|
+
* An array of fields to retrieve when indexing the collection
|
714
|
+
*/
|
715
|
+
indexFields?: string[];
|
716
|
+
|
706
717
|
/**
|
707
718
|
* When performing a creation operation, keep the provided _id instead of clearing it.
|
708
719
|
* @defaultValue `false`
|
709
720
|
*/
|
710
721
|
keepId?: boolean;
|
711
722
|
|
723
|
+
/**
|
724
|
+
* When performing a creation operation, keep existing _id values of documents embedded within the one being created instead of generating new ones.
|
725
|
+
* @defaultValue `true`
|
726
|
+
*/
|
727
|
+
keepEmbeddedIds?: boolean;
|
728
|
+
|
712
729
|
/**
|
713
730
|
* Create a temporary document which is not saved to the database. Only used during creation.
|
714
731
|
* @defaultValue `false`
|
@@ -780,7 +797,8 @@ export interface Metadata<ConcreteDocument extends Document<any, any>> {
|
|
780
797
|
name: DocumentType;
|
781
798
|
collection: string;
|
782
799
|
label: string;
|
783
|
-
|
800
|
+
labelPlural: string; // This is not set for the Document class but every class that implements Document actually provides it.
|
801
|
+
types: readonly string[];
|
784
802
|
embedded: Record<string, ConstructorOf<Document<any, any>>>;
|
785
803
|
hasSystemData: boolean;
|
786
804
|
permissions: {
|
@@ -0,0 +1 @@
|
|
1
|
+
export { ReleaseData } from './releaseData';
|
@@ -0,0 +1,98 @@
|
|
1
|
+
import { PropertiesToSource } from '../../../types/helperTypes';
|
2
|
+
import { DocumentData } from '../abstract/module.mjs';
|
3
|
+
import * as fields from '../data/fields.mjs';
|
4
|
+
|
5
|
+
export interface ReleaseDataSchema extends DocumentSchema {
|
6
|
+
generation: typeof fields.REQUIRED_NUMBER;
|
7
|
+
channel: typeof fields.REQUIRED_STRING;
|
8
|
+
suffix: typeof fields.STRING_FIELD;
|
9
|
+
build: typeof fields.REQUIRED_NUMBER;
|
10
|
+
time: typeof fields.TIMESTAMP_FIELD;
|
11
|
+
node_version: typeof fields.POSITIVE_INTEGER_FIELD;
|
12
|
+
notes: typeof fields.BLANK_STRING;
|
13
|
+
download: typeof fields.BLANK_STRING;
|
14
|
+
}
|
15
|
+
|
16
|
+
export interface ReleaseDataProperties {
|
17
|
+
/** The major generation of the Release */
|
18
|
+
generation: number;
|
19
|
+
|
20
|
+
/** The channel the Release belongs to, such as "stable" */
|
21
|
+
channel: string;
|
22
|
+
|
23
|
+
/** An optional appended string display for the Release */
|
24
|
+
suffix: string | undefined;
|
25
|
+
|
26
|
+
/** The internal build number for the Release */
|
27
|
+
build: number;
|
28
|
+
|
29
|
+
/** When the Release was released */
|
30
|
+
time: number | undefined;
|
31
|
+
|
32
|
+
/** The minimum required Node.js major version */
|
33
|
+
node_version: number | undefined;
|
34
|
+
|
35
|
+
/** Release notes for the update version */
|
36
|
+
notes: string;
|
37
|
+
|
38
|
+
/** A temporary download URL where this version may be obtained */
|
39
|
+
download: string;
|
40
|
+
}
|
41
|
+
|
42
|
+
export interface ReleaseDataConstructorData {
|
43
|
+
/** The major generation of the Release */
|
44
|
+
generation?: number | undefined | null;
|
45
|
+
|
46
|
+
/** The channel the Release belongs to, such as "stable" */
|
47
|
+
channel: string;
|
48
|
+
|
49
|
+
/** An optional appended string display for the Release */
|
50
|
+
suffix?: string | undefined | null;
|
51
|
+
|
52
|
+
/** The internal build number for the Release */
|
53
|
+
build?: number | undefined | null;
|
54
|
+
|
55
|
+
/** When the Release was released */
|
56
|
+
time?: number | undefined | null;
|
57
|
+
|
58
|
+
/** The minimum required Node.js major version */
|
59
|
+
node_version?: number | undefined | null;
|
60
|
+
|
61
|
+
/** Release notes for the update version */
|
62
|
+
notes?: string | undefined | null;
|
63
|
+
|
64
|
+
/** A temporary download URL where this version may be obtained */
|
65
|
+
download?: string | undefined | null;
|
66
|
+
}
|
67
|
+
|
68
|
+
/** A data object which represents the details of this Release of Foundry VTT */
|
69
|
+
export declare class ReleaseData<
|
70
|
+
Schema extends ReleaseDataSchema = ReleaseDataSchema,
|
71
|
+
Properties extends ReleaseDataProperties = ReleaseDataProperties,
|
72
|
+
ConstructorData extends ReleaseDataConstructorData = ReleaseDataConstructorData
|
73
|
+
> extends DocumentData<Schema, Properties, PropertiesToSource<ReleaseDataProperties>, ConstructorData> {
|
74
|
+
static defineSchema(): ReleaseDataSchema;
|
75
|
+
|
76
|
+
/** A formatted string for shortened display, such as "Version 9" */
|
77
|
+
get shortDisplay(): string;
|
78
|
+
|
79
|
+
/** A formatted string for general display, such as "V9 Prototype 1" */
|
80
|
+
get display(): string;
|
81
|
+
|
82
|
+
/** A formatted string for Version compatibility checking, such as "9.150" */
|
83
|
+
get version(): string;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Is this ReleaseData object newer than some other version?
|
87
|
+
* @param other - Some other version to compare against
|
88
|
+
* @returns Is this ReleaseData a newer version?
|
89
|
+
*/
|
90
|
+
isNewer(other: string | ReleaseData): boolean;
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Is this ReleaseData object a newer generation than some other version?
|
94
|
+
* @param other - Some other version to compare against
|
95
|
+
* @returns Is this ReleaseData a newer generation?
|
96
|
+
*/
|
97
|
+
isGenerationalChange(other: string | ReleaseData): boolean;
|
98
|
+
}
|