Type Utils
Preparing search index...
asTypeGuard
Function asTypeGuard
asTypeGuard
<
T
>
(
predicate
:
(
value
:
any
)
=>
boolean
)
:
TypeGuard
<
T
>
Type Parameters
T
Parameters
predicate
:
(
value
:
any
)
=>
boolean
Returns
TypeGuard
<
T
>
asTypeGuard
<
P
extends
(
value
:
any
)
=>
boolean
>
(
predicate
:
P
,
)
:
TypeGuard
<
Param0
<
P
>
>
Type Parameters
P
extends
(
value
:
any
)
=>
boolean
Parameters
predicate
:
P
Returns
TypeGuard
<
Param0
<
P
>
>
asTypeGuard
<
T
>
(
predicate
:
(
value
:
any
)
=>
boolean
,
metadata
:
Omit
<
{
context
?:
Record
<
string
,
any
>
|
null
;
kind
?:
string
;
optional
:
boolean
;
rules
:
{
args
:
any
[]
;
handler
:
CustomHandler
<
any
[]
,
T
>
;
rule
:
string
;
type
:
"custom"
;
}
[]
;
schema
:
TypeGuard
<
T
>
;
type
:
"custom"
;
}
,
"rules"
|
OmittedKeys
,
>
&
Partial
<
Pick
<
{
context
?:
Record
<
string
,
any
>
|
null
;
kind
?:
string
;
optional
:
boolean
;
rules
:
{
args
:
any
[]
;
handler
:
CustomHandler
<
any
[]
,
T
>
;
rule
:
string
;
type
:
"custom"
;
}
[]
;
schema
:
TypeGuard
<
T
>
;
type
:
"custom"
;
}
,
"rules"
,
>
,
>
,
)
:
TypeGuard
<
T
>
Type Parameters
T
Parameters
predicate
:
(
value
:
any
)
=>
boolean
metadata
:
Omit
<
{
context
?:
Record
<
string
,
any
>
|
null
;
kind
?:
string
;
optional
:
boolean
;
rules
:
{
args
:
any
[]
;
handler
:
CustomHandler
<
any
[]
,
T
>
;
rule
:
string
;
type
:
"custom"
;
}
[]
;
schema
:
TypeGuard
<
T
>
;
type
:
"custom"
;
}
,
"rules"
|
OmittedKeys
,
>
&
Partial
<
Pick
<
{
context
?:
Record
<
string
,
any
>
|
null
;
kind
?:
string
;
optional
:
boolean
;
rules
:
{
args
:
any
[]
;
handler
:
CustomHandler
<
any
[]
,
T
>
;
rule
:
string
;
type
:
"custom"
;
}
[]
;
schema
:
TypeGuard
<
T
>
;
type
:
"custom"
;
}
,
"rules"
,
>
,
>
Returns
TypeGuard
<
T
>
asTypeGuard
<
P
extends
(
value
:
any
)
=>
boolean
>
(
predicate
:
P
,
metadata
:
Omit
<
{
context
?:
Record
<
string
,
any
>
|
null
;
kind
?:
string
;
optional
:
boolean
;
rules
:
{
args
:
any
[]
;
handler
:
CustomHandler
<
any
[]
,
Param0
<
P
>
>
;
rule
:
string
;
type
:
"custom"
;
}
[]
;
schema
:
TypeGuard
<
Param0
<
P
>
>
;
type
:
"custom"
;
}
,
"rules"
|
OmittedKeys
,
>
&
Partial
<
Pick
<
{
context
?:
Record
<
string
,
any
>
|
null
;
kind
?:
string
;
optional
:
boolean
;
rules
:
{
args
:
any
[]
;
handler
:
CustomHandler
<
any
[]
,
Param0
<
P
>
>
;
rule
:
string
;
type
:
"custom"
;
}
[]
;
schema
:
TypeGuard
<
Param0
<
P
>
>
;
type
:
"custom"
;
}
,
"rules"
,
>
,
>
,
)
:
TypeGuard
<
Param0
<
P
>
>
Type Parameters
P
extends
(
value
:
any
)
=>
boolean
Parameters
predicate
:
P
metadata
:
Omit
<
{
context
?:
Record
<
string
,
any
>
|
null
;
kind
?:
string
;
optional
:
boolean
;
rules
:
{
args
:
any
[]
;
handler
:
CustomHandler
<
any
[]
,
Param0
<
P
>
>
;
rule
:
string
;
type
:
"custom"
;
}
[]
;
schema
:
TypeGuard
<
Param0
<
P
>
>
;
type
:
"custom"
;
}
,
"rules"
|
OmittedKeys
,
>
&
Partial
<
Pick
<
{
context
?:
Record
<
string
,
any
>
|
null
;
kind
?:
string
;
optional
:
boolean
;
rules
:
{
args
:
any
[]
;
handler
:
CustomHandler
<
any
[]
,
Param0
<
P
>
>
;
rule
:
string
;
type
:
"custom"
;
}
[]
;
schema
:
TypeGuard
<
Param0
<
P
>
>
;
type
:
"custom"
;
}
,
"rules"
,
>
,
>
Returns
TypeGuard
<
Param0
<
P
>
>
Settings
Member Visibility
Inherited
External
Theme
OS
Light
Dark
Type Utils
Loading...