@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
@@ -1,58 +1,58 @@
|
|
1
|
-
import {
|
1
|
+
import {
|
2
|
+
ConfiguredDocumentClass,
|
3
|
+
ConfiguredFlags,
|
4
|
+
FieldReturnType,
|
5
|
+
PropertiesToSource
|
6
|
+
} from '../../../../types/helperTypes';
|
2
7
|
import DocumentData from '../../abstract/data.mjs';
|
3
8
|
import * as documents from '../../documents.mjs';
|
4
9
|
import * as fields from '../fields.mjs';
|
5
10
|
|
6
11
|
interface NoteDataSchema extends DocumentSchema {
|
7
|
-
_id:
|
12
|
+
_id: fields.DocumentId;
|
8
13
|
entryId: fields.ForeignDocumentField<{ type: typeof documents.BaseJournalEntry; required: false }>;
|
9
|
-
x:
|
10
|
-
y:
|
11
|
-
icon: FieldReturnType<
|
12
|
-
typeof fields.IMAGE_FIELD,
|
13
|
-
{
|
14
|
-
required: true;
|
15
|
-
default: typeof CONST.DEFAULT_NOTE_ICON;
|
16
|
-
}
|
17
|
-
>;
|
14
|
+
x: fields.RequiredNumber;
|
15
|
+
y: fields.RequiredNumber;
|
16
|
+
icon: FieldReturnType<fields.ImageField, { required: true; default: typeof NoteData.DEFAULT_ICON }>;
|
18
17
|
iconSize: FieldReturnType<
|
19
|
-
|
18
|
+
fields.RequiredNumber,
|
20
19
|
{
|
21
20
|
default: 40;
|
22
21
|
validate: (n: unknown) => n is number;
|
23
22
|
validationError: 'Invalid {name} {field} which must be an integer greater than 32';
|
24
23
|
}
|
25
24
|
>;
|
26
|
-
iconTint:
|
27
|
-
text:
|
25
|
+
iconTint: fields.ColorField;
|
26
|
+
text: fields.StringField;
|
28
27
|
fontFamily: FieldReturnType<
|
29
|
-
|
28
|
+
fields.RequiredString,
|
30
29
|
{
|
31
30
|
default: () => typeof CONFIG['defaultFontFamily'];
|
32
31
|
}
|
33
32
|
>;
|
34
33
|
fontSize: FieldReturnType<
|
35
|
-
|
34
|
+
fields.RequiredNumber,
|
36
35
|
{
|
37
36
|
default: 48;
|
38
37
|
validate: (n: unknown) => n is number;
|
39
38
|
validationError: 'Invalid {name} {field} which must be an integer between 8 and 128';
|
40
39
|
}
|
41
40
|
>;
|
42
|
-
textAnchor: DocumentField<
|
41
|
+
textAnchor: DocumentField<typeof foundry.CONST.TEXT_ANCHOR_POINTS> & {
|
43
42
|
type: typeof Number;
|
44
43
|
required: true;
|
45
|
-
default: typeof CONST.TEXT_ANCHOR_POINTS.BOTTOM;
|
46
|
-
validate: (p: unknown) => p is foundry.CONST.
|
44
|
+
default: typeof foundry.CONST.TEXT_ANCHOR_POINTS.BOTTOM;
|
45
|
+
validate: (p: unknown) => p is foundry.CONST.TEXT_ANCHOR_POINTS;
|
47
46
|
validationError: 'Invalid {name} {field} which must be a value in CONST.TEXT_ANCHOR_POINTS';
|
48
47
|
};
|
49
|
-
textColor: FieldReturnType<
|
50
|
-
flags:
|
48
|
+
textColor: FieldReturnType<fields.ColorField, { default: '#FFFFFF' }>;
|
49
|
+
flags: fields.ObjectField;
|
51
50
|
}
|
52
51
|
|
53
52
|
interface NoteDataProperties {
|
54
53
|
/**
|
55
54
|
* The _id which uniquely identifies this BaseNote embedded document
|
55
|
+
* @defaultValue `null`
|
56
56
|
*/
|
57
57
|
_id: string | null;
|
58
58
|
|
@@ -76,6 +76,7 @@ interface NoteDataProperties {
|
|
76
76
|
|
77
77
|
/**
|
78
78
|
* An image icon path used to represent this note
|
79
|
+
* @defaultValue `CONST.DEFAULT_NOTE_ICON`
|
79
80
|
*/
|
80
81
|
icon: string | null;
|
81
82
|
|
@@ -112,7 +113,7 @@ interface NoteDataProperties {
|
|
112
113
|
* to the note icon.
|
113
114
|
* @defaultValue `CONST.TEXT_ANCHOR_POINTS.BOTTOM`
|
114
115
|
*/
|
115
|
-
textAnchor: foundry.CONST.
|
116
|
+
textAnchor: foundry.CONST.TEXT_ANCHOR_POINTS;
|
116
117
|
|
117
118
|
/**
|
118
119
|
* The string that defines the color with which the note text is rendered
|
@@ -130,93 +131,102 @@ interface NoteDataProperties {
|
|
130
131
|
interface NoteDataConstructorData {
|
131
132
|
/**
|
132
133
|
* The _id which uniquely identifies this BaseNote embedded document
|
134
|
+
* @defaultValue `null`
|
133
135
|
*/
|
134
|
-
_id?: string | null;
|
136
|
+
_id?: string | null | undefined;
|
135
137
|
|
136
138
|
/**
|
137
139
|
* The _id of a JournalEntry document which this Note represents
|
138
140
|
* @defaultValue `null`
|
139
141
|
*/
|
140
|
-
entryId?: string | null;
|
142
|
+
entryId?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseJournalEntry>> | string | null | undefined;
|
141
143
|
|
142
144
|
/**
|
143
145
|
* The x-coordinate position of the center of the note icon
|
144
146
|
* @defaultValue `0`
|
145
147
|
*/
|
146
|
-
x?: number | null;
|
148
|
+
x?: number | null | undefined;
|
147
149
|
|
148
150
|
/**
|
149
151
|
* The y-coordinate position of the center of the note icon
|
150
152
|
* @defaultValue `0`
|
151
153
|
*/
|
152
|
-
y?: number | null;
|
154
|
+
y?: number | null | undefined;
|
153
155
|
|
154
156
|
/**
|
155
157
|
* An image icon path used to represent this note
|
158
|
+
* @defaultValue `CONST.DEFAULT_NOTE_ICON`
|
156
159
|
*/
|
157
|
-
icon?: string | null;
|
160
|
+
icon?: string | null | undefined;
|
158
161
|
|
159
162
|
/**
|
160
163
|
* The pixel size of the map note icon
|
161
164
|
* @defaultValue `40`
|
162
165
|
*/
|
163
|
-
iconSize?: number | null;
|
166
|
+
iconSize?: number | null | undefined;
|
164
167
|
|
165
168
|
/**
|
166
169
|
* An optional color string used to tint the map note icon
|
167
170
|
*/
|
168
|
-
iconTint?: string | null;
|
171
|
+
iconTint?: string | null | undefined;
|
169
172
|
|
170
173
|
/**
|
171
174
|
* Optional text which overrides the title of the linked Journal Entry
|
172
175
|
*/
|
173
|
-
text?: string | null;
|
176
|
+
text?: string | null | undefined;
|
174
177
|
|
175
178
|
/**
|
176
179
|
* The font family used to display the text label on this note
|
177
180
|
* @defaultValue `CONFIG?.defaultFontFamily || "Signika"`
|
178
181
|
*/
|
179
|
-
fontFamily?: string | null;
|
182
|
+
fontFamily?: string | null | undefined;
|
180
183
|
|
181
184
|
/**
|
182
185
|
* The font size used to display the text label on this note
|
183
186
|
* @defaultValue `48`
|
184
187
|
*/
|
185
|
-
fontSize?: number | null;
|
188
|
+
fontSize?: number | null | undefined;
|
186
189
|
|
187
190
|
/**
|
188
191
|
* A value in CONST.TEXT_ANCHOR_POINTS which defines where the text label anchors
|
189
192
|
* to the note icon.
|
190
193
|
* @defaultValue `CONST.TEXT_ANCHOR_POINTS.BOTTOM`
|
191
194
|
*/
|
192
|
-
textAnchor?: foundry.CONST.
|
195
|
+
textAnchor?: foundry.CONST.TEXT_ANCHOR_POINTS | null | undefined;
|
193
196
|
|
194
197
|
/**
|
195
198
|
* The string that defines the color with which the note text is rendered
|
196
199
|
* @defaultValue `#FFFFFF`
|
197
200
|
*/
|
198
|
-
textColor?: string | null;
|
201
|
+
textColor?: string | null | undefined;
|
199
202
|
|
200
203
|
/**
|
201
204
|
* An object of optional key/value flags
|
202
205
|
* @defaultValue `{}`
|
203
206
|
*/
|
204
|
-
flags?: ConfiguredFlags<'Note'> | null;
|
207
|
+
flags?: ConfiguredFlags<'Note'> | null | undefined;
|
205
208
|
}
|
206
209
|
|
207
210
|
/**
|
208
211
|
* The data schema for a Note embedded document.
|
209
212
|
* @see BaseNote
|
210
213
|
*/
|
211
|
-
export
|
214
|
+
export class NoteData extends DocumentData<
|
212
215
|
NoteDataSchema,
|
213
216
|
NoteDataProperties,
|
214
217
|
PropertiesToSource<NoteDataProperties>,
|
215
218
|
NoteDataConstructorData,
|
216
219
|
documents.BaseNote
|
217
220
|
> {
|
221
|
+
/** @override */
|
218
222
|
static defineSchema(): NoteDataSchema;
|
223
|
+
|
224
|
+
/**
|
225
|
+
* The default icon used for newly created Note documents.
|
226
|
+
* @defaultValue `"icons/svg/book.svg"`
|
227
|
+
*/
|
228
|
+
static DEFAULT_ICON: string;
|
219
229
|
}
|
220
230
|
|
221
231
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
222
|
-
export
|
232
|
+
export interface NoteData extends NoteDataProperties {}
|
@@ -1,34 +1,41 @@
|
|
1
|
-
import * as documents from '../../documents.mjs';
|
2
|
-
import * as fields from '../fields.mjs';
|
3
|
-
|
4
1
|
import type { ConfiguredDocumentClass, ConfiguredFlags, PropertiesToSource } from '../../../../types/helperTypes';
|
5
|
-
import type EmbeddedCollection from '../../abstract/embedded-collection.mjs';
|
6
2
|
import type DocumentData from '../../abstract/data.mjs';
|
3
|
+
import type EmbeddedCollection from '../../abstract/embedded-collection.mjs';
|
4
|
+
import * as documents from '../../documents.mjs';
|
5
|
+
import * as fields from '../fields.mjs';
|
7
6
|
|
8
7
|
interface PlaylistDataSchema extends DocumentSchema {
|
9
|
-
_id:
|
10
|
-
name:
|
11
|
-
description:
|
8
|
+
_id: fields.DocumentId;
|
9
|
+
name: fields.RequiredString;
|
10
|
+
description: fields.BlankString;
|
12
11
|
sounds: fields.EmbeddedCollectionField<typeof documents.BasePlaylistSound>;
|
13
|
-
mode: DocumentField<foundry.CONST.
|
12
|
+
mode: DocumentField<foundry.CONST.PLAYLIST_MODES> & {
|
14
13
|
type: typeof Number;
|
15
14
|
required: true;
|
16
|
-
default: typeof CONST.PLAYLIST_MODES.SEQUENTIAL;
|
17
|
-
validate: (m: unknown) => m is foundry.CONST.
|
15
|
+
default: typeof foundry.CONST.PLAYLIST_MODES.SEQUENTIAL;
|
16
|
+
validate: (m: unknown) => m is foundry.CONST.PLAYLIST_MODES;
|
18
17
|
validationError: 'Invalid {name} {field} provided which must be a value from CONST.PLAYLIST_MODES';
|
19
18
|
};
|
20
|
-
playing:
|
21
|
-
fade:
|
19
|
+
playing: fields.BooleanField;
|
20
|
+
fade: fields.IntegerField;
|
22
21
|
folder: fields.ForeignDocumentField<{ type: typeof documents.BaseFolder }>;
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
sorting: DocumentField<foundry.CONST.PLAYLIST_SORT_MODES> & {
|
23
|
+
type: foundry.CONST.PLAYLIST_SORT_MODES;
|
24
|
+
required: true;
|
25
|
+
default: typeof foundry.CONST.PLAYLIST_SORT_MODES.ALPHABETICAL;
|
26
|
+
validate: (m: unknown) => m is foundry.CONST.PLAYLIST_SORT_MODES;
|
27
|
+
validationError: 'Invalid Playlist sorting mode';
|
28
|
+
};
|
29
|
+
sort: fields.IntegerSortField;
|
30
|
+
seed: fields.NonnegativeIntegerField;
|
31
|
+
permission: fields.DocumentPermissions;
|
32
|
+
flags: fields.ObjectField;
|
27
33
|
}
|
28
34
|
|
29
35
|
interface PlaylistDataProperties {
|
30
36
|
/**
|
31
37
|
* The _id which uniquely identifies this Playlist document
|
38
|
+
* @defaultValue `null`
|
32
39
|
*/
|
33
40
|
_id: string | null;
|
34
41
|
|
@@ -38,12 +45,14 @@ interface PlaylistDataProperties {
|
|
38
45
|
name: string;
|
39
46
|
|
40
47
|
/**
|
41
|
-
*
|
48
|
+
* The description of this playlist
|
49
|
+
* @defaultValue `""`
|
42
50
|
*/
|
43
51
|
description: string;
|
44
52
|
|
45
53
|
/**
|
46
54
|
* A Collection of PlaylistSounds embedded documents which belong to this playlist
|
55
|
+
* @defaultValue `new EmbeddedCollection(PlaylistSoundData, [], BasePlaylistSound.implementation)`
|
47
56
|
*/
|
48
57
|
sounds: EmbeddedCollection<ConfiguredDocumentClass<typeof documents.BasePlaylistSound>, PlaylistData>;
|
49
58
|
|
@@ -51,7 +60,7 @@ interface PlaylistDataProperties {
|
|
51
60
|
* The playback mode for sounds in this playlist
|
52
61
|
* @defaultValue `CONST.PLAYLIST_MODES.SEQUENTIAL`
|
53
62
|
*/
|
54
|
-
mode: foundry.CONST.
|
63
|
+
mode: foundry.CONST.PLAYLIST_MODES;
|
55
64
|
|
56
65
|
/**
|
57
66
|
* Is this playlist currently playing?
|
@@ -59,6 +68,7 @@ interface PlaylistDataProperties {
|
|
59
68
|
*/
|
60
69
|
playing: boolean;
|
61
70
|
|
71
|
+
/** A duration in milliseconds to fade volume transition */
|
62
72
|
fade: number | undefined;
|
63
73
|
|
64
74
|
/**
|
@@ -67,19 +77,26 @@ interface PlaylistDataProperties {
|
|
67
77
|
*/
|
68
78
|
folder: string | null;
|
69
79
|
|
80
|
+
/**
|
81
|
+
* The sorting mode used for this playlist.
|
82
|
+
* @defaultValue `CONST.PLAYLIST_SORT_MODES.ALPHABETICAL`
|
83
|
+
*/
|
84
|
+
sorting: foundry.CONST.PLAYLIST_SORT_MODES;
|
85
|
+
|
70
86
|
/**
|
71
87
|
* The numeric sort value which orders this playlist relative to its siblings
|
72
88
|
* @defaultValue `0`
|
73
89
|
*/
|
74
90
|
sort: number;
|
75
91
|
|
92
|
+
/** A seed used for playlist randomization to guarantee that all clients generate the same random order. */
|
76
93
|
seed: number | undefined;
|
77
94
|
|
78
95
|
/**
|
79
96
|
* An object which configures user permissions to this playlist
|
80
97
|
* @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
|
81
98
|
*/
|
82
|
-
permission: Record<string, foundry.CONST.
|
99
|
+
permission: Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS>;
|
83
100
|
|
84
101
|
/**
|
85
102
|
* An object of optional key/value flags
|
@@ -91,6 +108,7 @@ interface PlaylistDataProperties {
|
|
91
108
|
interface PlaylistDataConstructorData {
|
92
109
|
/**
|
93
110
|
* The _id which uniquely identifies this Playlist document
|
111
|
+
* @defaultValue `null`
|
94
112
|
*/
|
95
113
|
_id?: string | null | undefined;
|
96
114
|
|
@@ -100,12 +118,14 @@ interface PlaylistDataConstructorData {
|
|
100
118
|
name: string;
|
101
119
|
|
102
120
|
/**
|
103
|
-
*
|
121
|
+
* The description of this playlist
|
122
|
+
* @defaultValue `""`
|
104
123
|
*/
|
105
124
|
description?: string | null | undefined;
|
106
125
|
|
107
126
|
/**
|
108
127
|
* A Collection of PlaylistSounds embedded documents which belong to this playlist
|
128
|
+
* @defaultValue `new EmbeddedCollection(PlaylistSoundData, [], BasePlaylistSound.implementation)`
|
109
129
|
*/
|
110
130
|
sounds?:
|
111
131
|
| EmbeddedCollection<ConfiguredDocumentClass<typeof documents.BasePlaylistSound>, PlaylistData>
|
@@ -116,7 +136,7 @@ interface PlaylistDataConstructorData {
|
|
116
136
|
* The playback mode for sounds in this playlist
|
117
137
|
* @defaultValue `CONST.PLAYLIST_MODES.SEQUENTIAL`
|
118
138
|
*/
|
119
|
-
mode?: foundry.CONST.
|
139
|
+
mode?: foundry.CONST.PLAYLIST_MODES | null | undefined;
|
120
140
|
|
121
141
|
/**
|
122
142
|
* Is this playlist currently playing?
|
@@ -124,13 +144,20 @@ interface PlaylistDataConstructorData {
|
|
124
144
|
*/
|
125
145
|
playing?: boolean | null | undefined;
|
126
146
|
|
127
|
-
|
147
|
+
/** A duration in milliseconds to fade volume transition */
|
148
|
+
fade?: number | null | undefined;
|
128
149
|
|
129
150
|
/**
|
130
151
|
* The _id of a Folder which contains this playlist
|
131
152
|
* @defaultValue `null`
|
132
153
|
*/
|
133
|
-
folder?: string | null | undefined;
|
154
|
+
folder?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseFolder>> | string | null | undefined;
|
155
|
+
|
156
|
+
/**
|
157
|
+
* The sorting mode used for this playlist.
|
158
|
+
* @defaultValue `CONST.PLAYLIST_SORT_MODES.ALPHABETICAL`
|
159
|
+
*/
|
160
|
+
sorting?: foundry.CONST.PLAYLIST_SORT_MODES | null | undefined;
|
134
161
|
|
135
162
|
/**
|
136
163
|
* The numeric sort value which orders this playlist relative to its siblings
|
@@ -138,13 +165,14 @@ interface PlaylistDataConstructorData {
|
|
138
165
|
*/
|
139
166
|
sort?: number | null | undefined;
|
140
167
|
|
141
|
-
seed
|
168
|
+
/** A seed used for playlist randomization to guarantee that all clients generate the same random order. */
|
169
|
+
seed?: number | null | undefined;
|
142
170
|
|
143
171
|
/**
|
144
172
|
* An object which configures user permissions to this playlist
|
145
173
|
* @defaultValue `{ default: CONST.ENTITY_PERMISSIONS.NONE }`
|
146
174
|
*/
|
147
|
-
permission?: Record<string, foundry.CONST.
|
175
|
+
permission?: Record<string, foundry.CONST.DOCUMENT_PERMISSION_LEVELS> | null | undefined;
|
148
176
|
|
149
177
|
/**
|
150
178
|
* An object of optional key/value flags
|
@@ -157,13 +185,14 @@ interface PlaylistDataConstructorData {
|
|
157
185
|
* The data schema for a Playlist document.
|
158
186
|
* @see BasePlaylist
|
159
187
|
*/
|
160
|
-
export
|
188
|
+
export class PlaylistData extends DocumentData<
|
161
189
|
PlaylistDataSchema,
|
162
190
|
PlaylistDataProperties,
|
163
191
|
PropertiesToSource<PlaylistDataProperties>,
|
164
192
|
PlaylistDataConstructorData,
|
165
193
|
documents.BasePlaylist
|
166
194
|
> {
|
195
|
+
/** @override */
|
167
196
|
static defineSchema(): PlaylistDataSchema;
|
168
197
|
}
|
169
198
|
|
@@ -1,24 +1,26 @@
|
|
1
|
-
import * as fields from '../fields.mjs';
|
2
1
|
import type { ConfiguredFlags, FieldReturnType, PropertiesToSource } from '../../../../types/helperTypes';
|
3
2
|
import type DocumentData from '../../abstract/data.mjs';
|
4
3
|
import type { documents } from '../../module.mjs';
|
4
|
+
import * as fields from '../fields.mjs';
|
5
5
|
|
6
6
|
interface PlaylistSoundDataSchema extends DocumentSchema {
|
7
|
-
_id:
|
8
|
-
name:
|
9
|
-
description:
|
10
|
-
path:
|
11
|
-
playing:
|
12
|
-
pausedTime: FieldReturnType<
|
13
|
-
repeat:
|
14
|
-
volume: FieldReturnType<
|
15
|
-
fade:
|
16
|
-
|
7
|
+
_id: fields.DocumentId;
|
8
|
+
name: fields.RequiredString;
|
9
|
+
description: fields.BlankString;
|
10
|
+
path: fields.AudioField;
|
11
|
+
playing: fields.BooleanField;
|
12
|
+
pausedTime: FieldReturnType<fields.NumericField, { default: null }>;
|
13
|
+
repeat: fields.BooleanField;
|
14
|
+
volume: FieldReturnType<fields.AlphaField, { default: 0.5 }>;
|
15
|
+
fade: fields.IntegerField;
|
16
|
+
sort: fields.IntegerSortField;
|
17
|
+
flags: fields.ObjectField;
|
17
18
|
}
|
18
19
|
|
19
20
|
interface PlaylistSoundDataProperties {
|
20
21
|
/**
|
21
22
|
* The _id which uniquely identifies this PlaylistSound document
|
23
|
+
* @defaultValue `null`
|
22
24
|
*/
|
23
25
|
_id: string | null;
|
24
26
|
|
@@ -28,14 +30,15 @@ interface PlaylistSoundDataProperties {
|
|
28
30
|
name: string;
|
29
31
|
|
30
32
|
/**
|
31
|
-
*
|
33
|
+
* The description of this sound track
|
34
|
+
* @defaultValue `""`
|
32
35
|
*/
|
33
36
|
description: string;
|
34
37
|
|
35
38
|
/**
|
36
39
|
* The audio file path that is played by this sound
|
37
40
|
*/
|
38
|
-
path: string |
|
41
|
+
path: string | null | undefined;
|
39
42
|
|
40
43
|
/**
|
41
44
|
* Is this sound currently playing?
|
@@ -44,6 +47,7 @@ interface PlaylistSoundDataProperties {
|
|
44
47
|
playing: boolean;
|
45
48
|
|
46
49
|
/**
|
50
|
+
* The time in seconds at which playback was paused
|
47
51
|
* @defaultValue `null`
|
48
52
|
*/
|
49
53
|
pausedTime: number | null;
|
@@ -60,8 +64,12 @@ interface PlaylistSoundDataProperties {
|
|
60
64
|
*/
|
61
65
|
volume: number;
|
62
66
|
|
67
|
+
/** A duration in milliseconds to fade volume transition */
|
63
68
|
fade: number | undefined;
|
64
69
|
|
70
|
+
/** @defaultValue `0` */
|
71
|
+
sort: number;
|
72
|
+
|
65
73
|
/**
|
66
74
|
* An object of optional key/value flags
|
67
75
|
* @defaultValue `{}`
|
@@ -72,6 +80,7 @@ interface PlaylistSoundDataProperties {
|
|
72
80
|
interface PlaylistSoundDataConstructorData {
|
73
81
|
/**
|
74
82
|
* The _id which uniquely identifies this PlaylistSound document
|
83
|
+
* @defaultValue `null`
|
75
84
|
*/
|
76
85
|
_id?: string | null | undefined;
|
77
86
|
|
@@ -81,14 +90,15 @@ interface PlaylistSoundDataConstructorData {
|
|
81
90
|
name: string;
|
82
91
|
|
83
92
|
/**
|
84
|
-
*
|
93
|
+
* The description of this sound track
|
94
|
+
* @defaultValue `""`
|
85
95
|
*/
|
86
96
|
description?: string | null | undefined;
|
87
97
|
|
88
98
|
/**
|
89
99
|
* The audio file path that is played by this sound
|
90
100
|
*/
|
91
|
-
path?: string |
|
101
|
+
path?: string | null | undefined;
|
92
102
|
|
93
103
|
/**
|
94
104
|
* Is this sound currently playing?
|
@@ -97,6 +107,7 @@ interface PlaylistSoundDataConstructorData {
|
|
97
107
|
playing?: boolean | null | undefined;
|
98
108
|
|
99
109
|
/**
|
110
|
+
* The time in seconds at which playback was paused
|
100
111
|
* @defaultValue `null`
|
101
112
|
*/
|
102
113
|
pausedTime?: number | null | undefined;
|
@@ -113,8 +124,12 @@ interface PlaylistSoundDataConstructorData {
|
|
113
124
|
*/
|
114
125
|
volume?: number | null | undefined;
|
115
126
|
|
127
|
+
/** A duration in milliseconds to fade volume transition */
|
116
128
|
fade?: number | null | undefined;
|
117
129
|
|
130
|
+
/** @defaultValue `0` */
|
131
|
+
sort: number | null | undefined;
|
132
|
+
|
118
133
|
/**
|
119
134
|
* An object of optional key/value flags
|
120
135
|
* @defaultValue `{}`
|
@@ -126,13 +141,14 @@ interface PlaylistSoundDataConstructorData {
|
|
126
141
|
* The data schema for a PlaylistSound embedded document.
|
127
142
|
* @see BasePlaylistSound
|
128
143
|
*/
|
129
|
-
export
|
144
|
+
export class PlaylistSoundData extends DocumentData<
|
130
145
|
PlaylistSoundDataSchema,
|
131
146
|
PlaylistSoundDataProperties,
|
132
147
|
PropertiesToSource<PlaylistSoundDataProperties>,
|
133
148
|
PlaylistSoundDataConstructorData,
|
134
149
|
documents.BasePlaylistSound
|
135
150
|
> {
|
151
|
+
/** @override */
|
136
152
|
static defineSchema(): PlaylistSoundDataSchema;
|
137
153
|
|
138
154
|
/** @override */
|
@@ -17,9 +17,9 @@ type FieldExclusions =
|
|
17
17
|
| 'hidden';
|
18
18
|
|
19
19
|
interface PrototypeTokenDataSchema extends Omit<TokenDataSchema, FieldExclusions> {
|
20
|
-
randomImg:
|
20
|
+
randomImg: fields.BooleanField;
|
21
21
|
img: FieldReturnType<
|
22
|
-
|
22
|
+
fields.VideoField,
|
23
23
|
{ default: typeof foundry.CONST.DEFAULT_TOKEN; validate: (src: unknown) => boolean }
|
24
24
|
>;
|
25
25
|
}
|
@@ -38,18 +38,18 @@ interface PrototypeTokenDataProperties extends Omit<TokenDataProperties, FieldEx
|
|
38
38
|
img: string | null;
|
39
39
|
}
|
40
40
|
|
41
|
-
|
41
|
+
interface PrototypeTokenDataConstructorData extends Omit<TokenDataConstructorData, FieldExclusions> {
|
42
42
|
/**
|
43
43
|
* Uses a random "wildcard" image path which is resolved with a Token is created
|
44
44
|
* @defaultValue `false`
|
45
45
|
*/
|
46
|
-
randomImg?: boolean | null;
|
46
|
+
randomImg?: boolean | null | undefined;
|
47
47
|
|
48
48
|
/**
|
49
49
|
* A file path to an image or video file used to depict the Token
|
50
50
|
* @defaultValue `CONST.DEFAULT_TOKEN`
|
51
51
|
*/
|
52
|
-
img?: string | null;
|
52
|
+
img?: string | null | undefined;
|
53
53
|
}
|
54
54
|
|
55
55
|
export class PrototypeTokenData extends DocumentData<
|
@@ -59,14 +59,10 @@ export class PrototypeTokenData extends DocumentData<
|
|
59
59
|
PrototypeTokenDataConstructorData,
|
60
60
|
documents.BaseActor
|
61
61
|
> {
|
62
|
-
/**
|
63
|
-
* @override
|
64
|
-
*/
|
62
|
+
/** @override */
|
65
63
|
_initialize(): void;
|
66
64
|
|
67
|
-
/**
|
68
|
-
* @override
|
69
|
-
*/
|
65
|
+
/** @override */
|
70
66
|
toObject(source?: true): ReturnType<this['toJSON']> & { actorId: documents.BaseActor['id'] };
|
71
67
|
toObject(source: false): {
|
72
68
|
[Key in keyof PrototypeTokenDataSchema as string extends Key ? never : Key]: Key extends keyof this
|