Type Utils
Preparing search index...
Schema
Variable Schema
Const
Schema
:
{
and
:
{
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
TypeGuard
<
Merge
<
T1
,
T2
>
>
;
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TIntersection
<
GetTypeGuards
<
TGuards
>
>
>
;
}
;
any
:
()
=>
TypeGuard
<
any
>
;
array
:
{
()
:
TypeGuard
<
any
[]
>
;
(
rules
:
ArrayRules
[]
)
:
TypeGuard
<
any
[]
>
;
<
T
>
(
rules
:
ArrayRules
[]
,
schema
:
TypeGuard
<
T
>
)
:
TypeGuard
<
T
[]
>
;
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
TypeGuard
<
T
[]
>
;
(
tree
:
{}
)
:
TypeGuard
<
{}
[]
>
;
<
T
>
(
tree
:
ValidatorMap
<
T
>
)
:
TypeGuard
<
T
[]
>
;
<
T
>
(
rules
?:
null
|
ArrayRules
[]
|
TypeGuard
<
T
>
,
schema
?:
TypeGuard
<
T
>
,
)
:
TypeGuard
<
T
[]
>
;
}
;
asEnum
:
<
T
extends
PrimitiveType
>
(
values
:
T
[]
)
=>
TypeGuard
<
T
>
;
asNull
:
()
=>
TypeGuard
<
null
>
;
asUndefined
:
()
=>
TypeGuard
<
undefined
>
;
bigint
:
{
()
:
TypeGuard
<
bigint
>
;
(
rules
:
Partial
<
BigIntRulesConfig
>
)
:
TypeGuard
<
bigint
>
;
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
bigint
>
;
}
;
boolean
:
()
=>
TypeGuard
<
boolean
>
;
getStructMetadata
:
<
U
>
(
guard
:
TypeGuard
<
U
>
,
)
=>
V3
.
AnyStruct
|
V3
.
GenericStruct
<
U
,
true
>
;
number
:
{
()
:
TypeGuard
<
number
>
;
(
rules
:
Partial
<
NumberRulesConfig
>
)
:
TypeGuard
<
number
>
;
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
number
>
;
}
;
object
:
{
<
T
extends
{}
>
(
tree
:
ValidatorMap
<
T
>
)
:
TypeGuard
<
Sanitize
<
T
>
>
;
()
:
TypeGuard
<
Record
<
any
,
any
>
>
;
(
tree
:
{}
)
:
TypeGuard
<
{}
>
;
}
;
optional
:
()
=>
{
any
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
any
>
>
;
asNull
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
null
>
>
;
asUndefined
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
undefined
>
>
;
boolean
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
boolean
>
>
;
primitive
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
PrimitiveType
>
>
;
symbol
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
symbol
>
>
;
and
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Merge
<
T1
,
T2
>
>
>
;
and
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TIntersection
<
GetTypeGuards
<
TGuards
>
>
>
;
array
()
:
OptionalizeTypeGuard
<
TypeGuard
<
any
[]
>
>
;
array
(
rules
:
ArrayRules
[]
)
:
OptionalizeTypeGuard
<
TypeGuard
<
any
[]
>
>
;
array
<
T
>
(
rules
:
ArrayRules
[]
,
schema
:
TypeGuard
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
[]
>
>
;
array
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
[]
>
>
;
asEnum
<
T
extends
PrimitiveType
>
(
values
:
T
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
bigint
()
:
TypeGuard
<
bigint
>
;
bigint
(
rules
:
Partial
<
BigIntRulesConfig
>
)
:
TypeGuard
<
bigint
>
;
bigint
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
bigint
>
;
number
()
:
TypeGuard
<
number
>
;
number
(
rules
:
Partial
<
NumberRulesConfig
>
)
:
TypeGuard
<
number
>
;
number
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
number
>
;
object
<
T
extends
{}
>
(
tree
:
ValidatorMap
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Sanitize
<
T
>
>
>
;
object
()
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
any
,
any
>
>
>
;
object
(
tree
:
{}
)
:
OptionalizeTypeGuard
<
TypeGuard
<
{}
>
>
;
or
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T1
|
T2
>
>
;
or
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TUnion
<
GetTypeGuards
<
TGuards
>
>
>
;
record
()
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
string
,
any
>
>
>
;
record
(
rules
:
RecordRules
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
string
,
any
>
>
>
;
record
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
K
,
T
>
>
>
;
record
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
rules
:
RecordRules
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
K
,
T
>
>
>
;
string
()
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
string
(
rules
:
StringRules
[]
)
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
string
<
T
extends
string
>
(
matches
:
T
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
string
(
regex
:
RegExp
)
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
useSchema
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
}
;
or
:
{
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
TypeGuard
<
T1
|
T2
>
;
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TUnion
<
GetTypeGuards
<
TGuards
>
>
>
;
}
;
primitive
:
()
=>
TypeGuard
<
PrimitiveType
>
;
record
:
{
()
:
TypeGuard
<
Record
<
string
,
any
>
>
;
(
rules
:
Partial
<
Rules
>
)
:
TypeGuard
<
Record
<
string
,
any
>
>
;
(
rules
:
RecordRules
[]
)
:
TypeGuard
<
Record
<
string
,
any
>
>
;
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
)
:
TypeGuard
<
Record
<
K
,
T
>
>
;
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
rules
:
Partial
<
Rules
>
,
)
:
TypeGuard
<
Record
<
K
,
T
>
>
;
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
rules
:
RecordRules
[]
,
)
:
TypeGuard
<
Record
<
K
,
T
>
>
;
}
;
string
:
{
()
:
TypeGuard
<
string
>
;
(
rules
:
Partial
<
StringRulesConfig
>
)
:
TypeGuard
<
string
>
;
(
rules
:
StringRules
[]
)
:
TypeGuard
<
string
>
;
<
T
extends
string
>
(
matches
:
T
)
:
TypeGuard
<
T
>
;
(
regex
:
RegExp
)
:
TypeGuard
<
string
>
;
}
;
symbol
:
()
=>
TypeGuard
<
symbol
>
;
useSchema
:
<
T
>
(
schema
:
TypeGuard
<
T
>
)
=>
TypeGuard
<
T
>
;
}
= ...
Type declaration
and
:
{
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
TypeGuard
<
Merge
<
T1
,
T2
>
>
;
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TIntersection
<
GetTypeGuards
<
TGuards
>
>
>
;
}
any
:
()
=>
TypeGuard
<
any
>
array
:
{
()
:
TypeGuard
<
any
[]
>
;
(
rules
:
ArrayRules
[]
)
:
TypeGuard
<
any
[]
>
;
<
T
>
(
rules
:
ArrayRules
[]
,
schema
:
TypeGuard
<
T
>
)
:
TypeGuard
<
T
[]
>
;
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
TypeGuard
<
T
[]
>
;
(
tree
:
{}
)
:
TypeGuard
<
{}
[]
>
;
<
T
>
(
tree
:
ValidatorMap
<
T
>
)
:
TypeGuard
<
T
[]
>
;
<
T
>
(
rules
?:
null
|
ArrayRules
[]
|
TypeGuard
<
T
>
,
schema
?:
TypeGuard
<
T
>
,
)
:
TypeGuard
<
T
[]
>
;
}
asEnum
:
<
T
extends
PrimitiveType
>
(
values
:
T
[]
)
=>
TypeGuard
<
T
>
asNull
:
()
=>
TypeGuard
<
null
>
asUndefined
:
()
=>
TypeGuard
<
undefined
>
bigint
:
{
()
:
TypeGuard
<
bigint
>
;
(
rules
:
Partial
<
BigIntRulesConfig
>
)
:
TypeGuard
<
bigint
>
;
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
bigint
>
;
}
boolean
:
()
=>
TypeGuard
<
boolean
>
getStructMetadata
:
<
U
>
(
guard
:
TypeGuard
<
U
>
)
=>
V3
.
AnyStruct
|
V3
.
GenericStruct
<
U
,
true
>
number
:
{
()
:
TypeGuard
<
number
>
;
(
rules
:
Partial
<
NumberRulesConfig
>
)
:
TypeGuard
<
number
>
;
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
number
>
;
}
object
:
{
<
T
extends
{}
>
(
tree
:
ValidatorMap
<
T
>
)
:
TypeGuard
<
Sanitize
<
T
>
>
;
()
:
TypeGuard
<
Record
<
any
,
any
>
>
;
(
tree
:
{}
)
:
TypeGuard
<
{}
>
;
}
optional
:
()
=>
{
any
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
any
>
>
;
asNull
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
null
>
>
;
asUndefined
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
undefined
>
>
;
boolean
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
boolean
>
>
;
primitive
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
PrimitiveType
>
>
;
symbol
:
(
...
args
:
[
]
)
=>
OptionalizeTypeGuard
<
TypeGuard
<
symbol
>
>
;
and
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Merge
<
T1
,
T2
>
>
>
;
and
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TIntersection
<
GetTypeGuards
<
TGuards
>
>
>
;
array
()
:
OptionalizeTypeGuard
<
TypeGuard
<
any
[]
>
>
;
array
(
rules
:
ArrayRules
[]
)
:
OptionalizeTypeGuard
<
TypeGuard
<
any
[]
>
>
;
array
<
T
>
(
rules
:
ArrayRules
[]
,
schema
:
TypeGuard
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
[]
>
>
;
array
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
[]
>
>
;
asEnum
<
T
extends
PrimitiveType
>
(
values
:
T
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
bigint
()
:
TypeGuard
<
bigint
>
;
bigint
(
rules
:
Partial
<
BigIntRulesConfig
>
)
:
TypeGuard
<
bigint
>
;
bigint
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
bigint
>
;
number
()
:
TypeGuard
<
number
>
;
number
(
rules
:
Partial
<
NumberRulesConfig
>
)
:
TypeGuard
<
number
>
;
number
(
rules
:
NumberRules
[]
)
:
TypeGuard
<
number
>
;
object
<
T
extends
{}
>
(
tree
:
ValidatorMap
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Sanitize
<
T
>
>
>
;
object
()
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
any
,
any
>
>
>
;
object
(
tree
:
{}
)
:
OptionalizeTypeGuard
<
TypeGuard
<
{}
>
>
;
or
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T1
|
T2
>
>
;
or
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TUnion
<
GetTypeGuards
<
TGuards
>
>
>
;
record
()
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
string
,
any
>
>
>
;
record
(
rules
:
RecordRules
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
string
,
any
>
>
>
;
record
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
K
,
T
>
>
>
;
record
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
rules
:
RecordRules
[]
,
)
:
OptionalizeTypeGuard
<
TypeGuard
<
Record
<
K
,
T
>
>
>
;
string
()
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
string
(
rules
:
StringRules
[]
)
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
string
<
T
extends
string
>
(
matches
:
T
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
string
(
regex
:
RegExp
)
:
OptionalizeTypeGuard
<
TypeGuard
<
string
>
>
;
useSchema
<
T
>
(
schema
:
TypeGuard
<
T
>
)
:
OptionalizeTypeGuard
<
TypeGuard
<
T
>
>
;
}
or
:
{
<
T1
,
T2
>
(
guard1
:
TypeGuard
<
T1
>
,
guard2
:
TypeGuard
<
T2
>
,
)
:
TypeGuard
<
T1
|
T2
>
;
<
TGuards
extends
TypeGuards
<
any
>
>
(
...
guards
:
TGuards
,
)
:
TypeGuard
<
TUnion
<
GetTypeGuards
<
TGuards
>
>
>
;
}
primitive
:
()
=>
TypeGuard
<
PrimitiveType
>
record
:
{
()
:
TypeGuard
<
Record
<
string
,
any
>
>
;
(
rules
:
Partial
<
Rules
>
)
:
TypeGuard
<
Record
<
string
,
any
>
>
;
(
rules
:
RecordRules
[]
)
:
TypeGuard
<
Record
<
string
,
any
>
>
;
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
)
:
TypeGuard
<
Record
<
K
,
T
>
>
;
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
rules
:
Partial
<
Rules
>
,
)
:
TypeGuard
<
Record
<
K
,
T
>
>
;
<
K
extends
string
|
number
|
symbol
,
T
>
(
keyGuard
:
TypeGuard
<
K
>
,
valueGuard
:
TypeGuard
<
T
>
,
rules
:
RecordRules
[]
,
)
:
TypeGuard
<
Record
<
K
,
T
>
>
;
}
string
:
{
()
:
TypeGuard
<
string
>
;
(
rules
:
Partial
<
StringRulesConfig
>
)
:
TypeGuard
<
string
>
;
(
rules
:
StringRules
[]
)
:
TypeGuard
<
string
>
;
<
T
extends
string
>
(
matches
:
T
)
:
TypeGuard
<
T
>
;
(
regex
:
RegExp
)
:
TypeGuard
<
string
>
;
}
symbol
:
()
=>
TypeGuard
<
symbol
>
useSchema
:
<
T
>
(
schema
:
TypeGuard
<
T
>
)
=>
TypeGuard
<
T
>
Settings
Member Visibility
Inherited
External
Theme
OS
Light
Dark
Type Utils
Loading...