Skip to main content

optimal

Index

Type aliases

AnyFunction

AnyFunction: (...args: any[]) => any

AnySchema

AnySchema: Schema<any>

Blueprint

Blueprint<T>: { [ K in keyof T ]-?: Schema<T[K]> }

Type parameters

  • T: object

Builtin

Builtin: Date | Error | Function | RegExp

Constructor

Constructor<T>: abstract new (...args: any[]) => T | new (...args: any[]) => T

Type parameters

  • T

CriteriaFactory

CriteriaFactory<Input>: (state: SchemaState<Input>, ...args: any[]) => Criteria<Input> | void

Type parameters

  • Input

CriteriaValidator

CriteriaValidator<Input>: (value: Input, path: string, options: SchemaValidateOptions) => unknown

Type parameters

  • Input

DeepPartial

DeepPartial<T>: T extends Builtin | Primitive | unknown[] ? T : T extends object ? { [ K in keyof T ]?: DeepPartial<T[K]> } : T

Type parameters

  • T

DefaultValue

DefaultValue<T>: DefaultValueInitializer<T> | T

Type parameters

  • T

DefaultValueInitializer

DefaultValueInitializer<T>: (path: string, currentObject: UnknownObject, rootObject: UnknownObject) => T

Type parameters

  • T

Infer

Infer<T>: T extends Schema<infer U> ? U : T extends Record<string, AnySchema> ? InferFromObject<T> : T extends AnySchema[] ? InferFromObject<T> : never

Infer the underlying type from a schema.


Type parameters

  • T

InferFromObject

InferFromObject<T>: { [ K in keyof T ]: Infer<T[K]> }

Type parameters

  • T

InferNullable

InferNullable<P, N>: P extends null ? N | null : N

Type parameters

  • P
  • N

InferSchemaType

InferSchemaType<T>: T extends Schema<infer U> ? U : never

Type parameters

  • T

MaybeDate

MaybeDate: Date | number | string

NotNull

NotNull<T>: T extends null ? never : T

Type parameters

  • T

NotUndefined

NotUndefined<T>: T extends undefined ? never : T

Type parameters

  • T

Predicate

Predicate<T>: (value: T | null | undefined) => boolean

Type parameters

  • T

Primitive

Primitive: bigint | boolean | number | string | symbol | null | undefined

Schemas

Schemas: typeof schemas

Transformer

Transformer<T>: (value: T) => T

Type parameters

  • T

UnknownObject

UnknownObject: Record<string, unknown>

ValueComparator

ValueComparator<T>: (value: T, currentObject?: UnknownObject, rootObject?: UnknownObject) => boolean

Type parameters

  • T

WhenCondition

WhenCondition<T>: T | ValueComparator<T>

Type parameters

  • T