import { Ensure, Evaluate } from '../helpers/index'; import { TSchema } from '../schema/index'; import { TArray } from '../array/index'; import { TAsyncIterator } from '../async-iterator/index'; import { TConstructor } from '../constructor/index'; import { TEnum, TEnumRecord } from '../enum/index'; import { TFunction } from '../function/index'; import { TIntersect } from '../intersect/index'; import { TIterator } from '../iterator/index'; import { TObject, TProperties } from '../object/index'; import { TOptional } from '../optional/index'; import { TRecord } from '../record/index'; import { TReadonly } from '../readonly/index'; import { TRef } from '../ref/index'; import { TTuple } from '../tuple/index'; import { TUnion } from '../union/index'; import { Static } from '../static/index'; import { TRecursive } from '../recursive/index'; type TInferArray = (Ensure>>); type TInferAsyncIterator = (Ensure>>); type TInferConstructor = Ensure) => TInfer>; type TInferFunction = Ensure<(...args: TInferTuple) => TInfer>; type TInferIterator = (Ensure>>); type TInferIntersect = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TInferIntersect> : Result); type ReadonlyOptionalPropertyKeys = { [Key in keyof Properties]: Properties[Key] extends TReadonly ? (Properties[Key] extends TOptional ? Key : never) : never; }[keyof Properties]; type ReadonlyPropertyKeys = { [Key in keyof Source]: Source[Key] extends TReadonly ? (Source[Key] extends TOptional ? never : Key) : never; }[keyof Source]; type OptionalPropertyKeys = { [Key in keyof Source]: Source[Key] extends TOptional ? (Source[Key] extends TReadonly ? never : Key) : never; }[keyof Source]; type RequiredPropertyKeys = keyof Omit | ReadonlyPropertyKeys | OptionalPropertyKeys>; type InferPropertiesWithModifiers> = Evaluate<(Readonly>>> & Readonly>> & Partial>> & Required>>)>; type InferProperties = InferPropertiesWithModifiers; }>; type TInferObject = (InferProperties); type TInferTuple = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TInferTuple]> : Result); type TInferRecord extends infer Key extends PropertyKey ? Key : never, InferedType extends unknown = TInfer> = Ensure<{ [_ in InferredKey]: InferedType; }>; type TInferRef = (Ref extends keyof ModuleProperties ? TInfer : unknown); type TInferUnion = (Types extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TInferUnion> : Result); type TInfer = (Type extends TArray ? TInferArray : Type extends TAsyncIterator ? TInferAsyncIterator : Type extends TConstructor ? TInferConstructor : Type extends TFunction ? TInferFunction : Type extends TIntersect ? TInferIntersect : Type extends TIterator ? TInferIterator : Type extends TObject ? TInferObject : Type extends TRecord ? TInferRecord : Type extends TRef ? TInferRef : Type extends TTuple ? TInferTuple : Type extends TEnum ? Static : Type extends TUnion ? TInferUnion : Type extends TRecursive ? TInfer : Static); /** Inference Path for Imports. This type is used to compute TImport `static` */ export type TInferFromModuleKey = (Key extends keyof ModuleProperties ? TInfer : never); export {};