@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250724011756 → 13.346.0-beta.20250724175652

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.20250724011756",
4
+ "version": "13.346.0-beta.20250724175652",
5
5
  "description": "TypeScript type definitions for Foundry VTT",
6
6
  "type": "module",
7
7
  "types": "./src/index.d.mts",
@@ -40,11 +40,11 @@ type RenderApplicationHooks = {
40
40
  };
41
41
 
42
42
  type GetApplicationHeaderButtonsHooks = {
43
- [K in ApplicationName as `get${K}HeaderButtons`]: Hooks.RenderApplication<ApplicationConfig[K]>;
43
+ [K in ApplicationName as `get${K}HeaderButtons`]: Hooks.GetApplicationHeaderButtons<ApplicationConfig[K]>;
44
44
  };
45
45
 
46
46
  type CloseApplicationHooks = {
47
- [K in ApplicationName as `close${K}`]: Hooks.RenderApplication<ApplicationConfig[K]>;
47
+ [K in ApplicationName as `close${K}`]: Hooks.CloseApplication<ApplicationConfig[K]>;
48
48
  };
49
49
 
50
50
  type GetApplicationEntryContextHooks = {
@@ -1229,13 +1229,22 @@ declare namespace Document {
1229
1229
  }
1230
1230
  >;
1231
1231
 
1232
+ type Invalid<D extends Document.Any> = D extends { system: unknown } ? _InvalidSystem<D> : _Invalid<D>;
1233
+
1234
+ /** @internal */
1232
1235
  // @ts-expect-error This pattern is inherently an error.
1233
- interface Invalid<D extends Document.Any> extends _Invalid, D {}
1236
+ interface _InvalidSystem<D extends Document.Any> extends D {
1237
+ // `Record<string, unknown>` is used to allow arbitrary property access since `in` checks are
1238
+ // a nuisance.
1239
+ _source: Record<string, unknown>;
1240
+ system: Record<string, unknown>;
1241
+ get invalid(): true;
1242
+ }
1234
1243
 
1235
1244
  /** @internal */
1236
- interface _Invalid {
1237
- _source: object;
1238
- system?: object | undefined;
1245
+ // @ts-expect-error This pattern is inherently an error.
1246
+ interface _Invalid<D extends Document.Any> extends D {
1247
+ _source: Record<string, unknown>;
1239
1248
  get invalid(): true;
1240
1249
  }
1241
1250
 
@@ -1458,6 +1467,42 @@ declare namespace Document {
1458
1467
  | (DocumentType extends "Token" ? TokenDocument.Source : never)
1459
1468
  | (DocumentType extends "Wall" ? WallDocument.Source : never);
1460
1469
 
1470
+ type ParentForName<DocumentType extends Document.Type> =
1471
+ | (DocumentType extends "ActiveEffect" ? ActiveEffect.Parent : never)
1472
+ | (DocumentType extends "ActorDelta" ? ActorDelta.Parent : never)
1473
+ | (DocumentType extends "Actor" ? Actor.Parent : never)
1474
+ | (DocumentType extends "Adventure" ? Adventure.Parent : never)
1475
+ | (DocumentType extends "Card" ? Card.Parent : never)
1476
+ | (DocumentType extends "Cards" ? Cards.Parent : never)
1477
+ | (DocumentType extends "ChatMessage" ? ChatMessage.Parent : never)
1478
+ | (DocumentType extends "Combat" ? Combat.Parent : never)
1479
+ | (DocumentType extends "Combatant" ? Combatant.Parent : never)
1480
+ | (DocumentType extends "CombatantGroup" ? CombatantGroup.Parent : never)
1481
+ | (DocumentType extends "FogExploration" ? FogExploration.Parent : never)
1482
+ | (DocumentType extends "Folder" ? Folder.Parent : never)
1483
+ | (DocumentType extends "Item" ? Item.Parent : never)
1484
+ | (DocumentType extends "JournalEntryCategory" ? JournalEntryCategory.Parent : never)
1485
+ | (DocumentType extends "JournalEntryPage" ? JournalEntryPage.Parent : never)
1486
+ | (DocumentType extends "JournalEntry" ? JournalEntry.Parent : never)
1487
+ | (DocumentType extends "Macro" ? Macro.Parent : never)
1488
+ | (DocumentType extends "PlaylistSound" ? PlaylistSound.Parent : never)
1489
+ | (DocumentType extends "Playlist" ? Playlist.Parent : never)
1490
+ | (DocumentType extends "RegionBehavior" ? RegionBehavior.Parent : never)
1491
+ | (DocumentType extends "RollTable" ? RollTable.Parent : never)
1492
+ | (DocumentType extends "Scene" ? Scene.Parent : never)
1493
+ | (DocumentType extends "Setting" ? Setting.Parent : never)
1494
+ | (DocumentType extends "TableResult" ? TableResult.Parent : never)
1495
+ | (DocumentType extends "User" ? User.Parent : never)
1496
+ | (DocumentType extends "AmbientLight" ? AmbientLightDocument.Parent : never)
1497
+ | (DocumentType extends "AmbientSound" ? AmbientSoundDocument.Parent : never)
1498
+ | (DocumentType extends "Drawing" ? DrawingDocument.Parent : never)
1499
+ | (DocumentType extends "MeasuredTemplate" ? MeasuredTemplateDocument.Parent : never)
1500
+ | (DocumentType extends "Note" ? NoteDocument.Parent : never)
1501
+ | (DocumentType extends "Region" ? NoteDocument.Parent : never)
1502
+ | (DocumentType extends "Tile" ? TileDocument.Parent : never)
1503
+ | (DocumentType extends "Token" ? TokenDocument.Parent : never)
1504
+ | (DocumentType extends "Wall" ? WallDocument.Parent : never);
1505
+
1461
1506
  type SystemConstructor = AnyConstructor & {
1462
1507
  metadata: { name: SystemType };
1463
1508
  };