MobX-state-tree

MobX-state-tree

  • Documentation
  • TypeDocs
  • Sponsor
  • GitHub

›Interfaces

Introduction

  • Globals

Interfaces

  • CustomTypeOptions
  • FunctionWithFlag
  • IActionContext
  • IActionRecorder
  • IActionTrackingMiddleware2Call
  • IActionTrackingMiddleware2Hooks
  • IActionTrackingMiddlewareHooks
  • IAnyComplexType
  • IAnyModelType
  • IAnyType
  • IHooks
  • IJsonPatch
  • IMiddlewareEvent
  • IModelReflectionData
  • IModelReflectionPropertiesData
  • IModelType
  • IPatchRecorder
  • IReversibleJsonPatch
  • ISerializedActionCall
  • ISimpleType
  • ISnapshotProcessor
  • ISnapshotProcessors
  • IType
  • IValidationContextEntry
  • IValidationError
  • ReferenceOptionsGetSet
  • ReferenceOptionsOnInvalidated
  • UnionOptions
Edit

IAnyType

mobx-state-tree - v7.0.2 › IAnyType

Any kind of type.

Hierarchy

  • IType‹any, any, any›

    ↳ IAnyType

Index

Properties

  • identifierAttribute
  • name

Methods

  • create
  • describe
  • is
  • validate

Properties

Optional identifierAttribute

• identifierAttribute? : undefined | string

Inherited from IType.identifierAttribute

Defined in src/core/type/type.ts:92

Name of the identifier attribute or null if none.


name

• name: string

Inherited from IType.name

Defined in src/core/type/type.ts:87

Friendly type name.

Methods

create

▸ create(snapshot?: any | ExcludeReadonly‹any›, env?: any): this["Type"]

Inherited from IType.create

Defined in src/core/type/type.ts:99

Creates an instance for the type given an snapshot input.

Parameters:

NameType
snapshot?any | ExcludeReadonly‹any›
env?any

Returns: this["Type"]

An instance of that type.


describe

▸ describe(): string

Inherited from IType.describe

Defined in src/core/type/type.ts:121

Gets the textual representation of the type as a string.

Returns: string


is

▸ is(thing: any): thing is any | this["Type"]

Inherited from IType.is

Defined in src/core/type/type.ts:107

Checks if a given snapshot / instance is of the given type.

Parameters:

NameTypeDescription
thinganySnapshot or instance to be checked.

Returns: thing is any | this["Type"]

true if the value is of the current type, false otherwise.


validate

▸ validate(thing: any | any, context: IValidationContext): IValidationResult

Inherited from IType.validate

Defined in src/core/type/type.ts:116

Run's the type's typechecker on the given value with the given validation context.

Parameters:

NameTypeDescription
thingany | anyValue to be checked, either a snapshot or an instance.
contextIValidationContextValidation context, an array of { subpaths, subtypes } that should be validated

Returns: IValidationResult

The validation result, an array with the list of validation errors.

← IAnyModelTypeIHooks →
  • Hierarchy
  • Index
    • Properties
    • Methods
  • Properties
    • Optional identifierAttribute
    • name
  • Methods
    • create
    • describe
    • is
    • validate
MobX-state-tree
Docs
Getting StartedBasic conceptsAdvanced conceptsAPI Reference
Community
GitHub DiscussionsStack Overflow
More
BlogGitHubStar
Facebook Open Source
Copyright © 2025 Michel Weststrate