@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250824190511 → 13.346.0-beta.20250825020008

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 (37) hide show
  1. package/package.json +1 -1
  2. package/src/configuration/configuration.d.mts +4 -6
  3. package/src/configuration/globals.d.mts +1 -1
  4. package/src/foundry/client/_types.d.mts +2 -2
  5. package/src/foundry/client/applications/ui/scene-controls.d.mts +52 -2
  6. package/src/foundry/client/audio/_types.d.mts +11 -0
  7. package/src/foundry/client/audio/biquad.d.mts +7 -9
  8. package/src/foundry/client/audio/cache.d.mts +3 -2
  9. package/src/foundry/client/audio/convolver.d.mts +2 -6
  10. package/src/foundry/client/audio/helper.d.mts +263 -87
  11. package/src/foundry/client/audio/sound.d.mts +172 -70
  12. package/src/foundry/client/audio/timeout.d.mts +9 -3
  13. package/src/foundry/client/canvas/containers/elements/door-mesh.d.mts +3 -2
  14. package/src/foundry/client/canvas/interaction/render-flags.d.mts +11 -8
  15. package/src/foundry/client/canvas/perception/vision-mode.d.mts +10 -65
  16. package/src/foundry/client/canvas/primary/primary-graphics.d.mts +1 -8
  17. package/src/foundry/client/canvas/rendering/filters/_module.d.mts +1 -0
  18. package/src/foundry/client/canvas/rendering/shaders/base-shader.d.mts +7 -0
  19. package/src/foundry/client/client.d.mts +24 -0
  20. package/src/foundry/client/data/_module.d.mts +4 -2
  21. package/src/foundry/client/data/_types.d.mts +11 -0
  22. package/src/foundry/client/data/fields.d.mts +72 -0
  23. package/src/foundry/client/documents/abstract/canvas-document.d.mts +1 -1
  24. package/src/foundry/client/documents/abstract/client-document.d.mts +31 -6
  25. package/src/foundry/client/documents/actor.d.mts +3 -2
  26. package/src/foundry/client/documents/collections/compendium-collection.d.mts +111 -50
  27. package/src/foundry/client/documents/token.d.mts +6 -0
  28. package/src/foundry/client/helpers/localization.d.mts +2 -37
  29. package/src/foundry/client/packages/system.d.mts +5 -5
  30. package/src/foundry/client/utils/_module.d.mts +6 -5
  31. package/src/foundry/common/abstract/data.d.mts +87 -3
  32. package/src/foundry/common/abstract/embedded-collection.d.mts +5 -4
  33. package/src/foundry/common/abstract/type-data.d.mts +53 -11
  34. package/src/foundry/common/data/fields.d.mts +15 -1
  35. package/src/foundry/common/packages/_module.d.mts +2 -2
  36. package/src/foundry/common/packages/base-package.d.mts +12 -3
  37. package/src/foundry/common/packages/sub-types.d.mts +6 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@league-of-foundry-developers/foundry-vtt-types",
4
- "version": "13.346.0-beta.20250824190511",
4
+ "version": "13.346.0-beta.20250825020008",
5
5
  "description": "TypeScript type definitions for Foundry VTT",
6
6
  "type": "module",
7
7
  "types": "./src/index.d.mts",
@@ -266,9 +266,7 @@ export interface SettingConfig {
266
266
  "core.chatBubbles": fields.BooleanField<{ initial: true }>;
267
267
  "core.chatBubblesPan": fields.BooleanField<{ initial: true }>;
268
268
  "core.combatTrackerConfig": MaybeEmpty<{ resource: string; skipDefeated: boolean }>;
269
- "core.compendiumConfiguration": Partial<
270
- Record<string, foundry.documents.collections.CompendiumCollection.Configuration>
271
- >;
269
+ "core.compendiumConfiguration": foundry.documents.collections.CompendiumCollection.SettingField;
272
270
  "core.gridTemplates": fields.BooleanField<{ initial: false }>;
273
271
  "core.coneTemplateType": "round" | "flat";
274
272
  "core.colorSchema": fields.StringField<{
@@ -297,9 +295,9 @@ export interface SettingConfig {
297
295
  "core.disableResolutionScaling": boolean;
298
296
  "core.fontSize": number;
299
297
  "core.fpsMeter": boolean;
300
- "core.globalAmbientVolume": number;
301
- "core.globalInterfaceVolume": number;
302
- "core.globalPlaylistVolume": number;
298
+ "core.globalAmbientVolume": fields.AlphaField<{ required: true; initial: 0.5 }>;
299
+ "core.globalInterfaceVolume": fields.AlphaField<{ required: true; initial: 0.5 }>;
300
+ "core.globalPlaylistVolume": fields.AlphaField<{ required: true; initial: 0.5 }>;
303
301
  "core.keybindings": Record<string, foundry.helpers.interaction.ClientKeybindings.KeybindingActionBinding[]>;
304
302
  "core.language": fields.StringField<{
305
303
  required: true;
@@ -12,7 +12,7 @@
12
12
 
13
13
  // eslint-disable-next-line import-x/no-named-default
14
14
  import { default as AlphaBlurFilter, AlphaBlurFilterPass } from "#client/canvas/rendering/filters/blur.mjs";
15
- import { ShaderField } from "#client/canvas/perception/vision-mode.mjs";
15
+ import { ShaderField } from "#client/data/fields.mjs";
16
16
  import { DarknessLevelContainer } from "#client/canvas/layers/_module.mjs";
17
17
 
18
18
  export import AVSettings = globalThis.AVSettings;
@@ -81,9 +81,9 @@ type ManageCompendiumRequest = unknown;
81
81
 
82
82
  type ManageCompendiumResponse = unknown;
83
83
 
84
- type WorldCompendiumPackConfiguration = unknown;
84
+ type WorldCompendiumPackConfiguration = foundry.documents.collections.CompendiumCollection.Configuration;
85
85
 
86
- type WorldCompendiumConfiguration = Record<string, WorldCompendiumPackConfiguration>;
86
+ type WorldCompendiumConfiguration = foundry.documents.collections.CompendiumCollection.SettingData;
87
87
 
88
88
  type SettingConfig = foundry.helpers.ClientSettings.SettingConfig;
89
89
 
@@ -115,14 +115,34 @@ declare namespace SceneControls {
115
115
  }
116
116
 
117
117
  /**
118
- * The data structure for a set of controls in the {@link SceneControls#controls} record.
118
+ * The data structure for a set of controls in the {@linkcode SceneControls.controls | SceneControls#controls} record.
119
119
  */
120
120
  interface Control {
121
+ /**
122
+ * A unique identifier for the control
123
+ */
121
124
  name: string;
125
+
126
+ /**
127
+ * An integer indicating the control's order, with 0 being at the top
128
+ */
122
129
  order: number;
130
+
131
+ /**
132
+ * A title for the control: can be a localization path
133
+ */
123
134
  title: string;
135
+
136
+ /**
137
+ * One or more icon classes for the control, typically Font Awesome classes such as `"fa-solid fa-face-smile"`
138
+ */
124
139
  icon: string;
140
+
141
+ /**
142
+ * Whether the control should be visible to the current User
143
+ */
125
144
  visible?: boolean | undefined;
145
+
126
146
  tools: Record<string, Tool>;
127
147
 
128
148
  /**
@@ -138,17 +158,47 @@ declare namespace SceneControls {
138
158
  }
139
159
 
140
160
  /**
141
- * The data structure for a single tool in the {@link Control#tools} record.
161
+ * The data structure for a single tool in the {@linkcode Control.tools | Control#tools} record.
142
162
  */
143
163
  interface Tool {
164
+ /**
165
+ * An identifier for the tool, unique among the tools of its SceneControl
166
+ */
144
167
  name: string;
168
+
169
+ /**
170
+ * An integer indicating the tool's order, with 0 being at the top
171
+ */
145
172
  order: number;
173
+
174
+ /**
175
+ * A title for the tool: can be a localization path
176
+ */
146
177
  title: string;
178
+
179
+ /**
180
+ * One or more icon classes for the tool, typically Font Awesome classes such as `"fa-solid fa-face-smile"`
181
+ */
147
182
  icon: string;
148
183
 
184
+ /**
185
+ * Whether the tool should be visible to the current User
186
+ */
149
187
  visible?: boolean | undefined;
188
+
189
+ /**
190
+ * Is the tool an on-or-off toggle?
191
+ */
150
192
  toggle?: boolean | undefined;
193
+
194
+ /**
195
+ * Is the tool the currently the active one? Not applicable to toggles or buttons.
196
+ */
151
197
  active?: boolean | undefined;
198
+
199
+ /**
200
+ * Is the tool a "button" in the sense of immediately resolving on click without becoming the active tool?
201
+ */
152
202
  button?: boolean | undefined;
153
203
 
154
204
  /** A callback invoked when the tool is activated or deactivated */
@@ -16,3 +16,14 @@ type SoundCreationOptions = foundry.audio.AudioHelper.SoundCreationOptions;
16
16
  type SoundPlaybackOptions = foundry.audio.Sound.PlaybackOptions;
17
17
 
18
18
  type SoundScheduleCallback = foundry.audio.Sound.ScheduleCallback;
19
+
20
+ type AnalysisDataValue = foundry.audio.AudioHelper.AnalysisDataValue;
21
+
22
+ type AnalysisData = foundry.audio.AudioHelper.AnalysisData;
23
+
24
+ type ContextName = foundry.audio.AudioHelper.ContextName;
25
+
26
+ type BandName = foundry.audio.AudioHelper.BandName;
27
+
28
+ /** @privateRemarks We have no implementation of this type to point to because it is completely unused by core as of 13.347 */
29
+ type AnalysisNodes = unknown;
@@ -1,4 +1,4 @@
1
- import type { Identity, InexactPartial, NullishProps } from "#utils";
1
+ import type { Identity, InexactPartial } from "#utils";
2
2
 
3
3
  /**
4
4
  * A sound effect which applies a biquad filter.
@@ -9,7 +9,6 @@ declare class BiquadFilterEffect extends BiquadFilterNode {
9
9
  * @param context - The audio context required by the BiquadFilterNode
10
10
  * @param options - Additional options which modify the BiquadFilterEffect behavior
11
11
  */
12
- // options: not null (destructured)
13
12
  constructor(context: AudioContext, options?: BiquadFilterEffect.ConstructorOptions);
14
13
 
15
14
  /**
@@ -22,10 +21,12 @@ declare class BiquadFilterEffect extends BiquadFilterNode {
22
21
  /**
23
22
  * Update the state of the effect node given the active flag and numeric intensity.
24
23
  * @param options - Options which are updated
25
- * @throws If `type` is set to any value in {@link BiquadFilterEffect.AllowedFilterType} other than `"highpass"` or `"lowpass"`
24
+ * @remarks
25
+ * @throws If `type` is set to any value in {@linkcode BiquadFilterEffect.AllowedFilterType} other than `"highpass"` or `"lowpass"`
26
26
  */
27
- // options: not null (destructured)
28
27
  update(options?: BiquadFilterEffect.UpdateOptions): void;
28
+
29
+ #BiquadFilterEffect: true;
29
30
  }
30
31
 
31
32
  declare namespace BiquadFilterEffect {
@@ -56,16 +57,13 @@ declare namespace BiquadFilterEffect {
56
57
  /**
57
58
  * The initial intensity of the effect
58
59
  * @defaultValue `5`
59
- * @remarks Can't be `null` as it only has a parameter default
60
60
  */
61
61
  intensity: number;
62
62
 
63
63
  /**
64
64
  * The filter type to apply
65
65
  * @defaultValue `"lowpass"`
66
- * @remarks Can't be `null` as it only has a parameter default.
67
- *
68
- * Only allows a subset of {@linkcode BiquadFilterType}s
66
+ * @remarks Only allows a subset of {@linkcode BiquadFilterType}s
69
67
  */
70
68
  type: AllowedFilterType;
71
69
  }>;
@@ -77,7 +75,7 @@ declare namespace BiquadFilterEffect {
77
75
  */
78
76
  interface ConstructorOptions extends _ConstructorOptions, Omit<BiquadFilterOptions, "type"> {}
79
77
 
80
- type _UpdateOptions = NullishProps<{
78
+ type _UpdateOptions = InexactPartial<{
81
79
  /**
82
80
  * A new effect intensity
83
81
  * @remarks This is ignored if it fails a `Number.isFinite` check
@@ -4,7 +4,7 @@ import type { Identity } from "#utils";
4
4
  * A specialized cache used for audio buffers.
5
5
  * This is an LRU cache which expires buffers from the cache once the maximum cache size is exceeded.
6
6
  */
7
- declare class AudioBufferCache extends Map {
7
+ declare class AudioBufferCache extends Map<string, AudioBufferCache.Entry> {
8
8
  /**
9
9
  * Construct an AudioBufferCache providing a maximum disk size beyond which entries are expired.
10
10
  * @param cacheSize - The maximum cache size in bytes. 1GB by default.
@@ -42,10 +42,11 @@ declare class AudioBufferCache extends Map {
42
42
  * @param src - The audio buffer source path
43
43
  * @param locked - Lock the buffer, preventing its expiration?
44
44
  */
45
- // locked: not null (put directly into an Entry)
46
45
  lock(src: string, locked?: boolean): void;
47
46
 
48
47
  override toString(): string;
48
+
49
+ #AudioBufferCache: true;
49
50
  }
50
51
 
51
52
  declare namespace AudioBufferCache {
@@ -1,4 +1,4 @@
1
- import type { Identity, InexactPartial, NullishProps } from "#utils";
1
+ import type { Identity, InexactPartial } from "#utils";
2
2
 
3
3
  declare namespace ConvolverEffect {}
4
4
 
@@ -16,7 +16,6 @@ declare class ConvolverEffect extends ConvolverNode {
16
16
  * @param context - The audio context required by the ConvolverNode
17
17
  * @param options - Additional options which modify the ConvolverEffect behavior
18
18
  */
19
- // options: not null (destructured)
20
19
  constructor(context: AudioContext, options?: ConvolverEffect.ConstructorOptions);
21
20
 
22
21
  /**
@@ -30,7 +29,6 @@ declare class ConvolverEffect extends ConvolverNode {
30
29
  * Update the state of the effect node given the active flag and numeric intensity.
31
30
  * @param options - Options which are updated
32
31
  */
33
- // options: not null (destructured)
34
32
  update(options?: ConvolverEffect.UpdateOptions): void;
35
33
 
36
34
  /** @privateRemarks This override only does side effects then forwards args to super, no type changes */
@@ -61,14 +59,12 @@ declare namespace ConvolverEffect {
61
59
  /**
62
60
  * The file path to the impulse response buffer to use
63
61
  * @defaultValue `"sounds/impulse-responses/ir-full.wav"`
64
- * @remarks Can't be `null` as it only has a parameter default
65
62
  */
66
63
  impulseResponsePath: string;
67
64
 
68
65
  /**
69
66
  * The initial intensity of the effect
70
67
  * @defaultValue `5`
71
- * @remarks Can't be `null` as it only has a parameter default
72
68
  */
73
69
  intensity: number;
74
70
  }>;
@@ -76,7 +72,7 @@ declare namespace ConvolverEffect {
76
72
  interface ConstructorOptions extends _ConstructorOptions, ConvolverOptions {}
77
73
 
78
74
  /** @internal */
79
- type _UpdateOptions = NullishProps<{
75
+ type _UpdateOptions = InexactPartial<{
80
76
  /**
81
77
  * A new effect intensity
82
78
  * @remarks This is ignored if it fails a `Number.isFinite` check