@league-of-foundry-developers/foundry-vtt-types 9.249.3 → 9.255.1
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 +1 -1
- package/package.json +2 -2
- package/src/foundry/common/constants.mjs.d.ts +1 -0
- package/src/foundry/common/documents.mjs/baseMacro.d.ts +0 -3
- package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +8 -1
- package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +7 -1
- package/src/foundry/common/types.mjs.d.ts +120 -8
- package/src/foundry/common/utils/helpers.mjs.d.ts +0 -1
- package/src/foundry/common/utils/http.mjs.d.ts +52 -0
- package/src/foundry/common/utils/module.mjs.d.ts +1 -0
- package/src/foundry/common/utils/primitives.mjs.d.ts +2 -2
- package/src/foundry/common/utils/semaphore.mjs.d.ts +6 -3
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +8 -6
- package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
- package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +4 -4
- package/src/foundry/foundry.js/applications/notifications.d.ts +2 -5
- package/src/foundry/foundry.js/avClient.d.ts +15 -1
- package/src/foundry/foundry.js/avClients/index.d.ts +0 -1
- package/src/foundry/foundry.js/avClients/simplePeerAVClient.d.ts +31 -4
- package/src/foundry/foundry.js/avMaster.d.ts +21 -48
- package/src/foundry/foundry.js/avSettings.d.ts +19 -46
- package/src/foundry/foundry.js/canvas.d.ts +0 -8
- package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +6 -0
- package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -2
- package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +28 -6
- package/src/foundry/foundry.js/clientDocuments/actor.d.ts +13 -70
- package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +42 -9
- package/src/foundry/foundry.js/clientDocuments/cards.d.ts +2 -1
- package/src/foundry/foundry.js/clientDocuments/folder.d.ts +22 -20
- package/src/foundry/foundry.js/clientDocuments/item.d.ts +5 -23
- package/src/foundry/foundry.js/clientDocuments/macro.d.ts +10 -0
- package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +1 -1
- package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +24 -14
- package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +16 -14
- package/src/foundry/foundry.js/clientDocuments/scene.d.ts +12 -7
- package/src/foundry/foundry.js/clientDocuments/user.d.ts +2 -12
- package/src/foundry/foundry.js/clientSettings.d.ts +203 -230
- package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +3 -1
- package/src/foundry/foundry.js/config.d.ts +3 -0
- package/src/foundry/foundry.js/game.d.ts +1 -1
- package/src/foundry/foundry.js/gamepadManager.d.ts +12 -0
- package/src/foundry/foundry.js/globalVariables.d.ts +0 -31
- package/src/foundry/foundry.js/pixi/containers/baseGrid.d.ts +21 -6
- package/src/foundry/foundry.js/pixi/containers/baseGrids/hexagonalGrid.d.ts +13 -8
- package/src/foundry/foundry.js/pixi/containers/baseGrids/squareGrid.d.ts +5 -3
- package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +14 -5
- package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +9 -55
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/drawing.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/measuredTemplate.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +3 -0
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +4 -2
- package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +31 -17
- package/src/foundry/foundry.js/rollTerms/diceTerms/die.d.ts +0 -5
- package/src/foundry/foundry.js/rollTerms/diceTerms/fateDie.d.ts +21 -1
- package/src/foundry/foundry.js/videoHelper.d.ts +0 -7
- package/src/foundry/index.d.ts +0 -4
- package/src/types/helperTypes.d.ts +6 -0
- package/src/foundry/foundry.js/avClients/easyRTCClient.d.ts +0 -392
- package/src/foundry/foundry.js/features.d.ts +0 -0
- package/src/foundry/foundry.js/fonts.d.ts +0 -24
@@ -29,24 +29,26 @@ declare class AVMaster {
|
|
29
29
|
protected _connected: boolean;
|
30
30
|
|
31
31
|
/**
|
32
|
-
*
|
33
|
-
* This
|
34
|
-
* @defaultValue `
|
32
|
+
* The cached connection promise.
|
33
|
+
* This is required to prevent re-triggering a connection while one is already in progress.
|
34
|
+
* @defaultValue `null`
|
35
35
|
* @internal
|
36
36
|
*/
|
37
|
-
protected
|
37
|
+
protected _connecting: Promise<boolean> | null;
|
38
38
|
|
39
39
|
/**
|
40
|
-
*
|
40
|
+
* A flag to track whether the A/V system is currently in the process of reconnecting.
|
41
|
+
* This occurs if the connection is lost or interrupted.
|
42
|
+
* @defaultValue `false`
|
41
43
|
* @internal
|
42
44
|
*/
|
43
|
-
protected
|
45
|
+
protected _reconnecting: boolean;
|
44
46
|
|
45
47
|
/**
|
46
48
|
* @defaultValue `{}`
|
47
49
|
* @internal
|
48
50
|
*/
|
49
|
-
protected
|
51
|
+
protected _speakingData: { speaking: boolean; volumeHistories: number[] };
|
50
52
|
|
51
53
|
/**
|
52
54
|
* @defaultValue `0`
|
@@ -54,7 +56,7 @@ declare class AVMaster {
|
|
54
56
|
*/
|
55
57
|
protected _pttMuteTimeout: number;
|
56
58
|
|
57
|
-
get mode(): AVSettings.
|
59
|
+
get mode(): AVSettings.AV_MODES;
|
58
60
|
|
59
61
|
/**
|
60
62
|
* Connect to the Audio/Video client.
|
@@ -111,29 +113,27 @@ declare class AVMaster {
|
|
111
113
|
* @param mode - The currently selected voice broadcasting mode
|
112
114
|
* @internal
|
113
115
|
*/
|
114
|
-
protected _initializeUserVoiceDetection(mode: AVSettings.
|
116
|
+
protected _initializeUserVoiceDetection(mode: AVSettings.VOICE_MODES): void;
|
115
117
|
|
116
118
|
/**
|
117
119
|
* Activate voice detection tracking for a userId on a provided MediaStream.
|
118
120
|
* Currently only a MediaStream is supported because MediaStreamTrack processing is not yet supported cross-browser.
|
119
|
-
* @param userId - The Foundry User ID whose voice is being processed
|
120
121
|
* @param stream - The MediaStream which corresponds to that User
|
121
122
|
* @param ms - A number of milliseconds which represents the voice activation volume interval
|
122
123
|
* (default: `CONFIG.WebRTC.detectPeerVolumeInterval`)
|
123
124
|
*/
|
124
|
-
activateVoiceDetection(
|
125
|
+
activateVoiceDetection(stream: MediaStream, ms?: number): void;
|
125
126
|
|
126
127
|
/**
|
127
128
|
* Actions which the orchestration layer should take when a peer user disconnects from the audio/video service.
|
128
|
-
* @param userId - The id of the disconnecting User
|
129
129
|
*/
|
130
|
-
deactivateVoiceDetection(
|
130
|
+
deactivateVoiceDetection(): void;
|
131
131
|
|
132
132
|
/**
|
133
133
|
* Periodic notification of user audio level
|
134
134
|
*
|
135
|
-
* This function uses the audio level (in dB) of
|
136
|
-
*
|
135
|
+
* This function uses the audio level (in dB) of the audio stream to determine if the user is speaking or not and
|
136
|
+
* notifies the UI of such changes.
|
137
137
|
*
|
138
138
|
* The User is considered speaking if they are above the decibel threshold in any of the history values.
|
139
139
|
* This marks them as speaking as soon as they have a high enough volume, and marks them as not speaking only after
|
@@ -142,46 +142,31 @@ declare class AVMaster {
|
|
142
142
|
* There can be more optimal ways to do this and which uses whether the user was already considered speaking before
|
143
143
|
* or not, in order to eliminate short bursts of audio (coughing for example).
|
144
144
|
*
|
145
|
-
* @param userId - The user ID of the user whose audio levels are being reported
|
146
145
|
* @param dbLevel - The audio level in decibels of the user within the last 50ms
|
147
146
|
* @internal
|
148
147
|
*/
|
149
|
-
protected _onAudioLevel(
|
150
|
-
|
151
|
-
/**
|
152
|
-
* Set up interactivity and handling of push-to-talk broadcasting workflow.
|
153
|
-
* @internal
|
154
|
-
*/
|
155
|
-
protected _initializePushToTalk(): void;
|
148
|
+
protected _onAudioLevel(dbLevel: number): void;
|
156
149
|
|
157
150
|
/**
|
158
151
|
* Resets the speaking history of a user
|
159
152
|
* If the user was considered speaking, then mark them as not speaking
|
160
|
-
* @param userId - The ID of the user
|
161
153
|
* @internal
|
162
154
|
*/
|
163
|
-
protected _resetSpeakingHistory(
|
155
|
+
protected _resetSpeakingHistory(): void;
|
164
156
|
|
165
157
|
/**
|
166
158
|
* Handle activation of a push-to-talk key or button.
|
167
|
-
* @param
|
159
|
+
* @param context - The context data of the event
|
168
160
|
* @internal
|
169
161
|
*/
|
170
|
-
_onPTTStart(
|
162
|
+
_onPTTStart(context: KeyboardEventContext): void;
|
171
163
|
|
172
164
|
/**
|
173
165
|
* Handle deactivation of a push-to-talk key or button.
|
174
|
-
* @param
|
166
|
+
* @param context - The context data of the event
|
175
167
|
* @internal
|
176
168
|
*/
|
177
|
-
_onPTTEnd(
|
178
|
-
|
179
|
-
/**
|
180
|
-
* Handle matching old and new PTT configurations against the mouse or keyboard event.
|
181
|
-
* @param event - The original event
|
182
|
-
* @internal
|
183
|
-
*/
|
184
|
-
_isPTTKey(event: KeyboardEvent | MouseEvent): boolean;
|
169
|
+
_onPTTEnd(context: KeyboardEventContext): void;
|
185
170
|
|
186
171
|
render(): void;
|
187
172
|
|
@@ -200,15 +185,3 @@ declare class AVMaster {
|
|
200
185
|
|
201
186
|
debug(message: string): void;
|
202
187
|
}
|
203
|
-
|
204
|
-
declare namespace AVMaster {
|
205
|
-
type SpeakingData = Partial<Record<string, { speaking: boolean; volumeHistories: number[] }>>;
|
206
|
-
type PTTHandler = (event: KeyboardEvent | MouseEvent) => void;
|
207
|
-
type PTTHandlers =
|
208
|
-
| {}
|
209
|
-
| { mousedown: PTTHandler; mouseup: PTTHandler }
|
210
|
-
| {
|
211
|
-
keydown: PTTHandler;
|
212
|
-
keyup: PTTHandler;
|
213
|
-
};
|
214
|
-
}
|
@@ -12,9 +12,11 @@ interface AVSettingsData {
|
|
12
12
|
declare class AVSettings {
|
13
13
|
constructor();
|
14
14
|
|
15
|
-
|
15
|
+
/** @internal */
|
16
|
+
protected _set: <T>(key: string, value: T) => void;
|
16
17
|
|
17
|
-
|
18
|
+
/** @internal */
|
19
|
+
protected _change: () => void;
|
18
20
|
|
19
21
|
client: AVSettings.ClientSettings;
|
20
22
|
|
@@ -74,15 +76,7 @@ declare class AVSettings {
|
|
74
76
|
/**
|
75
77
|
* @defaultValue `'AVSettings.VOICE_MODES.PTT'`
|
76
78
|
*/
|
77
|
-
mode: AVSettings.
|
78
|
-
|
79
|
-
/**
|
80
|
-
* @defaultValue
|
81
|
-
* ```
|
82
|
-
* "`"
|
83
|
-
* ```
|
84
|
-
*/
|
85
|
-
pttKey: string;
|
79
|
+
mode: AVSettings.VOICE_MODES;
|
86
80
|
|
87
81
|
/**
|
88
82
|
* @defaultValue
|
@@ -92,11 +86,6 @@ declare class AVSettings {
|
|
92
86
|
*/
|
93
87
|
pttName: string;
|
94
88
|
|
95
|
-
/**
|
96
|
-
* @defaultValue `false`
|
97
|
-
*/
|
98
|
-
pttMouse: boolean;
|
99
|
-
|
100
89
|
/**
|
101
90
|
* @defaultValue `100`
|
102
91
|
*/
|
@@ -111,41 +100,14 @@ declare class AVSettings {
|
|
111
100
|
/**
|
112
101
|
* @defaultValue `{}`
|
113
102
|
*/
|
114
|
-
users:
|
103
|
+
users: Record<string, AVSettings.StoredUserSettings>;
|
115
104
|
};
|
116
105
|
|
117
106
|
static DEFAULT_WORLD_SETTINGS: {
|
118
107
|
/**
|
119
108
|
* @defaultValue `AVSettings.AV_MODES.DISABLED`
|
120
109
|
*/
|
121
|
-
mode: AVSettings.
|
122
|
-
|
123
|
-
server: {
|
124
|
-
/**
|
125
|
-
* @defaultValue `'FVTT'`
|
126
|
-
*/
|
127
|
-
type: string;
|
128
|
-
|
129
|
-
/**
|
130
|
-
* @defaultValue `""`
|
131
|
-
*/
|
132
|
-
url: string;
|
133
|
-
|
134
|
-
/**
|
135
|
-
* @defaultValue `""`
|
136
|
-
*/
|
137
|
-
room: string;
|
138
|
-
|
139
|
-
/**
|
140
|
-
* @defaultValue `""`
|
141
|
-
*/
|
142
|
-
username: string;
|
143
|
-
|
144
|
-
/**
|
145
|
-
* @defaultValue `""`
|
146
|
-
*/
|
147
|
-
password: string;
|
148
|
-
};
|
110
|
+
mode: AVSettings.AV_MODES;
|
149
111
|
|
150
112
|
turn: {
|
151
113
|
/**
|
@@ -217,6 +179,11 @@ declare class AVSettings {
|
|
217
179
|
blocked: boolean;
|
218
180
|
};
|
219
181
|
|
182
|
+
/**
|
183
|
+
* Stores the transient AV activity data received from other users.
|
184
|
+
*/
|
185
|
+
activity: Record<string, AVSettingsData>;
|
186
|
+
|
220
187
|
initialize(): void;
|
221
188
|
|
222
189
|
changed(): void;
|
@@ -243,6 +210,11 @@ declare class AVSettings {
|
|
243
210
|
* @internal
|
244
211
|
*/
|
245
212
|
protected _onSettingsChanged(): void;
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Handle another connected user changing their AV settings.
|
216
|
+
*/
|
217
|
+
handleUserActivity(userId: string, settings: AVSettingsData): void;
|
246
218
|
}
|
247
219
|
|
248
220
|
declare namespace AVSettings {
|
@@ -259,5 +231,6 @@ declare namespace AVSettings {
|
|
259
231
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
260
232
|
interface Overrides {}
|
261
233
|
type VoiceModes = PropertyTypeOrFallback<AVSettings.Overrides, 'VoiceModes', DefaultVoiceModes>;
|
262
|
-
type
|
234
|
+
type VOICE_MODES = ValueOf<VoiceModes>;
|
235
|
+
type AV_MODES = ValueOf<typeof AVSettings.AV_MODES>;
|
263
236
|
}
|
@@ -124,9 +124,6 @@ declare global {
|
|
124
124
|
/** @defaultValue `[]` */
|
125
125
|
values: number[];
|
126
126
|
|
127
|
-
/** @defaultValue `0` */
|
128
|
-
last: number;
|
129
|
-
|
130
127
|
/** @defaultValue `0` */
|
131
128
|
average: number;
|
132
129
|
|
@@ -135,9 +132,6 @@ declare global {
|
|
135
132
|
|
136
133
|
/** @defaultValue `document.getElementById("fps")` */
|
137
134
|
element: HTMLElement;
|
138
|
-
|
139
|
-
/** @defaultValue `undefined` */
|
140
|
-
fn: TickerCallback<void> | undefined;
|
141
135
|
};
|
142
136
|
|
143
137
|
/**
|
@@ -541,8 +535,6 @@ declare global {
|
|
541
535
|
}
|
542
536
|
}
|
543
537
|
|
544
|
-
type TickerCallback<T> = (this: T, dt: number) => any;
|
545
|
-
|
546
538
|
interface PerformanceSettings {
|
547
539
|
mode: foundry.CONST.CANVAS_PERFORMANCE_MODES;
|
548
540
|
blur: {
|
@@ -69,6 +69,7 @@ declare global {
|
|
69
69
|
* Handle a SocketResponse from the server when one or multiple documents were created
|
70
70
|
* @param response - The provided Socket response
|
71
71
|
* @returns An Array of created Document instances
|
72
|
+
* @internal
|
72
73
|
*/
|
73
74
|
protected _handleCreateDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
74
75
|
|
@@ -76,6 +77,7 @@ declare global {
|
|
76
77
|
* Handle a SocketResponse from the server when one or multiple documents were created
|
77
78
|
* @param response - The provided Socket response
|
78
79
|
* @returns An Array of created Document instances
|
80
|
+
* @internal
|
79
81
|
*/
|
80
82
|
protected _handleCreateEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
81
83
|
|
@@ -125,6 +127,7 @@ declare global {
|
|
125
127
|
* Handle a SocketResponse from the server when one or multiple documents were updated
|
126
128
|
* @param response - The provided Socket response
|
127
129
|
* @returns An Array of updated Document instances
|
130
|
+
* @internal
|
128
131
|
*/
|
129
132
|
protected _handleUpdateDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
130
133
|
|
@@ -132,6 +135,7 @@ declare global {
|
|
132
135
|
* Handle a SocketResponse from the server when embedded Documents are updated in a parent Document.
|
133
136
|
* @param response - The provided Socket response
|
134
137
|
* @returns An Array of updated Document instances
|
138
|
+
* @internal
|
135
139
|
*/
|
136
140
|
protected _handleUpdateEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
137
141
|
|
@@ -178,6 +182,7 @@ declare global {
|
|
178
182
|
* Handle a SocketResponse from the server where Documents are deleted.
|
179
183
|
* @param response - The provided Socket response
|
180
184
|
* @returns An Array of deleted Document instances
|
185
|
+
* @internal
|
181
186
|
*/
|
182
187
|
protected _handleDeleteDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
183
188
|
|
@@ -185,6 +190,7 @@ declare global {
|
|
185
190
|
* Handle a SocketResponse from the server when embedded Documents are deleted from a parent Document.
|
186
191
|
* @param response - The provided Socket response
|
187
192
|
* @returns An Array of deleted Document instances
|
193
|
+
* @internal
|
188
194
|
*/
|
189
195
|
protected _handleDeleteEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
|
190
196
|
|
@@ -377,8 +377,8 @@ export declare class ClientDocumentMixin<T extends foundry.abstract.Document<any
|
|
377
377
|
* @returns A data object of cleaned data suitable for compendium import
|
378
378
|
*/
|
379
379
|
toCompendium(
|
380
|
-
pack?: CompendiumCollection<CompendiumCollection.Metadata> | null,
|
381
|
-
options?: ClientDocumentMixin.CompendiumExportOptions
|
380
|
+
pack?: CompendiumCollection<CompendiumCollection.Metadata> | null | undefined,
|
381
|
+
options?: ClientDocumentMixin.CompendiumExportOptions | undefined
|
382
382
|
): Omit<T['data']['_source'], '_id' | 'folder' | 'permission'> & {
|
383
383
|
permission?: T['data']['_source']['permission'];
|
384
384
|
};
|
@@ -31,6 +31,11 @@ declare global {
|
|
31
31
|
*/
|
32
32
|
protected _sheet: FormApplication | null; // TODO: Actually an ActiveEffectConfig according to foundry but this is a problem with ClientDocumentMixins _sheet, this should actually be inferred from the CONFIG
|
33
33
|
|
34
|
+
/**
|
35
|
+
* Is there some system logic that makes this active effect ineligible for application?
|
36
|
+
*/
|
37
|
+
get isSuppressed(): boolean;
|
38
|
+
|
34
39
|
/**
|
35
40
|
* Summarize the active effect duration
|
36
41
|
*/
|
@@ -63,12 +68,6 @@ declare global {
|
|
63
68
|
*/
|
64
69
|
get sourceName(): string;
|
65
70
|
|
66
|
-
/**
|
67
|
-
* An instance of the ActiveEffectConfig sheet to use for this ActiveEffect instance.
|
68
|
-
* The reference to the sheet is cached so the same sheet instance is reused.
|
69
|
-
*/
|
70
|
-
get sheet(): FormApplication; // TODO: Actually an ActiveEffectConfig according to foundry but this is a problem with ClientDocumentMixin's sheet, this should actually be inferred from the CONFIG
|
71
|
-
|
72
71
|
/**
|
73
72
|
* Apply this ActiveEffect to a provided Actor.
|
74
73
|
* @param actor - The Actor to whom this effect should be applied
|
@@ -138,6 +137,29 @@ declare global {
|
|
138
137
|
options: DocumentModificationOptions,
|
139
138
|
user: foundry.documents.BaseUser
|
140
139
|
): Promise<void>;
|
140
|
+
|
141
|
+
/** @override */
|
142
|
+
protected _onCreate(
|
143
|
+
data: foundry.data.ActiveEffectData['_source'],
|
144
|
+
options: DocumentModificationOptions,
|
145
|
+
userId: string
|
146
|
+
): void;
|
147
|
+
|
148
|
+
/** @override */
|
149
|
+
protected _onUpdate(
|
150
|
+
data: DeepPartial<foundry.data.ActiveEffectData['_source']>,
|
151
|
+
options: DocumentModificationOptions,
|
152
|
+
userId: string
|
153
|
+
): void;
|
154
|
+
|
155
|
+
/** @override */
|
156
|
+
protected _onDelete(options: DocumentModificationOptions, userId: string): void;
|
157
|
+
|
158
|
+
/**
|
159
|
+
* Display changes to active effects as scrolling Token status text.
|
160
|
+
* @internal
|
161
|
+
*/
|
162
|
+
protected _displayScrollingStatus(enabled: boolean): void;
|
141
163
|
}
|
142
164
|
}
|
143
165
|
|
@@ -61,6 +61,11 @@ declare global {
|
|
61
61
|
*/
|
62
62
|
get img(): this['data']['img'];
|
63
63
|
|
64
|
+
/**
|
65
|
+
* Provide a thumbnail image path used to represent this document.
|
66
|
+
*/
|
67
|
+
get thumbnail(): this['data']['img'];
|
68
|
+
|
64
69
|
/**
|
65
70
|
* Provide an object which organizes all embedded Item instances by their type
|
66
71
|
*/
|
@@ -69,7 +74,7 @@ declare global {
|
|
69
74
|
Array<InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseItem>>>
|
70
75
|
>;
|
71
76
|
/**
|
72
|
-
* Test whether an Actor
|
77
|
+
* Test whether an Actor document is a synthetic representation of a Token (if true) or a full Document (if false)
|
73
78
|
*/
|
74
79
|
get isToken(): boolean;
|
75
80
|
|
@@ -83,11 +88,6 @@ declare global {
|
|
83
88
|
*/
|
84
89
|
get token(): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>> | null;
|
85
90
|
|
86
|
-
/**
|
87
|
-
* A convenience reference to the item type (data.type) of this Actor
|
88
|
-
*/
|
89
|
-
get type(): this['data']['type'];
|
90
|
-
|
91
91
|
/** @override */
|
92
92
|
get uuid(): string;
|
93
93
|
|
@@ -122,9 +122,6 @@ declare global {
|
|
122
122
|
*/
|
123
123
|
getRollData(): object;
|
124
124
|
|
125
|
-
/** @override */
|
126
|
-
protected _getSheetClass(): ConstructorOf<FormApplication> | null;
|
127
|
-
|
128
125
|
/**
|
129
126
|
* Create a new TokenData object which can be used to create a Token representation of the Actor.
|
130
127
|
* @param data - Additional data, such as x, y, rotation, etc. for the created token data (default: `{}`)
|
@@ -149,15 +146,15 @@ declare global {
|
|
149
146
|
modifyTokenAttribute(attribute: string, value: number, isDelta: boolean, isBar: boolean): Promise<this | undefined>;
|
150
147
|
|
151
148
|
/** @override */
|
152
|
-
|
149
|
+
prepareEmbeddedDocuments(): void;
|
153
150
|
|
154
151
|
/**
|
155
152
|
* Roll initiative for all Combatants in the currently active Combat encounter which are associated with this Actor.
|
156
|
-
* If viewing a full Actor
|
153
|
+
* If viewing a full Actor document, all Tokens which map to that actor will be targeted for initiative rolls.
|
157
154
|
* If viewing a synthetic Token actor, only that particular Token will be targeted for an initiative roll.
|
158
155
|
*
|
159
156
|
* @param options - Configuration for how initiative for this Actor is rolled.
|
160
|
-
* @returns A promise which resolves to the Combat
|
157
|
+
* @returns A promise which resolves to the Combat document once rolls are complete.
|
161
158
|
*/
|
162
159
|
rollInitiative(options?: Actor.RollInitiativeOptions): Promise<void>;
|
163
160
|
|
@@ -206,65 +203,11 @@ declare global {
|
|
206
203
|
): void;
|
207
204
|
|
208
205
|
/**
|
209
|
-
*
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
/**
|
214
|
-
* You are referencing Actor#_data which has been deprecated in favor of Actor#data#_source. Support for this reference will be removed in 0.9.0
|
215
|
-
* @deprecated since 0.8.0
|
216
|
-
*/
|
217
|
-
get _data(): this['data']['_source'];
|
218
|
-
|
219
|
-
/**
|
220
|
-
* You are referencing Actor#getOwnedItem(itemId) which is deprecated in favor of Actor#items#get(itemId). Support will be removed in 0.9.0
|
221
|
-
* @deprecated since 0.8.0
|
222
|
-
*/
|
223
|
-
getOwnedItem(itemId: string): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseItem>> | undefined;
|
224
|
-
|
225
|
-
/**
|
226
|
-
* You are referencing Actor#createOwnedItem which is deprecated in favor of Item.create or Actor#createEmbeddedDocuments. Support will be removed in 0.9.0
|
227
|
-
* @deprecated since 0.8.0
|
228
|
-
*/
|
229
|
-
createOwnedItem(
|
230
|
-
itemData: Parameters<this['createEmbeddedDocuments']>[1][] | Parameters<this['createEmbeddedDocuments']>[1],
|
231
|
-
options: Parameters<this['createEmbeddedDocuments']>[2]
|
232
|
-
): ReturnType<this['createEmbeddedDocuments']>;
|
233
|
-
|
234
|
-
/**
|
235
|
-
* You are referencing Actor#updateOwnedItem which is deprecated in favor of Item#update or Actor#updateEmbeddedDocuments. Support will be removed in 0.9.0
|
236
|
-
* @deprecated since 0.8.0
|
237
|
-
*/
|
238
|
-
updateOwnedItem(
|
239
|
-
itemData: Parameters<this['updateEmbeddedDocuments']>[1][] | Parameters<this['updateEmbeddedDocuments']>[1],
|
240
|
-
options: Parameters<this['updateEmbeddedDocuments']>[2]
|
241
|
-
): ReturnType<this['updateEmbeddedDocuments']>;
|
242
|
-
|
243
|
-
/**
|
244
|
-
* You are referencing Actor#deleteOwnedItem which is deprecated in favor of Item#delete or Actor#deleteEmbeddedDocuments. Support will be removed in 0.9.0
|
245
|
-
* @deprecated since 0.8.0
|
246
|
-
*/
|
247
|
-
deleteOwnedItem(
|
248
|
-
itemId: Parameters<this['deleteEmbeddedDocuments']>[1][] | Parameters<this['deleteEmbeddedDocuments']>[1],
|
249
|
-
options: Parameters<this['deleteEmbeddedDocuments']>[2]
|
250
|
-
): ReturnType<this['deleteEmbeddedDocuments']>;
|
251
|
-
|
252
|
-
/**
|
253
|
-
* You are referencing Actor.fromToken which is deprecated in favor of TokenDocument#getActor. Support will be removed in 0.9.0
|
254
|
-
* @deprecated since 0.8.0
|
255
|
-
*/
|
256
|
-
static fromToken(
|
257
|
-
token: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>>
|
258
|
-
): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseActor>>;
|
259
|
-
|
260
|
-
/**
|
261
|
-
* You are referencing Actor.createTokenActor which is deprecated in favor of TokenDocument#getActor. Support will be removed in 0.9.0
|
262
|
-
* @deprecated since 0.8.0
|
206
|
+
* Perform various actions on active tokens if embedded documents were changed.
|
207
|
+
* @param embeddedName - The type of embedded document that was modified.
|
208
|
+
* @internal
|
263
209
|
*/
|
264
|
-
|
265
|
-
_baseActor: unknown,
|
266
|
-
token: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>>
|
267
|
-
): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseActor>>;
|
210
|
+
protected _onEmbeddedDocumentChange(embeddedName: string): void;
|
268
211
|
}
|
269
212
|
namespace Actor {
|
270
213
|
interface RollInitiativeOptions {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { ConfiguredDocumentClass } from '../../../../types/helperTypes';
|
2
2
|
import { DocumentModificationOptions } from '../../../common/abstract/document.mjs';
|
3
3
|
import * as data from '../../../common/data/data.mjs';
|
4
|
+
import type { ActiveEffectDataConstructorData } from '../../../common/data/data.mjs/activeEffectData';
|
4
5
|
|
5
6
|
declare global {
|
6
7
|
/**
|
@@ -30,8 +31,8 @@ declare global {
|
|
30
31
|
|
31
32
|
/**
|
32
33
|
* A lazily evaluated reference to the Actor this Token modifies.
|
33
|
-
* If actorLink is true, then the
|
34
|
-
* Otherwise the Actor
|
34
|
+
* If actorLink is true, then the document is the primary Actor document.
|
35
|
+
* Otherwise the Actor document is a synthetic (ephemeral) document constructed using the Token's actorData.
|
35
36
|
*/
|
36
37
|
get actor(): InstanceType<ConfiguredDocumentClass<typeof Actor>> | null;
|
37
38
|
|
@@ -55,6 +56,11 @@ declare global {
|
|
55
56
|
*/
|
56
57
|
get inCombat(): boolean;
|
57
58
|
|
59
|
+
/**
|
60
|
+
* Is the Token currently hidden from player view?
|
61
|
+
*/
|
62
|
+
get hidden(): boolean;
|
63
|
+
|
58
64
|
/**
|
59
65
|
* @param data - (default: `{}`, unused)
|
60
66
|
* @param options - (default: `{}`, unused)
|
@@ -67,7 +73,7 @@ declare global {
|
|
67
73
|
|
68
74
|
/**
|
69
75
|
* Create a synthetic Actor using a provided Token instance
|
70
|
-
* If the Token data is linked, return the true Actor
|
76
|
+
* If the Token data is linked, return the true Actor document
|
71
77
|
* If the Token data is not linked, create a synthetic Actor using the Token's actorData override
|
72
78
|
*/
|
73
79
|
getActor(): InstanceType<ConfiguredDocumentClass<typeof Actor>> | null;
|
@@ -83,6 +89,18 @@ declare global {
|
|
83
89
|
{ alternative }?: { alternative?: string }
|
84
90
|
): SingleAttributeBar | ObjectAttributeBar | null;
|
85
91
|
|
92
|
+
/**
|
93
|
+
* A helper function to toggle a status effect which includes an Active Effect template
|
94
|
+
* @param effectData - The Active Effect data, including statusId
|
95
|
+
* @param options - Options to configure application of the Active Effect
|
96
|
+
* (default: `{}`)
|
97
|
+
* @returns Whether the Active Effect is now on or off
|
98
|
+
*/
|
99
|
+
toggleActiveEffect(
|
100
|
+
effectData: ActiveEffectDataConstructorData & { id: string; label: string; icon: string },
|
101
|
+
options?: ToggleActiveEffectOptions | undefined
|
102
|
+
): Promise<boolean>;
|
103
|
+
|
86
104
|
/**
|
87
105
|
* Redirect updates to a synthetic Token Actor to instead update the tokenData override object.
|
88
106
|
* Once an attribute in the Token has been overridden, it must always remain overridden.
|
@@ -138,10 +156,10 @@ declare global {
|
|
138
156
|
|
139
157
|
/**
|
140
158
|
* Redirect deletion of Documents within a synthetic Token Actor to instead update the tokenData override object.
|
141
|
-
* @param embeddedName - The named embedded Document type being
|
142
|
-
* @param ids - The
|
143
|
-
* @param options - Provided options which modify the
|
144
|
-
* @returns The
|
159
|
+
* @param embeddedName - The named embedded Document type being deleted
|
160
|
+
* @param ids - The IDs of Documents to delete
|
161
|
+
* @param options - Provided options which modify the deletion request
|
162
|
+
* @returns The deleted Embedded Document instances
|
145
163
|
*/
|
146
164
|
deleteActorEmbeddedDocuments(
|
147
165
|
embeddedName: 'Item',
|
@@ -163,6 +181,7 @@ declare global {
|
|
163
181
|
|
164
182
|
/**
|
165
183
|
* When the Actor data overrides change for an un-linked Token Actor, simulate the pre-update process.
|
184
|
+
* @internal
|
166
185
|
*/
|
167
186
|
protected _preUpdateTokenActor(
|
168
187
|
data: Parameters<foundry.documents.BaseActor['_preUpdate']>[0],
|
@@ -180,11 +199,16 @@ declare global {
|
|
180
199
|
/**
|
181
200
|
* When the base Actor for a TokenDocument changes, we may need to update its Actor instance
|
182
201
|
* @param update - (default: `{}`)
|
202
|
+
* @internal
|
183
203
|
*/
|
184
|
-
protected _onUpdateBaseActor(
|
204
|
+
protected _onUpdateBaseActor(
|
205
|
+
update?: Parameters<foundry.documents.BaseActor['_onUpdate']>[0],
|
206
|
+
options?: Parameters<foundry.data.ActorData['update']>[1]
|
207
|
+
): void;
|
185
208
|
|
186
209
|
/**
|
187
210
|
* When the Actor data overrides change for an un-linked Token Actor, simulate the post-update process.
|
211
|
+
* @internal
|
188
212
|
*/
|
189
213
|
protected _onUpdateTokenActor(
|
190
214
|
data: Parameters<foundry.documents.BaseActor['_onUpdate']>[0],
|
@@ -228,4 +252,13 @@ interface TrackedAttributes {
|
|
228
252
|
value: string[][];
|
229
253
|
}
|
230
254
|
|
231
|
-
|
255
|
+
interface ToggleActiveEffectOptions {
|
256
|
+
/**
|
257
|
+
* Should the Active Effect icon be displayed as an overlay on the token?
|
258
|
+
* @defaultValue `false`
|
259
|
+
*/
|
260
|
+
overlay?: boolean | undefined;
|
261
|
+
|
262
|
+
/** Force a certain active state for the effect. */
|
263
|
+
active?: boolean | undefined;
|
264
|
+
}
|
@@ -72,7 +72,8 @@ declare global {
|
|
72
72
|
* Pass an array of specific Card documents from this document to some other Cards stack.
|
73
73
|
* @param to - Some other Cards document that is the destination for the pass operation
|
74
74
|
* @param ids - The embedded Card ids which should be passed
|
75
|
-
* @param options -
|
75
|
+
* @param options - Additional options which modify the pass operation
|
76
|
+
* (default: `{}`)
|
76
77
|
* @returns An array of the Card embedded documents created within the destination stack
|
77
78
|
*/
|
78
79
|
pass(
|