UNPKG

dilswer

Version:

Blazingly fast data validation library with TypeScript integration.

49 lines (48 loc) 2.58 kB
import type { AnyType, OptionalField, RecordTypeSchema } from "./type-types"; import { ArrayType } from "./types/array"; import { BooleanType } from "./types/boolean"; import { CustomType } from "./types/custom"; import { DictType } from "./types/dict"; import { EnumType } from "./types/enum"; import { EnumMemberType } from "./types/enum-member"; import { FunctionType } from "./types/function"; import { InstanceOfType } from "./types/instance"; import { IntegerType } from "./types/integer"; import { IntersectionType } from "./types/intersection"; import { LiteralType } from "./types/literal"; import { NullType } from "./types/null"; import { NumberType } from "./types/number"; import { RecordType } from "./types/record"; import { RecursiveType, RecursiveTypeReference } from "./types/recursive"; import { SetType } from "./types/set"; import { StringType } from "./types/string"; import { SymbolType } from "./types/symbol"; import { TupleType } from "./types/tuple"; import { UndefinedType } from "./types/undefined"; import { UnionType } from "./types/union"; import { UnknownType } from "./types/unknown"; export declare const Type: { readonly Unknown: UnknownType; readonly String: StringType; readonly Number: NumberType; readonly Int: IntegerType; readonly Boolean: BooleanType; readonly Symbol: SymbolType; readonly Function: FunctionType; readonly Null: NullType; readonly Undefined: UndefinedType; Record<TS extends RecordTypeSchema>(args: TS): RecordType<TS>; Dict<DT extends AnyType[]>(...args: DT): DictType<DT>; Array<DT_1 extends AnyType[]>(...args: DT_1): ArrayType<DT_1>; Tuple<DT_2 extends AnyType[]>(...args: DT_2): TupleType<DT_2>; Set<DT_3 extends AnyType[]>(...args: DT_3): SetType<DT_3>; OneOf<DT_4 extends AnyType[]>(...args: DT_4): UnionType<DT_4>; AllOf<DT_5 extends AnyType[]>(...args: DT_5): IntersectionType<DT_5>; Literal<V extends (string | number | boolean)[]>(...values: V): UnionType<[LiteralType<V[number]>]>; EnumMember<M extends string | number>(enumMember: M): EnumMemberType<M>; Enum<T extends string, TEnumValue extends string | number>(enumInstance: { [key in T]: TEnumValue; }): EnumType<TEnumValue>; InstanceOf<DT_6>(instanceOf: new (...args: any[]) => DT_6): InstanceOfType<DT_6>; Custom<VF extends (v: any) => v is any>(validateFunction: VF): CustomType<VF>; Recursive<DT_7 extends AnyType>(getDataType: (ref: RecursiveTypeReference) => DT_7): RecursiveType<DT_7>; Option<DT_8 extends AnyType>(type: DT_8): OptionalField<DT_8>; };