mobx-state-tree
Advanced tools
Comparing version 6.0.1-pre.1 to 6.0.1
@@ -52,2 +52,2 @@ import { IObservableArray } from "mobx"; | ||
*/ | ||
export declare function isArrayType<Items extends IAnyType = IAnyType>(type: IAnyType): type is IArrayType<Items>; | ||
export declare function isArrayType(type: unknown): type is IArrayType<IAnyType>; |
@@ -69,2 +69,2 @@ import { IInterceptor, IKeyValueMap, IMapDidChange, IMapWillChange, Lambda } from "mobx"; | ||
*/ | ||
export declare function isMapType<Items extends IAnyType = IAnyType>(type: IAnyType): type is IMapType<Items>; | ||
export declare function isMapType(type: unknown): type is IMapType<IAnyType>; |
@@ -1,2 +0,2 @@ | ||
import { IAnyType, IType, _CustomOrOther, _NotCustomized, Instance, FunctionWithFlag, type IStateTreeNode } from "../../internal"; | ||
import { IAnyType, IType, _CustomOrOther, _NotCustomized, Instance, FunctionWithFlag } from "../../internal"; | ||
/** @hidden */ | ||
@@ -43,12 +43,18 @@ export interface ModelProperties { | ||
/** @hidden */ | ||
export type ExtractCFromProps<P extends ModelProperties> = { | ||
export type ExtractCFromProps<P extends ModelProperties> = MaybeEmpty<{ | ||
[k in keyof P]: P[k]["CreationType"]; | ||
}; | ||
}>; | ||
/** @hidden */ | ||
export type ModelCreationType<PC> = { | ||
export type MaybeEmpty<T> = keyof T extends never ? EmptyObject : T; | ||
/** @hidden */ | ||
export type ModelCreationType<PC> = MaybeEmpty<{ | ||
[P in DefinablePropsNames<PC>]: PC[P]; | ||
} & Partial<PC>; | ||
type WithAdditionalProperties<T> = T extends Record<string, never> ? Record<string, unknown> : T; | ||
}> & Partial<PC>; | ||
type WithAdditionalProperties<T> = T extends Record<string, never> ? EmptyObject : T; | ||
declare const $nonEmptyObject: unique symbol; | ||
type EmptyObject = { | ||
[$nonEmptyObject]?: never; | ||
}; | ||
/** @hidden */ | ||
export type ModelCreationType2<P extends ModelProperties, CustomC> = keyof P extends never ? IStateTreeNode : _CustomOrOther<CustomC, ModelCreationType<ExtractCFromProps<P>>>; | ||
export type ModelCreationType2<P extends ModelProperties, CustomC> = MaybeEmpty<keyof P extends never ? _CustomOrOther<CustomC, ModelCreationType<EmptyObject>> : _CustomOrOther<CustomC, ModelCreationType<ExtractCFromProps<P>>>>; | ||
/** @hidden */ | ||
@@ -126,3 +132,3 @@ export type ModelSnapshotType<P extends ModelProperties> = { | ||
*/ | ||
export declare function isModelType<IT extends IAnyModelType = IAnyModelType>(type: IAnyType): type is IT; | ||
export declare function isModelType(type: unknown): type is IAnyModelType; | ||
export {}; |
@@ -104,2 +104,2 @@ import { ISimpleType, IType } from "../internal"; | ||
*/ | ||
export declare function isPrimitiveType<IT extends ISimpleType<string> | ISimpleType<number> | ISimpleType<boolean> | typeof DatePrimitive>(type: IT): type is IT; | ||
export declare function isPrimitiveType(type: unknown): type is ISimpleType<string> | ISimpleType<number> | ISimpleType<boolean> | typeof DatePrimitive; |
@@ -1,2 +0,2 @@ | ||
import { IType } from "../../internal"; | ||
import { IType, type ISimpleType } from "../../internal"; | ||
export declare function frozen<C>(subType: IType<C, any, any>): IType<C, C, C>; | ||
@@ -11,2 +11,2 @@ export declare function frozen<T>(defaultValue: T): IType<T | undefined | null, T, T>; | ||
*/ | ||
export declare function isFrozenType<IT extends IType<T | any, T, T>, T = any>(type: IT): type is IT; | ||
export declare function isFrozenType(type: unknown): type is ISimpleType<any>; |
@@ -40,3 +40,3 @@ import { ISimpleType } from "../../internal"; | ||
*/ | ||
export declare function isIdentifierType<IT extends typeof identifier | typeof identifierNumber>(type: IT): type is IT; | ||
export declare function isIdentifierType(type: unknown): type is typeof identifier | typeof identifierNumber; | ||
/** | ||
@@ -43,0 +43,0 @@ * Valid types for identifiers. |
@@ -10,2 +10,2 @@ import { IAnyType } from "../../internal"; | ||
*/ | ||
export declare function isLateType<IT extends IAnyType>(type: IT): type is IT; | ||
export declare function isLateType(type: unknown): type is IAnyType; |
@@ -25,2 +25,2 @@ import { ISimpleType, Primitives } from "../../internal"; | ||
*/ | ||
export declare function isLiteralType<IT extends ISimpleType<any>>(type: IT): type is IT; | ||
export declare function isLiteralType(type: unknown): type is ISimpleType<any>; |
@@ -20,2 +20,2 @@ import { IType, IAnyType, ExtractCSTWithSTN } from "../../internal"; | ||
*/ | ||
export declare function isOptionalType<IT extends IAnyType>(type: IT): type is IT; | ||
export declare function isOptionalType(type: unknown): type is IOptionalIType<IAnyType, [any, ...any[]]>; |
@@ -35,3 +35,3 @@ import { IType, IAnyType, IAnyStateTreeNode, IAnyComplexType, IMaybe, ReferenceIdentifier, IStateTreeNode } from "../../internal"; | ||
*/ | ||
export declare function isReferenceType<IT extends IReferenceType<any>>(type: IT): type is IT; | ||
export declare function isReferenceType(type: unknown): type is IReferenceType<IAnyComplexType>; | ||
export declare function safeReference<IT extends IAnyComplexType>(subType: IT, options: (ReferenceOptionsGetSet<IT> | {}) & { | ||
@@ -38,0 +38,0 @@ acceptsUndefined: false; |
@@ -10,2 +10,2 @@ import { IAnyType } from "../../internal"; | ||
*/ | ||
export declare function isRefinementType<IT extends IAnyType>(type: IT): type is IT; | ||
export declare function isRefinementType(type: unknown): type is IAnyType; |
@@ -15,3 +15,3 @@ import { IType, IAnyType, _NotCustomized } from "../../internal"; | ||
} | ||
type IUnionType<Types extends IAnyType[]> = ITypeUnion<Types[number]["CreationType"], Types[number]["SnapshotType"], Types[number]["TypeWithoutSTN"]>; | ||
export type IUnionType<Types extends IAnyType[]> = ITypeUnion<Types[number]["CreationType"], Types[number]["SnapshotType"], Types[number]["TypeWithoutSTN"]>; | ||
export declare function union<Types extends IAnyType[]>(...types: Types): IUnionType<Types>; | ||
@@ -25,3 +25,2 @@ export declare function union<Types extends IAnyType[]>(options: UnionOptions, ...types: Types): IUnionType<Types>; | ||
*/ | ||
export declare function isUnionType<IT extends IAnyType>(type: IT): type is IT; | ||
export {}; | ||
export declare function isUnionType(type: unknown): type is IUnionType<IAnyType[]>; |
{ | ||
"name": "mobx-state-tree", | ||
"version": "6.0.1-pre.1", | ||
"version": "6.0.1", | ||
"description": "Opinionated, transactional, MobX powered state container", | ||
@@ -5,0 +5,0 @@ "main": "dist/mobx-state-tree.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1279076
28586
3