@league-of-foundry-developers/foundry-vtt-types 13.346.0-beta.20250811030058 → 13.346.0-beta.20250811234631
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.
|
4
|
+
"version": "13.346.0-beta.20250811234631",
|
5
5
|
"description": "TypeScript type definitions for Foundry VTT",
|
6
6
|
"type": "module",
|
7
7
|
"types": "./src/index.d.mts",
|
@@ -164,14 +164,14 @@
|
|
164
164
|
"type-fest": "^4.41.0",
|
165
165
|
"typescript": "^5.8.2",
|
166
166
|
"typescript-eslint": "^8.31.0",
|
167
|
-
"vitest": "^4.0.0-beta.
|
167
|
+
"vitest": "^4.0.0-beta.7"
|
168
168
|
},
|
169
169
|
"overrides": {
|
170
170
|
"expect-type": "^1.2.2"
|
171
171
|
},
|
172
172
|
"peerDependencies": {
|
173
|
-
"typescript": "
|
174
|
-
"
|
173
|
+
"@typescript/native-preview": "*",
|
174
|
+
"typescript": "^5.4"
|
175
175
|
},
|
176
176
|
"peerDependenciesMeta": {
|
177
177
|
"typescript": {
|
@@ -1,13 +1,5 @@
|
|
1
1
|
import type { DataModel } from "../abstract/data.d.mts";
|
2
|
-
import type {
|
3
|
-
AnyMutableObject,
|
4
|
-
EmptyObject,
|
5
|
-
GetKey,
|
6
|
-
NullishCoalesce,
|
7
|
-
RemoveIndexSignatures,
|
8
|
-
ToMethod,
|
9
|
-
ValueOf,
|
10
|
-
} from "#utils";
|
2
|
+
import type { AnyMutableObject, GetKey, NullishCoalesce, RemoveIndexSignatures, ToMethod, ValueOf } from "#utils";
|
11
3
|
import type { SchemaField } from "./fields.d.mts";
|
12
4
|
|
13
5
|
import fields = foundry.data.fields;
|
@@ -612,8 +604,9 @@ declare namespace TextureData {
|
|
612
604
|
* A {@linkcode fields.SchemaField} subclass used to represent texture data.
|
613
605
|
*/
|
614
606
|
declare class TextureData<
|
615
|
-
SrcOptions extends TextureData.SrcOptions = TextureData.DefaultOptions,
|
616
|
-
|
607
|
+
const SrcOptions extends TextureData.SrcOptions = TextureData.DefaultOptions,
|
608
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
609
|
+
const SchemaOptions extends fields.SchemaField.Options<TextureData.Schema<SrcOptions>> = {},
|
617
610
|
> extends fields.SchemaField<TextureData.Schema<SrcOptions>, SchemaOptions> {
|
618
611
|
/**
|
619
612
|
* @param options - Options which are forwarded to the SchemaField constructor
|
@@ -540,14 +540,11 @@ declare namespace DataField {
|
|
540
540
|
* @deprecated AssignmentType is being deprecated. See {@linkcode SchemaField.AssignmentData}
|
541
541
|
* for more details.
|
542
542
|
*/
|
543
|
-
type AssignmentTypeFor<ConcreteDataField extends Any> =
|
544
|
-
ConcreteDataField extends DataField<any, infer AssignmentType, any, any> ? AssignmentType : never;
|
543
|
+
type AssignmentTypeFor<ConcreteDataField extends Any> = ConcreteDataField[" __fvtt_types_internal_assignment_data"];
|
545
544
|
|
546
|
-
type InitializedTypeFor<ConcreteDataField extends Any> =
|
547
|
-
ConcreteDataField extends DataField<any, any, infer InitializedType, any> ? InitializedType : never;
|
545
|
+
type InitializedTypeFor<ConcreteDataField extends Any> = ConcreteDataField[" __fvtt_types_internal_initialized_data"];
|
548
546
|
|
549
|
-
type PersistedTypeFor<ConcreteDataField extends Any> =
|
550
|
-
ConcreteDataField extends DataField<any, any, any, infer PersistedType> ? PersistedType : never;
|
547
|
+
type PersistedTypeFor<ConcreteDataField extends Any> = ConcreteDataField[" __fvtt_types_internal_source_data"];
|
551
548
|
|
552
549
|
/** The type of the default options for the {@linkcode DataField} class. */
|
553
550
|
interface DefaultOptions {
|
@@ -894,15 +891,12 @@ declare abstract class AnyDataField extends DataField<any, any, any, any> {
|
|
894
891
|
* - PersistedType: `SchemaField.PersistedType<Fields>`
|
895
892
|
*/
|
896
893
|
declare class SchemaField<
|
897
|
-
Fields extends DataSchema,
|
898
|
-
Options extends SchemaField.Options<Fields> = SchemaField.DefaultOptions,
|
894
|
+
const Fields extends DataSchema,
|
895
|
+
const Options extends SchemaField.Options<Fields> = SchemaField.DefaultOptions,
|
899
896
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
900
|
-
AssignmentType = SchemaField.Internal.AssignmentType<Fields,
|
901
|
-
InitializedType = SchemaField.Internal.InitializedType<Fields,
|
902
|
-
PersistedType extends AnyObject | null | undefined = SchemaField.Internal.PersistedType<
|
903
|
-
Fields,
|
904
|
-
SimpleMerge<Options, SchemaField.DefaultOptions>
|
905
|
-
>,
|
897
|
+
const AssignmentType = SchemaField.Internal.AssignmentType<Fields, Options>,
|
898
|
+
const InitializedType = SchemaField.Internal.InitializedType<Fields, Options>,
|
899
|
+
const PersistedType extends AnyObject | null | undefined = SchemaField.Internal.PersistedType<Fields, Options>,
|
906
900
|
>
|
907
901
|
extends DataField<Options, AssignmentType, InitializedType, PersistedType>
|
908
902
|
implements DataField.Internal.NestedFieldImplementation
|
@@ -1100,7 +1094,8 @@ declare namespace SchemaField {
|
|
1100
1094
|
*/
|
1101
1095
|
type AssignmentData<Fields extends DataSchema> = PrettifyType<
|
1102
1096
|
RemoveIndexSignatures<{
|
1103
|
-
|
1097
|
+
// Note(LukeAbby): Simply stripping off `readonly` may eventually need to be revisited.
|
1098
|
+
-readonly [Key in keyof Fields]?: Fields[Key][" __fvtt_types_internal_assignment_data"];
|
1104
1099
|
}>
|
1105
1100
|
>;
|
1106
1101
|
|
@@ -1108,10 +1103,24 @@ declare namespace SchemaField {
|
|
1108
1103
|
* The required type of data used when updating a document.
|
1109
1104
|
* @template Fields - the DataSchema fields of the SchemaField
|
1110
1105
|
*/
|
1111
|
-
// Note(LukeAbby): Currently this is
|
1106
|
+
// Note(LukeAbby): Currently this is too close to `AssignmentData` but the intent is to make it
|
1112
1107
|
// more accurate in the future.
|
1113
|
-
|
1114
|
-
|
1108
|
+
type UpdateData<Fields extends DataSchema> = _AddUpdateKeys<
|
1109
|
+
RemoveIndexSignatures<{
|
1110
|
+
-readonly [Key in keyof Fields]?: Fields[Key][" __fvtt_types_internal_assignment_data"];
|
1111
|
+
}>
|
1112
|
+
>;
|
1113
|
+
|
1114
|
+
/** @internal */
|
1115
|
+
type _AddUpdateKeys<T> = PrettifyType<
|
1116
|
+
T & {
|
1117
|
+
[K in keyof T as K extends string ? (T[K] extends undefined ? `-=${K}` : never) : never]?: null;
|
1118
|
+
} & {
|
1119
|
+
// Note(LukeAbby): There's more work to be done here. For example `type` and `==system` must
|
1120
|
+
// go together. This will be added once a performant validator type is created.
|
1121
|
+
[K in keyof T as K extends string ? `==${K}` : never]?: T[K];
|
1122
|
+
}
|
1123
|
+
>;
|
1115
1124
|
|
1116
1125
|
/**
|
1117
1126
|
* Gets the initialized version of a schema. This means a
|
@@ -1119,7 +1128,7 @@ declare namespace SchemaField {
|
|
1119
1128
|
*/
|
1120
1129
|
type InitializedData<Fields extends DataSchema> = PrettifyType<
|
1121
1130
|
RemoveIndexSignatures<{
|
1122
|
-
[Key in keyof Fields]: Fields[Key][" __fvtt_types_internal_initialized_data"];
|
1131
|
+
-readonly [Key in keyof Fields]: Fields[Key][" __fvtt_types_internal_initialized_data"];
|
1123
1132
|
}>
|
1124
1133
|
>;
|
1125
1134
|
|
@@ -1129,13 +1138,13 @@ declare namespace SchemaField {
|
|
1129
1138
|
*/
|
1130
1139
|
type SourceData<Fields extends DataSchema> = PrettifyType<
|
1131
1140
|
RemoveIndexSignatures<{
|
1132
|
-
[Key in keyof Fields]: Fields[Key][" __fvtt_types_internal_source_data"];
|
1141
|
+
-readonly [Key in keyof Fields]: Fields[Key][" __fvtt_types_internal_source_data"];
|
1133
1142
|
}>
|
1134
1143
|
>;
|
1135
1144
|
|
1136
1145
|
type UpdateSourceData<Fields extends DataSchema> = PrettifyType<
|
1137
1146
|
RemoveIndexSignatures<{
|
1138
|
-
[Key in keyof Fields]: Fields[Key][" __fvtt_types_internal_initialized_data"];
|
1147
|
+
-readonly [Key in keyof Fields]: Fields[Key][" __fvtt_types_internal_initialized_data"];
|
1139
1148
|
}>
|
1140
1149
|
>;
|
1141
1150
|
|
@@ -2559,16 +2568,16 @@ declare namespace ArrayField {
|
|
2559
2568
|
* - InitialValue: `new Set()`
|
2560
2569
|
*/
|
2561
2570
|
declare class SetField<
|
2562
|
-
ElementFieldType extends DataField.Any,
|
2563
|
-
Options extends SetField.AnyOptions = SetField.DefaultOptions,
|
2571
|
+
const ElementFieldType extends DataField.Any,
|
2572
|
+
const Options extends SetField.AnyOptions = SetField.DefaultOptions,
|
2564
2573
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
2565
|
-
AssignmentElementType = ArrayField.AssignmentElementType<ElementFieldType>,
|
2566
|
-
InitializedElementType = ArrayField.InitializedElementType<ElementFieldType>,
|
2574
|
+
const AssignmentElementType = ArrayField.AssignmentElementType<ElementFieldType>,
|
2575
|
+
const InitializedElementType = ArrayField.InitializedElementType<ElementFieldType>,
|
2567
2576
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
2568
|
-
AssignmentType = SetField.AssignmentType<AssignmentElementType, Options>,
|
2569
|
-
InitializedType = SetField.InitializedType<InitializedElementType, Options>,
|
2570
|
-
PersistedElementType = ArrayField.PersistedElementType<ElementFieldType>,
|
2571
|
-
PersistedType extends PersistedElementType[] | null | undefined = SetField.PersistedType<
|
2577
|
+
const AssignmentType = SetField.AssignmentType<AssignmentElementType, Options>,
|
2578
|
+
const InitializedType = SetField.InitializedType<InitializedElementType, Options>,
|
2579
|
+
const PersistedElementType = ArrayField.PersistedElementType<ElementFieldType>,
|
2580
|
+
const PersistedType extends PersistedElementType[] | null | undefined = SetField.PersistedType<
|
2572
2581
|
PersistedElementType,
|
2573
2582
|
Options
|
2574
2583
|
>,
|
@@ -2844,24 +2853,24 @@ declare namespace EmbeddedDataField {
|
|
2844
2853
|
* - InitialValue: `[]`
|
2845
2854
|
*/
|
2846
2855
|
declare class EmbeddedCollectionField<
|
2847
|
-
ElementFieldType extends Document.AnyConstructor,
|
2856
|
+
const ElementFieldType extends Document.AnyConstructor,
|
2848
2857
|
// TODO(LukeAbby): See if `ParentDataModel` can be made redundant by automatically inferring.
|
2849
|
-
ParentDataModel extends Document.Any,
|
2850
|
-
Options extends EmbeddedCollectionField.Options<any> = EmbeddedCollectionField.DefaultOptions,
|
2858
|
+
const ParentDataModel extends Document.Any,
|
2859
|
+
const Options extends EmbeddedCollectionField.Options<any> = EmbeddedCollectionField.DefaultOptions,
|
2851
2860
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
2852
|
-
AssignmentElementType = EmbeddedCollectionField.AssignmentElementType<ElementFieldType>,
|
2853
|
-
InitializedElementType extends
|
2861
|
+
const AssignmentElementType = EmbeddedCollectionField.AssignmentElementType<ElementFieldType>,
|
2862
|
+
const InitializedElementType extends
|
2854
2863
|
Document.Internal.Instance.Any = EmbeddedCollectionField.InitializedElementType<ElementFieldType>,
|
2855
2864
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
2856
|
-
AssignmentType = EmbeddedCollectionField.AssignmentType<AssignmentElementType, Options>,
|
2857
|
-
InitializedType = EmbeddedCollectionField.InitializedType<
|
2865
|
+
const AssignmentType = EmbeddedCollectionField.AssignmentType<AssignmentElementType, Options>,
|
2866
|
+
const InitializedType = EmbeddedCollectionField.InitializedType<
|
2858
2867
|
AssignmentElementType,
|
2859
2868
|
InitializedElementType,
|
2860
2869
|
ParentDataModel,
|
2861
2870
|
Options
|
2862
2871
|
>,
|
2863
|
-
PersistedElementType = EmbeddedCollectionField.PersistedElementType<ElementFieldType>,
|
2864
|
-
PersistedType extends PersistedElementType[] | null | undefined = EmbeddedCollectionField.PersistedType<
|
2872
|
+
const PersistedElementType = EmbeddedCollectionField.PersistedElementType<ElementFieldType>,
|
2873
|
+
const PersistedType extends PersistedElementType[] | null | undefined = EmbeddedCollectionField.PersistedType<
|
2865
2874
|
AssignmentElementType,
|
2866
2875
|
PersistedElementType,
|
2867
2876
|
Options
|
@@ -3095,23 +3104,23 @@ declare namespace EmbeddedCollectionField {
|
|
3095
3104
|
* - InitialValue: `[]`
|
3096
3105
|
*/
|
3097
3106
|
declare class EmbeddedCollectionDeltaField<
|
3098
|
-
ElementFieldType extends Document.AnyConstructor,
|
3099
|
-
ParentDataModel extends Document.Any,
|
3100
|
-
Options extends EmbeddedCollectionDeltaField.Options<any> = EmbeddedCollectionDeltaField.DefaultOptions,
|
3107
|
+
const ElementFieldType extends Document.AnyConstructor,
|
3108
|
+
const ParentDataModel extends Document.Any,
|
3109
|
+
const Options extends EmbeddedCollectionDeltaField.Options<any> = EmbeddedCollectionDeltaField.DefaultOptions,
|
3101
3110
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
3102
|
-
AssignmentElementType = EmbeddedCollectionDeltaField.AssignmentElementType<ElementFieldType>,
|
3103
|
-
InitializedElementType extends
|
3111
|
+
const AssignmentElementType = EmbeddedCollectionDeltaField.AssignmentElementType<ElementFieldType>,
|
3112
|
+
const InitializedElementType extends
|
3104
3113
|
Document.Internal.Instance.Any = EmbeddedCollectionDeltaField.InitializedElementType<ElementFieldType>,
|
3105
3114
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
3106
|
-
AssignmentType = EmbeddedCollectionDeltaField.AssignmentType<AssignmentElementType, Options>,
|
3107
|
-
InitializedType = EmbeddedCollectionDeltaField.InitializedType<
|
3115
|
+
const AssignmentType = EmbeddedCollectionDeltaField.AssignmentType<AssignmentElementType, Options>,
|
3116
|
+
const InitializedType = EmbeddedCollectionDeltaField.InitializedType<
|
3108
3117
|
AssignmentElementType,
|
3109
3118
|
InitializedElementType,
|
3110
3119
|
ParentDataModel,
|
3111
3120
|
Options
|
3112
3121
|
>,
|
3113
|
-
PersistedElementType = EmbeddedCollectionDeltaField.PersistedElementType<ElementFieldType>,
|
3114
|
-
PersistedType extends PersistedElementType[] | null | undefined = EmbeddedCollectionDeltaField.PersistedType<
|
3122
|
+
const PersistedElementType = EmbeddedCollectionDeltaField.PersistedElementType<ElementFieldType>,
|
3123
|
+
const PersistedType extends PersistedElementType[] | null | undefined = EmbeddedCollectionDeltaField.PersistedType<
|
3115
3124
|
AssignmentElementType,
|
3116
3125
|
PersistedElementType,
|
3117
3126
|
Options
|
@@ -3380,11 +3389,11 @@ declare namespace EmbeddedDocumentField {
|
|
3380
3389
|
* - InitialValue: `null`
|
3381
3390
|
*/
|
3382
3391
|
declare class DocumentIdField<
|
3383
|
-
Options extends DocumentIdField.Options = DocumentIdField.DefaultOptions,
|
3392
|
+
const Options extends DocumentIdField.Options = DocumentIdField.DefaultOptions,
|
3384
3393
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
3385
|
-
AssignmentType = DocumentIdField.AssignmentType<Options>,
|
3386
|
-
InitializedType = DocumentIdField.InitializedType<Options>,
|
3387
|
-
PersistedType extends string | null | undefined = DocumentIdField.InitializedType<Options>,
|
3394
|
+
const AssignmentType = DocumentIdField.AssignmentType<Options>,
|
3395
|
+
const InitializedType = DocumentIdField.InitializedType<Options>,
|
3396
|
+
const PersistedType extends string | null | undefined = DocumentIdField.InitializedType<Options>,
|
3388
3397
|
> extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
|
3389
3398
|
/** @defaultValue `true` */
|
3390
3399
|
override required: boolean;
|
@@ -3573,12 +3582,12 @@ declare namespace DocumentUUIDField {
|
|
3573
3582
|
* - InitialValue: `null`
|
3574
3583
|
*/
|
3575
3584
|
declare class ForeignDocumentField<
|
3576
|
-
DocumentType extends Document.AnyConstructor,
|
3577
|
-
Options extends ForeignDocumentField.Options = ForeignDocumentField.DefaultOptions,
|
3585
|
+
const DocumentType extends Document.AnyConstructor,
|
3586
|
+
const Options extends ForeignDocumentField.Options = ForeignDocumentField.DefaultOptions,
|
3578
3587
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
3579
|
-
AssignmentType = ForeignDocumentField.AssignmentType<DocumentType, Options>,
|
3580
|
-
InitializedType = ForeignDocumentField.InitializedType<DocumentType, Options>,
|
3581
|
-
PersistedType extends string | null | undefined = ForeignDocumentField.PersistedType<Options>,
|
3588
|
+
const AssignmentType = ForeignDocumentField.AssignmentType<DocumentType, Options>,
|
3589
|
+
const InitializedType = ForeignDocumentField.InitializedType<DocumentType, Options>,
|
3590
|
+
const PersistedType extends string | null | undefined = ForeignDocumentField.PersistedType<Options>,
|
3582
3591
|
> extends DocumentIdField<Options, AssignmentType, InitializedType, PersistedType> {
|
3583
3592
|
/**
|
3584
3593
|
* @param model - The foreign DataModel class definition which this field should link to.
|
@@ -3692,11 +3701,11 @@ declare namespace ForeignDocumentField {
|
|
3692
3701
|
* - InitialValue: `null`
|
3693
3702
|
*/
|
3694
3703
|
declare class ColorField<
|
3695
|
-
Options extends StringField.Options = ColorField.DefaultOptions,
|
3704
|
+
const Options extends StringField.Options = ColorField.DefaultOptions,
|
3696
3705
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
3697
|
-
AssignmentType = ColorField.AssignmentType<Options>,
|
3698
|
-
InitializedType = ColorField.InitializedType<Options>,
|
3699
|
-
PersistedType extends string | null | undefined = ColorField.PersistedType<Options>,
|
3706
|
+
const AssignmentType = ColorField.AssignmentType<Options>,
|
3707
|
+
const InitializedType = ColorField.InitializedType<Options>,
|
3708
|
+
const PersistedType extends string | null | undefined = ColorField.PersistedType<Options>,
|
3700
3709
|
> extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
|
3701
3710
|
/** @defaultValue `true` */
|
3702
3711
|
override nullable: boolean;
|
@@ -3798,11 +3807,11 @@ declare namespace ColorField {
|
|
3798
3807
|
* - InitialValue: `null`
|
3799
3808
|
*/
|
3800
3809
|
declare class FilePathField<
|
3801
|
-
Options extends FilePathField.Options = FilePathField.DefaultOptions,
|
3810
|
+
const Options extends FilePathField.Options = FilePathField.DefaultOptions,
|
3802
3811
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
3803
|
-
AssignmentType = FilePathField.AssignmentType<Options>,
|
3804
|
-
InitializedType = FilePathField.InitializedType<Options>,
|
3805
|
-
PersistedType extends string | null | undefined = FilePathField.InitializedType<Options>,
|
3812
|
+
const AssignmentType = FilePathField.AssignmentType<Options>,
|
3813
|
+
const InitializedType = FilePathField.InitializedType<Options>,
|
3814
|
+
const PersistedType extends string | null | undefined = FilePathField.InitializedType<Options>,
|
3806
3815
|
> extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
|
3807
3816
|
/**
|
3808
3817
|
* @param options - Options which configure the behavior of the field
|
@@ -3932,11 +3941,11 @@ declare namespace FilePathField {
|
|
3932
3941
|
* - InitialValue: `0`
|
3933
3942
|
*/
|
3934
3943
|
declare class AngleField<
|
3935
|
-
Options extends AngleField.Options = AngleField.DefaultOptions,
|
3944
|
+
const Options extends AngleField.Options = AngleField.DefaultOptions,
|
3936
3945
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
3937
|
-
AssignmentType = AngleField.AssignmentType<Options>,
|
3938
|
-
InitializedType = AngleField.InitializedType<Options>,
|
3939
|
-
PersistedType extends number | null | undefined = AngleField.InitializedType<Options>,
|
3946
|
+
const AssignmentType = AngleField.AssignmentType<Options>,
|
3947
|
+
const InitializedType = AngleField.InitializedType<Options>,
|
3948
|
+
const PersistedType extends number | null | undefined = AngleField.InitializedType<Options>,
|
3940
3949
|
> extends NumberField<Options, AssignmentType, InitializedType, PersistedType> {
|
3941
3950
|
/**
|
3942
3951
|
* @param options - Options which configure the behavior of the field
|
@@ -4046,11 +4055,11 @@ declare namespace AngleField {
|
|
4046
4055
|
* - InitialValue: `1`
|
4047
4056
|
*/
|
4048
4057
|
declare class AlphaField<
|
4049
|
-
Options extends NumberField.Options = AlphaField.DefaultOptions,
|
4058
|
+
const Options extends NumberField.Options = AlphaField.DefaultOptions,
|
4050
4059
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
4051
|
-
AssignmentType = AlphaField.AssignmentType<Options>,
|
4052
|
-
InitializedType = AlphaField.InitializedType<Options>,
|
4053
|
-
PersistedType extends number | null | undefined = AlphaField.InitializedType<Options>,
|
4060
|
+
const AssignmentType = AlphaField.AssignmentType<Options>,
|
4061
|
+
const InitializedType = AlphaField.InitializedType<Options>,
|
4062
|
+
const PersistedType extends number | null | undefined = AlphaField.InitializedType<Options>,
|
4054
4063
|
> extends NumberField<Options, AssignmentType, InitializedType, PersistedType> {
|
4055
4064
|
/** @defaultValue `true` */
|
4056
4065
|
override required: boolean;
|
@@ -4155,12 +4164,12 @@ declare namespace HueField {
|
|
4155
4164
|
* This can only be changed later by GM users.
|
4156
4165
|
*/
|
4157
4166
|
declare class DocumentAuthorField<
|
4158
|
-
DocumentType extends Document.AnyConstructor,
|
4159
|
-
Options extends DocumentAuthorField.Options = DocumentAuthorField.DefaultOptions,
|
4167
|
+
const DocumentType extends Document.AnyConstructor,
|
4168
|
+
const Options extends DocumentAuthorField.Options = DocumentAuthorField.DefaultOptions,
|
4160
4169
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
4161
|
-
AssignmentType = ForeignDocumentField.AssignmentType<DocumentType, Options>,
|
4162
|
-
InitializedType = ForeignDocumentField.InitializedType<DocumentType, Options>,
|
4163
|
-
PersistedType extends string | null | undefined = ForeignDocumentField.PersistedType<Options>,
|
4170
|
+
const AssignmentType = ForeignDocumentField.AssignmentType<DocumentType, Options>,
|
4171
|
+
const InitializedType = ForeignDocumentField.InitializedType<DocumentType, Options>,
|
4172
|
+
const PersistedType extends string | null | undefined = ForeignDocumentField.PersistedType<Options>,
|
4164
4173
|
> extends ForeignDocumentField<DocumentType, Options, AssignmentType, InitializedType, PersistedType> {
|
4165
4174
|
/** @defaultValue `true` */
|
4166
4175
|
override nullable: boolean;
|
@@ -4202,11 +4211,11 @@ declare namespace DocumentAuthorField {
|
|
4202
4211
|
* - InitialValue: `{ default: DOCUMENT_OWNERSHIP_LEVELS.NONE }`
|
4203
4212
|
*/
|
4204
4213
|
declare class DocumentOwnershipField<
|
4205
|
-
Options extends DocumentOwnershipField.Options = DocumentOwnershipField.DefaultOptions,
|
4214
|
+
const Options extends DocumentOwnershipField.Options = DocumentOwnershipField.DefaultOptions,
|
4206
4215
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
4207
|
-
AssignmentType = DocumentOwnershipField.AssignmentType<Options>,
|
4208
|
-
InitializedType = DocumentOwnershipField.InitializedType<Options>,
|
4209
|
-
PersistedType extends
|
4216
|
+
const AssignmentType = DocumentOwnershipField.AssignmentType<Options>,
|
4217
|
+
const InitializedType = DocumentOwnershipField.InitializedType<Options>,
|
4218
|
+
const PersistedType extends
|
4210
4219
|
| Record<string, DOCUMENT_OWNERSHIP_LEVELS>
|
4211
4220
|
| null
|
4212
4221
|
| undefined = DocumentOwnershipField.InitializedType<Options>,
|
@@ -4287,11 +4296,11 @@ declare namespace DocumentOwnershipField {
|
|
4287
4296
|
*/
|
4288
4297
|
declare class JSONField<
|
4289
4298
|
// TODO(LukeAbby): Due to the unconditional setting of `blank`, `trim`, and `choices` setting them is meaningless which basically means they're removed from the options.
|
4290
|
-
Options extends StringField.Options = JSONField.DefaultOptions,
|
4299
|
+
const Options extends StringField.Options = JSONField.DefaultOptions,
|
4291
4300
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
4292
|
-
AssignmentType = JSONField.AssignmentType<Options>,
|
4293
|
-
InitializedType = JSONField.InitializedType<Options>,
|
4294
|
-
PersistedType extends string | null | undefined = JSONField.PersistedType<Options>,
|
4301
|
+
const AssignmentType = JSONField.AssignmentType<Options>,
|
4302
|
+
const InitializedType = JSONField.InitializedType<Options>,
|
4303
|
+
const PersistedType extends string | null | undefined = JSONField.PersistedType<Options>,
|
4295
4304
|
> extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
|
4296
4305
|
// options: not null (unchecked `in` operation in super), context: not null (destructured in super)
|
4297
4306
|
constructor(options?: Options, context?: DataField.ConstructionContext);
|
@@ -4444,11 +4453,11 @@ declare class AnyField extends DataField<DataField.Options.Any, unknown, unknown
|
|
4444
4453
|
* - InitialValue: `""`
|
4445
4454
|
*/
|
4446
4455
|
declare class HTMLField<
|
4447
|
-
Options extends StringField.Options = HTMLField.DefaultOptions,
|
4456
|
+
const Options extends StringField.Options = HTMLField.DefaultOptions,
|
4448
4457
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
4449
|
-
AssignmentType = HTMLField.AssignmentType<Options>,
|
4450
|
-
InitializedType = HTMLField.InitializedType<Options>,
|
4451
|
-
PersistedType extends string | null | undefined = HTMLField.InitializedType<Options>,
|
4458
|
+
const AssignmentType = HTMLField.AssignmentType<Options>,
|
4459
|
+
const InitializedType = HTMLField.InitializedType<Options>,
|
4460
|
+
const PersistedType extends string | null | undefined = HTMLField.InitializedType<Options>,
|
4452
4461
|
> extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
|
4453
4462
|
/** @defaultValue `true` */
|
4454
4463
|
override required: boolean;
|
@@ -4538,11 +4547,11 @@ declare namespace HTMLField {
|
|
4538
4547
|
* - InitialValue: `0`
|
4539
4548
|
*/
|
4540
4549
|
declare class IntegerSortField<
|
4541
|
-
Options extends NumberField.Options = IntegerSortField.DefaultOptions,
|
4550
|
+
const Options extends NumberField.Options = IntegerSortField.DefaultOptions,
|
4542
4551
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
4543
|
-
AssignmentType = IntegerSortField.AssignmentType<Options>,
|
4544
|
-
InitializedType = IntegerSortField.InitializedType<Options>,
|
4545
|
-
PersistedType extends number | null | undefined = IntegerSortField.InitializedType<Options>,
|
4552
|
+
const AssignmentType = IntegerSortField.AssignmentType<Options>,
|
4553
|
+
const InitializedType = IntegerSortField.InitializedType<Options>,
|
4554
|
+
const PersistedType extends number | null | undefined = IntegerSortField.InitializedType<Options>,
|
4546
4555
|
> extends NumberField<Options, AssignmentType, InitializedType, PersistedType> {
|
4547
4556
|
/** @defaultValue `true` */
|
4548
4557
|
override required: boolean;
|
@@ -4604,10 +4613,10 @@ declare namespace IntegerSortField {
|
|
4604
4613
|
* A subclass of {@linkcode TypedObjectField} that is used specifically for the Document "flags" field.
|
4605
4614
|
*/
|
4606
4615
|
declare class DocumentFlagsField<
|
4607
|
-
Name extends Document.Type,
|
4616
|
+
const Name extends Document.Type,
|
4608
4617
|
// The type `{}` is useful here because in an intersection it reduces down to nothing unlike `EmptyObject`.
|
4609
4618
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
4610
|
-
ExtensionFlags extends AnyObject = {},
|
4619
|
+
const ExtensionFlags extends AnyObject = {},
|
4611
4620
|
const Options extends DocumentFlagsField.Options = DocumentFlagsField.DefaultOptions,
|
4612
4621
|
> extends TypedObjectField<
|
4613
4622
|
ObjectField,
|
@@ -4709,11 +4718,11 @@ declare namespace DocumentFlagsField {
|
|
4709
4718
|
*/
|
4710
4719
|
// TODO: exclude everything in DocumentStatsField.managedFields from AssignmentType
|
4711
4720
|
declare class DocumentStatsField<
|
4712
|
-
Options extends DocumentStatsField.Options = DocumentStatsField.DefaultOptions,
|
4721
|
+
const Options extends DocumentStatsField.Options = DocumentStatsField.DefaultOptions,
|
4713
4722
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
4714
|
-
AssignmentType = DocumentStatsField.AssignmentType<Options>,
|
4715
|
-
InitializedType = DocumentStatsField.InitializedType<Options>,
|
4716
|
-
PersistedType extends AnyObject | null | undefined = DocumentStatsField.PersistedType<Options>,
|
4723
|
+
const AssignmentType = DocumentStatsField.AssignmentType<Options>,
|
4724
|
+
const InitializedType = DocumentStatsField.InitializedType<Options>,
|
4725
|
+
const PersistedType extends AnyObject | null | undefined = DocumentStatsField.PersistedType<Options>,
|
4717
4726
|
> extends SchemaField<DocumentStatsField.Schema, Options, AssignmentType, InitializedType, PersistedType> {
|
4718
4727
|
/**
|
4719
4728
|
* @param options - Options which configure the behavior of the field
|