ParseFunction: { <T extends ZodType<any, ZodTypeDef, any>>( data: TypeOf<T>, envelope: undefined, schema: T, safeParse?: false, ): TypeOf<T>; <T extends ZodType<any, ZodTypeDef, any>>( data: TypeOf<T>, envelope: undefined, schema: T, safeParse: true, ): ParsedResult<TypeOf<T>>; <T extends ZodType<any, ZodTypeDef, any>, E extends Envelope>( data: unknown, envelope: E, schema: T, safeParse?: false, ): E extends ArrayEnvelope ? TypeOf<T>[] : TypeOf<T>; <T extends ZodType<any, ZodTypeDef, any>, E extends Envelope>( data: unknown, envelope: E, schema: T, safeParse: true, ): E extends ArrayEnvelope ? ParsedResult<unknown, TypeOf<T>[]> : ParsedResult<unknown, TypeOf<T>>; < T extends ZodType<any, ZodTypeDef, any>, E extends Envelope, S extends boolean = false, >( data: unknown, envelope: E, schema: T, safeParse?: S, ): S extends true ? E extends ArrayEnvelope ? ParsedResult<unknown, TypeOf<T>[]> : ParsedResult<unknown, TypeOf<T>> : E extends ArrayEnvelope ? TypeOf<T>[] : TypeOf<T>;} Type declaration
- <T extends ZodType<any, ZodTypeDef, any>>(
data: TypeOf<T>,
envelope: undefined,
schema: T,
safeParse?: false,
): TypeOf<T> Type Parameters
- T extends ZodType<any, ZodTypeDef, any>
Parameters
- data: TypeOf<T>
- envelope: undefined
- schema: T
Optional
safeParse: false
Returns TypeOf<T>
- <T extends ZodType<any, ZodTypeDef, any>>(
data: TypeOf<T>,
envelope: undefined,
schema: T,
safeParse: true,
): ParsedResult<TypeOf<T>> Type Parameters
- T extends ZodType<any, ZodTypeDef, any>
Parameters
- data: TypeOf<T>
- envelope: undefined
- schema: T
- safeParse: true
- <T extends ZodType<any, ZodTypeDef, any>, E extends Envelope>(
data: unknown,
envelope: E,
schema: T,
safeParse?: false,
): E extends ArrayEnvelope ? TypeOf<T>[] : TypeOf<T> Type Parameters
- T extends ZodType<any, ZodTypeDef, any>
- E extends Envelope
Parameters
- data: unknown
- envelope: E
- schema: T
Optional
safeParse: false
Returns E extends ArrayEnvelope ? TypeOf<T>[] : TypeOf<T>
- <T extends ZodType<any, ZodTypeDef, any>, E extends Envelope>(
data: unknown,
envelope: E,
schema: T,
safeParse: true,
): E extends ArrayEnvelope
? ParsedResult<unknown, TypeOf<T>[]>
: ParsedResult<unknown, TypeOf<T>> Type Parameters
- T extends ZodType<any, ZodTypeDef, any>
- E extends Envelope
Parameters
- data: unknown
- envelope: E
- schema: T
- safeParse: true
- <
T extends ZodType<any, ZodTypeDef, any>,
E extends Envelope,
S extends boolean = false,
>(
data: unknown,
envelope: E,
schema: T,
safeParse?: S,
): S extends true
? E extends ArrayEnvelope
? ParsedResult<unknown, TypeOf<T>[]>
: ParsedResult<unknown, TypeOf<T>>
: E extends ArrayEnvelope ? TypeOf<T>[] : TypeOf<T> Type Parameters
- T extends ZodType<any, ZodTypeDef, any>
- E extends Envelope
- S extends boolean = false
Parameters
- data: unknown
- envelope: E
- schema: T
Optional
safeParse: S
The parser function that can parse the data using the provided schema and envelope we use function overloads to provide the correct return type based on the provided envelope