Skip to main content

Interface: ZodPreprocess<B, I>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:720

Extends​

Type Parameters​

B​

B extends SomeType = $ZodType

I​

I = unknown

Properties​

_def​

_def: $ZodPipeDef<$ZodTransform<unknown, I>, B>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:11

Deprecated​

Use .def instead.

Inherited from​

ZodPipe._def


_input​

_input: I

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:15

Deprecated​

Use z.input<typeof schema> instead.

Inherited from​

ZodPipe._input


_output​

_output: output<B>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:13

Deprecated​

Use z.output<typeof schema> instead.

Inherited from​

ZodPipe._output


_zod​

_zod: $ZodPreprocessInternals<B, I>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:722

Overrides​

ZodPipe._zod


~standard​

~standard: ZodStandardSchemaWithJSON<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:721

Overrides​

ZodPipe.~standard


def​

def: $ZodPreprocessDef<B, I>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:723

Overrides​

ZodPipe.def


description?​

optional description: string

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:63

Inherited from​

ZodPipe.description


in​

in: $ZodTransform

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:704

Inherited from​

ZodPipe.in


out​

out: B

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:705

Inherited from​

ZodPipe.out


spa()​

spa: (data, params?) => Promise<ZodSafeParseResult<output<B>>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:30

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

Promise<ZodSafeParseResult<output<B>>>

Inherited from​

ZodPipe.spa


type​

type: "pipe"

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:9

Inherited from​

ZodPipe.type

Methods​

and()​

and<T>(incoming): ZodIntersection<ZodPreprocess<B, I>, T>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:55

Type Parameters​

T​

T extends SomeType

Parameters​

incoming​

T

Returns​

ZodIntersection<ZodPreprocess<B, I>, T>

Inherited from​

ZodPipe.and


apply()​

apply<T, TArgs>(fn, ...args): T

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:85

Type Parameters​

T​

T

TArgs​

TArgs extends unknown[] = []

Parameters​

fn​

(schema, ...args) => T

args​

...TArgs

Returns​

T

Inherited from​

ZodPipe.apply


array()​

array(): ZodArray<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:53

Returns​

ZodArray<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.array


brand()​

brand<T, Dir>(value?): PropertyKey extends T ? ZodPreprocess<B, I> : $ZodBranded<ZodPreprocess<B, I>, T, Dir>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:25

Type Parameters​

T​

T extends PropertyKey = PropertyKey

Dir​

Dir extends "inout" | "in" | "out" = "out"

Parameters​

value?​

T

Returns​

PropertyKey extends T ? ZodPreprocess<B, I> : $ZodBranded<ZodPreprocess<B, I>, T, Dir>

Inherited from​

ZodPipe.brand


catch()​

Call Signature​

catch(def): ZodCatch<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:57

Parameters​
def​

output<B>

Returns​

ZodCatch<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.catch

Call Signature​

catch(def): ZodCatch<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:58

Parameters​
def​

(ctx) => output<B>

Returns​

ZodCatch<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.catch


check()​

check(...checks): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:19

Parameters​

checks​

...(CheckFn<output<B>> | $ZodCheck<output<B>>)[]

Returns​

this

Inherited from​

ZodPipe.check


clone()​

clone(def?, params?): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:21

Parameters​

def?​

$ZodPipeDef<$ZodTransform<unknown, I>, B>

params?​
parent​

boolean

Returns​

this

Inherited from​

ZodPipe.clone


decode()​

decode(data, params?): output<B>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:34

Parameters​

data​

I

params?​

ParseContext<$ZodIssue>

Returns​

output<B>

Inherited from​

ZodPipe.decode


decodeAsync()​

decodeAsync(data, params?): Promise<output<B>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:36

Parameters​

data​

I

params?​

ParseContext<$ZodIssue>

Returns​

Promise<output<B>>

Inherited from​

ZodPipe.decodeAsync


default()​

Call Signature​

default(def): ZodDefault<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:49

Parameters​
def​

NoUndefined<output<B>>

Returns​

ZodDefault<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.default

Call Signature​

default(def): ZodDefault<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:50

Parameters​
def​

() => NoUndefined<output<B>>

Returns​

ZodDefault<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.default


describe()​

describe(description): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:62

Returns a new instance that has been registered in z.globalRegistry with the specified description

Parameters​

description​

string

Returns​

this

Inherited from​

ZodPipe.describe


encode()​

encode(data, params?): I

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:33

Parameters​

data​

output<B>

params?​

ParseContext<$ZodIssue>

Returns​

I

Inherited from​

ZodPipe.encode


encodeAsync()​

encodeAsync(data, params?): Promise<I>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:35

Parameters​

data​

output<B>

params?​

ParseContext<$ZodIssue>

Returns​

Promise<I>

Inherited from​

ZodPipe.encodeAsync


exactOptional()​

exactOptional(): ZodExactOptional<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:45

Returns​

ZodExactOptional<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.exactOptional


isNullable()​

isNullable(): boolean

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:84

Returns​

boolean

Deprecated​

Try safe-parsing null (this is what isNullable does internally):

const schema = z.string().nullable();
const isNullable = schema.safeParse(null).success; // true

Inherited from​

ZodPipe.isNullable


isOptional()​

isOptional(): boolean

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:75

Returns​

boolean

Deprecated​

Try safe-parsing undefined (this is what isOptional does internally):

const schema = z.string().optional();
const isOptional = schema.safeParse(undefined).success; // true

Inherited from​

ZodPipe.isOptional


meta()​

Call Signature​

meta(): {[key: string]: unknown; deprecated?: boolean; description?: string; id?: string; title?: string; } | undefined

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:65

Returns the metadata associated with this instance in z.globalRegistry

Returns​

{[key: string]: unknown; deprecated?: boolean; description?: string; id?: string; title?: string; } | undefined

Inherited from​

ZodPipe.meta

Call Signature​

meta(data): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:67

Returns a new instance that has been registered in z.globalRegistry with the specified metadata

Parameters​
data​
deprecated?​

boolean

description?​

string

id?​

string

title?​

string

Returns​

this

Inherited from​

ZodPipe.meta


nonoptional()​

nonoptional(params?): ZodNonOptional<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:46

Parameters​

params?​

string |

{ error?: string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>; message?: string; }

error?​

string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>

message?​

string

Deprecated

This parameter is deprecated. Use error instead.

Returns​

ZodNonOptional<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.nonoptional


nullable()​

nullable(): ZodNullable<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:47

Returns​

ZodNullable<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.nullable


nullish()​

nullish(): ZodOptional<ZodNullable<ZodPreprocess<B, I>>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:48

Returns​

ZodOptional<ZodNullable<ZodPreprocess<B, I>>>

Inherited from​

ZodPipe.nullish


optional()​

optional(): ZodOptional<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:44

Returns​

ZodOptional<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.optional


or()​

or<T>(option): ZodUnion<[ZodPreprocess<B, I>, T]>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:54

Type Parameters​

T​

T extends SomeType

Parameters​

option​

T

Returns​

ZodUnion<[ZodPreprocess<B, I>, T]>

Inherited from​

ZodPipe.or


overwrite()​

overwrite(fn): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:43

Parameters​

fn​

(x) => output<B>

Returns​

this

Inherited from​

ZodPipe.overwrite


parse()​

parse(data, params?): output<B>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:26

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

output<B>

Inherited from​

ZodPipe.parse


parseAsync()​

parseAsync(data, params?): Promise<output<B>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:28

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

Promise<output<B>>

Inherited from​

ZodPipe.parseAsync


pipe()​

pipe<T>(target): ZodPipe<ZodPreprocess<B, I>, T>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:59

Type Parameters​

T​

T extends $ZodType<any, output<B>, $ZodTypeInternals<any, output<B>>>

Parameters​

target​

T | $ZodType<any, output<B>, $ZodTypeInternals<any, output<B>>>

Returns​

ZodPipe<ZodPreprocess<B, I>, T>

Inherited from​

ZodPipe.pipe


prefault()​

Call Signature​

prefault(def): ZodPrefault<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:51

Parameters​
def​

() => I

Returns​

ZodPrefault<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.prefault

Call Signature​

prefault(def): ZodPrefault<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:52

Parameters​
def​

I

Returns​

ZodPrefault<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.prefault


readonly()​

readonly(): ZodReadonly<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:60

Returns​

ZodReadonly<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.readonly


refine()​

refine<Ch>(check, params?): Ch extends (arg) => arg is R ? ZodPreprocess<B, I> & ZodType<R, I, $ZodTypeInternals<R, I>> : ZodPreprocess<B, I>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:41

Type Parameters​

Ch​

Ch extends (arg) => unknown

Parameters​

check​

Ch

params?​

string |

{ abort?: boolean; error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>; message?: string; params?: Record<string, any>; path?: PropertyKey[]; when?: (payload) => boolean; }

abort?​

boolean

If true, no later checks will be executed if this check fails. Default false.

error?​

string | $ZodErrorMap<NonNullable<$ZodIssue>>

message?​

string

Deprecated

This parameter is deprecated. Use error instead.

params?​

Record<string, any>

path?​

PropertyKey[]

when?​

(payload) => boolean

If provided, the check runs only when this returns true. By default, it is skipped if prior parsing produced aborting issues.

Returns​

Ch extends (arg) => arg is R ? ZodPreprocess<B, I> & ZodType<R, I, $ZodTypeInternals<R, I>> : ZodPreprocess<B, I>

Inherited from​

ZodPipe.refine


register()​

register<R>(registry, ...meta): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:24

Type Parameters​

R​

R extends $ZodRegistry<MetadataType, $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>

Parameters​

registry​

R

meta​

...ZodPreprocess<B, I> extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], R["_schema"] & ZodPreprocess<B, I>>?] : [$replace<R["_meta"], R["_schema"] & ZodPreprocess<B, I>>] : ["Incompatible schema"]

Returns​

this

Inherited from​

ZodPipe.register


safeDecode()​

safeDecode(data, params?): ZodSafeParseResult<output<B>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:38

Parameters​

data​

I

params?​

ParseContext<$ZodIssue>

Returns​

ZodSafeParseResult<output<B>>

Inherited from​

ZodPipe.safeDecode


safeDecodeAsync()​

safeDecodeAsync(data, params?): Promise<ZodSafeParseResult<output<B>>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:40

Parameters​

data​

I

params?​

ParseContext<$ZodIssue>

Returns​

Promise<ZodSafeParseResult<output<B>>>

Inherited from​

ZodPipe.safeDecodeAsync


safeEncode()​

safeEncode(data, params?): ZodSafeParseResult<I>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:37

Parameters​

data​

output<B>

params?​

ParseContext<$ZodIssue>

Returns​

ZodSafeParseResult<I>

Inherited from​

ZodPipe.safeEncode


safeEncodeAsync()​

safeEncodeAsync(data, params?): Promise<ZodSafeParseResult<I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:39

Parameters​

data​

output<B>

params?​

ParseContext<$ZodIssue>

Returns​

Promise<ZodSafeParseResult<I>>

Inherited from​

ZodPipe.safeEncodeAsync


safeParse()​

safeParse(data, params?): ZodSafeParseResult<output<B>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:27

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

ZodSafeParseResult<output<B>>

Inherited from​

ZodPipe.safeParse


safeParseAsync()​

safeParseAsync(data, params?): Promise<ZodSafeParseResult<output<B>>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:29

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

Promise<ZodSafeParseResult<output<B>>>

Inherited from​

ZodPipe.safeParseAsync


superRefine()​

superRefine(refinement, params?): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:42

Parameters​

refinement​

(arg, ctx) => void | Promise<void>

params?​

$ZodSuperRefineParams

Returns​

this

Inherited from​

ZodPipe.superRefine


toJSONSchema()​

toJSONSchema(params?): ZodStandardJSONSchemaPayload<ZodPreprocess<B, I>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:18

Converts this schema to a JSON Schema representation.

Parameters​

params?​

ToJSONSchemaParams

Returns​

ZodStandardJSONSchemaPayload<ZodPreprocess<B, I>>

Inherited from​

ZodPipe.toJSONSchema


transform()​

transform<NewOut>(transform): ZodPipe<ZodPreprocess<B, I>, ZodTransform<Awaited<NewOut>, output<B>>>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:56

Type Parameters​

NewOut​

NewOut

Parameters​

transform​

(arg, ctx) => NewOut | Promise<NewOut>

Returns​

ZodPipe<ZodPreprocess<B, I>, ZodTransform<Awaited<NewOut>, output<B>>>

Inherited from​

ZodPipe.transform


validate()​

validate(data, params?): data is I

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:31

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

data is I

Inherited from​

ZodPipe.validate


validateAsync()​

validateAsync(data, params?): Promise<boolean>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:32

Parameters​

data​

unknown

params?​

ParseContext<$ZodIssue>

Returns​

Promise<boolean>

Inherited from​

ZodPipe.validateAsync


with()​

with(...checks): this

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:20

Parameters​

checks​

...(CheckFn<output<B>> | $ZodCheck<output<B>>)[]

Returns​

this

Inherited from​

ZodPipe.with