@modelcontextprotocol/sdk
Preparing search index...
server/completable
Completable
Class Completable<T>
Type Parameters
T
extends
ZodTypeAny
Hierarchy
ZodType
<
T
[
"_output"
]
,
CompletableDef
<
T
>
,
T
[
"_input"
]
>
Completable
Index
Constructors
constructor
Properties
_
def
_
input
_
output
_
type
~standard
spa
Accessors
description
Methods
_
get
Or
Return
Ctx
_
get
Type
_
parse
_
parse
Async
_
parse
Sync
_
process
Input
Params
_
refinement
~validate
and
array
brand
catch
default
describe
is
Nullable
is
Optional
nullable
nullish
optional
or
parse
parse
Async
pipe
promise
readonly
refine
refinement
safe
Parse
safe
Parse
Async
super
Refine
transform
unwrap
create
Constructors
constructor
new
Completable
<
T
extends
ZodTypeAny
>
(
def
:
CompletableDef
)
:
Completable
<
T
>
Type Parameters
T
extends
ZodTypeAny
Parameters
def
:
CompletableDef
Returns
Completable
<
T
>
Properties
Readonly
_
def
_def
:
CompletableDef
Readonly
_
input
_input
:
T
[
"_input"
]
Readonly
_
output
_output
:
T
[
"_output"
]
Readonly
_
type
_type
:
T
[
"_output"
]
~standard
"~standard"
:
Props
<
T
[
"_input"
]
,
T
[
"_output"
]
>
spa
spa
:
(
data
:
unknown
,
params
?:
Partial
<
ParseParams
>
,
)
=>
Promise
<
SafeParseReturnType
<
T
[
"_input"
]
,
T
[
"_output"
]
>
>
Alias of safeParseAsync
Accessors
description
get
description
()
:
string
|
undefined
Returns
string
|
undefined
Methods
_
get
Or
Return
Ctx
_getOrReturnCtx
(
input
:
ParseInput
,
ctx
?:
ParseContext
)
:
ParseContext
Parameters
input
:
ParseInput
Optional
ctx
:
ParseContext
Returns
ParseContext
_
get
Type
_getType
(
input
:
ParseInput
)
:
string
Parameters
input
:
ParseInput
Returns
string
_
parse
_parse
(
input
:
ParseInput
)
:
ParseReturnType
<
T
[
"_output"
]
>
Parameters
input
:
ParseInput
Returns
ParseReturnType
<
T
[
"_output"
]
>
_
parse
Async
_parseAsync
(
input
:
ParseInput
)
:
AsyncParseReturnType
<
T
[
"_output"
]
>
Parameters
input
:
ParseInput
Returns
AsyncParseReturnType
<
T
[
"_output"
]
>
_
parse
Sync
_parseSync
(
input
:
ParseInput
)
:
SyncParseReturnType
<
T
[
"_output"
]
>
Parameters
input
:
ParseInput
Returns
SyncParseReturnType
<
T
[
"_output"
]
>
_
process
Input
Params
_processInputParams
(
input
:
ParseInput
,
)
:
{
ctx
:
ParseContext
;
status
:
ParseStatus
}
Parameters
input
:
ParseInput
Returns
{
ctx
:
ParseContext
;
status
:
ParseStatus
}
_
refinement
_refinement
(
refinement
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
any
,
)
:
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
Parameters
refinement
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
any
Returns
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
~validate
"~validate"
(
data
:
unknown
)
:
Result
<
T
[
"_output"
]
>
|
Promise
<
Result
<
T
[
"_output"
]
>
>
Parameters
data
:
unknown
Returns
Result
<
T
[
"_output"
]
>
|
Promise
<
Result
<
T
[
"_output"
]
>
>
and
and
<
T
extends
ZodTypeAny
>
(
incoming
:
T
)
:
ZodIntersection
<
Completable
<
T
>
,
T
>
Type Parameters
T
extends
ZodTypeAny
Parameters
incoming
:
T
Returns
ZodIntersection
<
Completable
<
T
>
,
T
>
array
array
()
:
ZodArray
<
Completable
<
T
>
>
Returns
ZodArray
<
Completable
<
T
>
>
brand
brand
<
B
extends
string
|
number
|
symbol
>
(
brand
?:
B
,
)
:
ZodBranded
<
Completable
<
T
>
,
B
>
Type Parameters
B
extends
string
|
number
|
symbol
Parameters
Optional
brand
:
B
Returns
ZodBranded
<
Completable
<
T
>
,
B
>
catch
catch
(
def
:
T
[
"_output"
]
)
:
ZodCatch
<
Completable
<
T
>
>
Parameters
def
:
T
[
"_output"
]
Returns
ZodCatch
<
Completable
<
T
>
>
catch
(
def
:
(
ctx
:
{
error
:
ZodError
;
input
:
T
[
"_input"
]
}
)
=>
T
[
"_output"
]
,
)
:
ZodCatch
<
Completable
<
T
>
>
Parameters
def
:
(
ctx
:
{
error
:
ZodError
;
input
:
T
[
"_input"
]
}
)
=>
T
[
"_output"
]
Returns
ZodCatch
<
Completable
<
T
>
>
default
default
(
def
:
noUndefined
<
T
[
"_input"
]
>
)
:
ZodDefault
<
Completable
<
T
>
>
Parameters
def
:
noUndefined
<
T
[
"_input"
]
>
Returns
ZodDefault
<
Completable
<
T
>
>
default
(
def
:
()
=>
noUndefined
<
T
[
"_input"
]
>
)
:
ZodDefault
<
Completable
<
T
>
>
Parameters
def
:
()
=>
noUndefined
<
T
[
"_input"
]
>
Returns
ZodDefault
<
Completable
<
T
>
>
describe
describe
(
description
:
string
)
:
this
Parameters
description
:
string
Returns
this
is
Nullable
isNullable
()
:
boolean
Returns
boolean
is
Optional
isOptional
()
:
boolean
Returns
boolean
nullable
nullable
()
:
ZodNullable
<
Completable
<
T
>
>
Returns
ZodNullable
<
Completable
<
T
>
>
nullish
nullish
()
:
ZodOptional
<
ZodNullable
<
Completable
<
T
>
>
>
Returns
ZodOptional
<
ZodNullable
<
Completable
<
T
>
>
>
optional
optional
()
:
ZodOptional
<
Completable
<
T
>
>
Returns
ZodOptional
<
Completable
<
T
>
>
or
or
<
T
extends
ZodTypeAny
>
(
option
:
T
)
:
ZodUnion
<
[
Completable
<
T
>
,
T
]
>
Type Parameters
T
extends
ZodTypeAny
Parameters
option
:
T
Returns
ZodUnion
<
[
Completable
<
T
>
,
T
]
>
parse
parse
(
data
:
unknown
,
params
?:
Partial
<
ParseParams
>
)
:
T
[
"_output"
]
Parameters
data
:
unknown
Optional
params
:
Partial
<
ParseParams
>
Returns
T
[
"_output"
]
parse
Async
parseAsync
(
data
:
unknown
,
params
?:
Partial
<
ParseParams
>
)
:
Promise
<
T
[
"_output"
]
>
Parameters
data
:
unknown
Optional
params
:
Partial
<
ParseParams
>
Returns
Promise
<
T
[
"_output"
]
>
pipe
pipe
<
T
extends
ZodTypeAny
>
(
target
:
T
)
:
ZodPipeline
<
Completable
<
T
>
,
T
>
Type Parameters
T
extends
ZodTypeAny
Parameters
target
:
T
Returns
ZodPipeline
<
Completable
<
T
>
,
T
>
promise
promise
()
:
ZodPromise
<
Completable
<
T
>
>
Returns
ZodPromise
<
Completable
<
T
>
>
readonly
readonly
()
:
ZodReadonly
<
Completable
<
T
>
>
Returns
ZodReadonly
<
Completable
<
T
>
>
refine
refine
<
RefinedOutput
extends
any
>
(
check
:
(
arg
:
T
[
"_output"
]
)
=>
arg
is
RefinedOutput
,
message
?:
|
string
|
Partial
<
Omit
<
ZodCustomIssue
,
"code"
>
>
|
(
(
arg
:
T
[
"_output"
]
)
=>
CustomErrorParams
)
,
)
:
ZodEffects
<
Completable
<
T
>
,
RefinedOutput
,
T
[
"_input"
]
>
Type Parameters
RefinedOutput
extends
any
Parameters
check
:
(
arg
:
T
[
"_output"
]
)
=>
arg
is
RefinedOutput
Optional
message
:
|
string
|
Partial
<
Omit
<
ZodCustomIssue
,
"code"
>
>
|
(
(
arg
:
T
[
"_output"
]
)
=>
CustomErrorParams
)
Returns
ZodEffects
<
Completable
<
T
>
,
RefinedOutput
,
T
[
"_input"
]
>
refine
(
check
:
(
arg
:
T
[
"_output"
]
)
=>
unknown
,
message
?:
|
string
|
Partial
<
Omit
<
ZodCustomIssue
,
"code"
>
>
|
(
(
arg
:
T
[
"_output"
]
)
=>
CustomErrorParams
)
,
)
:
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
Parameters
check
:
(
arg
:
T
[
"_output"
]
)
=>
unknown
Optional
message
:
|
string
|
Partial
<
Omit
<
ZodCustomIssue
,
"code"
>
>
|
(
(
arg
:
T
[
"_output"
]
)
=>
CustomErrorParams
)
Returns
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
refinement
refinement
<
RefinedOutput
extends
any
>
(
check
:
(
arg
:
T
[
"_output"
]
)
=>
arg
is
RefinedOutput
,
refinementData
:
|
IssueData
|
(
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
IssueData
)
,
)
:
ZodEffects
<
Completable
<
T
>
,
RefinedOutput
,
T
[
"_input"
]
>
Type Parameters
RefinedOutput
extends
any
Parameters
check
:
(
arg
:
T
[
"_output"
]
)
=>
arg
is
RefinedOutput
refinementData
:
IssueData
|
(
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
IssueData
)
Returns
ZodEffects
<
Completable
<
T
>
,
RefinedOutput
,
T
[
"_input"
]
>
refinement
(
check
:
(
arg
:
T
[
"_output"
]
)
=>
boolean
,
refinementData
:
|
IssueData
|
(
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
IssueData
)
,
)
:
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
Parameters
check
:
(
arg
:
T
[
"_output"
]
)
=>
boolean
refinementData
:
IssueData
|
(
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
IssueData
)
Returns
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
safe
Parse
safeParse
(
data
:
unknown
,
params
?:
Partial
<
ParseParams
>
,
)
:
SafeParseReturnType
<
T
[
"_input"
]
,
T
[
"_output"
]
>
Parameters
data
:
unknown
Optional
params
:
Partial
<
ParseParams
>
Returns
SafeParseReturnType
<
T
[
"_input"
]
,
T
[
"_output"
]
>
safe
Parse
Async
safeParseAsync
(
data
:
unknown
,
params
?:
Partial
<
ParseParams
>
,
)
:
Promise
<
SafeParseReturnType
<
T
[
"_input"
]
,
T
[
"_output"
]
>
>
Parameters
data
:
unknown
Optional
params
:
Partial
<
ParseParams
>
Returns
Promise
<
SafeParseReturnType
<
T
[
"_input"
]
,
T
[
"_output"
]
>
>
super
Refine
superRefine
<
RefinedOutput
extends
any
>
(
refinement
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
,
)
=>
arg
is
RefinedOutput
,
)
:
ZodEffects
<
Completable
<
T
>
,
RefinedOutput
,
T
[
"_input"
]
>
Type Parameters
RefinedOutput
extends
any
Parameters
refinement
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
arg
is
RefinedOutput
Returns
ZodEffects
<
Completable
<
T
>
,
RefinedOutput
,
T
[
"_input"
]
>
superRefine
(
refinement
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
void
,
)
:
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
Parameters
refinement
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
void
Returns
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
superRefine
(
refinement
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
Promise
<
void
>
,
)
:
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
Parameters
refinement
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
Promise
<
void
>
Returns
ZodEffects
<
Completable
<
T
>
,
T
[
"_output"
]
,
T
[
"_input"
]
>
transform
transform
<
NewOut
>
(
transform
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
,
)
=>
NewOut
|
Promise
<
NewOut
>
,
)
:
ZodEffects
<
Completable
<
T
>
,
NewOut
>
Type Parameters
NewOut
Parameters
transform
:
(
arg
:
T
[
"_output"
]
,
ctx
:
RefinementCtx
)
=>
NewOut
|
Promise
<
NewOut
>
Returns
ZodEffects
<
Completable
<
T
>
,
NewOut
>
unwrap
unwrap
()
:
T
Returns
T
Static
create
create
<
T
extends
ZodTypeAny
>
(
type
:
T
,
params
:
{
description
?:
string
;
errorMap
?:
ZodErrorMap
;
invalid_type_error
?:
string
;
message
?:
string
;
required_error
?:
string
;
}
&
{
complete
:
CompleteCallback
<
T
>
}
,
)
:
Completable
<
T
>
Type Parameters
T
extends
ZodTypeAny
Parameters
type
:
T
params
:
{
description
?:
string
;
errorMap
?:
ZodErrorMap
;
invalid_type_error
?:
string
;
message
?:
string
;
required_error
?:
string
;
}
&
{
complete
:
CompleteCallback
<
T
>
}
Returns
Completable
<
T
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
_
def
_
input
_
output
_
type
~standard
spa
Accessors
description
Methods
_
get
Or
Return
Ctx
_
get
Type
_
parse
_
parse
Async
_
parse
Sync
_
process
Input
Params
_
refinement
~validate
and
array
brand
catch
default
describe
is
Nullable
is
Optional
nullable
nullish
optional
or
parse
parse
Async
pipe
promise
readonly
refine
refinement
safe
Parse
safe
Parse
Async
super
Refine
transform
unwrap
create
@modelcontextprotocol/sdk
Loading...
Alias of safeParseAsync