@league-of-foundry-developers/foundry-vtt-types 0.8.9-4 → 0.8.9-8

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.
Files changed (93) hide show
  1. package/README.md +41 -13
  2. package/index-lenient.d.ts +10 -0
  3. package/package.json +10 -1
  4. package/src/foundry/common/abstract/backend.mjs.d.ts +14 -15
  5. package/src/foundry/common/abstract/document.mjs.d.ts +6 -2
  6. package/src/foundry/common/data/data.mjs/drawingData.d.ts +8 -3
  7. package/src/foundry/common/data/data.mjs/index.d.ts +2 -0
  8. package/src/foundry/common/data/data.mjs/playlistData.d.ts +171 -0
  9. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +143 -0
  10. package/src/foundry/common/data/fields.mjs.d.ts +2 -2
  11. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +11 -1
  12. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +21 -2
  13. package/src/foundry/common/types.mjs.d.ts +5 -0
  14. package/src/foundry/foundry.js/application.d.ts +2 -5
  15. package/src/foundry/foundry.js/applications/cameraViews.d.ts +36 -31
  16. package/src/foundry/foundry.js/applications/compendium.d.ts +5 -2
  17. package/src/foundry/foundry.js/applications/filePicker.d.ts +114 -114
  18. package/src/foundry/foundry.js/applications/formApplication.d.ts +3 -11
  19. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +20 -27
  20. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +66 -0
  21. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
  22. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  23. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +5 -2
  24. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +57 -0
  25. package/src/foundry/foundry.js/applications/formApplications/{folderConfig.d.ts → documentSheets/folderConfig.d.ts} +2 -2
  26. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +7 -0
  27. package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +84 -0
  28. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +60 -0
  29. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +72 -0
  30. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +54 -60
  31. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +41 -28
  32. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +75 -0
  33. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +190 -148
  34. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +133 -110
  35. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +66 -0
  36. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +93 -95
  37. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +163 -147
  38. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -7
  39. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +41 -23
  40. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +95 -86
  41. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +146 -158
  42. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +60 -70
  43. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +25 -17
  44. package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +11 -5
  45. package/src/foundry/foundry.js/applications/hotbar.d.ts +5 -4
  46. package/src/foundry/foundry.js/applications/sceneControls.d.ts +13 -3
  47. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +90 -71
  48. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/actorDirectory.d.ts +13 -56
  49. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/itemDirectory.d.ts +7 -30
  50. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/journalDirectory.d.ts +14 -34
  51. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/macroDirectory.d.ts +6 -52
  52. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +249 -139
  53. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/sceneDirectory.d.ts +6 -23
  54. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +3 -5
  55. package/src/foundry/foundry.js/cameraPopoutAppWrapper.d.ts +12 -7
  56. package/src/foundry/foundry.js/canvas.d.ts +2 -1
  57. package/src/foundry/foundry.js/clientDatabaseBackend.d.ts +210 -0
  58. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +1 -1
  59. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/index.d.ts +8 -0
  60. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/tokenDocument.d.ts +1 -1
  61. package/src/foundry/foundry.js/clientDocuments/index.d.ts +19 -0
  62. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +195 -6
  63. package/src/foundry/foundry.js/clientDocuments/playlistSound.d.ts +113 -0
  64. package/src/foundry/foundry.js/clientDocuments/prototypeToken.d.ts +15 -0
  65. package/src/foundry/foundry.js/clientSettings.d.ts +14 -1
  66. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +44 -8
  67. package/src/foundry/foundry.js/config.d.ts +85 -71
  68. package/src/foundry/foundry.js/dragDrop.d.ts +17 -14
  69. package/src/foundry/foundry.js/globalVariables.d.ts +7 -4
  70. package/src/foundry/foundry.js/mouseInteractionManager.d.ts +78 -34
  71. package/src/foundry/foundry.js/pixi/containers/canvasLayer.d.ts +2 -1
  72. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayer.d.ts +10 -19
  73. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/backgroundLayer.d.ts +6 -2
  74. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/mapLayers/foregroundLayer.d.ts +2 -2
  75. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +1 -1
  76. package/src/foundry/foundry.js/pixi/containers/doorControl.d.ts +53 -35
  77. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +6 -2
  78. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientLight.d.ts +38 -40
  79. package/src/foundry/foundry.js/pixi/containers/placeableObjects/ambientSound.d.ts +56 -56
  80. package/src/foundry/foundry.js/pixi/containers/placeableObjects/note.d.ts +9 -50
  81. package/src/foundry/foundry.js/pixi/containers/placeableObjects/tile.d.ts +166 -47
  82. package/src/foundry/foundry.js/pixi/containers/placeableObjects/wall.d.ts +1 -1
  83. package/src/foundry/foundry.js/pixi/containers/ruler.d.ts +11 -7
  84. package/src/foundry/foundry.js/pixi/graphics/gridHighlight.d.ts +4 -9
  85. package/src/foundry/foundry.js/pointSource.d.ts +173 -85
  86. package/src/foundry/foundry.js/textEditor.d.ts +39 -8
  87. package/src/foundry/index.d.ts +2 -25
  88. package/src/foundry/foundry.js/applications/formApplications/ambientSoundConfig.d.ts +0 -68
  89. package/src/foundry/foundry.js/applications/formApplications/lightConfig.d.ts +0 -98
  90. package/src/foundry/foundry.js/applications/formApplications/measuredTemplateConfig.d.ts +0 -61
  91. package/src/foundry/foundry.js/applications/formApplications/noteConfig.d.ts +0 -77
  92. package/src/foundry/foundry.js/applications/formApplications/playlistSoundConfig.d.ts +0 -70
  93. package/src/foundry/foundry.js/applications/formApplications/tileConfig.d.ts +0 -73
@@ -0,0 +1,210 @@
1
+ import type { ConfiguredDocumentClassForName } from '../../types/helperTypes';
2
+ import type { Request } from '../common/abstract/backend.mjs';
3
+ import type Document from '../common/abstract/document.mjs';
4
+
5
+ declare global {
6
+ /**
7
+ * The client-side database backend implementation which handles Document modification operations.
8
+ */
9
+ class ClientDatabaseBackend extends foundry.abstract.DatabaseBackend {
10
+ /**
11
+ * Activate the Socket event listeners used to receive responses from events which modify database documents
12
+ * @param socket - The active game socket
13
+ */
14
+ activateSocketListeners(socket: io.Socket): void;
15
+
16
+ /** @override */
17
+ protected _getDocuments<T extends Document<any, any>>(
18
+ documentClass: ConstructorOf<T>,
19
+ request: Request,
20
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>
21
+ ): Promise<T[]>;
22
+
23
+ /**
24
+ * @override
25
+ * @remarks
26
+ * Get operations for embedded Documents are currently un-supported.
27
+ * The returned promise always rejects.
28
+ */
29
+ protected _getEmbeddedDocuments<T extends Document<any, any>>(
30
+ documentClass: ConstructorOf<T>,
31
+ parent: T extends Document<any, infer U> ? U : never,
32
+ request: Request,
33
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>
34
+ ): Promise<never>;
35
+
36
+ /** @override */
37
+ protected _createDocuments<T extends Document<any, any>>(
38
+ documentClass: ConstructorOf<T>,
39
+ request: Request,
40
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>
41
+ ): Promise<T[]>;
42
+
43
+ /** @override */
44
+ protected _createEmbeddedDocuments<T extends Document<any, any>>(
45
+ documentClass: ConstructorOf<T>,
46
+ parent: T extends Document<any, infer U> ? U : never,
47
+ request: Request,
48
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>
49
+ ): Promise<T[]>;
50
+
51
+ /**
52
+ * Perform a standardized pre-creation workflow for all Document types. For internal use only.
53
+ * @internal
54
+ */
55
+ protected _preCreateDocumentArray<T extends Document<any, any>>(
56
+ documentClass: ConstructorOf<T>,
57
+ {
58
+ data,
59
+ options,
60
+ pack,
61
+ parent,
62
+ user
63
+ }: Pick<Request, 'data' | 'pack' | 'parent' | 'options'> & {
64
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>;
65
+ }
66
+ ): Promise<T[]>;
67
+
68
+ /**
69
+ * Handle a SocketResponse from the server when one or multiple documents were created
70
+ * @param response - The provided Socket response
71
+ * @returns An Array of created Document instances
72
+ */
73
+ protected _handleCreateDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
74
+
75
+ /**
76
+ * Handle a SocketResponse from the server when one or multiple documents were created
77
+ * @param response - The provided Socket response
78
+ * @returns An Array of created Document instances
79
+ */
80
+ protected _handleCreateEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
81
+
82
+ /**
83
+ * Perform a standardized post-creation workflow for all Document types. For internal use only.
84
+ * @returns An array of callback operations to perform once every Document is created
85
+ * @internal
86
+ */
87
+ protected _postCreateDocumentCallbacks(
88
+ type: string,
89
+ collection: Collection<foundry.abstract.Document<any, any>>,
90
+ result: object[],
91
+ { options, userId, parent, pack }: Pick<Request, 'options' | 'parent' | 'pack'> & { userId?: string }
92
+ ): (() => void)[];
93
+
94
+ /** @override */
95
+ protected _updateDocuments<T extends Document<any, any>>(
96
+ documentClass: ConstructorOf<T>,
97
+ request: Request,
98
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>
99
+ ): Promise<T[]>;
100
+
101
+ /** @override */
102
+ protected _updateEmbeddedDocuments<T extends Document<any, any>>(
103
+ documentClass: ConstructorOf<T>,
104
+ parent: T extends Document<any, infer U> ? U : never,
105
+ request: Request,
106
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>
107
+ ): Promise<T[]>;
108
+
109
+ /**
110
+ * Perform a standardized pre-update workflow for all Document types. For internal use only.
111
+ * @internal
112
+ */
113
+ protected _preUpdateDocumentArray<T extends Document<any, any>>(
114
+ collection: Collection<T>,
115
+ {
116
+ updates,
117
+ options,
118
+ user
119
+ }: Pick<Request, 'updates' | 'options'> & {
120
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>;
121
+ }
122
+ ): Promise<T[]>;
123
+
124
+ /**
125
+ * Handle a SocketResponse from the server when one or multiple documents were updated
126
+ * @param response - The provided Socket response
127
+ * @returns An Array of updated Document instances
128
+ */
129
+ protected _handleUpdateDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
130
+
131
+ /**
132
+ * Handle a SocketResponse from the server when embedded Documents are updated in a parent Document.
133
+ * @param response - The provided Socket response
134
+ * @returns An Array of updated Document instances
135
+ */
136
+ protected _handleUpdateEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
137
+
138
+ /**
139
+ * Perform a standardized post-update workflow for all Document types. For internal use only.
140
+ * @returns An array of callback operations to perform after every Document is updated
141
+ * @internal
142
+ */
143
+ protected _postUpdateDocumentCallbacks(
144
+ collection: Collection<foundry.abstract.Document<any, any>>,
145
+ result: object[],
146
+ { options, userId }: Pick<Request, 'options'> & { userId?: string }
147
+ ): () => void;
148
+
149
+ /** @override */
150
+ protected _deleteDocuments<T extends Document<any, any>>(
151
+ documentClass: ConstructorOf<T>,
152
+ request: Request,
153
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>
154
+ ): Promise<T[]>;
155
+
156
+ /** @override */
157
+ protected _deleteEmbeddedDocuments<T extends Document<any, any>>(
158
+ documentClass: ConstructorOf<T>,
159
+ parent: T extends Document<any, infer U> ? U : never,
160
+ request: Request,
161
+ user: InstanceType<ConfiguredDocumentClassForName<'User'>>
162
+ ): Promise<T[]>;
163
+
164
+ /**
165
+ * Perform a standardized pre-delete workflow for all Document types. For internal use only.
166
+ * @internal
167
+ */
168
+ protected _preDeleteDocumentArray<T extends Document<any, any>>(
169
+ collection: Collection<T>,
170
+ {
171
+ ids,
172
+ options,
173
+ user
174
+ }: Pick<Request, 'ids' | 'options'> & { user: InstanceType<ConfiguredDocumentClassForName<'User'>> }
175
+ ): Promise<T[]>;
176
+
177
+ /**
178
+ * Handle a SocketResponse from the server where Documents are deleted.
179
+ * @param response - The provided Socket response
180
+ * @returns An Array of deleted Document instances
181
+ */
182
+ protected _handleDeleteDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
183
+
184
+ /**
185
+ * Handle a SocketResponse from the server when embedded Documents are deleted from a parent Document.
186
+ * @param response - The provided Socket response
187
+ * @returns An Array of deleted Document instances
188
+ */
189
+ protected _handleDeleteEmbeddedDocuments(response: SocketResponse): foundry.abstract.Document<any, any>[];
190
+
191
+ /**
192
+ * Perform a standardized post-deletion workflow for all Document types. For internal use only.
193
+ * @returns An array of callback operations to perform after every Document is deleted
194
+ * @internal
195
+ */
196
+ protected _postDeleteDocumentCallbacks(
197
+ collection: Collection<foundry.abstract.Document<any, any>>,
198
+ result: object[],
199
+ { options, userId }: Pick<Request, 'options'> & { userId?: string }
200
+ ): (() => void)[];
201
+
202
+ /** @override */
203
+ getFlagScopes(): string[];
204
+
205
+ /** @override */
206
+ getCompendiumScopes(): string[];
207
+ }
208
+ }
209
+
210
+ export {};
@@ -339,7 +339,7 @@ export declare class ClientDocumentMixin<T extends foundry.abstract.Document<any
339
339
  T['data']['_source'],
340
340
  '_id' | 'folder' | 'permission'
341
341
  > & {
342
- permission?: T extends { toObject(): infer U } ? U : never;
342
+ permission?: T['data']['_source']['permission'];
343
343
  };
344
344
 
345
345
  /**
@@ -0,0 +1,8 @@
1
+ import './ambientLightDocument';
2
+ import './ambientSoundDocument';
3
+ import './drawingDocument';
4
+ import './measuredTemplateDocument';
5
+ import './noteDocument';
6
+ import './tileDocument';
7
+ import './tokenDocument';
8
+ import './wallDocument';
@@ -204,7 +204,7 @@ declare global {
204
204
  /**
205
205
  * Inspect the Actor data model and identify the set of attributes which could be used for a Token Bar
206
206
  */
207
- static getTrackedAttributeChoices(attributes?: TrackedAttributes): Partial<Record<string, string[]>>;
207
+ static getTrackedAttributeChoices(attributes?: TrackedAttributes): Record<string, string[]>;
208
208
  }
209
209
  }
210
210
 
@@ -0,0 +1,19 @@
1
+ import './activeEffect';
2
+ import './actor';
3
+ import './canvasDocuments';
4
+ import './chatMessage';
5
+ import './combat';
6
+ import './combatant';
7
+ import './fogExploration';
8
+ import './folder';
9
+ import './item';
10
+ import './journalEntry';
11
+ import './macro';
12
+ import './playlist';
13
+ import './playlistSound';
14
+ import './prototypeToken';
15
+ import './rollTable';
16
+ import './scene';
17
+ import './setting';
18
+ import './tableResult';
19
+ import './user';
@@ -1,7 +1,9 @@
1
- // TODO
1
+ import type { ConfiguredDocumentClass, ConstructorDataType } from '../../../types/helperTypes';
2
+ import type { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
+
2
4
  declare global {
3
5
  /**
4
- * The client-side Playlist document which extends the common BasePlaylist abstraction.
6
+ * The client-side Playlist document which extends the common BasePlaylist model.
5
7
  * Each Playlist document contains PlaylistData which defines its data schema.
6
8
  *
7
9
  * @see {@link data.PlaylistData} The Playlist data schema
@@ -9,9 +11,196 @@ declare global {
9
11
  * @see {@link embedded.PlaylistSound} The PlaylistSound embedded document within a parent Playlist
10
12
  * @see {@link applications.PlaylistConfig} The Playlist configuration application
11
13
  *
12
- * @param data - Initial data provided to construct the Playlist document
13
14
  */
14
- class Playlist extends ClientDocumentMixin(foundry.documents.BasePlaylist) {}
15
- }
15
+ class Playlist extends ClientDocumentMixin(foundry.documents.BasePlaylist) {
16
+ /**
17
+ * @param data - Initial data provided to construct the Playlist document
18
+ */
19
+ constructor(
20
+ data: ConstructorParameters<typeof foundry.documents.BasePlaylist>[0],
21
+ context?: ConstructorParameters<typeof foundry.documents.BasePlaylist>[1]
22
+ );
23
+
24
+ /**
25
+ * Each sound which is played within the Playlist has a created Sound instance.
26
+ * The keys of this object are the sound IDs and the values are the Sound instances.
27
+ * @remarks This seems to be unused and will always be the empty object, see https://gitlab.com/foundrynet/foundryvtt/-/issues/5970
28
+ */
29
+ audio: {};
30
+
31
+ /**
32
+ * Playlists may have a playback order which defines the sequence of Playlist Sounds
33
+ * @defaultValue `undefined`
34
+ * @internal
35
+ */
36
+ protected _playbackOrder: string[] | undefined;
37
+
38
+ /**
39
+ * The playback mode for the Playlist instance
40
+ */
41
+ get mode(): foundry.CONST.PlaylistMode;
42
+
43
+ /**
44
+ * The order in which sounds within this playlist will be played (if sequential or shuffled)
45
+ * Uses a stored seed for randomization to guarantee that all clients generate the same random order.
46
+ */
47
+ get playbackOrder(): string[];
48
+
49
+ /**
50
+ * An indicator for whether any Sound within the Playlist is currently playing
51
+ */
52
+ get playing(): boolean;
53
+
54
+ /** @override */
55
+ get visible(): boolean;
56
+
57
+ /**
58
+ * Begin simultaneous playback for all sounds in the Playlist.
59
+ * @returns The updated Playlist entity
60
+ */
61
+ playAll(): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
62
+
63
+ /**
64
+ * Play the next Sound within the sequential or shuffled Playlist.
65
+ * @param soundId - The currently playing sound ID, if known
66
+ * @param options - Additional options which configure the next track
67
+ * @returns The updated Playlist document
68
+ */
69
+ playNext(
70
+ soundId?: string,
71
+ options?: Partial<Playlist.PlayNextOptions>
72
+ ): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined | null>;
73
+
74
+ /**
75
+ * Begin playback of a specific Sound within this Playlist.
76
+ * Determine which other sounds should remain playing, if any.
77
+ * @param sound - The desired sound that should play
78
+ * @returns The updated Playlist
79
+ */
80
+ playSound(
81
+ sound: InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>
82
+ ): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
83
+
84
+ /**
85
+ * Stop playback of a specific Sound within this Playlist.
86
+ * Determine which other sounds should remain playing, if any.
87
+ * @param sound - The desired sound that should play
88
+ * @returns The updated Playlist
89
+ */
90
+ stopSound(
91
+ sound: InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>
92
+ ): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
93
+
94
+ /**
95
+ * End playback for any/all currently playing sounds within the Playlist.
96
+ * @returns The updated Playlist entity
97
+ */
98
+ stopAll(): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
99
+
100
+ /**
101
+ * Cycle the playlist mode
102
+ * @returns A promise which resolves to the updated Playlist instance
103
+ */
104
+ cycleMode(): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
16
105
 
17
- export {};
106
+ /**
107
+ * Get the next sound in the cached playback order. For internal use.
108
+ * @internal
109
+ */
110
+ protected _getNextSound(soundId: string): InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>> | undefined;
111
+
112
+ /**
113
+ * Get the previous sound in the cached playback order. For internal use.
114
+ * @internal
115
+ */
116
+ protected _getPreviousSound(
117
+ soundId: string
118
+ ): InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>> | undefined;
119
+
120
+ /**
121
+ * Define the sorting order for the Sounds within this Playlist. For internal use.
122
+ * @internal
123
+ */
124
+ protected _sortSounds(
125
+ a: InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>,
126
+ b: InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>
127
+ ): number;
128
+
129
+ /** @override */
130
+ protected _preUpdate(
131
+ changed: DeepPartial<ConstructorDataType<foundry.data.PlaylistData>>,
132
+ options: DocumentModificationOptions,
133
+ user: foundry.documents.BaseUser
134
+ ): Promise<void>;
135
+
136
+ /** @override */
137
+ protected _onUpdate(
138
+ changed: DeepPartial<foundry.data.PlaylistData['_source']>,
139
+ options: DocumentModificationOptions,
140
+ userId: string
141
+ ): void;
142
+
143
+ /** @override */
144
+ protected _onDelete(options: DocumentModificationOptions, userId: string): void;
145
+
146
+ /** @override */
147
+ protected _onCreateEmbeddedDocuments(
148
+ embeddedName: string,
149
+ documents: foundry.abstract.Document<any, any>[],
150
+ result: Record<string, unknown>[],
151
+ options: DocumentModificationOptions,
152
+ userId: string
153
+ ): void;
154
+
155
+ /** @override */
156
+ protected _onUpdateEmbeddedDocuments(
157
+ embeddedName: string,
158
+ documents: foundry.abstract.Document<any, any>[],
159
+ result: Record<string, unknown>[],
160
+ options: DocumentModificationContext,
161
+ userId: string
162
+ ): void;
163
+
164
+ /** @override */
165
+ protected _onDeleteEmbeddedDocuments(
166
+ embeddedName: string,
167
+ documents: foundry.abstract.Document<any, any>[],
168
+ result: string[],
169
+ options: DocumentModificationContext,
170
+ userId: string
171
+ ): void;
172
+
173
+ /**
174
+ * Handle callback logic when an individual sound within the Playlist concludes playback naturally
175
+ * @internal
176
+ */
177
+ _onSoundEnd(
178
+ sound: InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>
179
+ ): Promise<InstanceType<ConfiguredDocumentClass<typeof Playlist>> | undefined>;
180
+
181
+ /**
182
+ * Handle callback logic when playback for an individual sound within the Playlist is started.
183
+ * Schedule auto-preload of next track
184
+ * @internal
185
+ */
186
+ _onSoundStart(sound: InstanceType<ConfiguredDocumentClass<typeof PlaylistSound>>): Promise<void>;
187
+
188
+ /** @override */
189
+ toCompendium(pack?: CompendiumCollection<CompendiumCollection.Metadata>): Omit<
190
+ foundry.data.PlaylistData['_source'],
191
+ '_id' | 'folder' | 'permission'
192
+ > & {
193
+ permission?: foundry.data.PlaylistData['_source']['permission'];
194
+ };
195
+ }
196
+
197
+ namespace Playlist {
198
+ interface PlayNextOptions {
199
+ /**
200
+ * Whether to advance forward (if 1) or backwards (if -1)
201
+ * @defaultValue `1`
202
+ */
203
+ direction: 1 | -1;
204
+ }
205
+ }
206
+ }
@@ -0,0 +1,113 @@
1
+ import type { ConfiguredDocumentClassForName } from '../../../types/helperTypes';
2
+ import type { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
+
4
+ declare global {
5
+ /**
6
+ * The client-side PlaylistSound document which extends the common BasePlaylistSound model.
7
+ * Each PlaylistSound belongs to the sounds collection of a Playlist entity.
8
+ * Each PlaylistSound contains a PlaylistSoundData object which provides its source data.
9
+ *
10
+ * @see {@link foundry.data.PlaylistSoundData} The PlaylistSound data schema
11
+ * @see {@link Playlist} The Playlist document which contains PlaylistSound embedded documents
12
+ * @see {@link Sound} The Sound API which manages web audio playback
13
+ *
14
+ */
15
+ class PlaylistSound extends ClientDocumentMixin(foundry.documents.BasePlaylistSound) {
16
+ /**
17
+ * @param data - Initial data provided to construct the PlaylistSound document
18
+ * @param parent - The parent Playlist document to which this result belongs
19
+ */
20
+ constructor(
21
+ data: ConstructorParameters<typeof foundry.documents.BasePlaylistSound>[0],
22
+ context?: ConstructorParameters<typeof foundry.documents.BasePlaylistSound>[1]
23
+ );
24
+
25
+ /**
26
+ * The Sound which manages playback for this playlist sound
27
+ */
28
+ sound: Sound | null;
29
+
30
+ /**
31
+ * A debounced function, accepting a single volume parameter to adjust the volume of this sound
32
+ * @param volume - The desired volume level
33
+ */
34
+ debounceVolume: (volume: number) => void;
35
+
36
+ /**
37
+ * The debounce tolerance for processing rapid volume changes into database updates in milliseconds
38
+ * @defaultValue `100`
39
+ */
40
+ static VOLUME_DEBOUNCE_MS: number;
41
+
42
+ /**
43
+ * Create a Sound used to play this PlaylistSound document
44
+ * @internal
45
+ */
46
+ protected _createSound(): Sound | null;
47
+
48
+ /**
49
+ * A convenience reference to the HTTP path to the source audio file
50
+ */
51
+ get path(): string | undefined | null;
52
+
53
+ /**
54
+ * A convenience indicator for whether this sound is currently playing.
55
+ */
56
+ get playing(): boolean;
57
+
58
+ /**
59
+ * The effective volume at which this PlaylistSound should be playing, including the global playlist volume modifier
60
+ */
61
+ get volume(): number;
62
+
63
+ /**
64
+ * Determine the fade duration for this PlaylistSound based on its own configuration and that of its parent.
65
+ */
66
+ get fadeDuration(): number;
67
+
68
+ /**
69
+ * Synchronize playback for this particular PlaylistSound instance
70
+ */
71
+ sync(): void | Promise<void> | Promise<Sound>;
72
+
73
+ /** @override */
74
+ protected _onUpdate(
75
+ changed: DeepPartial<foundry.data.PlaylistSoundData['_source']>,
76
+ options: DocumentModificationOptions,
77
+ userId: string
78
+ ): void;
79
+
80
+ /** @override */
81
+ protected _onDelete(options: DocumentModificationOptions, userId: string): void;
82
+
83
+ /**
84
+ * Special handling that occurs when a PlaylistSound reaches the natural conclusion of its playback.
85
+ * @internal
86
+ */
87
+ protected _onEnd(): Promise<void | InstanceType<ConfiguredDocumentClassForName<'Playlist'>> | undefined>;
88
+
89
+ /**
90
+ * Special handling that occurs when playback of a PlaylistSound is started.
91
+ * @internal
92
+ */
93
+ protected _onStart(): Promise<void>;
94
+
95
+ /**
96
+ * Special handling that occurs when a PlaylistSound is manually stopped before its natural conclusion.
97
+ * @internal
98
+ */
99
+ protected _onStop(): Promise<void>;
100
+
101
+ /**
102
+ * Handle fading in the volume for this sound when it begins to play (or loop)
103
+ * @internal
104
+ */
105
+ protected _fadeIn(sound: Sound): void;
106
+
107
+ /**
108
+ * Handle fading out the volume for this sound when it begins to play (or loop)
109
+ * @internal
110
+ */
111
+ protected _fadeOut(sound: Sound): void;
112
+ }
113
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * An extended Document definition used specifically
3
+ * This ensures that the PrototypeTokenData schema is used instead of the standard TokenData.
4
+ * This exists specifically for prototype Token configuration in the TokenConfig app and should not be used otherwise.
5
+ * @internal
6
+ * @remarks The types for this are incorrect, in particular everything related to the data should use
7
+ * {@link foundry.data.PrototypeTokenData} instead of {@link foundry.data.TokenData}. However, with the current approach
8
+ * to type documents, we don't see a way to do this. This class is just added for reference. As the documentation above
9
+ * says, don't use it (there really shouldn't be a need to do so).
10
+ */
11
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
+ // @ts-ignore
13
+ declare class PrototypeTokenDocument extends TokenDocument {
14
+ static get schema(): typeof foundry.data.PrototypeTokenData;
15
+ }
@@ -219,7 +219,7 @@ declare namespace ClientSettings {
219
219
  }
220
220
 
221
221
  interface Values {
222
- 'core.combatTrackerConfig': { resource: string; skipDefeated: boolean };
222
+ 'core.combatTrackerConfig': { resource: string; skipDefeated: boolean } | {};
223
223
  'core.compendiumConfiguration': Partial<Record<string, CompendiumCollection.Configuration>>;
224
224
  'core.rollMode': foundry.CONST.DiceRollMode;
225
225
  'core.animateRollTable': boolean;
@@ -229,6 +229,19 @@ declare namespace ClientSettings {
229
229
  'core.globalPlaylistVolume': number;
230
230
  'core.globalAmbientVolume': number;
231
231
  'core.globalInterfaceVolume': number;
232
+ 'core.moduleConfiguration': Record<string, boolean>;
233
+ 'core.chatBubbles': boolean;
234
+ 'core.chatBubblesPan': boolean;
235
+ 'core.coneTemplateType': 'round' | 'flat';
236
+ 'core.language': string;
237
+ 'core.leftClickRelease': boolean;
238
+ 'core.lightAnimation': boolean;
239
+ 'core.maxFPS': number;
240
+ 'core.mipmap': boolean;
241
+ 'core.noCanvas': boolean;
242
+ 'core.softShadows': boolean;
243
+ 'core.tokenDragPreview': boolean;
244
+ 'core.visionAnimation': boolean;
232
245
  [key: string]: unknown;
233
246
  }
234
247
  }