Presto
GitHub
Getting Started
Packages
View Model
BaseViewModel
isViewModelClass
isViewModelInstance
viewModelFactory
Async Choices
AsyncChoices
AsyncChoicesInterface
useAsyncChoices
Caching
useViewModelCache
ViewModelCache
Errors
InvalidFieldError
MissingFieldsError
Fields
BooleanField
CharField
DateField
DateRangeField
DateTimeField
DateTimeRangeField
DecimalField
DecimalRangeField
EmailField
Field
FileField
FloatField
FloatRangeField
ImageField
IntegerField
IntegerRangeField
JsonField
ListField
ManyRelatedViewModelField
NumberField
PasswordField
RangeField
RelatedViewModelField
TextField
TimeField
URLField
Utils
normalizeFields
ViewModelFieldPaths
Final Form
REST
Routing
UI
UI ANTD
Util
On this page
API
Methods
getChoices
getLabel
getMissingLabel
getValue
list
parseValue
retrieve
useListProps
useResolveItems
useRetrieveProps
Properties
multiple
AsyncChoicesInterface
Typescript Type
Source
import type { AsyncChoicesInterface } from "@prestojs/viewmodel";
AsyncChoicesInterface
<
ItemType
,
ValueType
>
API
Methods
getChoices
(
items
)
Source
Arguments:
Argument
Type
Description
*
items
ItemType
[]
Returns:
(
Choice
|
[
string
,
Choice
[]
]
)[]
getLabel
(
item
)
Source
Arguments:
Argument
Type
Description
*
item
ItemType
Returns:
ReactNode
getMissingLabel
(
value
)
Source
Arguments:
Argument
Type
Description
*
value
ValueType
Returns:
ReactNode
getValue
(
item
)
Source
Arguments:
Argument
Type
Description
*
item
ItemType
Returns:
ValueType
list
(
params
)
Source
Arguments:
Argument
Type
Description
*
params
Record
Returns:
Promise
parseValue
(
value
)
Source
Arguments:
Argument
Type
Description
*
value
any
Returns:
ValueType
retrieve
(
value
,
?deps
)
Source
Arguments:
Argument
Type
Description
*
value
ValueType
|
ValueType
[]
deps
any
Returns:
Promise
useListProps
(
args
)
Source
Arguments:
Argument
Type
Description
*
args
any
Returns:
any
useResolveItems
<
T
>
(
item
)
Source
Arguments:
Argument
Type
Description
*
item
T
Returns:
T
useRetrieveProps
(
args
)
Source
Arguments:
Argument
Type
Description
*
args
any
Returns:
any
Properties
multiple
Source
boolean