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
25 lines (24 loc) • 761 B
TypeScript
import type { AnyStandardType, AnyType } from "./schemas";
import { TypeInfo } from "./TypeChecker";
/**
* A type that represents the union of several other types (a | b | c | ...).
*
* Example:
* ```ts
* const booleanOrNumberType = types.or(types.boolean, types.number)
* ```
*
* @typeparam T Type.
* @param orTypes Possible types.
* @returns
*/
export declare function typesOr<T extends AnyType[]>(...orTypes: T): T[number];
/**
* `types.or` type info.
*/
export declare class OrTypeInfo extends TypeInfo {
readonly orTypes: ReadonlyArray<AnyStandardType>;
private _orTypeInfos;
get orTypeInfos(): ReadonlyArray<TypeInfo>;
constructor(thisType: AnyStandardType, orTypes: ReadonlyArray<AnyStandardType>);
}