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