@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250728061606 → 13.346.0-beta.20250730012658

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,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.20250728061606",
4
+ "version": "13.346.0-beta.20250730012658",
5
5
  "description": "TypeScript type definitions for Foundry VTT",
6
6
  "type": "module",
7
7
  "types": "./src/index.d.mts",
@@ -15,7 +15,6 @@ import type {
15
15
  RemoveIndexSignatures,
16
16
  FixedInstanceType,
17
17
  NullishProps,
18
- DiscriminatedUnion,
19
18
  PickValue,
20
19
  Identity,
21
20
  Brand,
@@ -25,6 +24,7 @@ import type {
25
24
  PrettifyType,
26
25
  AllKeysOf,
27
26
  Override,
27
+ ConcreteKeys,
28
28
  } from "#utils";
29
29
  import type * as CONST from "../constants.mts";
30
30
  import type {
@@ -1214,7 +1214,22 @@ declare namespace Document {
1214
1214
  : SystemMap[Exclude<SubType, ConfiguredSubType>]);
1215
1215
 
1216
1216
  /** @internal */
1217
- type _DiscriminateUndefined<T extends object | undefined> = DiscriminatedUnion<Exclude<T, undefined>>;
1217
+ type _DiscriminateUndefined<T extends object | undefined> = _DiscriminatedUnion<
1218
+ Exclude<T, undefined>,
1219
+ {
1220
+ // Avoid discriminating index signatures.
1221
+ [K in keyof T]: ConcreteKeys<T>;
1222
+ }[keyof T]
1223
+ >;
1224
+
1225
+ /** @internal */
1226
+ type _DiscriminatedUnion<U extends object, AllKeys extends PropertyKey> = U extends object
1227
+ ? [Exclude<AllKeys, keyof U>] extends [never]
1228
+ ? U
1229
+ : U & {
1230
+ readonly [K in Exclude<AllKeys, keyof U>]?: never;
1231
+ }
1232
+ : never;
1218
1233
 
1219
1234
  // TODO(LukeAbby): Improve the type display with a helper here.
1220
1235
  // TODO(LukeAbby): Add `StoredSource` for a better type display there.