@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250705112003 → 13.346.0-beta.20250705133313
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 +5 -3
- package/src/configuration/hooks.d.mts +1 -1
- package/src/foundry/client/applications/api/document-sheet.d.mts +8 -1
- package/src/foundry/client/applications/api/handlebars-application.d.mts +2 -2
- package/src/foundry/client/applications/sheets/ambient-light-config.d.mts +2 -2
- package/src/foundry/client/applications/sheets/region-behavior-config.d.mts +1 -1
- package/src/foundry/client/documents/abstract/document-collection.d.mts +6 -4
- package/src/foundry/client/documents/active-effect.d.mts +12 -5
- package/src/foundry/client/documents/actor-delta.d.mts +12 -5
- package/src/foundry/client/documents/actor.d.mts +12 -5
- package/src/foundry/client/documents/adventure.d.mts +12 -5
- package/src/foundry/client/documents/ambient-light.d.mts +12 -5
- package/src/foundry/client/documents/ambient-sound.d.mts +12 -5
- package/src/foundry/client/documents/card.d.mts +11 -6
- package/src/foundry/client/documents/cards.d.mts +13 -6
- package/src/foundry/client/documents/chat-message.d.mts +15 -8
- package/src/foundry/client/documents/collections/compendium-collection.d.mts +2 -0
- package/src/foundry/client/documents/combat.d.mts +12 -5
- package/src/foundry/client/documents/combatant-group.d.mts +12 -5
- package/src/foundry/client/documents/combatant.d.mts +12 -5
- package/src/foundry/client/documents/drawing.d.mts +12 -5
- package/src/foundry/client/documents/fog-exploration.d.mts +12 -5
- package/src/foundry/client/documents/folder.d.mts +13 -6
- package/src/foundry/client/documents/item.d.mts +10 -5
- package/src/foundry/client/documents/journal-entry-category.d.mts +12 -5
- package/src/foundry/client/documents/journal-entry-page.d.mts +12 -5
- package/src/foundry/client/documents/journal-entry.d.mts +12 -5
- package/src/foundry/client/documents/macro.d.mts +12 -5
- package/src/foundry/client/documents/measured-template.d.mts +12 -5
- package/src/foundry/client/documents/note.d.mts +12 -5
- package/src/foundry/client/documents/playlist-sound.d.mts +12 -5
- package/src/foundry/client/documents/playlist.d.mts +12 -5
- package/src/foundry/client/documents/region-behavior.d.mts +12 -5
- package/src/foundry/client/documents/region.d.mts +12 -5
- package/src/foundry/client/documents/roll-table.d.mts +13 -6
- package/src/foundry/client/documents/scene.d.mts +12 -5
- package/src/foundry/client/documents/setting.d.mts +8 -1
- package/src/foundry/client/documents/table-result.d.mts +12 -5
- package/src/foundry/client/documents/tile.d.mts +12 -5
- package/src/foundry/client/documents/token.d.mts +15 -12
- package/src/foundry/client/documents/user.d.mts +10 -5
- package/src/foundry/client/documents/wall.d.mts +12 -5
- package/src/foundry/client/helpers/client-settings.d.mts +7 -3
- package/src/foundry/common/abstract/document.d.mts +98 -50
- package/src/foundry/common/abstract/type-data.d.mts +35 -10
- package/src/foundry/common/data/data.d.mts +2 -2
- package/src/foundry/common/data/fields.d.mts +71 -59
- package/src/foundry/common/documents/active-effect.d.mts +6 -5
- package/src/foundry/common/documents/actor-delta.d.mts +6 -5
- package/src/foundry/common/documents/actor.d.mts +6 -5
- package/src/foundry/common/documents/adventure.d.mts +6 -5
- package/src/foundry/common/documents/ambient-light.d.mts +6 -5
- package/src/foundry/common/documents/ambient-sound.d.mts +6 -5
- package/src/foundry/common/documents/card.d.mts +6 -5
- package/src/foundry/common/documents/cards.d.mts +6 -5
- package/src/foundry/common/documents/chat-message.d.mts +6 -5
- package/src/foundry/common/documents/combat.d.mts +6 -5
- package/src/foundry/common/documents/combatant-group.d.mts +6 -5
- package/src/foundry/common/documents/combatant.d.mts +6 -5
- package/src/foundry/common/documents/drawing.d.mts +6 -5
- package/src/foundry/common/documents/fog-exploration.d.mts +6 -5
- package/src/foundry/common/documents/folder.d.mts +6 -5
- package/src/foundry/common/documents/item.d.mts +6 -5
- package/src/foundry/common/documents/journal-entry-category.d.mts +6 -5
- package/src/foundry/common/documents/journal-entry-page.d.mts +6 -5
- package/src/foundry/common/documents/journal-entry.d.mts +6 -5
- package/src/foundry/common/documents/macro.d.mts +6 -5
- package/src/foundry/common/documents/measured-template.d.mts +6 -5
- package/src/foundry/common/documents/note.d.mts +6 -5
- package/src/foundry/common/documents/playlist-sound.d.mts +6 -5
- package/src/foundry/common/documents/playlist.d.mts +6 -5
- package/src/foundry/common/documents/region-behavior.d.mts +6 -5
- package/src/foundry/common/documents/region.d.mts +6 -5
- package/src/foundry/common/documents/roll-table.d.mts +6 -5
- package/src/foundry/common/documents/scene.d.mts +6 -5
- package/src/foundry/common/documents/setting.d.mts +4 -3
- package/src/foundry/common/documents/table-result.d.mts +6 -5
- package/src/foundry/common/documents/tile.d.mts +6 -5
- package/src/foundry/common/documents/token.d.mts +6 -5
- package/src/foundry/common/documents/user.d.mts +6 -5
- package/src/foundry/common/documents/wall.d.mts +6 -5
- package/src/foundry/common/packages/base-world.d.mts +31 -29
- package/src/types/augments/pixi.d.mts +4 -0
- package/tsconfig.json +1 -4
@@ -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<
|
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
|
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<
|
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
|
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<
|
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
|
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<
|
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
|
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<
|
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<
|
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
|
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
|
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<
|
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
|
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<
|
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
|
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<
|
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
|
-
|
1090
|
-
|
1091
|
-
|
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
|
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<
|
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
|
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<
|
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
|
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)
|
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<
|