zod
Advanced tools
Comparing version 2.0.0-alpha.4 to 2.0.0-alpha.5
@@ -44,3 +44,3 @@ import { ZodString, ZodStringDef } from './types/string'; | ||
declare const recordType: <Value extends ZodType<any, import("./types/base").ZodTypeDef> = ZodType<any, import("./types/base").ZodTypeDef>>(valueType: Value) => ZodRecord<Value>; | ||
declare const functionType: <T extends ZodTuple<any>, U extends ZodType<any, import("./types/base").ZodTypeDef>>(args?: T | undefined, returns?: U | undefined) => ZodFunction<T, U>; | ||
declare const functionType: <T extends ZodTuple<any> = ZodTuple<[]>, U extends ZodType<any, import("./types/base").ZodTypeDef> = ZodVoid>(args?: T | undefined, returns?: U | undefined) => ZodFunction<T, U>; | ||
declare const literalType: <T extends import("./helpers/primitive").Primitive>(value: T) => ZodLiteral<T>; | ||
@@ -47,0 +47,0 @@ declare const enumType: <U extends string, T extends [U, ...U[]]>(values: T) => ZodEnum<T>; |
@@ -6,2 +6,3 @@ import * as z from './base'; | ||
import { ZodUnion } from './union'; | ||
import { ZodVoid } from './void'; | ||
export interface ZodFunctionDef<Args extends ZodTuple<any> = ZodTuple<any>, Returns extends z.ZodTypeAny = z.ZodTypeAny> extends z.ZodTypeDef { | ||
@@ -20,3 +21,3 @@ t: z.ZodTypes.function; | ||
validate: (func: TypeOfFunction<Args, Returns>) => TypeOfFunction<Args, Returns>; | ||
static create: <T extends ZodTuple<any>, U extends z.ZodType<any, z.ZodTypeDef>>(args?: T | undefined, returns?: U | undefined) => ZodFunction<T, U>; | ||
static create: <T extends ZodTuple<any> = ZodTuple<[]>, U extends z.ZodType<any, z.ZodTypeDef> = ZodVoid>(args?: T | undefined, returns?: U | undefined) => ZodFunction<T, U>; | ||
optional: () => ZodUnion<[this, ZodUndefined]>; | ||
@@ -23,0 +24,0 @@ nullable: () => ZodUnion<[this, ZodNull]>; |
{ | ||
"name": "zod", | ||
"version": "2.0.0-alpha.4", | ||
"version": "2.0.0-alpha.5", | ||
"description": "TypeScript-first schema declaration and validation library with static type inference", | ||
@@ -5,0 +5,0 @@ "main": "./lib/src/index.js", |
Sorry, the diff of this file is not supported yet
290234
4378