UNPKG

mobx-keystone-mindreframer

Version:

A MobX powered state management solution based on data trees with first class support for Typescript, snapshots, patches and much more

12 lines (11 loc) 438 B
import type { AnyType, TypeToData } from "./schemas"; import type { TypeCheckError } from "./TypeCheckError"; /** * Checks if a value conforms to a given type. * * @typename T Type. * @param type Type to check for. * @param value Value to check. * @returns A TypeError if the check fails or null if no error. */ export declare function typeCheck<T extends AnyType>(type: T, value: TypeToData<T>): TypeCheckError | null;