@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250705112003 → 13.346.0-beta.20250705141556

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 (84) hide show
  1. package/package.json +9 -4
  2. package/src/configuration/hooks.d.mts +1 -1
  3. package/src/foundry/client/applications/api/document-sheet.d.mts +8 -1
  4. package/src/foundry/client/applications/api/handlebars-application.d.mts +2 -2
  5. package/src/foundry/client/applications/sheets/ambient-light-config.d.mts +2 -2
  6. package/src/foundry/client/applications/sheets/region-behavior-config.d.mts +1 -1
  7. package/src/foundry/client/documents/abstract/document-collection.d.mts +6 -4
  8. package/src/foundry/client/documents/active-effect.d.mts +12 -5
  9. package/src/foundry/client/documents/actor-delta.d.mts +12 -5
  10. package/src/foundry/client/documents/actor.d.mts +12 -5
  11. package/src/foundry/client/documents/adventure.d.mts +12 -5
  12. package/src/foundry/client/documents/ambient-light.d.mts +12 -5
  13. package/src/foundry/client/documents/ambient-sound.d.mts +12 -5
  14. package/src/foundry/client/documents/card.d.mts +11 -6
  15. package/src/foundry/client/documents/cards.d.mts +13 -6
  16. package/src/foundry/client/documents/chat-message.d.mts +15 -8
  17. package/src/foundry/client/documents/collections/compendium-collection.d.mts +2 -0
  18. package/src/foundry/client/documents/combat.d.mts +12 -5
  19. package/src/foundry/client/documents/combatant-group.d.mts +12 -5
  20. package/src/foundry/client/documents/combatant.d.mts +12 -5
  21. package/src/foundry/client/documents/drawing.d.mts +12 -5
  22. package/src/foundry/client/documents/fog-exploration.d.mts +12 -5
  23. package/src/foundry/client/documents/folder.d.mts +13 -6
  24. package/src/foundry/client/documents/item.d.mts +10 -5
  25. package/src/foundry/client/documents/journal-entry-category.d.mts +12 -5
  26. package/src/foundry/client/documents/journal-entry-page.d.mts +12 -5
  27. package/src/foundry/client/documents/journal-entry.d.mts +12 -5
  28. package/src/foundry/client/documents/macro.d.mts +12 -5
  29. package/src/foundry/client/documents/measured-template.d.mts +12 -5
  30. package/src/foundry/client/documents/note.d.mts +12 -5
  31. package/src/foundry/client/documents/playlist-sound.d.mts +12 -5
  32. package/src/foundry/client/documents/playlist.d.mts +12 -5
  33. package/src/foundry/client/documents/region-behavior.d.mts +12 -5
  34. package/src/foundry/client/documents/region.d.mts +12 -5
  35. package/src/foundry/client/documents/roll-table.d.mts +13 -6
  36. package/src/foundry/client/documents/scene.d.mts +12 -5
  37. package/src/foundry/client/documents/setting.d.mts +8 -1
  38. package/src/foundry/client/documents/table-result.d.mts +12 -5
  39. package/src/foundry/client/documents/tile.d.mts +12 -5
  40. package/src/foundry/client/documents/token.d.mts +15 -12
  41. package/src/foundry/client/documents/user.d.mts +10 -5
  42. package/src/foundry/client/documents/wall.d.mts +12 -5
  43. package/src/foundry/client/helpers/client-settings.d.mts +7 -3
  44. package/src/foundry/common/abstract/document.d.mts +98 -50
  45. package/src/foundry/common/abstract/type-data.d.mts +35 -10
  46. package/src/foundry/common/data/data.d.mts +2 -2
  47. package/src/foundry/common/data/fields.d.mts +71 -59
  48. package/src/foundry/common/documents/active-effect.d.mts +6 -5
  49. package/src/foundry/common/documents/actor-delta.d.mts +6 -5
  50. package/src/foundry/common/documents/actor.d.mts +6 -5
  51. package/src/foundry/common/documents/adventure.d.mts +6 -5
  52. package/src/foundry/common/documents/ambient-light.d.mts +6 -5
  53. package/src/foundry/common/documents/ambient-sound.d.mts +6 -5
  54. package/src/foundry/common/documents/card.d.mts +6 -5
  55. package/src/foundry/common/documents/cards.d.mts +6 -5
  56. package/src/foundry/common/documents/chat-message.d.mts +6 -5
  57. package/src/foundry/common/documents/combat.d.mts +6 -5
  58. package/src/foundry/common/documents/combatant-group.d.mts +6 -5
  59. package/src/foundry/common/documents/combatant.d.mts +6 -5
  60. package/src/foundry/common/documents/drawing.d.mts +6 -5
  61. package/src/foundry/common/documents/fog-exploration.d.mts +6 -5
  62. package/src/foundry/common/documents/folder.d.mts +6 -5
  63. package/src/foundry/common/documents/item.d.mts +6 -5
  64. package/src/foundry/common/documents/journal-entry-category.d.mts +6 -5
  65. package/src/foundry/common/documents/journal-entry-page.d.mts +6 -5
  66. package/src/foundry/common/documents/journal-entry.d.mts +6 -5
  67. package/src/foundry/common/documents/macro.d.mts +6 -5
  68. package/src/foundry/common/documents/measured-template.d.mts +6 -5
  69. package/src/foundry/common/documents/note.d.mts +6 -5
  70. package/src/foundry/common/documents/playlist-sound.d.mts +6 -5
  71. package/src/foundry/common/documents/playlist.d.mts +6 -5
  72. package/src/foundry/common/documents/region-behavior.d.mts +6 -5
  73. package/src/foundry/common/documents/region.d.mts +6 -5
  74. package/src/foundry/common/documents/roll-table.d.mts +6 -5
  75. package/src/foundry/common/documents/scene.d.mts +6 -5
  76. package/src/foundry/common/documents/setting.d.mts +4 -3
  77. package/src/foundry/common/documents/table-result.d.mts +6 -5
  78. package/src/foundry/common/documents/tile.d.mts +6 -5
  79. package/src/foundry/common/documents/token.d.mts +6 -5
  80. package/src/foundry/common/documents/user.d.mts +6 -5
  81. package/src/foundry/common/documents/wall.d.mts +6 -5
  82. package/src/foundry/common/packages/base-world.d.mts +31 -29
  83. package/src/types/augments/pixi.d.mts +4 -0
  84. package/tsconfig.json +2 -5
@@ -364,26 +364,33 @@ declare namespace PlaylistSound {
364
364
  interface DialogCreateOptions extends InexactPartial<Create> {}
365
365
  }
366
366
 
367
+ /**
368
+ * If `Temporary` is true then `PlaylistSound.Implementation`, otherwise `PlaylistSound.Stored`.
369
+ */
370
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
371
+ ? PlaylistSound.Implementation
372
+ : PlaylistSound.Stored;
373
+
367
374
  /**
368
375
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
369
376
  */
370
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
377
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
371
378
 
372
379
  namespace Flags {
373
380
  /**
374
381
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
375
382
  */
376
- type Scope = Document.FlagKeyOf<Flags>;
383
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
377
384
 
378
385
  /**
379
386
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
380
387
  */
381
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
388
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
382
389
 
383
390
  /**
384
391
  * Gets the type of a particular flag given a `Scope` and a `Key`.
385
392
  */
386
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
393
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
387
394
  }
388
395
 
389
396
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -397,7 +404,7 @@ declare namespace PlaylistSound {
397
404
  /**
398
405
  * The arguments to construct the document.
399
406
  *
400
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
407
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
401
408
  * now recommended.
402
409
  */
403
410
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -456,26 +456,33 @@ declare namespace Playlist {
456
456
  interface DialogCreateOptions extends InexactPartial<Create> {}
457
457
  }
458
458
 
459
+ /**
460
+ * If `Temporary` is true then `Playlist.Implementation`, otherwise `Playlist.Stored`.
461
+ */
462
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
463
+ ? Playlist.Implementation
464
+ : Playlist.Stored;
465
+
459
466
  /**
460
467
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
461
468
  */
462
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
469
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
463
470
 
464
471
  namespace Flags {
465
472
  /**
466
473
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
467
474
  */
468
- type Scope = Document.FlagKeyOf<Flags>;
475
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
469
476
 
470
477
  /**
471
478
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
472
479
  */
473
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
480
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
474
481
 
475
482
  /**
476
483
  * Gets the type of a particular flag given a `Scope` and a `Key`.
477
484
  */
478
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
485
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
479
486
  }
480
487
 
481
488
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -538,7 +545,7 @@ declare namespace Playlist {
538
545
  /**
539
546
  * The arguments to construct the document.
540
547
  *
541
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
548
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
542
549
  * now recommended.
543
550
  */
544
551
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -394,26 +394,33 @@ declare namespace RegionBehavior {
394
394
  interface DialogCreateOptions extends InexactPartial<Create> {}
395
395
  }
396
396
 
397
+ /**
398
+ * If `Temporary` is true then `RegionBehavior.Implementation`, otherwise `RegionBehavior.Stored`.
399
+ */
400
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
401
+ ? RegionBehavior.Implementation
402
+ : RegionBehavior.Stored;
403
+
397
404
  /**
398
405
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
399
406
  */
400
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
407
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
401
408
 
402
409
  namespace Flags {
403
410
  /**
404
411
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
405
412
  */
406
- type Scope = Document.FlagKeyOf<Flags>;
413
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
407
414
 
408
415
  /**
409
416
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
410
417
  */
411
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
418
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
412
419
 
413
420
  /**
414
421
  * Gets the type of a particular flag given a `Scope` and a `Key`.
415
422
  */
416
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
423
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
417
424
  }
418
425
 
419
426
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -427,7 +434,7 @@ declare namespace RegionBehavior {
427
434
  /**
428
435
  * The arguments to construct the document.
429
436
  *
430
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
437
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
431
438
  * now recommended.
432
439
  */
433
440
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -711,26 +711,33 @@ declare namespace RegionDocument {
711
711
  interface DialogCreateOptions extends InexactPartial<Create> {}
712
712
  }
713
713
 
714
+ /**
715
+ * If `Temporary` is true then `RegionDocument.Implementation`, otherwise `RegionDocument.Stored`.
716
+ */
717
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
718
+ ? RegionDocument.Implementation
719
+ : RegionDocument.Stored;
720
+
714
721
  /**
715
722
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
716
723
  */
717
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
724
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
718
725
 
719
726
  namespace Flags {
720
727
  /**
721
728
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
722
729
  */
723
- type Scope = Document.FlagKeyOf<Flags>;
730
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
724
731
 
725
732
  /**
726
733
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
727
734
  */
728
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
735
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
729
736
 
730
737
  /**
731
738
  * Gets the type of a particular flag given a `Scope` and a `Key`.
732
739
  */
733
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
740
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
734
741
  }
735
742
 
736
743
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -888,7 +895,7 @@ declare namespace RegionDocument {
888
895
  /**
889
896
  * The arguments to construct the document.
890
897
  *
891
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
898
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
892
899
  * now recommended.
893
900
  */
894
901
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -436,26 +436,33 @@ declare namespace RollTable {
436
436
  results: Document.ToConfiguredInstance<typeof foundry.documents.BaseTableResult>[];
437
437
  }
438
438
 
439
+ /**
440
+ * If `Temporary` is true then `RollTable.Implementation`, otherwise `RollTable.Stored`.
441
+ */
442
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
443
+ ? RollTable.Implementation
444
+ : RollTable.Stored;
445
+
439
446
  /**
440
447
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
441
448
  */
442
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
449
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
443
450
 
444
451
  namespace Flags {
445
452
  /**
446
453
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
447
454
  */
448
- type Scope = Document.FlagKeyOf<Flags>;
455
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
449
456
 
450
457
  /**
451
458
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
452
459
  */
453
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
460
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
454
461
 
455
462
  /**
456
463
  * Gets the type of a particular flag given a `Scope` and a `Key`.
457
464
  */
458
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
465
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
459
466
  }
460
467
 
461
468
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -587,7 +594,7 @@ declare namespace RollTable {
587
594
  /**
588
595
  * The arguments to construct the document.
589
596
  *
590
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
597
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
591
598
  * now recommended.
592
599
  */
593
600
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -801,7 +808,7 @@ declare class RollTable extends BaseRollTable.Internal.ClientDocument {
801
808
  static fromFolder<Temporary extends boolean | undefined = undefined>(
802
809
  folder: Folder.Implementation,
803
810
  options?: RollTable.Database.CreateOperation<Temporary>,
804
- ): Promise<Document.TemporaryIf<WallDocument.Implementation, Temporary> | undefined>;
811
+ ): Promise<WallDocument.TemporaryIf<Temporary> | undefined>;
805
812
 
806
813
  /*
807
814
  * After this point these are not really overridden methods.
@@ -975,26 +975,33 @@ declare namespace Scene {
975
975
  interface DialogCreateOptions extends InexactPartial<Create> {}
976
976
  }
977
977
 
978
+ /**
979
+ * If `Temporary` is true then `Scene.Implementation`, otherwise `Scene.Stored`.
980
+ */
981
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
982
+ ? Scene.Implementation
983
+ : Scene.Stored;
984
+
978
985
  /**
979
986
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
980
987
  */
981
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
988
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
982
989
 
983
990
  namespace Flags {
984
991
  /**
985
992
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
986
993
  */
987
- type Scope = Document.FlagKeyOf<Flags>;
994
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
988
995
 
989
996
  /**
990
997
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
991
998
  */
992
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
999
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
993
1000
 
994
1001
  /**
995
1002
  * Gets the type of a particular flag given a `Scope` and a `Key`.
996
1003
  */
997
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
1004
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
998
1005
  }
999
1006
 
1000
1007
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -1127,7 +1134,7 @@ declare namespace Scene {
1127
1134
  /**
1128
1135
  * The arguments to construct the document.
1129
1136
  *
1130
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
1137
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
1131
1138
  * now recommended.
1132
1139
  */
1133
1140
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -322,6 +322,13 @@ declare namespace Setting {
322
322
  interface DialogCreateOptions extends InexactPartial<Create> {}
323
323
  }
324
324
 
325
+ /**
326
+ * If `Temporary` is true then `Setting.Implementation`, otherwise `Setting.Stored`.
327
+ */
328
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
329
+ ? Setting.Implementation
330
+ : Setting.Stored;
331
+
325
332
  /**
326
333
  * @deprecated `Settings` does not have any flags.
327
334
  *
@@ -363,7 +370,7 @@ declare namespace Setting {
363
370
  /**
364
371
  * The arguments to construct the document.
365
372
  *
366
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
373
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
367
374
  * now recommended.
368
375
  */
369
376
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -398,26 +398,33 @@ declare namespace TableResult {
398
398
  interface DialogCreateOptions extends InexactPartial<Create> {}
399
399
  }
400
400
 
401
+ /**
402
+ * If `Temporary` is true then `TableResult.Implementation`, otherwise `TableResult.Stored`.
403
+ */
404
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
405
+ ? TableResult.Implementation
406
+ : TableResult.Stored;
407
+
401
408
  /**
402
409
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
403
410
  */
404
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
411
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
405
412
 
406
413
  namespace Flags {
407
414
  /**
408
415
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
409
416
  */
410
- type Scope = Document.FlagKeyOf<Flags>;
417
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
411
418
 
412
419
  /**
413
420
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
414
421
  */
415
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
422
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
416
423
 
417
424
  /**
418
425
  * Gets the type of a particular flag given a `Scope` and a `Key`.
419
426
  */
420
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
427
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
421
428
  }
422
429
 
423
430
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -431,7 +438,7 @@ declare namespace TableResult {
431
438
  /**
432
439
  * The arguments to construct the document.
433
440
  *
434
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
441
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
435
442
  * now recommended.
436
443
  */
437
444
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -409,26 +409,33 @@ declare namespace TileDocument {
409
409
  interface DialogCreateOptions extends InexactPartial<Create> {}
410
410
  }
411
411
 
412
+ /**
413
+ * If `Temporary` is true then `TileDocument.Implementation`, otherwise `TileDocument.Stored`.
414
+ */
415
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
416
+ ? TileDocument.Implementation
417
+ : TileDocument.Stored;
418
+
412
419
  /**
413
420
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
414
421
  */
415
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
422
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name>, CoreFlags {}
416
423
 
417
424
  namespace Flags {
418
425
  /**
419
426
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
420
427
  */
421
- type Scope = Document.FlagKeyOf<Flags>;
428
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
422
429
 
423
430
  /**
424
431
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
425
432
  */
426
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
433
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
427
434
 
428
435
  /**
429
436
  * Gets the type of a particular flag given a `Scope` and a `Key`.
430
437
  */
431
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
438
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
432
439
  }
433
440
 
434
441
  interface CoreFlags {
@@ -455,7 +462,7 @@ declare namespace TileDocument {
455
462
  /**
456
463
  * The arguments to construct the document.
457
464
  *
458
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
465
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
459
466
  * now recommended.
460
467
  */
461
468
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -930,26 +930,33 @@ declare namespace TokenDocument {
930
930
  interface DialogCreateOptions extends InexactPartial<Create> {}
931
931
  }
932
932
 
933
+ /**
934
+ * If `Temporary` is true then `Token.Implementation`, otherwise `Token.Stored`.
935
+ */
936
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
937
+ ? TokenDocument.Implementation
938
+ : TokenDocument.Stored;
939
+
933
940
  /**
934
941
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
935
942
  */
936
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
943
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name>, CoreFlags {}
937
944
 
938
945
  namespace Flags {
939
946
  /**
940
947
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
941
948
  */
942
- type Scope = Document.FlagKeyOf<Flags>;
949
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
943
950
 
944
951
  /**
945
952
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
946
953
  */
947
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
954
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
948
955
 
949
956
  /**
950
957
  * Gets the type of a particular flag given a `Scope` and a `Key`.
951
958
  */
952
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
959
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
953
960
  }
954
961
 
955
962
  interface CoreFlags {
@@ -1086,13 +1093,9 @@ declare namespace TokenDocument {
1086
1093
 
1087
1094
  type GetEmbeddedCollectionName = Embedded.CollectionName | "Actor" | "Item" | "ActiveEffect";
1088
1095
 
1089
- // TODO(LukeAbby): Simplified for now to prevent circularities. The correct implementation would
1090
- // be this:
1091
- // | (Name extends "Actor" ? globalThis.Collection<Actor.Implementation> : never)
1092
- // | (Name extends "Item" ? globalThis.Collection<Item.Implementation> : never)
1093
- // | (Name extends "ActiveEffect" ? globalThis.Collection<ActiveEffect.Implementation> : never)
1094
- // | (Name extends Embedded.CollectionName ? Embedded.CollectionFor<Name> : never);
1095
- type GetEmbeddedCollectionResult<_Name extends GetEmbeddedCollectionName> = Collection.Any;
1096
+ type GetEmbeddedCollectionResult<Name extends GetEmbeddedCollectionName> =
1097
+ | (Name extends Document.Type ? globalThis.Collection<Document.ImplementationFor<Name>> : never)
1098
+ | (Name extends Embedded.CollectionName ? Embedded.CollectionFor<Name> : never);
1096
1099
 
1097
1100
  type MovementState = "completed" | "paused" | "pending" | "stopped";
1098
1101
 
@@ -1444,7 +1447,7 @@ declare namespace TokenDocument {
1444
1447
  /**
1445
1448
  * The arguments to construct the document.
1446
1449
  *
1447
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
1450
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
1448
1451
  * now recommended.
1449
1452
  */
1450
1453
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -394,26 +394,31 @@ declare namespace User {
394
394
  interface DialogCreateOptions extends InexactPartial<Create> {}
395
395
  }
396
396
 
397
+ /**
398
+ * If `Temporary` is true then `User.Implementation`, otherwise `User.Stored`.
399
+ */
400
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary ? User.Implementation : User.Stored;
401
+
397
402
  /**
398
403
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
399
404
  */
400
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
405
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
401
406
 
402
407
  namespace Flags {
403
408
  /**
404
409
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
405
410
  */
406
- type Scope = Document.FlagKeyOf<Flags>;
411
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
407
412
 
408
413
  /**
409
414
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
410
415
  */
411
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
416
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
412
417
 
413
418
  /**
414
419
  * Gets the type of a particular flag given a `Scope` and a `Key`.
415
420
  */
416
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
421
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
417
422
  }
418
423
 
419
424
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -580,7 +585,7 @@ declare namespace User {
580
585
  /**
581
586
  * The arguments to construct the document.
582
587
  *
583
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
588
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
584
589
  * now recommended.
585
590
  */
586
591
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -499,26 +499,33 @@ declare namespace WallDocument {
499
499
  interface DialogCreateOptions extends InexactPartial<Create> {}
500
500
  }
501
501
 
502
+ /**
503
+ * If `Temporary` is true then `WallDocument.Implementation`, otherwise `WallDocument.Stored`.
504
+ */
505
+ type TemporaryIf<Temporary extends boolean | undefined> = true extends Temporary
506
+ ? WallDocument.Implementation
507
+ : WallDocument.Stored;
508
+
502
509
  /**
503
510
  * The flags that are available for this document in the form `{ [scope: string]: { [key: string]: unknown } }`.
504
511
  */
505
- interface Flags extends Document.ConfiguredFlagsForName<Name> {}
512
+ interface Flags extends Document.Internal.ConfiguredFlagsForName<Name> {}
506
513
 
507
514
  namespace Flags {
508
515
  /**
509
516
  * The valid scopes for the flags on this document e.g. `"core"` or `"dnd5e"`.
510
517
  */
511
- type Scope = Document.FlagKeyOf<Flags>;
518
+ type Scope = Document.Internal.FlagKeyOf<Flags>;
512
519
 
513
520
  /**
514
521
  * The valid keys for a certain scope for example if the scope is "core" then a valid key may be `"sheetLock"` or `"viewMode"`.
515
522
  */
516
- type Key<Scope extends Flags.Scope> = Document.FlagKeyOf<Document.FlagGetKey<Flags, Scope>>;
523
+ type Key<Scope extends Flags.Scope> = Document.Internal.FlagKeyOf<Document.Internal.FlagGetKey<Flags, Scope>>;
517
524
 
518
525
  /**
519
526
  * Gets the type of a particular flag given a `Scope` and a `Key`.
520
527
  */
521
- type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
528
+ type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.Internal.GetFlag<Flags, Scope, Key>;
522
529
  }
523
530
 
524
531
  interface DropData extends Document.Internal.DropData<Name> {}
@@ -532,7 +539,7 @@ declare namespace WallDocument {
532
539
  /**
533
540
  * The arguments to construct the document.
534
541
  *
535
- * @deprecated - Writing the signature directly has helped reduce circularities and therefore is
542
+ * @deprecated Writing the signature directly has helped reduce circularities and therefore is
536
543
  * now recommended.
537
544
  */
538
545
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -3,7 +3,7 @@ import type FormApplication from "#client/appv1/api/form-application-v1.mjs";
3
3
  import type ApplicationV2 from "#client/applications/api/application.d.mts";
4
4
  import type { CustomFormInput } from "#client/applications/forms/fields.d.mts";
5
5
  import type DataModel from "#common/abstract/data.d.mts";
6
- import type { DataField } from "#common/data/fields.d.mts";
6
+ import type { DataField, SchemaField } from "#common/data/fields.d.mts";
7
7
 
8
8
  /**
9
9
  * A class responsible for managing defined game settings or settings menus.
@@ -235,14 +235,18 @@ declare namespace ClientSettings {
235
235
  | (T extends symbol ? typeof Symbol : never)
236
236
  | (T extends bigint ? typeof BigInt : never)
237
237
  | (T extends readonly (infer V)[] ? typeof Array<V> : never)
238
- | (T extends AnyObject ? typeof Object : never);
238
+ | (T extends AnyObject ? typeof Object : never)
239
+ // TODO(LukeAbby): If `DataModel.AnyConstructor` can be used in `RuntimeType` this can be switched to `...args: never`
240
+ | (T extends DataModel.Any ? new (...args: any[]) => T : never);
239
241
 
240
242
  type SettingCreateData<N extends Namespace, K extends KeyFor<N>> = ToSettingCreateData<ConfiguredType<N, K>>;
241
243
 
242
244
  type ToSettingCreateData<T extends Type> = ReplaceUndefinedWithNull<
243
245
  | SettingType<T>
244
246
  // TODO(LukeAbby): The `fromSource` function is called with `strict` which changes how fallback behaviour works. See `ClientSettings#set`
245
- | (T extends (abstract new (...args: infer _1) => infer Instance extends DataModel.Any) ? Instance : never)
247
+ | (T extends (abstract new (...args: infer _1) => infer Instance extends DataModel.Any)
248
+ ? SchemaField.CreateData<DataModel.SchemaOf<Instance>>
249
+ : never)
246
250
  >;
247
251
 
248
252
  type SettingInitializedType<N extends Namespace, K extends KeyFor<N>> = ToSettingInitializedType<