CustomTypeOptions
mobx-state-tree - v7.0.2 › CustomTypeOptions
Type parameters
▪ S
▪ T
Hierarchy
- CustomTypeOptions
Index
Properties
Methods
Properties
name
• name: string
Defined in src/types/utility-types/custom.ts:15
Friendly name
Methods
fromSnapshot
▸ fromSnapshot(snapshot: S, env?: any): T
Defined in src/types/utility-types/custom.ts:17
given a serialized value and environment, how to turn it into the target type
Parameters:
| Name | Type |
|---|---|
snapshot | S |
env? | any |
Returns: T
getValidationMessage
▸ getValidationMessage(snapshot: S): string
Defined in src/types/utility-types/custom.ts:23
a non empty string is assumed to be a validation error
Parameters:
| Name | Type |
|---|---|
snapshot | S |
Returns: string
isTargetType
▸ isTargetType(value: T | S): boolean
Defined in src/types/utility-types/custom.ts:21
if true, this is a converted value, if false, it's a snapshot
Parameters:
| Name | Type |
|---|---|
value | T | S |
Returns: boolean
toSnapshot
▸ toSnapshot(value: T): S
Defined in src/types/utility-types/custom.ts:19
return the serialization of the current value
Parameters:
| Name | Type |
|---|---|
value | T |
Returns: S