mobx 5.15.0 → 5.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/README.md +8 -5
  3. package/lib/api/action.d.ts +13 -25
  4. package/lib/api/actiondecorator.d.ts +27 -27
  5. package/lib/api/autorun.d.ts +24 -24
  6. package/lib/api/become-observed.d.ts +5 -5
  7. package/lib/api/computed.d.ts +14 -14
  8. package/lib/api/configure.d.ts +18 -18
  9. package/lib/api/decorate.d.ts +6 -6
  10. package/lib/api/extendobservable.d.ts +7 -7
  11. package/lib/api/extras.d.ts +10 -10
  12. package/lib/api/flow.d.ts +9 -8
  13. package/lib/api/intercept-read.d.ts +8 -8
  14. package/lib/api/intercept.d.ts +8 -8
  15. package/lib/api/iscomputed.d.ts +3 -3
  16. package/lib/api/isobservable.d.ts +2 -2
  17. package/lib/api/object-api.d.ts +34 -34
  18. package/lib/api/observable.d.ts +44 -44
  19. package/lib/api/observabledecorator.d.ts +6 -6
  20. package/lib/api/observe.d.ts +8 -8
  21. package/lib/api/tojs.d.ts +11 -11
  22. package/lib/api/trace.d.ts +3 -3
  23. package/lib/api/transaction.d.ts +8 -8
  24. package/lib/api/when.d.ts +15 -15
  25. package/lib/core/action.d.ts +22 -22
  26. package/lib/core/atom.d.ts +37 -37
  27. package/lib/core/computedvalue.d.ts +95 -95
  28. package/lib/core/derivation.d.ts +74 -74
  29. package/lib/core/globalstate.d.ts +107 -107
  30. package/lib/core/observable.d.ts +45 -45
  31. package/lib/core/reaction.d.ts +63 -63
  32. package/lib/core/spy.d.ts +6 -6
  33. package/lib/index.js +7 -0
  34. package/lib/internal.d.ts +45 -45
  35. package/lib/mobx.d.ts +18 -18
  36. package/lib/mobx.es6.js +4206 -4190
  37. package/lib/mobx.js +4344 -4377
  38. package/lib/mobx.js.flow +6 -4
  39. package/lib/mobx.min.js +1 -1
  40. package/lib/mobx.module.js +4393 -4379
  41. package/lib/mobx.umd.js +4393 -4377
  42. package/lib/mobx.umd.min.js +1 -1
  43. package/lib/types/dynamicobject.d.ts +1 -1
  44. package/lib/types/intercept-utils.d.ts +9 -9
  45. package/lib/types/listen-utils.d.ts +8 -8
  46. package/lib/types/modifiers.d.ts +7 -7
  47. package/lib/types/observablearray.d.ts +42 -42
  48. package/lib/types/observablemap.d.ts +83 -83
  49. package/lib/types/observableobject.d.ts +67 -67
  50. package/lib/types/observableset.d.ts +49 -49
  51. package/lib/types/observablevalue.d.ts +38 -38
  52. package/lib/types/type-utils.d.ts +4 -4
  53. package/lib/utils/comparer.d.ts +14 -14
  54. package/lib/utils/decorators.d.ts +9 -9
  55. package/lib/utils/eq.d.ts +1 -1
  56. package/lib/utils/iterable.d.ts +1 -1
  57. package/lib/utils/utils.d.ts +43 -43
  58. package/package.json +6 -91
@@ -1,67 +1,67 @@
1
- import { ComputedValue, IAtom, IComputedValueOptions, IEnhancer, IInterceptable, IListenable, Lambda, ObservableValue } from "../internal";
2
- export interface IObservableObject {
3
- "observable-object": IObservableObject;
4
- }
5
- export declare type IObjectDidChange = {
6
- name: PropertyKey;
7
- object: any;
8
- type: "add";
9
- newValue: any;
10
- } | {
11
- name: PropertyKey;
12
- object: any;
13
- type: "update";
14
- oldValue: any;
15
- newValue: any;
16
- } | {
17
- name: PropertyKey;
18
- object: any;
19
- type: "remove";
20
- oldValue: any;
21
- };
22
- export declare type IObjectWillChange = {
23
- object: any;
24
- type: "update" | "add";
25
- name: PropertyKey;
26
- newValue: any;
27
- } | {
28
- object: any;
29
- type: "remove";
30
- name: PropertyKey;
31
- };
32
- export declare class ObservableObjectAdministration implements IInterceptable<IObjectWillChange>, IListenable {
33
- target: any;
34
- values: Map<string | number | symbol, ObservableValue<any> | ComputedValue<any>>;
35
- name: string;
36
- defaultEnhancer: IEnhancer<any>;
37
- keysAtom: IAtom;
38
- changeListeners: any;
39
- interceptors: any;
40
- private proxy;
41
- private pendingKeys;
42
- constructor(target: any, values: Map<string | number | symbol, ObservableValue<any> | ComputedValue<any>>, name: string, defaultEnhancer: IEnhancer<any>);
43
- read(key: PropertyKey): any;
44
- write(key: PropertyKey, newValue: any): void;
45
- has(key: PropertyKey): any;
46
- addObservableProp(propName: PropertyKey, newValue: any, enhancer?: IEnhancer<any>): void;
47
- addComputedProp(propertyOwner: any, // where is the property declared?
48
- propName: PropertyKey, options: IComputedValueOptions<any>): void;
49
- remove(key: PropertyKey): void;
50
- illegalAccess(owner: any, propName: any): void;
51
- /**
52
- * Observes this object. Triggers for the events 'add', 'update' and 'delete'.
53
- * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe
54
- * for callback details
55
- */
56
- observe(callback: (changes: IObjectDidChange) => void, fireImmediately?: boolean): Lambda;
57
- intercept(handler: any): Lambda;
58
- notifyPropertyAddition(key: PropertyKey, newValue: any): void;
59
- getKeys(): PropertyKey[];
60
- }
61
- export interface IIsObservableObject {
62
- $mobx: ObservableObjectAdministration;
63
- }
64
- export declare function asObservableObject(target: any, name?: PropertyKey, defaultEnhancer?: IEnhancer<any>): ObservableObjectAdministration;
65
- export declare function generateObservablePropConfig(propName: any): any;
66
- export declare function generateComputedPropConfig(propName: any): any;
67
- export declare function isObservableObject(thing: any): thing is IObservableObject;
1
+ import { ComputedValue, IAtom, IComputedValueOptions, IEnhancer, IInterceptable, IListenable, Lambda, ObservableValue } from "../internal";
2
+ export interface IObservableObject {
3
+ "observable-object": IObservableObject;
4
+ }
5
+ export declare type IObjectDidChange = {
6
+ name: PropertyKey;
7
+ object: any;
8
+ type: "add";
9
+ newValue: any;
10
+ } | {
11
+ name: PropertyKey;
12
+ object: any;
13
+ type: "update";
14
+ oldValue: any;
15
+ newValue: any;
16
+ } | {
17
+ name: PropertyKey;
18
+ object: any;
19
+ type: "remove";
20
+ oldValue: any;
21
+ };
22
+ export declare type IObjectWillChange = {
23
+ object: any;
24
+ type: "update" | "add";
25
+ name: PropertyKey;
26
+ newValue: any;
27
+ } | {
28
+ object: any;
29
+ type: "remove";
30
+ name: PropertyKey;
31
+ };
32
+ export declare class ObservableObjectAdministration implements IInterceptable<IObjectWillChange>, IListenable {
33
+ target: any;
34
+ values: Map<string | number | symbol, ObservableValue<any> | ComputedValue<any>>;
35
+ name: string;
36
+ defaultEnhancer: IEnhancer<any>;
37
+ keysAtom: IAtom;
38
+ changeListeners: any;
39
+ interceptors: any;
40
+ private proxy;
41
+ private pendingKeys;
42
+ constructor(target: any, values: Map<string | number | symbol, ObservableValue<any> | ComputedValue<any>>, name: string, defaultEnhancer: IEnhancer<any>);
43
+ read(key: PropertyKey): any;
44
+ write(key: PropertyKey, newValue: any): void;
45
+ has(key: PropertyKey): any;
46
+ addObservableProp(propName: PropertyKey, newValue: any, enhancer?: IEnhancer<any>): void;
47
+ addComputedProp(propertyOwner: any, // where is the property declared?
48
+ propName: PropertyKey, options: IComputedValueOptions<any>): void;
49
+ remove(key: PropertyKey): void;
50
+ illegalAccess(owner: any, propName: any): void;
51
+ /**
52
+ * Observes this object. Triggers for the events 'add', 'update' and 'delete'.
53
+ * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe
54
+ * for callback details
55
+ */
56
+ observe(callback: (changes: IObjectDidChange) => void, fireImmediately?: boolean): Lambda;
57
+ intercept(handler: any): Lambda;
58
+ notifyPropertyAddition(key: PropertyKey, newValue: any): void;
59
+ getKeys(): PropertyKey[];
60
+ }
61
+ export interface IIsObservableObject {
62
+ $mobx: ObservableObjectAdministration;
63
+ }
64
+ export declare function asObservableObject(target: any, name?: PropertyKey, defaultEnhancer?: IEnhancer<any>): ObservableObjectAdministration;
65
+ export declare function generateObservablePropConfig(propName: any): any;
66
+ export declare function generateComputedPropConfig(propName: any): any;
67
+ export declare function isObservableObject(thing: any): thing is IObservableObject;
@@ -1,49 +1,49 @@
1
- import { $mobx, IEnhancer, IListenable, Lambda, IInterceptable, IInterceptor } from "../internal";
2
- export declare type IObservableSetInitialValues<T> = Set<T> | T[];
3
- export declare type ISetDidChange<T = any> = {
4
- object: ObservableSet<T>;
5
- type: "add";
6
- newValue: T;
7
- } | {
8
- object: ObservableSet<T>;
9
- type: "delete";
10
- oldValue: T;
11
- };
12
- export declare type ISetWillChange<T = any> = {
13
- type: "delete";
14
- object: ObservableSet<T>;
15
- oldValue: T;
16
- } | {
17
- type: "add";
18
- object: ObservableSet<T>;
19
- newValue: T;
20
- };
21
- export declare class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillChange>, IListenable {
22
- name: string;
23
- [$mobx]: {};
24
- private _data;
25
- private _atom;
26
- changeListeners: any;
27
- interceptors: any;
28
- dehancer: any;
29
- enhancer: (newV: any, oldV: any | undefined) => any;
30
- constructor(initialData?: IObservableSetInitialValues<T>, enhancer?: IEnhancer<T>, name?: string);
31
- private dehanceValue;
32
- clear(): void;
33
- forEach(callbackFn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
34
- readonly size: number;
35
- add(value: T): this;
36
- delete(value: any): boolean;
37
- has(value: any): boolean;
38
- entries(): IterableIterator<[T, T]>;
39
- keys(): IterableIterator<T>;
40
- values(): IterableIterator<T>;
41
- replace(other: ObservableSet<T> | IObservableSetInitialValues<T>): ObservableSet<T>;
42
- observe(listener: (changes: ISetDidChange<T>) => void, fireImmediately?: boolean): Lambda;
43
- intercept(handler: IInterceptor<ISetWillChange<T>>): Lambda;
44
- toJS(): Set<T>;
45
- toString(): string;
46
- [Symbol.iterator](): IterableIterator<T>;
47
- [Symbol.toStringTag]: "Set";
48
- }
49
- export declare const isObservableSet: (thing: any) => thing is ObservableSet<any>;
1
+ import { $mobx, IEnhancer, IListenable, Lambda, IInterceptable, IInterceptor } from "../internal";
2
+ export declare type IObservableSetInitialValues<T> = Set<T> | readonly T[];
3
+ export declare type ISetDidChange<T = any> = {
4
+ object: ObservableSet<T>;
5
+ type: "add";
6
+ newValue: T;
7
+ } | {
8
+ object: ObservableSet<T>;
9
+ type: "delete";
10
+ oldValue: T;
11
+ };
12
+ export declare type ISetWillChange<T = any> = {
13
+ type: "delete";
14
+ object: ObservableSet<T>;
15
+ oldValue: T;
16
+ } | {
17
+ type: "add";
18
+ object: ObservableSet<T>;
19
+ newValue: T;
20
+ };
21
+ export declare class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillChange>, IListenable {
22
+ name: string;
23
+ [$mobx]: {};
24
+ private _data;
25
+ private _atom;
26
+ changeListeners: any;
27
+ interceptors: any;
28
+ dehancer: any;
29
+ enhancer: (newV: any, oldV: any | undefined) => any;
30
+ constructor(initialData?: IObservableSetInitialValues<T>, enhancer?: IEnhancer<T>, name?: string);
31
+ private dehanceValue;
32
+ clear(): void;
33
+ forEach(callbackFn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
34
+ readonly size: number;
35
+ add(value: T): this;
36
+ delete(value: any): boolean;
37
+ has(value: any): boolean;
38
+ entries(): IterableIterator<[T, T]>;
39
+ keys(): IterableIterator<T>;
40
+ values(): IterableIterator<T>;
41
+ replace(other: ObservableSet<T> | IObservableSetInitialValues<T>): ObservableSet<T>;
42
+ observe(listener: (changes: ISetDidChange<T>) => void, fireImmediately?: boolean): Lambda;
43
+ intercept(handler: IInterceptor<ISetWillChange<T>>): Lambda;
44
+ toJS(): Set<T>;
45
+ toString(): string;
46
+ [Symbol.iterator](): IterableIterator<T>;
47
+ [Symbol.toStringTag]: "Set";
48
+ }
49
+ export declare const isObservableSet: (thing: any) => thing is ObservableSet<any>;
@@ -1,38 +1,38 @@
1
- import { Atom, IEnhancer, IInterceptable, IEqualsComparer, IInterceptor, IListenable, Lambda } from "../internal";
2
- export interface IValueWillChange<T> {
3
- object: any;
4
- type: "update";
5
- newValue: T;
6
- }
7
- export interface IValueDidChange<T> extends IValueWillChange<T> {
8
- oldValue: T | undefined;
9
- }
10
- export interface IObservableValue<T> {
11
- get(): T;
12
- set(value: T): void;
13
- intercept(handler: IInterceptor<IValueWillChange<T>>): Lambda;
14
- observe(listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda;
15
- }
16
- export declare class ObservableValue<T> extends Atom implements IObservableValue<T>, IInterceptable<IValueWillChange<T>>, IListenable {
17
- enhancer: IEnhancer<T>;
18
- name: string;
19
- private equals;
20
- hasUnreportedChange: boolean;
21
- interceptors: any;
22
- changeListeners: any;
23
- value: any;
24
- dehancer: any;
25
- constructor(value: T, enhancer: IEnhancer<T>, name?: string, notifySpy?: boolean, equals?: IEqualsComparer<any>);
26
- private dehanceValue;
27
- set(newValue: T): void;
28
- private prepareNewValue;
29
- setNewValue(newValue: T): void;
30
- get(): T;
31
- intercept(handler: IInterceptor<IValueWillChange<T>>): Lambda;
32
- observe(listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda;
33
- toJSON(): T;
34
- toString(): string;
35
- valueOf(): T;
36
- [Symbol.toPrimitive](): T;
37
- }
38
- export declare const isObservableValue: (x: any) => x is IObservableValue<any>;
1
+ import { Atom, IEnhancer, IInterceptable, IEqualsComparer, IInterceptor, IListenable, Lambda } from "../internal";
2
+ export interface IValueWillChange<T> {
3
+ object: any;
4
+ type: "update";
5
+ newValue: T;
6
+ }
7
+ export interface IValueDidChange<T> extends IValueWillChange<T> {
8
+ oldValue: T | undefined;
9
+ }
10
+ export interface IObservableValue<T> {
11
+ get(): T;
12
+ set(value: T): void;
13
+ intercept(handler: IInterceptor<IValueWillChange<T>>): Lambda;
14
+ observe(listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda;
15
+ }
16
+ export declare class ObservableValue<T> extends Atom implements IObservableValue<T>, IInterceptable<IValueWillChange<T>>, IListenable {
17
+ enhancer: IEnhancer<T>;
18
+ name: string;
19
+ private equals;
20
+ hasUnreportedChange: boolean;
21
+ interceptors: any;
22
+ changeListeners: any;
23
+ value: any;
24
+ dehancer: any;
25
+ constructor(value: T, enhancer: IEnhancer<T>, name?: string, notifySpy?: boolean, equals?: IEqualsComparer<any>);
26
+ private dehanceValue;
27
+ set(newValue: T): void;
28
+ private prepareNewValue;
29
+ setNewValue(newValue: T): void;
30
+ get(): T;
31
+ intercept(handler: IInterceptor<IValueWillChange<T>>): Lambda;
32
+ observe(listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda;
33
+ toJSON(): T;
34
+ toString(): string;
35
+ valueOf(): T;
36
+ [Symbol.toPrimitive](): T;
37
+ }
38
+ export declare const isObservableValue: (x: any) => x is IObservableValue<any>;
@@ -1,4 +1,4 @@
1
- import { IDepTreeNode } from "../internal";
2
- export declare function getAtom(thing: any, property?: string): IDepTreeNode;
3
- export declare function getAdministration(thing: any, property?: string): any;
4
- export declare function getDebugName(thing: any, property?: string): string;
1
+ import { IDepTreeNode } from "../internal";
2
+ export declare function getAtom(thing: any, property?: string): IDepTreeNode;
3
+ export declare function getAdministration(thing: any, property?: string): any;
4
+ export declare function getDebugName(thing: any, property?: string): string;
@@ -1,14 +1,14 @@
1
- export interface IEqualsComparer<T> {
2
- (a: T, b: T): boolean;
3
- }
4
- declare function identityComparer(a: any, b: any): boolean;
5
- declare function structuralComparer(a: any, b: any): boolean;
6
- declare function shallowComparer(a: any, b: any): boolean;
7
- declare function defaultComparer(a: any, b: any): boolean;
8
- export declare const comparer: {
9
- identity: typeof identityComparer;
10
- structural: typeof structuralComparer;
11
- default: typeof defaultComparer;
12
- shallow: typeof shallowComparer;
13
- };
14
- export {};
1
+ export interface IEqualsComparer<T> {
2
+ (a: T, b: T): boolean;
3
+ }
4
+ declare function identityComparer(a: any, b: any): boolean;
5
+ declare function structuralComparer(a: any, b: any): boolean;
6
+ declare function shallowComparer(a: any, b: any): boolean;
7
+ declare function defaultComparer(a: any, b: any): boolean;
8
+ export declare const comparer: {
9
+ identity: typeof identityComparer;
10
+ structural: typeof structuralComparer;
11
+ default: typeof defaultComparer;
12
+ shallow: typeof shallowComparer;
13
+ };
14
+ export {};
@@ -1,9 +1,9 @@
1
- export declare const mobxDidRunLazyInitializersSymbol: unique symbol;
2
- export declare const mobxPendingDecorators: unique symbol;
3
- export declare type BabelDescriptor = PropertyDescriptor & {
4
- initializer?: () => any;
5
- };
6
- export declare type PropertyCreator = (instance: any, propertyName: PropertyKey, descriptor: BabelDescriptor | undefined, decoratorTarget: any, decoratorArgs: any[]) => void;
7
- export declare function initializeInstance(target: any): any;
8
- export declare function createPropDecorator(propertyInitiallyEnumerable: boolean, propertyCreator: PropertyCreator): Function;
9
- export declare function quacksLikeADecorator(args: IArguments): boolean;
1
+ export declare const mobxDidRunLazyInitializersSymbol: unique symbol;
2
+ export declare const mobxPendingDecorators: unique symbol;
3
+ export declare type BabelDescriptor = PropertyDescriptor & {
4
+ initializer?: () => any;
5
+ };
6
+ export declare type PropertyCreator = (instance: any, propertyName: PropertyKey, descriptor: BabelDescriptor | undefined, decoratorTarget: any, decoratorArgs: any[]) => void;
7
+ export declare function initializeInstance(target: any): any;
8
+ export declare function createPropDecorator(propertyInitiallyEnumerable: boolean, propertyCreator: PropertyCreator): Function;
9
+ export declare function quacksLikeADecorator(args: IArguments): boolean;
package/lib/utils/eq.d.ts CHANGED
@@ -1 +1 @@
1
- export declare function deepEqual(a: any, b: any, depth?: number): boolean;
1
+ export declare function deepEqual(a: any, b: any, depth?: number): boolean;
@@ -1 +1 @@
1
- export declare function makeIterable<T>(iterator: Iterator<T>): IterableIterator<T>;
1
+ export declare function makeIterable<T>(iterator: Iterator<T>): IterableIterator<T>;
@@ -1,43 +1,43 @@
1
- import { IKeyValueMap, IObservableArray, ObservableMap } from "../internal";
2
- export declare const OBFUSCATED_ERROR = "An invariant failed, however the error is obfuscated because this is an production build.";
3
- export declare const EMPTY_ARRAY: never[];
4
- export declare const EMPTY_OBJECT: {};
5
- export interface Lambda {
6
- (): void;
7
- name?: string;
8
- }
9
- export declare function getNextId(): number;
10
- export declare function fail(message: string | boolean): never;
11
- export declare function invariant(check: false, message?: string | boolean): never;
12
- export declare function invariant(check: true, message?: string | boolean): void;
13
- export declare function invariant(check: any, message?: string | boolean): void;
14
- export declare function deprecated(msg: string): boolean;
15
- export declare function deprecated(thing: string, replacement: string): boolean;
16
- /**
17
- * Makes sure that the provided function is invoked at most once.
18
- */
19
- export declare function once(func: Lambda): Lambda;
20
- export declare const noop: () => void;
21
- export declare function unique<T>(list: T[]): T[];
22
- export declare function isObject(value: any): boolean;
23
- export declare function isPlainObject(value: any): boolean;
24
- export declare function makeNonEnumerable(object: any, propNames: PropertyKey[]): void;
25
- export declare function addHiddenProp(object: any, propName: PropertyKey, value: any): void;
26
- export declare function addHiddenFinalProp(object: any, propName: PropertyKey, value: any): void;
27
- export declare function isPropertyConfigurable(object: any, prop: PropertyKey): boolean;
28
- export declare function assertPropertyConfigurable(object: any, prop: PropertyKey): void;
29
- export declare function createInstanceofPredicate<T>(name: string, clazz: new (...args: any[]) => T): (x: any) => x is T;
30
- /**
31
- * Returns whether the argument is an array, disregarding observability.
32
- */
33
- export declare function isArrayLike(x: any): x is Array<any> | IObservableArray<any>;
34
- export declare function isES6Map(thing: any): boolean;
35
- export declare function isES6Set(thing: any): thing is Set<any>;
36
- /**
37
- * Returns the following: own keys, prototype keys & own symbol keys, if they are enumerable.
38
- */
39
- export declare function getPlainObjectKeys(object: any): (string | number | symbol)[];
40
- export declare function stringifyKey(key: any): string;
41
- export declare function getMapLikeKeys<K, V>(map: ObservableMap<K, V>): ReadonlyArray<K>;
42
- export declare function getMapLikeKeys<V>(map: IKeyValueMap<V> | any): ReadonlyArray<string>;
43
- export declare function toPrimitive(value: any): any;
1
+ import { IKeyValueMap, IObservableArray, ObservableMap } from "../internal";
2
+ export declare const OBFUSCATED_ERROR = "An invariant failed, however the error is obfuscated because this is a production build.";
3
+ export declare const EMPTY_ARRAY: never[];
4
+ export declare const EMPTY_OBJECT: {};
5
+ export interface Lambda {
6
+ (): void;
7
+ name?: string;
8
+ }
9
+ export declare function getNextId(): number;
10
+ export declare function fail(message: string | boolean): never;
11
+ export declare function invariant(check: false, message?: string | boolean): never;
12
+ export declare function invariant(check: true, message?: string | boolean): void;
13
+ export declare function invariant(check: any, message?: string | boolean): void;
14
+ export declare function deprecated(msg: string): boolean;
15
+ export declare function deprecated(thing: string, replacement: string): boolean;
16
+ /**
17
+ * Makes sure that the provided function is invoked at most once.
18
+ */
19
+ export declare function once(func: Lambda): Lambda;
20
+ export declare const noop: () => void;
21
+ export declare function unique<T>(list: T[]): T[];
22
+ export declare function isObject(value: any): boolean;
23
+ export declare function isPlainObject(value: any): boolean;
24
+ export declare function makeNonEnumerable(object: any, propNames: PropertyKey[]): void;
25
+ export declare function addHiddenProp(object: any, propName: PropertyKey, value: any): void;
26
+ export declare function addHiddenFinalProp(object: any, propName: PropertyKey, value: any): void;
27
+ export declare function isPropertyConfigurable(object: any, prop: PropertyKey): boolean;
28
+ export declare function assertPropertyConfigurable(object: any, prop: PropertyKey): void;
29
+ export declare function createInstanceofPredicate<T>(name: string, clazz: new (...args: any[]) => T): (x: any) => x is T;
30
+ /**
31
+ * Returns whether the argument is an array, disregarding observability.
32
+ */
33
+ export declare function isArrayLike(x: any): x is Array<any> | IObservableArray<any>;
34
+ export declare function isES6Map(thing: any): boolean;
35
+ export declare function isES6Set(thing: any): thing is Set<any>;
36
+ /**
37
+ * Returns the following: own keys, prototype keys & own symbol keys, if they are enumerable.
38
+ */
39
+ export declare function getPlainObjectKeys(object: any): (string | number | symbol)[];
40
+ export declare function stringifyKey(key: any): string;
41
+ export declare function getMapLikeKeys<K, V>(map: ObservableMap<K, V>): ReadonlyArray<K>;
42
+ export declare function getMapLikeKeys<V>(map: IKeyValueMap<V> | any): ReadonlyArray<string>;
43
+ export declare function toPrimitive(value: any): any;
package/package.json CHANGED
@@ -1,40 +1,19 @@
1
1
  {
2
2
  "name": "mobx",
3
- "version": "5.15.0",
3
+ "version": "5.15.4",
4
4
  "description": "Simple, scalable state management.",
5
- "main": "lib/mobx.js",
5
+ "main": "lib/index.js",
6
6
  "umd:main": "lib/mobx.umd.js",
7
7
  "module": "lib/mobx.module.js",
8
8
  "browser": {
9
- "./lib/mobx.js": "./lib/mobx.js",
9
+ "./lib/mobx.js": "./lib/mobx.min.js",
10
10
  "./lib/mobx.module.js": "./lib/mobx.module.js"
11
11
  },
12
12
  "unpkg": "lib/mobx.umd.min.js",
13
13
  "jsnext:main": "lib/mobx.module.js",
14
14
  "react-native": "lib/mobx.module.js",
15
15
  "typings": "lib/mobx.d.ts",
16
- "scripts": {
17
- "test": "jest",
18
- "watch": "jest --watch",
19
- "test:mixed-versions": "jest --testRegex mixed-versions",
20
- "test:all": "yarn tsc --noEmit && yarn lint && yarn jest -i && yarn test:flow && yarn test:mixed-versions",
21
- "test:webpack": "node scripts/webpack-regression-tests.js",
22
- "test:flow": "node_modules/.bin/flow check",
23
- "test:performance": "PERSIST=true time node --expose-gc test/perf/index.js",
24
- "test:ci": "yarn test:all && yarn test:performance && yarn test -i --coverage && yarn test:webpack && yarn size",
25
- "prettier": "prettier \"**/*.js\" \"**/*.jsx\" \"**/*.tsx\" \"**/*.ts\" \"docs/**/*.md\"",
26
- "_prepublish": "yarn small-build",
27
- "quick-build": "tsc --pretty",
28
- "small-build": "node scripts/build.js",
29
- "lint": "eslint src/**/*.ts",
30
- "size": "size-limit",
31
- "publish-script": "node scripts/publish.js",
32
- "docs:build": "yarn --cwd website build",
33
- "docs:start": "yarn --cwd website start",
34
- "docs:publish": "yarn --cwd website publish-gh-pages",
35
- "prepare": "yarn --cwd website install",
36
- "dedup": "npx yarn-deduplicate -s fewer yarn.lock"
37
- },
16
+ "scripts": {},
38
17
  "repository": {
39
18
  "type": "git",
40
19
  "url": "https://github.com/mobxjs/mobx.git"
@@ -43,7 +22,7 @@
43
22
  "license": "MIT",
44
23
  "funding": {
45
24
  "type": "opencollective",
46
- "url": "https://opencollective.com/immer"
25
+ "url": "https://opencollective.com/mobx"
47
26
  },
48
27
  "bugs": {
49
28
  "url": "https://github.com/mobxjs/mobx/issues"
@@ -53,41 +32,8 @@
53
32
  "LICENSE"
54
33
  ],
55
34
  "homepage": "https://mobx.js.org/",
56
- "devDependencies": {
57
- "@babel/core": "^7.3.4",
58
- "@babel/plugin-proposal-class-properties": "^7.3.4",
59
- "@babel/plugin-proposal-decorators": "^7.3.0",
60
- "@babel/plugin-transform-runtime": "^7.3.4",
61
- "@babel/preset-env": "^7.3.4",
62
- "@babel/runtime": "^7.3.4",
63
- "@types/jest": "^24.0.11",
64
- "@types/node": "^11.11.3",
65
- "@typescript-eslint/eslint-plugin": "^1.4.2",
66
- "babel-jest": "^24.5.0",
67
- "chalk": "^1.1.3",
68
- "coveralls": "^3.0.3",
69
- "eslint": "^5.15.2",
70
- "flow-bin": "^0.59.0",
71
- "fs-extra": "^7.0.1",
72
- "husky": "^1.3.1",
73
- "iterall": "^1.2.2",
74
- "jest": "^24.5.0",
75
- "lint-staged": "^8.1.5",
76
- "prettier": "^1.16.4",
77
- "rollup": "^1.6.0",
78
- "rollup-plugin-filesize": "^6.0.1",
79
- "rollup-plugin-node-resolve": "^4.0.1",
80
- "rollup-plugin-replace": "^2.1.0",
81
- "rollup-plugin-terser": "^4.0.4",
82
- "serializr": "^1.5.1",
83
- "shelljs": "^0.8.3",
84
- "size-limit": "^1.3.3",
85
- "tape": "^4.10.1",
86
- "ts-jest": "^24.0.0",
87
- "tslib": "^1.9.3",
88
- "typescript": "^3.3.3333"
89
- },
90
35
  "dependencies": {},
36
+ "devDependencies": {},
91
37
  "keywords": [
92
38
  "mobx",
93
39
  "mobservable",
@@ -107,36 +53,5 @@
107
53
  "prettier --write",
108
54
  "git add"
109
55
  ]
110
- },
111
- "jest": {
112
- "globals": {
113
- "ts-jest": {
114
- "tsConfig": "tsconfig.test.json"
115
- }
116
- },
117
- "transform": {
118
- "^.+\\.tsx?$": "ts-jest",
119
- "^.+\\.jsx?$": "babel-jest"
120
- },
121
- "testRegex": "test/base/.*\\.(t|j)sx?$",
122
- "moduleFileExtensions": [
123
- "ts",
124
- "tsx",
125
- "js",
126
- "jsx",
127
- "json"
128
- ],
129
- "testPathIgnorePatterns": [
130
- "/node_modules/",
131
- "/\\./"
132
- ],
133
- "watchPathIgnorePatterns": [
134
- "<rootDir>/node_modules/"
135
- ]
136
- },
137
- "husky": {
138
- "hooks": {
139
- "pre-commit": "lint-staged"
140
- }
141
56
  }
142
57
  }