Interface: ZodLiteral<T>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:621
Extends
Type Parameters
T
Properties
_def
_def:
$ZodLiteralDef<T>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:11
Deprecated
Use .def instead.
Inherited from
_input
_input:
T
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:15
Deprecated
Use z.input<typeof schema> instead.
Inherited from
_output
_output:
T
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:13
Deprecated
Use z.output<typeof schema> instead.
Inherited from
_zod
_zod:
$ZodLiteralInternals
Defined in: packages/agentos/node_modules/zod/v4/core/schemas.d.cts:111
Inherited from
~standard
~standard:
ZodStandardSchemaWithJSON<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:622
Overrides
def
def:
$ZodLiteralDef<T>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:8
Inherited from
description?
optionaldescription:string
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:63
Inherited from
spa()
spa: (
data,params?) =>Promise<ZodSafeParseResult<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:30
Parameters
data
unknown
params?
Returns
Promise<ZodSafeParseResult<T>>
Inherited from
type
type:
"literal"
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:9
Inherited from
value
value:
T
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:625
Legacy
Use .values instead. Accessing this property will throw an error if the literal accepts multiple values.
values
values:
Set<T>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:623
Methods
and()
and<
T>(incoming):ZodIntersection<ZodLiteral<T>,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<ZodLiteral<T>, T>
Inherited from
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
array()
array():
ZodArray<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:53
Returns
ZodArray<ZodLiteral<T>>
Inherited from
brand()
brand<
T,Dir>(value?):PropertyKeyextendsT?ZodLiteral<T> :$ZodBranded<ZodLiteral<T>,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 ? ZodLiteral<T> : $ZodBranded<ZodLiteral<T>, T, Dir>
Inherited from
catch()
Call Signature
catch(
def):ZodCatch<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:57
Parameters
def
T
Returns
ZodCatch<ZodLiteral<T>>
Inherited from
Call Signature
catch(
def):ZodCatch<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:58
Parameters
def
(ctx) => T
Returns
ZodCatch<ZodLiteral<T>>
Inherited from
check()
check(...
checks):this
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:19
Parameters
checks
...(CheckFn<T> | $ZodCheck<T>)[]
Returns
this
Inherited from
clone()
clone(
def?,params?):this
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:21
Parameters
def?
params?
parent
boolean
Returns
this
Inherited from
decode()
decode(
data,params?):T
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:34
Parameters
data
T
params?
Returns
T
Inherited from
decodeAsync()
decodeAsync(
data,params?):Promise<T>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:36
Parameters
data
T
params?
Returns
Promise<T>
Inherited from
default()
Call Signature
default(
def):ZodDefault<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:49
Parameters
def
NoUndefined<T>
Returns
ZodDefault<ZodLiteral<T>>
Inherited from
Call Signature
default(
def):ZodDefault<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:50
Parameters
def
() => NoUndefined<T>
Returns
ZodDefault<ZodLiteral<T>>
Inherited from
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
encode()
encode(
data,params?):T
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:33
Parameters
data
T
params?
Returns
T
Inherited from
encodeAsync()
encodeAsync(
data,params?):Promise<T>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:35
Parameters
data
T
params?
Returns
Promise<T>
Inherited from
exactOptional()
exactOptional():
ZodExactOptional<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:45
Returns
ZodExactOptional<ZodLiteral<T>>
Inherited from
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
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
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
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
nonoptional()
nonoptional(
params?):ZodNonOptional<ZodLiteral<T>>
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<ZodLiteral<T>>
Inherited from
nullable()
nullable():
ZodNullable<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:47
Returns
ZodNullable<ZodLiteral<T>>
Inherited from
nullish()
nullish():
ZodOptional<ZodNullable<ZodLiteral<T>>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:48
Returns
ZodOptional<ZodNullable<ZodLiteral<T>>>
Inherited from
optional()
optional():
ZodOptional<ZodLiteral<T>>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:44
Returns
ZodOptional<ZodLiteral<T>>
Inherited from
or()
or<
T>(option):ZodUnion<[ZodLiteral<T>,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<[ZodLiteral<T>, T]>
Inherited from
overwrite()
overwrite(
fn):this
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:43
Parameters
fn
(x) => T
Returns
this
Inherited from
parse()
parse(
data,params?):T
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:26
Parameters
data
unknown
params?
Returns
T
Inherited from
parseAsync()
parseAsync(
data,params?):Promise<T>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:28
Parameters
data
unknown
params?
Returns
Promise<T>
Inherited from
pipe()
pipe<
T>(target):ZodPipe<ZodLiteral<T>,T>
Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:59