@league-of-foundry-developers/foundry-vtt-types 0.8.9-9 → 9.245.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 +403 -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 +24 -23
- 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 +118 -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 +9 -2
- 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/geometry.mjs.d.ts +148 -0
- package/src/foundry/common/utils/helpers.mjs.d.ts +64 -39
- package/src/foundry/common/utils/module.mjs.d.ts +1 -0
- package/src/foundry/common/utils/primitives.mjs.d.ts +106 -16
- package/src/foundry/foundry.js/application.d.ts +138 -110
- package/src/foundry/foundry.js/applications/basePlaceableHUD.d.ts +2 -2
- package/src/foundry/foundry.js/applications/basePlaceableHUDs/drawingHUD.d.ts +2 -2
- package/src/foundry/foundry.js/applications/basePlaceableHUDs/tileHUD.d.ts +2 -2
- package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +3 -3
- package/src/foundry/foundry.js/applications/cameraViews.d.ts +2 -2
- package/src/foundry/foundry.js/applications/chatPopout.d.ts +3 -3
- package/src/foundry/foundry.js/applications/compendium.d.ts +2 -2
- package/src/foundry/foundry.js/applications/dialog.d.ts +1 -1
- package/src/foundry/foundry.js/applications/filePicker.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplication.d.ts +46 -15
- package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +20 -31
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +5 -5
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +5 -5
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +7 -7
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +7 -10
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +7 -7
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +7 -7
- package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +2 -2
- 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/moduleManagement.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +11 -12
- package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +9 -9
- package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/frameViewer.d.ts +1 -1
- package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +2 -2
- package/src/foundry/foundry.js/applications/hotbar.d.ts +2 -2
- package/src/foundry/foundry.js/applications/mainMenu.d.ts +2 -2
- package/src/foundry/foundry.js/applications/notifications.d.ts +7 -4
- package/src/foundry/foundry.js/applications/pause.d.ts +2 -2
- package/src/foundry/foundry.js/applications/playerList.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sceneControls.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +3 -3
- package/src/foundry/foundry.js/applications/sidebar.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTab.d.ts +5 -8
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +8 -7
- package/src/foundry/foundry.js/applications/sidebarTabs/combatTracker.d.ts +26 -28
- package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +4 -4
- package/src/foundry/foundry.js/applications/sidebarTabs/settings.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 +3 -3
- package/src/foundry/foundry.js/audioContainer.d.ts +28 -10
- package/src/foundry/foundry.js/avSettings.d.ts +7 -7
- package/src/foundry/foundry.js/canvas.d.ts +153 -46
- package/src/foundry/foundry.js/canvasAnimation.d.ts +31 -8
- package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +47 -92
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +11 -11
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
- package/src/foundry/foundry.js/clientDocuments/card.d.ts +134 -0
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +370 -0
- package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
- package/src/foundry/foundry.js/clientDocuments/combat.d.ts +46 -48
- package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +15 -18
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +15 -11
- 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 +2 -2
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
- package/src/foundry/foundry.js/clientKeybindings.d.ts +309 -0
- package/src/foundry/foundry.js/clientSettings.d.ts +12 -10
- package/src/foundry/foundry.js/collections/documentCollection.d.ts +1 -1
- 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/folders.d.ts +1 -1
- 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/collisionResult.d.ts +60 -0
- package/src/foundry/foundry.js/config.d.ts +487 -907
- package/src/foundry/foundry.js/dragDrop.d.ts +27 -34
- package/src/foundry/foundry.js/game.d.ts +171 -50
- 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 +210 -84
- package/src/foundry/foundry.js/imageHelper.d.ts +26 -2
- 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/placeableObject.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +3 -3
- package/src/foundry/foundry.js/pixi/index.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/meshes/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/meshes/samplerMesh.d.ts +22 -0
- package/src/foundry/foundry.js/pixi/points/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +92 -0
- package/src/foundry/foundry.js/pixi/polygons/index.d.ts +2 -1
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +98 -0
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +396 -0
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/rectangles/normalizedRectangle.d.ts +7 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +11 -37
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShader.d.ts +114 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveBackgroundShader.d.ts +57 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShader.d.ts +47 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/bewitchingWaveColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/chromaColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/emanationColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/energyFieldColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fairyLightColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fogColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/ghostLightColorationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/hexaDomeColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/index.d.ts +5 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/lightDomeColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/pulseColorationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/radialRainbowColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/sunburstColorationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/swirlingRainbowColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/torchColorationShader.d.ts +3 -2
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/vortexColorationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/waveColorationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShader.d.ts +63 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/bewitchingWaveIlluminationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/blackHoleIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/fairyLightIlluminationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/ghostLightIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/index.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/pulseIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/roilingIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/sunburstIlluminationShader.d.ts +1 -2
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/torchIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/vortexIlluminationShader.d.ts +6 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/waveIlluminationShader.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/index.d.ts +5 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/baseSamplerShader.d.ts +22 -0
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/index.d.ts +3 -4
- package/src/foundry/foundry.js/pixi/texts/preciseText.d.ts +10 -2
- package/src/foundry/foundry.js/pixi/transforms/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/transforms/synchronizedTransform.d.ts +38 -0
- package/src/foundry/foundry.js/pointSource.d.ts +59 -328
- package/src/foundry/foundry.js/pointSources/index.d.ts +3 -0
- package/src/foundry/foundry.js/pointSources/lightSource.d.ts +417 -0
- package/src/foundry/foundry.js/pointSources/soundSource.d.ts +46 -0
- package/src/foundry/foundry.js/pointSources/visionSource.d.ts +125 -0
- package/src/foundry/foundry.js/polygonEdge.d.ts +26 -0
- package/src/foundry/foundry.js/polygonVertex.d.ts +89 -0
- package/src/foundry/foundry.js/quadtree.d.ts +2 -2
- package/src/foundry/foundry.js/quadtreeCulling.d.ts +11 -0
- package/src/foundry/foundry.js/ray.d.ts +156 -162
- package/src/foundry/foundry.js/rays/index.d.ts +1 -0
- package/src/foundry/foundry.js/rays/sightRay.d.ts +34 -0
- package/src/foundry/foundry.js/roll.d.ts +51 -65
- 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/screenCulling.d.ts +19 -0
- package/src/foundry/foundry.js/searchFilter.d.ts +37 -33
- package/src/foundry/foundry.js/specialEffect.d.ts +1 -1
- package/src/foundry/foundry.js/textEditor.d.ts +1 -1
- package/src/foundry/foundry.js/textureLoader.d.ts +28 -18
- package/src/foundry/foundry.js/textureUtils.d.ts +5 -8
- package/src/foundry/foundry.js/videoHelper.d.ts +2 -1
- package/src/foundry/index.d.ts +29 -26
- package/src/types/utils.d.ts +11 -3
- package/src/foundry/foundry.js/pixi/polygons/sourcePolygon.d.ts +0 -25
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShader.d.ts +0 -21
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/chromaColorationShader.d.ts +0 -18
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/emanationColorationShader.d.ts +0 -17
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/energyFieldColorationShader.d.ts +0 -18
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/fogColorationShader.d.ts +0 -17
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/hexaDomeColorationShader.d.ts +0 -17
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/lightDomeColorationShader.d.ts +0 -17
- package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardIlluminationShader.d.ts +0 -22
@@ -97,12 +97,12 @@ declare class Quadtree<T> {
|
|
97
97
|
|
98
98
|
/**
|
99
99
|
* Get all the objects which could collide with the provided rectangle
|
100
|
-
* @param rect - The target rectangle
|
100
|
+
* @param rect - The normalized target rectangle
|
101
101
|
* @param _s - The existing result set, for internal use.
|
102
102
|
* (default: `new Set<T>()`)
|
103
103
|
* @returns The objects in the Quadtree which represent potential collisions
|
104
104
|
*/
|
105
|
-
getObjects(rect:
|
105
|
+
getObjects(rect: NormalizedRectangle, _s?: Set<T>): Set<T>;
|
106
106
|
|
107
107
|
/**
|
108
108
|
* Obtain the leaf nodes to which a target rectangle belongs.
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* An experimental approach to culling using the quadtree mapping rather than the screen rectangle.
|
3
|
+
* @internal
|
4
|
+
*/
|
5
|
+
declare class QuadtreeCulling {
|
6
|
+
constructor();
|
7
|
+
|
8
|
+
cull(screen: Rectangle): void;
|
9
|
+
|
10
|
+
protected _getRect(screen: Rectangle): NormalizedRectangle;
|
11
|
+
}
|
@@ -1,171 +1,165 @@
|
|
1
|
-
|
2
|
-
/** The x-coordinate of intersection */
|
3
|
-
x: number;
|
1
|
+
import type { LineIntersection } from '../common/utils/geometry.mjs.js';
|
4
2
|
|
5
|
-
|
6
|
-
|
3
|
+
declare global {
|
4
|
+
interface RayIntersection {
|
5
|
+
/** The x-coordinate of intersection */
|
6
|
+
x: number;
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
/** The y-coordinate of intersection */
|
9
|
+
y: number;
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
}
|
14
|
-
|
15
|
-
/**
|
16
|
-
* A ray for the purposes of computing sight and collision
|
17
|
-
* Given points A[x,y] and B[x,y]
|
18
|
-
*
|
19
|
-
* Slope-Intercept form:
|
20
|
-
* y = a + bx
|
21
|
-
* y = A.y + ((B.y - A.Y) / (B.x - A.x))x
|
22
|
-
*
|
23
|
-
* Parametric form:
|
24
|
-
* R(t) = (1-t)A + tB
|
25
|
-
*/
|
26
|
-
declare class Ray {
|
27
|
-
/**
|
28
|
-
* @param A - The origin of the Ray
|
29
|
-
* @param B - The destination of the Ray
|
30
|
-
*/
|
31
|
-
constructor(A: Point, B: Point);
|
32
|
-
|
33
|
-
/**
|
34
|
-
* The origin point, `{x, y}`
|
35
|
-
*/
|
36
|
-
A: Point;
|
37
|
-
|
38
|
-
/**
|
39
|
-
* The destination point, `{x, y}`
|
40
|
-
*/
|
41
|
-
B: Point;
|
42
|
-
|
43
|
-
/**
|
44
|
-
* The origin y-coordinate
|
45
|
-
*/
|
46
|
-
y0: number;
|
11
|
+
/** The proximity to the Ray origin, as a ratio of distance */
|
12
|
+
t0: number;
|
47
13
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
x0: number;
|
14
|
+
/** The proximity to the Ray destination, as a ratio of distance */
|
15
|
+
t1: number;
|
16
|
+
}
|
52
17
|
|
53
18
|
/**
|
54
|
-
*
|
55
|
-
|
56
|
-
dx: number;
|
57
|
-
|
58
|
-
/**
|
59
|
-
* The vertical distance of the ray, y1 - y0
|
60
|
-
*/
|
61
|
-
dy: number;
|
62
|
-
|
63
|
-
/**
|
64
|
-
* The slope of the ray, dy over dx
|
65
|
-
*/
|
66
|
-
slope: number;
|
67
|
-
|
68
|
-
/**
|
69
|
-
* The cached angle, computed lazily in Ray#angle
|
70
|
-
* @defaultValue `undefined`
|
71
|
-
* @internal
|
72
|
-
*/
|
73
|
-
protected _angle: number | undefined;
|
74
|
-
|
75
|
-
/**
|
76
|
-
* The cached distance, computed lazily in Ray#distance
|
77
|
-
* @defaultValue `undefined`
|
78
|
-
* @internal
|
79
|
-
*/
|
80
|
-
protected _distance: number | undefined;
|
81
|
-
|
82
|
-
/**
|
83
|
-
* The normalized angle of the ray in radians on the range (-PI, PI).
|
84
|
-
* The angle is computed lazily (only if required) and cached.
|
85
|
-
*/
|
86
|
-
get angle(): number;
|
87
|
-
set angle(value: number);
|
88
|
-
|
89
|
-
/**
|
90
|
-
* A bounding rectangle that encompasses the Ray
|
91
|
-
*/
|
92
|
-
get bounds(): NormalizedRectangle;
|
93
|
-
|
94
|
-
/**
|
95
|
-
* The distance (length) of the Ray in pixels.
|
96
|
-
* The distance is computed lazily (only if required) and cached.
|
97
|
-
*/
|
98
|
-
get distance(): number;
|
99
|
-
set distance(value: number);
|
100
|
-
|
101
|
-
/**
|
102
|
-
* A factory method to construct a Ray from an origin point, an angle, and a distance
|
103
|
-
* @param x - The origin x-coordinate
|
104
|
-
* @param y - The origin y-coordinate
|
105
|
-
* @param radians - The ray angle in radians
|
106
|
-
* @param distance - The distance of the ray in pixels
|
107
|
-
* @returns The constructed Ray instance
|
108
|
-
*/
|
109
|
-
static fromAngle(x: number, y: number, radians: number, distance: number): Ray;
|
110
|
-
|
111
|
-
/**
|
112
|
-
* A factory method to construct a Ray from points in array format.
|
113
|
-
* @param A - The origin point [x,y]
|
114
|
-
* @param B - The destination point [x,y]
|
115
|
-
* @returns The constructed Ray instance
|
116
|
-
*/
|
117
|
-
static fromArrays(A: PointArray, B: PointArray): Ray;
|
118
|
-
|
119
|
-
/**
|
120
|
-
* Project the Array by some proportion of it's initial distance.
|
121
|
-
* Return the coordinates of that point along the path.
|
122
|
-
* @param t - The distance along the Ray
|
123
|
-
* @returns The coordinates of the projected point
|
124
|
-
*/
|
125
|
-
project(t: number): { x: number; y: number };
|
126
|
-
|
127
|
-
/**
|
128
|
-
* Reverse the direction of the Ray, returning a second Ray
|
129
|
-
*/
|
130
|
-
reverse(): Ray;
|
131
|
-
|
132
|
-
/**
|
133
|
-
* Create a new ray which uses the same origin point, but a slightly offset angle and distance
|
134
|
-
* @param offset - An offset in radians which modifies the angle of the original Ray
|
135
|
-
* @param distance - A distance the new ray should project, otherwise uses the same distance.
|
136
|
-
* @returns A new Ray with an offset angle
|
137
|
-
*/
|
138
|
-
shiftAngle(angleOffset: number, distance?: number): Ray;
|
139
|
-
|
140
|
-
/**
|
141
|
-
* Find the point I[x,y] and distance t* on ray R(t) which intersects another ray
|
142
|
-
* http://paulbourke.net/geometry/pointlineplane/
|
19
|
+
* A ray for the purposes of computing sight and collision
|
20
|
+
* Given points A[x,y] and B[x,y]
|
143
21
|
*
|
144
|
-
*
|
22
|
+
* Slope-Intercept form:
|
23
|
+
* y = a + bx
|
24
|
+
* y = A.y + ((B.y - A.Y) / (B.x - A.x))x
|
145
25
|
*
|
146
|
-
*
|
147
|
-
*
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
26
|
+
* Parametric form:
|
27
|
+
* R(t) = (1-t)A + tB
|
28
|
+
*/
|
29
|
+
class Ray {
|
30
|
+
/**
|
31
|
+
* @param A - The origin of the Ray
|
32
|
+
* @param B - The destination of the Ray
|
33
|
+
*/
|
34
|
+
constructor(A: Point, B: Point);
|
35
|
+
|
36
|
+
/**
|
37
|
+
* The origin point, `{x, y}`
|
38
|
+
*/
|
39
|
+
A: Point;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* The destination point, `{x, y}`
|
43
|
+
*/
|
44
|
+
B: Point;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* The origin y-coordinate
|
48
|
+
*/
|
49
|
+
y0: number;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* The origin x-coordinate
|
53
|
+
*/
|
54
|
+
x0: number;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* The horizontal distance of the ray, x1 - x0
|
58
|
+
*/
|
59
|
+
dx: number;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* The vertical distance of the ray, y1 - y0
|
63
|
+
*/
|
64
|
+
dy: number;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* The slope of the ray, dy over dx
|
68
|
+
*/
|
69
|
+
slope: number;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* The cached angle, computed lazily in Ray#angle
|
73
|
+
* @defaultValue `undefined`
|
74
|
+
* @internal
|
75
|
+
*/
|
76
|
+
protected _angle: number | undefined;
|
77
|
+
|
78
|
+
/**
|
79
|
+
* The cached distance, computed lazily in Ray#distance
|
80
|
+
* @defaultValue `undefined`
|
81
|
+
* @internal
|
82
|
+
*/
|
83
|
+
protected _distance: number | undefined;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* The normalized angle of the ray in radians on the range (-PI, PI).
|
87
|
+
* The angle is computed lazily (only if required) and cached.
|
88
|
+
*/
|
89
|
+
get angle(): number;
|
90
|
+
set angle(value: number);
|
91
|
+
|
92
|
+
/**
|
93
|
+
* A bounding rectangle that encompasses the Ray
|
94
|
+
*/
|
95
|
+
get bounds(): NormalizedRectangle;
|
96
|
+
|
97
|
+
/**
|
98
|
+
* The distance (length) of the Ray in pixels.
|
99
|
+
* The distance is computed lazily (only if required) and cached.
|
100
|
+
*/
|
101
|
+
get distance(): number;
|
102
|
+
set distance(value: number);
|
103
|
+
|
104
|
+
/**
|
105
|
+
* A factory method to construct a Ray from an origin point, an angle, and a distance
|
106
|
+
* @param x - The origin x-coordinate
|
107
|
+
* @param y - The origin y-coordinate
|
108
|
+
* @param radians - The ray angle in radians
|
109
|
+
* @param distance - The distance of the ray in pixels
|
110
|
+
* @returns The constructed Ray instance
|
111
|
+
*/
|
112
|
+
static fromAngle(x: number, y: number, radians: number, distance: number): Ray;
|
113
|
+
|
114
|
+
/**
|
115
|
+
* A factory method to construct a Ray from points in array format.
|
116
|
+
* @param A - The origin point [x,y]
|
117
|
+
* @param B - The destination point [x,y]
|
118
|
+
* @returns The constructed Ray instance
|
119
|
+
*/
|
120
|
+
static fromArrays(A: PointArray, B: PointArray): Ray;
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Project the Array by some proportion of it's initial distance.
|
124
|
+
* Return the coordinates of that point along the path.
|
125
|
+
* @param t - The distance along the Ray
|
126
|
+
* @returns The coordinates of the projected point
|
127
|
+
*/
|
128
|
+
project(t: number): { x: number; y: number };
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Create a Ray by projecting a certain distance towards a known point.
|
132
|
+
* @param origin - The origin of the Ray
|
133
|
+
* @param point - The point towards which to project
|
134
|
+
* @param distance - The distance of projection
|
135
|
+
*/
|
136
|
+
static towardsPoint(origin: Point, point: Point, distance: number): Ray;
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Create a Ray by projecting a certain squared-distance towards a known point.
|
140
|
+
* @param origin - The origin of the Ray
|
141
|
+
* @param point - The point towards which to project
|
142
|
+
* @param distance2 - The squared distance of projection
|
143
|
+
*/
|
144
|
+
static towardsPointSquared(origin: Point, point: Point, distance2: number): Ray;
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Reverse the direction of the Ray, returning a second Ray
|
148
|
+
*/
|
149
|
+
reverse(): Ray;
|
150
|
+
|
151
|
+
/**
|
152
|
+
* Create a new ray which uses the same origin point, but a slightly offset angle and distance
|
153
|
+
* @param offset - An offset in radians which modifies the angle of the original Ray
|
154
|
+
* @param distance - A distance the new ray should project, otherwise uses the same distance.
|
155
|
+
* @returns A new Ray with an offset angle
|
156
|
+
*/
|
157
|
+
shiftAngle(angleOffset: number, distance?: number): Ray;
|
158
|
+
|
159
|
+
/**
|
160
|
+
* Find the point I[x,y] and distance t* on ray R(t) which intersects another ray
|
161
|
+
* @see foundry.utils.lineLineIntersection
|
162
|
+
*/
|
163
|
+
intersectSegment(coords: [x0: number, y0: number, x1: number, y1: number]): LineIntersection | null;
|
164
|
+
}
|
171
165
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
import './sightRay';
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* A subclass of Ray that is used specifically for computing source polygons
|
3
|
+
*
|
4
|
+
* This was used for the RadialSweepPolygon but can now be deleted once that is
|
5
|
+
* @deprecated since v9d2
|
6
|
+
*/
|
7
|
+
declare class SightRay extends Ray {
|
8
|
+
/**
|
9
|
+
* The array of sorted collision points which apply for this Ray.
|
10
|
+
*/
|
11
|
+
collisions: WallEndpoint[];
|
12
|
+
|
13
|
+
/**
|
14
|
+
* The target endpoint at which this Ray was fired
|
15
|
+
*/
|
16
|
+
endpoint: WallEndpoint | null;
|
17
|
+
|
18
|
+
/**
|
19
|
+
* The result objects which records the outcome of this Ray
|
20
|
+
*/
|
21
|
+
result: {
|
22
|
+
collisions: unknown[];
|
23
|
+
continuation: unknown | undefined;
|
24
|
+
limitation: number;
|
25
|
+
superfluous: boolean;
|
26
|
+
stopped: boolean;
|
27
|
+
activeWalls: unknown | undefined;
|
28
|
+
};
|
29
|
+
|
30
|
+
/**
|
31
|
+
* The final collision point that this SightRay encountered.
|
32
|
+
*/
|
33
|
+
get lastCollision(): WallEndpoint | null;
|
34
|
+
}
|
@@ -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 }>): Evaluated<this>;
|
151
|
+
evaluate(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
|
152
|
+
evaluate(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<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<Evaluated<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'>>): Evaluated<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 }>): Evaluated<this>;
|
177
|
+
roll(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
|
178
|
+
roll(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<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 }>): Evaluated<this>;
|
187
|
+
reroll(options: InexactPartial<Options> & { async: true }): Promise<Evaluated<this>>;
|
188
|
+
reroll(options?: InexactPartial<Options>): Evaluated<this> | Promise<Evaluated<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
|
@@ -350,11 +351,29 @@ declare global {
|
|
350
351
|
|
351
352
|
/**
|
352
353
|
* Render a Roll instance to HTML
|
353
|
-
* @param
|
354
|
-
*
|
354
|
+
* @param options - Options which affect how the Roll is rendered
|
355
|
+
* (default: `{}`)
|
355
356
|
* @returns The rendered HTML template as a string
|
356
357
|
*/
|
357
|
-
render(
|
358
|
+
render(options?: {
|
359
|
+
/**
|
360
|
+
* Flavor text to include
|
361
|
+
* @defaultValue `undefined`
|
362
|
+
*/
|
363
|
+
flavor?: string;
|
364
|
+
|
365
|
+
/**
|
366
|
+
* A custom HTML template path
|
367
|
+
* @defaultValue `this.constructor.CHAT_TEMPLATE`
|
368
|
+
*/
|
369
|
+
template?: string;
|
370
|
+
|
371
|
+
/**
|
372
|
+
* Is the Roll displayed privately?
|
373
|
+
* @defaultValue `false`
|
374
|
+
*/
|
375
|
+
isPrivate?: boolean;
|
376
|
+
}): Promise<string>;
|
358
377
|
|
359
378
|
/**
|
360
379
|
* Transform a Roll instance into a ChatMessage, displaying the roll result.
|
@@ -373,15 +392,15 @@ declare global {
|
|
373
392
|
*/
|
374
393
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
375
394
|
messageData?: T,
|
376
|
-
{ rollMode, create }?: { rollMode?:
|
395
|
+
{ rollMode, create }?: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create?: true }
|
377
396
|
): Promise<InstanceType<ConfiguredDocumentClass<typeof ChatMessage>> | undefined>;
|
378
397
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
379
398
|
messageData: T,
|
380
|
-
{ rollMode, create }: { rollMode?:
|
399
|
+
{ rollMode, create }: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create: false }
|
381
400
|
): MessageData<T>;
|
382
401
|
toMessage<T extends DeepPartial<ConstructorParameters<ConfiguredDocumentClass<typeof ChatMessage>>[0]> = {}>(
|
383
402
|
messageData: T,
|
384
|
-
{ rollMode, create }: { rollMode?:
|
403
|
+
{ rollMode, create }: { rollMode?: keyof CONFIG.Dice.RollModes | 'roll'; create: boolean }
|
385
404
|
): Promise<InstanceType<ConfiguredDocumentClass<typeof ChatMessage>> | undefined> | MessageData<T>;
|
386
405
|
|
387
406
|
/**
|
@@ -439,42 +458,14 @@ declare global {
|
|
439
458
|
* roll.formula; // 4d8 + 8
|
440
459
|
* ```
|
441
460
|
*/
|
442
|
-
static fromTerms(
|
461
|
+
static fromTerms<T extends ConstructorOf<Roll<any>>>(
|
462
|
+
this: T,
|
443
463
|
terms: RollTerm[],
|
444
|
-
options?:
|
445
|
-
):
|
446
|
-
|
447
|
-
/**
|
448
|
-
* @deprecated since 0.8.1
|
449
|
-
*/
|
450
|
-
get _rolled(): boolean;
|
464
|
+
options?: InexactPartial<Options>
|
465
|
+
): InstanceType<T>;
|
451
466
|
}
|
452
467
|
}
|
453
468
|
|
454
|
-
interface ChatOptions {
|
455
|
-
/**
|
456
|
-
* @defaultValue `false`
|
457
|
-
*/
|
458
|
-
blind?: boolean;
|
459
|
-
|
460
|
-
/**
|
461
|
-
* @defaultValue `null`
|
462
|
-
*/
|
463
|
-
flavor?: any;
|
464
|
-
|
465
|
-
/**
|
466
|
-
* @defaultValue `false`
|
467
|
-
*/
|
468
|
-
isPrivate?: boolean;
|
469
|
-
|
470
|
-
template?: string;
|
471
|
-
|
472
|
-
/**
|
473
|
-
* @defaultValue The id of the current user
|
474
|
-
*/
|
475
|
-
user?: string;
|
476
|
-
}
|
477
|
-
|
478
469
|
type Options = RollTerm.EvaluationOptions;
|
479
470
|
|
480
471
|
interface SplitGroupOptions {
|
@@ -488,22 +479,17 @@ interface SplitGroupOptions {
|
|
488
479
|
interface Data {
|
489
480
|
formula: string;
|
490
481
|
results: Array<number | string>;
|
491
|
-
terms: Array<
|
482
|
+
terms: Array<PoolTerm.TermData | DiceTerm.Data>;
|
492
483
|
total: number | null;
|
493
484
|
}
|
494
485
|
|
495
486
|
type Flavor = Record<`%F${number}%`, string>;
|
496
487
|
|
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
488
|
type MessageData<T extends DeepPartial<ConstructorParameters<typeof ChatMessage>[0]>> = {
|
505
489
|
user: string;
|
506
490
|
type: typeof foundry.CONST.CHAT_MESSAGE_TYPES['ROLL'];
|
507
491
|
content: number;
|
508
492
|
sound: typeof CONFIG.sounds.dice;
|
509
493
|
} & T;
|
494
|
+
|
495
|
+
type Evaluated<T extends Roll> = T & { _evaluated: true; _total: number; get total(): number };
|
@@ -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
|
}
|