diff --git a/src/types/helperTypes.d.mts b/src/types/helperTypes.d.mts deleted file mode 100644 index 4e5737452..000000000 --- a/src/types/helperTypes.d.mts +++ /dev/null @@ -1,222 +0,0 @@ -import type { Operation } from "../foundry/common/abstract/document.d.mts"; -import type Document from "../foundry/common/abstract/document.d.mts"; -import type * as utils from "../utils/index.d.mts"; - -/** - * @deprecated No replacement. - */ -export type ModuleRequiredOrOptional = Name extends keyof RequiredModules ? never : undefined; - -/** - * @deprecated without replacement, use `ConfiguredModule` instead. - */ -export type ConfiguredModuleData = utils.ConfiguredModuleData; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type ConfiguredModule = utils.ConfiguredModule; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type LoggingLevels = utils.LoggingLevels; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type GetKey = utils.GetKey; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type IntentionalPartial = utils.IntentionalPartial; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type OverlapsWith = utils.OverlapsWith; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type ArrayOverlaps = utils.ArrayOverlaps; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type MakeConform = utils.MakeConform; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type MustConform = utils.MustConform; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type InterfaceToObject = utils.InterfaceToObject; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type ConformRecord = utils.ConformRecord; - -/** - * @deprecated {@link Document.DatabaseOperationsFor | `Document.DatabaseOperationsFor`}. - */ -export type DatabaseOperationsFor< - Name extends Document.Type, - ConcreteOperation extends Operation, -> = Document.DatabaseOperationsFor; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type ToMethod = utils.ToMethod; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type Brand = utils.Brand; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type PrettifyType = utils.PrettifyType; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type PrettifyTypeDeep = utils.PrettifyTypeDeep; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type UnionToIntersection = (U extends unknown ? (arg: U) => void : never) extends (arg: infer I) => void - ? I - : never; - -/** - * @deprecated {@link Document.ConfiguredSheetClassFor | `Document.ConfiguredSheetClassFor`} - */ -export type ConfiguredSheetClass = Document.ConfiguredSheetClassFor - -/** - * @deprecated {@link Document.ConfiguredObjectClassFor | `Document.ConfiguredObjectClassFor`} - */ -export type ObjectClass = Document.ConfiguredObjectClassFor; - -/** - * @deprecated {@link Document.ConfiguredLayerClassFor | `Document.ConfiguredLayerClassFor`} - */ -export type LayerClass = Document.ConfiguredLayerClassFor; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type MaybeEmpty = - | T - | { - [K in keyof T]?: never; - }; - -/** - * The following uses `extends object` instead of `AnyObject` to allow `O = typeof SomeClass` - */ -export type PropertiesOfType = { - [K in keyof O]: [O[K], T] extends [T, O[K]] ? K : never; -}[keyof O]; - -/** - * @deprecated {@link Folder.DocumentType | `Folder.DocumentType`}. - */ -export type FolderDocumentTypes = Folder.DocumentType; - -/** - * @deprecated {@link Document.SystemType | `Document.SystemType`}. - */ -type DocumentTypeWithTypeData = Document.SystemType; - -/** - * @deprecated {@link Document.AnyConstructor | `Document.ConstructorDataFor`}. - */ -export type ConstructorDataType = Document.ConstructorDataFor; - -/** - * @deprecated {@link Document.AnyConstructor | `Document.AnyConstructor`}. - */ -export type DocumentConstructor = Document.AnyConstructor; - -/** - * @deprecated {@link Document.ToConfiguredClass | `Document.ToConfiguredClass`}. - */ -export type ConfiguredDocumentClass = - Document.ToConfiguredClass; - -/** - * @deprecated {@link Document.ToConfiguredInstance | `Document.Configured.Instance`}. - */ -export type ConfiguredDocumentInstance = - Document.ToConfiguredInstance; - -/** - * @deprecated {@link Document.Type | `Document.Type`}. - */ -export type DocumentType = Document.Type; - -/** - * @deprecated {@link Document.PlaceableType | `Document.PlaceableType`}. - */ -export type PlaceableDocumentType = Document.PlaceableType; - -/** - * @deprecated {@link Document.SubTypesOf | `Document.SubTypesOf`}. - */ -export type DocumentSubTypes = Document.SubTypesOf; - -/** - * @deprecated {@link Document.ConfiguredClassForName | `Document.ConfiguredClassForName`}. - */ -export type ConfiguredDocumentClassForName = Document.ConfiguredClassForName; - -/** - * @deprecated {@link Document.ConfiguredInstanceForName | `Document.ConfiguredInstanceForName`}. - */ -export type ConfiguredDocumentInstanceForName = Document.ConfiguredInstanceForName; - -/** - * @deprecated {@link Document.ConfiguredObjectClassForName | `Document.ConfiguredObjectClassForName`}. - */ -export type ConfiguredObjectClassForName = - Document.ConfiguredObjectClassForName; - -/** - * @deprecated {@link PlaceablesLayer.ConfiguredClassForName | `PlaceablesLayer.ConfiguredClassForName`}. - */ -export type ConfiguredLayerClassForName = CONFIG[Name]["layerClass"]; - -/** - * @deprecated {@link Document.ConfiguredDataForName | `Document.ConfiguredDataForName`}. - */ -export type ConfiguredData = Document.ConfiguredDataForName>; - -/** - * @deprecated {@link Document.ConfiguredDataForName | `Document.ConfiguredDataForName`}. - */ -export type ConfiguredSource = Document.ConfiguredDataForName>; - -/** - * @deprecated {@link Document.ConfiguredFlagsForName | `Document.ConfiguredFlagsForName`}. - */ -export type ConfiguredFlags = Document.ConfiguredFlagsForName>; - -/** - * @deprecated {@link Document.ToObjectFalseType | `Document.ToObjectFalseType`}. - */ -export type ToObjectFalseType = Document.ToObjectFalseType>; - -/** - * @deprecated {@link PropertyKey | `PropertyKey`} - */ -export type AnyKey = keyof any; diff --git a/src/types/index.d.mts b/src/types/index.d.mts index 4bb9efb25..f544a387c 100644 --- a/src/types/index.d.mts +++ b/src/types/index.d.mts @@ -1,5 +1,3 @@ import "./augments/index.d.mts"; import "./config.d.mts"; import "./documentConfiguration.d.mts"; -import "./utils.d.mts"; -import "./helperTypes.d.mts"; diff --git a/src/types/utils.d.mts b/src/types/utils.d.mts deleted file mode 100644 index eab20527a..000000000 --- a/src/types/utils.d.mts +++ /dev/null @@ -1,212 +0,0 @@ -import type { Document } from "../foundry/common/abstract/module.d.mts"; -import type * as utils from "../utils/index.d.mts"; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type DeepPartial = utils.DeepPartial; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type AllKeysOf = utils.AllKeysOf; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type InexactPartial = utils.AllKeysOf> = utils.InexactPartial< - T, - K ->; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type NullishProps = utils.AllKeysOf> = utils.NullishProps< - T, - K ->; - -/** - * @deprecated - Deprecated with no replacement. This type is almost always an anti-pattern because - * going from the instance-side of a class to a constructor loses static properties. Where you would - * reach for `ConstructorOf` you should instead generally use the class directly. Specifically use - * `ClassName.AnyConstructor` if that exists or make `AnyConstructor` yourself. - * - * The `AnyConstructor` type differentiates itself from `typeof ClassName` by truly allowing any - * constructor, including abstract ones unlike `ConstructorOf`. Writing `AnyConstructor` is a manual - * process and is likely impossible to ergonomically automate. - * - * The reason why `AnyConstructor` has to be written manually is because of a few reasons that - * culminate in a human authorship being required. Firstly the type parameters must be given the most - * appropriate supertype. For most type parameters this is their constraint. - * - * For example `T extends number` in most cases should probably be substituted with `number`. However - * formally speaking this depends on the variance of `T`. `never` is more appropriate for contravariant - * type parameters and `any` is the only appropriate type for invariant type parameters. - * - * This determination could be done automatically in a type but a lack of first class higher-kinded type - * support makes it impossible to pass a generic constructor of any size and operate over its type parameters - * and bounds. There are in theory ways more limited ways involving passing it through a `HKT` interface but - * would require breaking the signature of `ConstructorOf` anyways and is probably more boilerplate than its worth. - */ -export type ConstructorOf = new (arg0: never, ...args: never[]) => T; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type Expanded = utils.Expanded; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type ValueOf = utils.ValueOf; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type ConcreteKeys = utils.ConcreteKeys; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type RemoveIndexSignatures = utils.RemoveIndexSignatures; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type Titlecase = utils.Titlecase; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type Merge = utils.Merge; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type IsObject = utils.IsObject; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type SimpleMerge = utils.SimpleMerge; - -/** - * @deprecated - {@link GetKey | `GetKey`} - */ -export type PropertyTypeOrFallback = Key extends keyof T ? T[Key] : Fallback; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type RequiredProps = utils.RequiredProps< - Extract, - Extract>> ->; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type Mixin = utils.Mixin< - MixinClass, - BaseClass ->; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type GetDataReturnType = utils.GetDataReturnType; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type HandleEmptyObject = utils.HandleEmptyObject; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type AnyObject = utils.AnyObject; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type AnyMutableObject = utils.AnyMutableObject; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type AnyArray = utils.AnyArray; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type MutableArray = utils.MutableArray; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type AnyFunction = utils.AnyFunction; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type AnyConstructor = utils.AnyConstructor; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type AnyConcreteConstructor = utils.AnyConcreteConstructor; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type MustBePromise = utils.MustBePromise; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type MaybePromise = utils.MaybePromise; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type NonNullish = utils.NonNullish; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type EmptyObject = utils.EmptyObject; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type ShapeWithIndexSignature< - T extends utils.AnyObject, - // Uses `extends object` to allow interfaces and if useful other objects. - PrimaryShape extends object, - IndexSignature extends PropertyKey, - IndexType, -> = utils.ShapeWithIndexSignature; - -/** - * @deprecated import from `fvtt-types/utils` instead. - */ -export type Defer = utils.Defer; - -/** - * @deprecated {@link Document.ToConfiguredStored | `Document.ToConfiguredStored`} - */ -export type ConfiguredStoredDocument = Document.ToConfiguredStored; - -/** - * @deprecated {@link Document.Stored | `Document.Stored`} - */ -export type StoredDocument = Document.Stored< - utils.MakeConform ->; - -/** - * @deprecated {@link Document.Temporary | `Document.Temporary`} - */ -export type TemporaryDocument = Document.Temporary>;