id | title | sidebar_label |
---|---|---|
ianymodeltype |
IAnyModelType |
IAnyModelType |
mobx-state-tree - v5.2.0 › IAnyModelType
Any model type.
↳ IModelType‹any, any, any, any›
↳ IAnyModelType
- actions
- create
- describe
- extend
- is
- named
- postProcessSnapshot
- preProcessSnapshot
- props
- validate
- views
- volatile
• identifierAttribute? : undefined | string
Inherited from IType.identifierAttribute
Defined in packages/mobx-state-tree/src/core/type/type.ts:89
Name of the identifier attribute or null if none.
• name: string
Defined in packages/mobx-state-tree/src/core/type/type.ts:84
Friendly type name.
• properties: any
Inherited from IModelType.properties
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:187
▸ actions<A>(fn
: function): IModelType‹any, any & A, any, any›
Inherited from IModelType.actions
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:201
Type parameters:
▪ A: ModelActions
Parameters:
▪ fn: function
▸ (self
: Instance‹this›): A
Parameters:
Name | Type |
---|---|
self |
Instance‹this› |
Returns: IModelType‹any, any & A, any, any›
▸ create(snapshot?
: C, env?
: any): this["Type"]
Defined in packages/mobx-state-tree/src/core/type/type.ts:96
Creates an instance for the type given an snapshot input.
Parameters:
Name | Type |
---|---|
snapshot? |
C |
env? |
any |
Returns: this["Type"]
An instance of that type.
▸ describe(): string
Defined in packages/mobx-state-tree/src/core/type/type.ts:118
Gets the textual representation of the type as a string.
Returns: string
▸ extend<A, V, VS>(fn
: function): IModelType‹any, any & A & V & VS, any, any›
Inherited from IModelType.extend
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:209
Type parameters:
▪ A: ModelActions
▪ V: Object
▪ VS: Object
Parameters:
▪ fn: function
▸ (self
: Instance‹this›): object
Parameters:
Name | Type |
---|---|
self |
Instance‹this› |
Returns: IModelType‹any, any & A & V & VS, any, any›
▸ is(thing
: any): thing is ModelCreationType2<any, any> | this["Type"]
Defined in packages/mobx-state-tree/src/core/type/type.ts:104
Checks if a given snapshot / instance is of the given type.
Parameters:
Name | Type | Description |
---|---|---|
thing |
any | Snapshot or instance to be checked. |
Returns: thing is ModelCreationType2<any, any> | this["Type"]
true if the value is of the current type, false otherwise.
▸ named(newName
: string): IModelType‹any, any, any, any›
Inherited from IModelType.named
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:189
Parameters:
Name | Type |
---|---|
newName |
string |
Returns: IModelType‹any, any, any, any›
▸ postProcessSnapshot<NewS>(fn
: function): IModelType‹any, any, any, NewS›
Inherited from IModelType.postProcessSnapshot
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:217
Type parameters:
▪ NewS
Parameters:
▪ fn: function
▸ (snapshot
: ModelSnapshotType2‹any, any›): NewS
Parameters:
Name | Type |
---|---|
snapshot |
ModelSnapshotType2‹any, any› |
Returns: IModelType‹any, any, any, NewS›
▸ preProcessSnapshot<NewC>(fn
: function): IModelType‹any, any, NewC, any›
Inherited from IModelType.preProcessSnapshot
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:213
Type parameters:
▪ NewC
Parameters:
▪ fn: function
▸ (snapshot
: NewC): ModelCreationType2‹any, any›
Parameters:
Name | Type |
---|---|
snapshot |
NewC |
Returns: IModelType‹any, any, NewC, any›
▸ props<PROPS2>(props
: PROPS2): IModelType‹any & ModelPropertiesDeclarationToProperties‹PROPS2›, any, any, any›
Inherited from IModelType.props
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:193
Type parameters:
▪ PROPS2: ModelPropertiesDeclaration
Parameters:
Name | Type |
---|---|
props |
PROPS2 |
Returns: IModelType‹any & ModelPropertiesDeclarationToProperties‹PROPS2›, any, any, any›
▸ validate(thing
: ModelCreationType2‹any, any›, context
: IValidationContext): IValidationResult
Defined in packages/mobx-state-tree/src/core/type/type.ts:113
Run's the type's typechecker on the given value with the given validation context.
Parameters:
Name | Type | Description |
---|---|---|
thing |
ModelCreationType2‹any, any› | Value to be checked, either a snapshot or an instance. |
context |
IValidationContext | Validation context, an array of { subpaths, subtypes } that should be validated |
Returns: IValidationResult
The validation result, an array with the list of validation errors.
▸ views<V>(fn
: function): IModelType‹any, any & V, any, any›
Inherited from IModelType.views
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:197
Type parameters:
▪ V: Object
Parameters:
▪ fn: function
▸ (self
: Instance‹this›): V
Parameters:
Name | Type |
---|---|
self |
Instance‹this› |
Returns: IModelType‹any, any & V, any, any›
▸ volatile<TP>(fn
: function): IModelType‹any, any & TP, any, any›
Inherited from IModelType.volatile
Defined in packages/mobx-state-tree/src/types/complex-types/model.ts:205
Type parameters:
▪ TP: object
Parameters:
▪ fn: function
▸ (self
: Instance‹this›): TP
Parameters:
Name | Type |
---|---|
self |
Instance‹this› |
Returns: IModelType‹any, any & TP, any, any›