@league-of-foundry-developers/foundry-vtt-types 9.268.2 → 9.269.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@league-of-foundry-developers/foundry-vtt-types",
3
- "version": "9.268.2",
3
+ "version": "9.269.0",
4
4
  "description": "TypeScript type definitions for Foundry VTT",
5
5
  "exports": {
6
6
  ".": {
@@ -76,7 +76,7 @@
76
76
  "lint-staged": "^12.1.2",
77
77
  "prettier": "^2.5.1",
78
78
  "tsd": "^0.20.0",
79
- "typescript": "~4.6.2"
79
+ "typescript": "~4.7.2"
80
80
  },
81
81
  "husky": {
82
82
  "hooks": {
@@ -221,7 +221,7 @@ declare namespace AVSettings {
221
221
  type ClientSettings = typeof AVSettings.DEFAULT_CLIENT_SETTINGS;
222
222
  type WorldSettings = typeof AVSettings.DEFAULT_WORLD_SETTINGS;
223
223
  type StoredUserSettings = typeof AVSettings.DEFAULT_USER_SETTINGS;
224
- type UserSettings = StoredUserSettings & { canBroadCastAudio: boolean; canBroadcastVideo: boolean };
224
+ type UserSettings = StoredUserSettings & { canBroadcastAudio: boolean; canBroadcastVideo: boolean };
225
225
  type Settings = { client: ClientSettings; world: WorldSettings };
226
226
  interface DefaultVoiceModes {
227
227
  ALWAYS: 'always';
@@ -1,4 +1,5 @@
1
1
  import { DocumentConstructor, PlaceableObjectConstructor } from '../../types/helperTypes';
2
+ import type { StatusEffect } from './data/documents/token';
2
3
 
3
4
  declare global {
4
5
  /**
@@ -93,31 +94,24 @@ declare global {
93
94
  /** @defaultValue `"fas fa-id-badge"` */
94
95
  sidebarIcon: string;
95
96
 
96
- presets: {
97
- /**
98
- * @defaultValue
99
- * ```javascript
100
- * {
101
- * type: "deck",
102
- * label: "CARDS.DeckPresetPokerDark",
103
- * src: "cards/poker-deck-dark.json"
104
- * }
105
- * ```
106
- */
107
- pokerDark: CONFIG.Cards.Preset;
108
-
109
- /**
110
- * @defaultValue
111
- * ```javascript
112
- * {
113
- * type: "deck",
114
- * label: "CARDS.DeckPresetPokerLight",
115
- * src: "cards/poker-deck-light.json"
116
- * }
117
- * ```
118
- */
119
- pokerLight: CONFIG.Cards.Preset;
120
- } & Record<string, CONFIG.Cards.Preset>;
97
+ /**
98
+ * @defaultValue
99
+ * ```typescript
100
+ * {
101
+ * pokerDark: {
102
+ * type: "deck",
103
+ * label: "CARDS.DeckPresetPokerDark",
104
+ * src: "cards/poker-deck-dark.json"
105
+ * },
106
+ * pokerLight: {
107
+ * type: "deck",
108
+ * label: "CARDS.DeckPresetPokerLight",
109
+ * src: "cards/poker-deck-light.json"
110
+ * }
111
+ * }
112
+ * ```
113
+ */
114
+ presets: Record<string, CONFIG.Cards.Preset>;
121
115
  };
122
116
 
123
117
  /**
@@ -998,7 +992,7 @@ declare global {
998
992
  * ]
999
993
  * ```
1000
994
  */
1001
- statusEffects: { id: string; label: string; icon: string }[];
995
+ statusEffects: StatusEffect[];
1002
996
 
1003
997
  /**
1004
998
  * A mapping of core audio effects used which can be replaced by systems or mods
@@ -1,8 +1,7 @@
1
1
  import { ConfiguredDocumentClass } from '../../../../types/helperTypes';
2
2
  import { DocumentModificationOptions } from '../../../common/abstract/document.mjs.js';
3
- import * as data from '../../../common/data/data.mjs/index.js';
4
-
5
3
  import type { ActiveEffectDataConstructorData } from '../../../common/data/data.mjs/activeEffectData';
4
+ import * as data from '../../../common/data/data.mjs/index.js';
6
5
  import type { PrototypeTokenDataConstructorData } from '../../../common/data/data.mjs/prototypeTokenData';
7
6
 
8
7
  declare global {
@@ -97,10 +96,7 @@ declare global {
97
96
  * (default: `{}`)
98
97
  * @returns Whether the Active Effect is now on or off
99
98
  */
100
- toggleActiveEffect(
101
- effectData: ActiveEffectDataConstructorData & { id: string; label: string; icon: string },
102
- options?: ToggleActiveEffectOptions | undefined
103
- ): Promise<boolean>;
99
+ toggleActiveEffect(effectData: StatusEffect, options?: ToggleActiveEffectOptions | undefined): Promise<boolean>;
104
100
 
105
101
  /**
106
102
  * Redirect updates to a synthetic Token Actor to instead update the tokenData override object.
@@ -281,3 +277,5 @@ interface ToggleActiveEffectOptions {
281
277
  /** Force a certain active state for the effect. */
282
278
  active?: boolean | undefined;
283
279
  }
280
+
281
+ export type StatusEffect = ActiveEffectDataConstructorData & { id: string };
@@ -187,7 +187,7 @@ declare namespace Dialog {
187
187
  /**
188
188
  * The name of the default button which should be triggered on Enter
189
189
  */
190
- default: string;
190
+ default?: string | undefined;
191
191
  }
192
192
  }
193
193
 
@@ -1,5 +1,4 @@
1
- import DocumentData from '../foundry/common/abstract/data.mjs';
2
- import { AnyDocumentData } from '../foundry/common/abstract/data.mjs';
1
+ import DocumentData, { AnyDocumentData } from '../foundry/common/abstract/data.mjs';
3
2
  import Document from '../foundry/common/abstract/document.mjs';
4
3
  import EmbeddedCollection from '../foundry/common/abstract/embedded-collection.mjs';
5
4
 
@@ -125,7 +125,7 @@ type Merge<T, U> = T extends object
125
125
  */
126
126
  type PromisedType<T> = T extends Promise<infer TResult> ? TResult : T;
127
127
 
128
- type StoredDocument<D extends foundry.abstract.Document<any, any>> = D & {
128
+ type StoredDocument<D extends { data: { _source: unknown } }> = D & {
129
129
  id: string;
130
130
  data: D['data'] & {
131
131
  _id: string;