@league-of-foundry-developers/foundry-vtt-types 0.8.9-9 → 9.238.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -27
- package/index.d.ts +2 -2
- package/package.json +34 -15
- package/src/foundry/common/abstract/document.mjs.d.ts +24 -10
- package/src/foundry/common/config.mjs/index.d.ts +1 -0
- package/src/foundry/common/config.mjs/releaseData.d.ts +98 -0
- package/src/foundry/common/constants.mjs.d.ts +402 -213
- package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +36 -29
- package/src/foundry/common/data/data.mjs/actorData.d.ts +32 -21
- package/src/foundry/common/data/data.mjs/adventureData.d.ts +165 -0
- package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +45 -124
- package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +49 -77
- package/src/foundry/common/data/data.mjs/animationData.d.ts +17 -9
- package/src/foundry/common/data/data.mjs/cardData.d.ts +265 -0
- package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +66 -0
- package/src/foundry/common/data/data.mjs/cardsData.d.ts +238 -0
- package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +51 -39
- package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +18 -11
- package/src/foundry/common/data/data.mjs/combatData.d.ts +51 -25
- package/src/foundry/common/data/data.mjs/combatantData.d.ts +48 -30
- package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +8 -7
- package/src/foundry/common/data/data.mjs/drawingData.d.ts +68 -67
- package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +21 -25
- package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +24 -23
- package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +23 -16
- package/src/foundry/common/data/data.mjs/folderData.d.ts +28 -25
- package/src/foundry/common/data/data.mjs/index.d.ts +5 -0
- package/src/foundry/common/data/data.mjs/itemData.d.ts +26 -18
- package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +21 -20
- package/src/foundry/common/data/data.mjs/lightData.d.ts +228 -0
- package/src/foundry/common/data/data.mjs/macroData.d.ts +52 -35
- package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +41 -38
- package/src/foundry/common/data/data.mjs/noteData.d.ts +47 -37
- package/src/foundry/common/data/data.mjs/playlistData.d.ts +55 -26
- package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +32 -16
- package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +7 -11
- package/src/foundry/common/data/data.mjs/rollTableData.d.ts +30 -24
- package/src/foundry/common/data/data.mjs/sceneData.d.ts +132 -111
- package/src/foundry/common/data/data.mjs/settingData.d.ts +11 -8
- package/src/foundry/common/data/data.mjs/tableResultData.d.ts +30 -26
- package/src/foundry/common/data/data.mjs/tileData.d.ts +43 -36
- package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +10 -9
- package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +6 -3
- package/src/foundry/common/data/data.mjs/tokenData.d.ts +105 -157
- package/src/foundry/common/data/data.mjs/userData.d.ts +111 -33
- package/src/foundry/common/data/data.mjs/videoData.d.ts +9 -8
- package/src/foundry/common/data/data.mjs/wallData.d.ts +67 -39
- package/src/foundry/common/data/fields.mjs.d.ts +180 -83
- package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +9 -3
- package/src/foundry/common/documents.mjs/baseActor.d.ts +17 -45
- package/src/foundry/common/documents.mjs/baseAdventure.d.ts +38 -0
- package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +3 -1
- package/src/foundry/common/documents.mjs/baseCard.d.ts +62 -0
- package/src/foundry/common/documents.mjs/baseCards.d.ts +39 -0
- package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseCombat.d.ts +5 -2
- package/src/foundry/common/documents.mjs/baseCombatant.d.ts +10 -1
- package/src/foundry/common/documents.mjs/baseDrawing.d.ts +11 -1
- package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +4 -3
- package/src/foundry/common/documents.mjs/baseFolder.d.ts +10 -1
- package/src/foundry/common/documents.mjs/baseItem.d.ts +11 -29
- package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseMacro.d.ts +16 -14
- package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +4 -1
- package/src/foundry/common/documents.mjs/baseNote.d.ts +2 -2
- package/src/foundry/common/documents.mjs/basePlaylist.d.ts +1 -0
- package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +2 -1
- package/src/foundry/common/documents.mjs/baseRollTable.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseScene.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseSetting.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseTableResult.d.ts +10 -3
- package/src/foundry/common/documents.mjs/baseTile.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseToken.d.ts +3 -0
- package/src/foundry/common/documents.mjs/baseUser.d.ts +7 -1
- package/src/foundry/common/documents.mjs/baseWall.d.ts +7 -10
- package/src/foundry/common/documents.mjs/index.d.ts +3 -0
- package/src/foundry/common/module.mjs.d.ts +3 -0
- package/src/foundry/common/packages.mjs/moduleData.d.ts +12 -9
- package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +24 -24
- package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +27 -21
- package/src/foundry/common/packages.mjs/packageData.d.ts +108 -82
- package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +18 -11
- package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +16 -15
- package/src/foundry/common/packages.mjs/systemData.d.ts +21 -20
- package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +3 -3
- package/src/foundry/common/packages.mjs/worldData.d.ts +29 -18
- package/src/foundry/common/types.mjs.d.ts +95 -0
- package/src/foundry/common/utils/helpers.mjs.d.ts +27 -2
- package/src/foundry/common/utils/primitives.mjs.d.ts +99 -16
- package/src/foundry/foundry.js/application.d.ts +2 -2
- package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplication.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +2 -2
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +5 -5
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +5 -8
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +3 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
- package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +8 -9
- package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +6 -6
- package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
- package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
- package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +2 -2
- package/src/foundry/foundry.js/avSettings.d.ts +7 -7
- package/src/foundry/foundry.js/canvas.d.ts +148 -46
- package/src/foundry/foundry.js/canvasAnimation.d.ts +1 -1
- package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
- package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +384 -0
- package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
- package/src/foundry/foundry.js/clientDocuments/combat.d.ts +4 -8
- package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
- package/src/foundry/foundry.js/clientDocuments/index.d.ts +2 -0
- package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
- package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
- package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
- package/src/foundry/foundry.js/clientKeybindings.d.ts +299 -0
- package/src/foundry/foundry.js/clientSettings.d.ts +11 -9
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
- package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
- package/src/foundry/foundry.js/config.d.ts +465 -887
- package/src/foundry/foundry.js/game.d.ts +86 -11
- package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
- package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
- package/src/foundry/foundry.js/hooks.d.ts +57 -0
- package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
- package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
- package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
- package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +3 -3
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
- package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
- package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +1 -1
- package/src/foundry/foundry.js/pointSource.d.ts +2 -2
- package/src/foundry/foundry.js/roll.d.ts +25 -36
- package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
- package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
- package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
- package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
- package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
- package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
- package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
- package/src/foundry/foundry.js/textEditor.d.ts +1 -1
- package/src/foundry/index.d.ts +4 -0
- package/src/types/utils.d.ts +11 -3
@@ -1,33 +1,33 @@
|
|
1
|
+
import {
|
2
|
+
ConfiguredDocumentClass,
|
3
|
+
ConfiguredFlags,
|
4
|
+
FieldReturnType,
|
5
|
+
PropertiesToSource
|
6
|
+
} from '../../../../types/helperTypes';
|
1
7
|
import DocumentData from '../../abstract/data.mjs';
|
2
|
-
import {
|
3
|
-
import { CONST, documents } from '../../module.mjs';
|
8
|
+
import { documents } from '../../module.mjs';
|
4
9
|
import * as fields from '../fields.mjs';
|
5
|
-
import { AnimationData, AnimationDataConstructorData } from './animationData';
|
6
|
-
import { TokenBarData, TokenBarDataConstructorData } from './tokenBarData';
|
7
10
|
import { ActorDataSource } from './actorData.js';
|
11
|
+
import { LightData, LightDataConstructorData } from './lightData';
|
12
|
+
import { TokenBarData, TokenBarDataConstructorData } from './tokenBarData';
|
8
13
|
|
9
|
-
interface
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
export interface TokenDataSchema extends DocumentSchema {
|
15
|
-
_id: typeof fields.DOCUMENT_ID;
|
16
|
-
name: typeof fields.STRING_FIELD;
|
17
|
-
displayName: DocumentField<CONST.TokenDisplayMode> & {
|
14
|
+
interface TokenDataSchema extends DocumentSchema {
|
15
|
+
_id: fields.DocumentId;
|
16
|
+
name: fields.StringField;
|
17
|
+
displayName: DocumentField<foundry.CONST.TOKEN_DISPLAY_MODES> & {
|
18
18
|
type: typeof Number;
|
19
19
|
required: true;
|
20
|
-
default: typeof CONST.TOKEN_DISPLAY_MODES.NONE;
|
20
|
+
default: typeof foundry.CONST.TOKEN_DISPLAY_MODES.NONE;
|
21
21
|
validate: (m: any) => boolean;
|
22
22
|
validationError: 'Invalid {name} {field} which must be a value in CONST.TOKEN_DISPLAY_MODES';
|
23
23
|
};
|
24
24
|
actorId: fields.ForeignDocumentField<{ type: documents.BaseActor; required: true }>;
|
25
|
-
actorLink:
|
26
|
-
actorData:
|
27
|
-
img: FieldReturnType<
|
28
|
-
tint:
|
29
|
-
width: FieldReturnType<
|
30
|
-
height: FieldReturnType<
|
25
|
+
actorLink: fields.BooleanField;
|
26
|
+
actorData: fields.ObjectField;
|
27
|
+
img: FieldReturnType<fields.VideoField, { default: () => typeof TokenData.DEFAULT_ICON }>;
|
28
|
+
tint: fields.ColorField;
|
29
|
+
width: FieldReturnType<fields.RequiredPositiveNumber, { default: 1 }>;
|
30
|
+
height: FieldReturnType<fields.RequiredPositiveNumber, { default: 1 }>;
|
31
31
|
scale: DocumentField<number> & {
|
32
32
|
type: typeof Number;
|
33
33
|
required: true;
|
@@ -35,50 +35,45 @@ export interface TokenDataSchema extends DocumentSchema {
|
|
35
35
|
validate: (s: unknown) => boolean;
|
36
36
|
validationError: 'Invalid {name} {field} which must be a number between 0.25 and 10';
|
37
37
|
};
|
38
|
-
mirrorX:
|
39
|
-
mirrorY:
|
40
|
-
x:
|
41
|
-
y:
|
42
|
-
elevation:
|
43
|
-
lockRotation:
|
44
|
-
rotation: FieldReturnType<
|
38
|
+
mirrorX: fields.BooleanField;
|
39
|
+
mirrorY: fields.BooleanField;
|
40
|
+
x: fields.RequiredNumber;
|
41
|
+
y: fields.RequiredNumber;
|
42
|
+
elevation: fields.RequiredNumber;
|
43
|
+
lockRotation: fields.BooleanField;
|
44
|
+
rotation: FieldReturnType<fields.AngleField, { default: 0 }>;
|
45
45
|
effects: DocumentField<string[]> & {
|
46
|
-
type: typeof String
|
46
|
+
type: [typeof String];
|
47
47
|
required: true;
|
48
48
|
default: string[];
|
49
49
|
};
|
50
|
-
overlayEffect:
|
51
|
-
alpha:
|
52
|
-
hidden:
|
50
|
+
overlayEffect: fields.StringField;
|
51
|
+
alpha: fields.AlphaField;
|
52
|
+
hidden: fields.BooleanField;
|
53
53
|
vision: DocumentField<boolean> & {
|
54
54
|
type: typeof Boolean;
|
55
55
|
required: true;
|
56
56
|
default: (data: { readonly dimSight?: number; readonly brightSight?: number }) => boolean;
|
57
57
|
};
|
58
|
-
dimSight:
|
59
|
-
brightSight:
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
lightAngle: typeof fields.ANGLE_FIELD;
|
64
|
-
lightColor: typeof fields.COLOR_FIELD;
|
65
|
-
lightAlpha: FieldReturnType<typeof fields.ALPHA_FIELD, { default: 0.25 }>;
|
66
|
-
lightAnimation: DocumentField<AnimationData> & {
|
67
|
-
type: typeof AnimationData;
|
58
|
+
dimSight: fields.NonnegativeNumberField;
|
59
|
+
brightSight: fields.NonnegativeNumberField;
|
60
|
+
sightAngle: fields.AngleField;
|
61
|
+
light: DocumentField<LightData> & {
|
62
|
+
type: typeof LightData;
|
68
63
|
required: true;
|
69
|
-
default:
|
64
|
+
default: Record<string, never>;
|
70
65
|
};
|
71
|
-
disposition: DocumentField<CONST.
|
66
|
+
disposition: DocumentField<foundry.CONST.TOKEN_DISPOSITIONS> & {
|
72
67
|
type: typeof Number;
|
73
68
|
required: true;
|
74
|
-
default: typeof CONST.TOKEN_DISPOSITIONS.HOSTILE;
|
69
|
+
default: typeof foundry.CONST.TOKEN_DISPOSITIONS.HOSTILE;
|
75
70
|
validate: (n: any) => boolean;
|
76
71
|
validationError: 'Invalid {name} {field} which must be a value in CONST.TOKEN_DISPOSITIONS';
|
77
72
|
};
|
78
|
-
displayBars: DocumentField<CONST.
|
73
|
+
displayBars: DocumentField<foundry.CONST.TOKEN_DISPLAY_MODES> & {
|
79
74
|
type: typeof Number;
|
80
75
|
required: true;
|
81
|
-
default: typeof CONST.TOKEN_DISPLAY_MODES.NONE;
|
76
|
+
default: typeof foundry.CONST.TOKEN_DISPLAY_MODES.NONE;
|
82
77
|
validate: (m: any) => boolean;
|
83
78
|
validationError: 'Invalid {name} {field} which must be a value in CONST.TOKEN_DISPLAY_MODES';
|
84
79
|
};
|
@@ -92,10 +87,10 @@ export interface TokenDataSchema extends DocumentSchema {
|
|
92
87
|
required: true;
|
93
88
|
default: () => { attribute: Game['system']['data']['secondaryTokenAttribute'] | null };
|
94
89
|
};
|
95
|
-
flags:
|
90
|
+
flags: fields.ObjectField;
|
96
91
|
}
|
97
92
|
|
98
|
-
|
93
|
+
interface TokenDataProperties {
|
99
94
|
/**
|
100
95
|
* The Token _id which uniquely identifies it within its parent Scene
|
101
96
|
* @defaultValue `null`
|
@@ -105,13 +100,13 @@ export interface TokenDataProperties {
|
|
105
100
|
/**
|
106
101
|
* The name used to describe the Token
|
107
102
|
*/
|
108
|
-
name
|
103
|
+
name: string | undefined;
|
109
104
|
|
110
105
|
/**
|
111
106
|
* The display mode of the Token nameplate, from CONST.TOKEN_DISPLAY_MODES
|
112
107
|
* @defaultValue `CONST.TOKEN_DISPLAY_MODES.NONE`
|
113
108
|
*/
|
114
|
-
displayName: CONST.
|
109
|
+
displayName: foundry.CONST.TOKEN_DISPLAY_MODES;
|
115
110
|
|
116
111
|
/**
|
117
112
|
* The _id of an Actor document which this Token represents
|
@@ -133,14 +128,14 @@ export interface TokenDataProperties {
|
|
133
128
|
|
134
129
|
/**
|
135
130
|
* A file path to an image or video file used to depict the Token
|
136
|
-
* @defaultValue `
|
131
|
+
* @defaultValue `TokenData.DEFAULT_ICON`
|
137
132
|
*/
|
138
133
|
img: string | null;
|
139
134
|
|
140
135
|
/**
|
141
136
|
* An optional color tint applied to the Token image
|
142
137
|
*/
|
143
|
-
tint
|
138
|
+
tint: string | null | undefined;
|
144
139
|
|
145
140
|
/**
|
146
141
|
* The width of the Token in grid units
|
@@ -211,7 +206,7 @@ export interface TokenDataProperties {
|
|
211
206
|
/**
|
212
207
|
* A single icon path which is displayed as an overlay on the Token
|
213
208
|
*/
|
214
|
-
overlayEffect
|
209
|
+
overlayEffect: string | undefined;
|
215
210
|
|
216
211
|
/**
|
217
212
|
* The opacity of the token image
|
@@ -243,18 +238,6 @@ export interface TokenDataProperties {
|
|
243
238
|
*/
|
244
239
|
brightSight: number;
|
245
240
|
|
246
|
-
/**
|
247
|
-
* How far in distance units this Token emits dim light
|
248
|
-
* @defaultValue `0`
|
249
|
-
*/
|
250
|
-
dimLight: number;
|
251
|
-
|
252
|
-
/**
|
253
|
-
* How far in distance units this Token emits bright light
|
254
|
-
* @defaultValue `0`
|
255
|
-
*/
|
256
|
-
brightLight: number;
|
257
|
-
|
258
241
|
/**
|
259
242
|
* The angle at which this Token is able to see, if it has vision
|
260
243
|
* @defaultValue `360`
|
@@ -262,49 +245,32 @@ export interface TokenDataProperties {
|
|
262
245
|
sightAngle: number;
|
263
246
|
|
264
247
|
/**
|
265
|
-
*
|
266
|
-
* @defaultValue `
|
267
|
-
*/
|
268
|
-
lightAngle: number;
|
269
|
-
|
270
|
-
/**
|
271
|
-
* The color of the token's emitted light as an HTML hexadecimal color string
|
272
|
-
*/
|
273
|
-
lightColor: string | undefined | null;
|
274
|
-
|
275
|
-
/**
|
276
|
-
* The intensity of any light emitted by the token
|
277
|
-
* @defaultValue `0.25`
|
278
|
-
*/
|
279
|
-
lightAlpha: number;
|
280
|
-
|
281
|
-
/**
|
282
|
-
* A data object which configures token light animation settings
|
283
|
-
* @defaultValue `{}`
|
248
|
+
* Configuration of the light source that this Token emits, if any
|
249
|
+
* @defaultValue `new LightData({})`
|
284
250
|
*/
|
285
|
-
|
251
|
+
light: LightData;
|
286
252
|
|
287
253
|
/**
|
288
254
|
* A displayed Token disposition from CONST.TOKEN_DISPOSITIONS
|
289
255
|
* @defaultValue `CONST.TOKEN_DISPOSITIONS.HOSTILE`
|
290
256
|
*/
|
291
|
-
disposition: CONST.
|
257
|
+
disposition: foundry.CONST.TOKEN_DISPOSITIONS;
|
292
258
|
|
293
259
|
/**
|
294
260
|
* The display mode of Token resource bars, from CONST.TOKEN_DISPLAY_MODES
|
295
261
|
* @defaultValue `CONST.TOKEN_DISPLAY_MODES.NONE`
|
296
262
|
*/
|
297
|
-
displayBars: CONST.
|
263
|
+
displayBars: foundry.CONST.TOKEN_DISPLAY_MODES;
|
298
264
|
|
299
265
|
/**
|
300
266
|
* The configuration of the Token's primary resource bar
|
301
|
-
* @defaultValue `{ attribute: game?.system.data.primaryTokenAttribute || null }`
|
267
|
+
* @defaultValue `new TokenBarData({ attribute: game?.system.data.primaryTokenAttribute || null })`
|
302
268
|
*/
|
303
269
|
bar1: TokenBarData;
|
304
270
|
|
305
271
|
/**
|
306
272
|
* The configuration of the Token's secondary resource bar
|
307
|
-
* @defaultValue `{ attribute: game?.system.data.secondaryTokenAttribute || null }`
|
273
|
+
* @defaultValue `new TokenBarData({ attribute: game?.system.data.secondaryTokenAttribute || null })`
|
308
274
|
*/
|
309
275
|
bar2: TokenBarData;
|
310
276
|
|
@@ -315,29 +281,29 @@ export interface TokenDataProperties {
|
|
315
281
|
flags: ConfiguredFlags<'Token'>;
|
316
282
|
}
|
317
283
|
|
318
|
-
|
284
|
+
interface TokenDataConstructorData {
|
319
285
|
/**
|
320
286
|
* The Token _id which uniquely identifies it within its parent Scene
|
321
287
|
* @defaultValue `null`
|
322
288
|
*/
|
323
|
-
_id?: string | null;
|
289
|
+
_id?: string | null | undefined;
|
324
290
|
|
325
291
|
/**
|
326
292
|
* The name used to describe the Token
|
327
293
|
*/
|
328
|
-
name?: string | null;
|
294
|
+
name?: string | null | undefined;
|
329
295
|
|
330
296
|
/**
|
331
297
|
* The display mode of the Token nameplate, from CONST.TOKEN_DISPLAY_MODES
|
332
298
|
* @defaultValue `CONST.TOKEN_DISPLAY_MODES.NONE`
|
333
299
|
*/
|
334
|
-
displayName?: CONST.
|
300
|
+
displayName?: foundry.CONST.TOKEN_DISPLAY_MODES | null | undefined;
|
335
301
|
|
336
302
|
/**
|
337
303
|
* The _id of an Actor document which this Token represents
|
338
304
|
* @defaultValue `null`
|
339
305
|
*/
|
340
|
-
actorId?: string | null;
|
306
|
+
actorId?: InstanceType<ConfiguredDocumentClass<typeof documents.BaseActor>> | string | null | undefined;
|
341
307
|
|
342
308
|
/**
|
343
309
|
* Does this Token uniquely represent a singular Actor, or is it one of many?
|
@@ -349,190 +315,161 @@ export interface TokenDataConstructorData {
|
|
349
315
|
* Token-level data which overrides the base data of the associated Actor
|
350
316
|
* @defaultValue `{}`
|
351
317
|
*/
|
352
|
-
actorData?: Partial<ActorDataSource> | null;
|
318
|
+
actorData?: Partial<ActorDataSource> | null | undefined;
|
353
319
|
|
354
320
|
/**
|
355
321
|
* A file path to an image or video file used to depict the Token
|
356
|
-
* @defaultValue `
|
322
|
+
* @defaultValue `TokenData.DEFAULT_ICON`
|
357
323
|
*/
|
358
|
-
img?: string | null;
|
324
|
+
img?: string | null | undefined;
|
359
325
|
|
360
326
|
/**
|
361
327
|
* An optional color tint applied to the Token image
|
362
328
|
*/
|
363
|
-
tint?: string | null;
|
329
|
+
tint?: string | null | undefined;
|
364
330
|
|
365
331
|
/**
|
366
332
|
* The width of the Token in grid units
|
367
333
|
* @defaultValue `1`
|
368
334
|
*/
|
369
|
-
width?: number | null;
|
335
|
+
width?: number | null | undefined;
|
370
336
|
|
371
337
|
/**
|
372
338
|
* The height of the Token in grid units
|
373
339
|
* @defaultValue `1`
|
374
340
|
*/
|
375
|
-
height?: number | null;
|
341
|
+
height?: number | null | undefined;
|
376
342
|
|
377
343
|
/**
|
378
344
|
* A scale factor applied to the Token image, between 0.25 and 3
|
379
345
|
* @defaultValue `1`
|
380
346
|
*/
|
381
|
-
scale?: number | null;
|
347
|
+
scale?: number | null | undefined;
|
382
348
|
|
383
349
|
/**
|
384
350
|
* Flip the Token image horizontally?
|
385
351
|
* @defaultValue `false`
|
386
352
|
*/
|
387
|
-
mirrorX?: boolean | null;
|
353
|
+
mirrorX?: boolean | null | undefined;
|
388
354
|
|
389
355
|
/**
|
390
356
|
* Flip the Token image vertically?
|
391
357
|
* @defaultValue `false`
|
392
358
|
*/
|
393
|
-
mirrorY?: boolean | null;
|
359
|
+
mirrorY?: boolean | null | undefined;
|
394
360
|
|
395
361
|
/**
|
396
362
|
* The x-coordinate of the top-left corner of the Token
|
397
363
|
* @defaultValue `0`
|
398
364
|
*/
|
399
|
-
x?: number | null;
|
365
|
+
x?: number | null | undefined;
|
400
366
|
|
401
367
|
/**
|
402
368
|
* The y-coordinate of the top-left corner of the Token
|
403
369
|
* @defaultValue `0`
|
404
370
|
*/
|
405
|
-
y?: number | null;
|
371
|
+
y?: number | null | undefined;
|
406
372
|
|
407
373
|
/**
|
408
374
|
* The vertical elevation of the Token, in distance units
|
409
375
|
* @defaultValue `0`
|
410
376
|
*/
|
411
|
-
elevation?: number | null;
|
377
|
+
elevation?: number | null | undefined;
|
412
378
|
|
413
379
|
/**
|
414
380
|
* Prevent the Token image from visually rotating?
|
415
381
|
* @defaultValue `false`
|
416
382
|
*/
|
417
|
-
lockRotation?: boolean | null;
|
383
|
+
lockRotation?: boolean | null | undefined;
|
418
384
|
|
419
385
|
/**
|
420
386
|
* The rotation of the Token in degrees, from 0 to 360. A value of 0 represents a southward-facing Token.
|
421
387
|
* @defaultValue `0`
|
422
388
|
*/
|
423
|
-
rotation?: number | null;
|
389
|
+
rotation?: number | null | undefined;
|
424
390
|
|
425
391
|
/**
|
426
392
|
* An array of effect icon paths which are displayed on the Token
|
427
393
|
* @defaultValue `[]`
|
428
394
|
*/
|
429
|
-
effects?: string[] | null;
|
395
|
+
effects?: string[] | null | undefined;
|
430
396
|
|
431
397
|
/**
|
432
398
|
* A single icon path which is displayed as an overlay on the Token
|
433
399
|
*/
|
434
|
-
overlayEffect?: string | null;
|
400
|
+
overlayEffect?: string | null | undefined;
|
435
401
|
|
436
402
|
/**
|
437
403
|
* The opacity of the token image
|
438
404
|
* @defaultValue `1`
|
439
405
|
*/
|
440
|
-
alpha?: number | null;
|
406
|
+
alpha?: number | null | undefined;
|
441
407
|
|
442
408
|
/**
|
443
409
|
* Is the Token currently hidden from player view?
|
444
410
|
* @defaultValue `false`
|
445
411
|
*/
|
446
|
-
hidden?: boolean | null;
|
412
|
+
hidden?: boolean | null | undefined;
|
447
413
|
|
448
414
|
/**
|
449
415
|
* Is this Token a source of vision?
|
450
416
|
* @defaultValue Whether dimSight or brightSight have a value greater 0.
|
451
417
|
*/
|
452
|
-
vision?: boolean | null;
|
418
|
+
vision?: boolean | null | undefined;
|
453
419
|
|
454
420
|
/**
|
455
421
|
* How far in distance units the Token can naturally see as if in dim light
|
456
422
|
* @defaultValue `0`
|
457
423
|
*/
|
458
|
-
dimSight?: number | null;
|
424
|
+
dimSight?: number | null | undefined;
|
459
425
|
|
460
426
|
/**
|
461
427
|
* How far in distance units the Token can naturally see as if in bright light
|
462
428
|
* @defaultValue `0`
|
463
429
|
*/
|
464
|
-
brightSight?: number | null;
|
465
|
-
|
466
|
-
/**
|
467
|
-
* How far in distance units this Token emits dim light
|
468
|
-
* @defaultValue `0`
|
469
|
-
*/
|
470
|
-
dimLight?: number | null;
|
471
|
-
|
472
|
-
/**
|
473
|
-
* How far in distance units this Token emits bright light
|
474
|
-
* @defaultValue `0`
|
475
|
-
*/
|
476
|
-
brightLight?: number | null;
|
430
|
+
brightSight?: number | null | undefined;
|
477
431
|
|
478
432
|
/**
|
479
433
|
* The angle at which this Token is able to see, if it has vision
|
480
434
|
* @defaultValue `360`
|
481
435
|
*/
|
482
|
-
sightAngle?: number | null;
|
483
|
-
|
484
|
-
/**
|
485
|
-
* The angle at which this Token is able to emit light
|
486
|
-
* @defaultValue `360`
|
487
|
-
*/
|
488
|
-
lightAngle?: number | null;
|
436
|
+
sightAngle?: number | null | undefined;
|
489
437
|
|
490
438
|
/**
|
491
|
-
*
|
439
|
+
* Configuration of the light source that this Token emits, if any
|
440
|
+
* @defaultValue `new LightData({})`
|
492
441
|
*/
|
493
|
-
|
494
|
-
|
495
|
-
/**
|
496
|
-
* The intensity of any light emitted by the token
|
497
|
-
* @defaultValue `0.25`
|
498
|
-
*/
|
499
|
-
lightAlpha?: number | null;
|
500
|
-
|
501
|
-
/**
|
502
|
-
* A data object which configures token light animation settings
|
503
|
-
* @defaultValue `{}`
|
504
|
-
*/
|
505
|
-
lightAnimation?: AnimationDataConstructorData | null;
|
442
|
+
light?: LightDataConstructorData | null | undefined;
|
506
443
|
|
507
444
|
/**
|
508
445
|
* A displayed Token disposition from CONST.TOKEN_DISPOSITIONS
|
509
446
|
* @defaultValue `CONST.TOKEN_DISPOSITIONS.HOSTILE`
|
510
447
|
*/
|
511
|
-
disposition?: CONST.
|
448
|
+
disposition?: foundry.CONST.TOKEN_DISPOSITIONS | null | undefined;
|
512
449
|
|
513
450
|
/**
|
514
451
|
* The display mode of Token resource bars, from CONST.TOKEN_DISPLAY_MODES
|
515
452
|
* @defaultValue `CONST.TOKEN_DISPLAY_MODES.NONE`
|
516
453
|
*/
|
517
|
-
displayBars?: CONST.
|
454
|
+
displayBars?: foundry.CONST.TOKEN_DISPLAY_MODES | null | undefined;
|
518
455
|
|
519
456
|
/**
|
520
457
|
* The configuration of the Token's primary resource bar
|
521
|
-
* @defaultValue `{ attribute: game?.system.data.primaryTokenAttribute || null }`
|
458
|
+
* @defaultValue `new TokenBarData({ attribute: game?.system.data.primaryTokenAttribute || null })`
|
522
459
|
*/
|
523
|
-
bar1?: TokenBarDataConstructorData | null;
|
460
|
+
bar1?: TokenBarDataConstructorData | null | undefined;
|
524
461
|
|
525
462
|
/**
|
526
463
|
* The configuration of the Token's secondary resource bar
|
527
|
-
* @defaultValue `{ attribute: game?.system.data.secondaryTokenAttribute || null }`
|
464
|
+
* @defaultValue `new TokenBarData({ attribute: game?.system.data.secondaryTokenAttribute || null })`
|
528
465
|
*/
|
529
|
-
bar2?: TokenBarDataConstructorData | null;
|
466
|
+
bar2?: TokenBarDataConstructorData | null | undefined;
|
530
467
|
|
531
468
|
/**
|
532
469
|
* An object of optional key/value flags
|
533
470
|
* @defaultValue `{}`
|
534
471
|
*/
|
535
|
-
flags?: ConfiguredFlags<'Token'> | null;
|
472
|
+
flags?: ConfiguredFlags<'Token'> | null | undefined;
|
536
473
|
}
|
537
474
|
|
538
475
|
/**
|
@@ -545,14 +482,25 @@ export class TokenData extends DocumentData<
|
|
545
482
|
TokenDataConstructorData,
|
546
483
|
documents.BaseToken
|
547
484
|
> {
|
485
|
+
/** @override */
|
548
486
|
static defineSchema(): TokenDataSchema;
|
549
487
|
|
550
488
|
/**
|
551
|
-
* The default icon used for newly created
|
489
|
+
* The default icon used for newly created Token documents
|
552
490
|
* @defaultValue `CONST.DEFAULT_TOKEN`
|
553
491
|
*/
|
554
492
|
static DEFAULT_ICON: string;
|
493
|
+
|
494
|
+
/**
|
495
|
+
* Migrate TokenData attributes to the new inner LightData structure.
|
496
|
+
* This can be safely removed after several major versions have passed. Maybe V12?
|
497
|
+
* @override
|
498
|
+
*/
|
499
|
+
_initializeSource(data: TokenDataConstructorData): PropertiesToSource<TokenDataProperties>;
|
500
|
+
|
501
|
+
/** @override */
|
502
|
+
protected _initialize(): void;
|
555
503
|
}
|
556
504
|
|
557
505
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
558
|
-
export
|
506
|
+
export interface TokenData extends TokenDataProperties {}
|