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.
- package/CHANGELOG.md +23 -2
- package/README.md +8 -5
- package/lib/api/action.d.ts +13 -25
- package/lib/api/actiondecorator.d.ts +27 -27
- package/lib/api/autorun.d.ts +24 -24
- package/lib/api/become-observed.d.ts +5 -5
- package/lib/api/computed.d.ts +14 -14
- package/lib/api/configure.d.ts +18 -18
- package/lib/api/decorate.d.ts +6 -6
- package/lib/api/extendobservable.d.ts +7 -7
- package/lib/api/extras.d.ts +10 -10
- package/lib/api/flow.d.ts +9 -8
- package/lib/api/intercept-read.d.ts +8 -8
- package/lib/api/intercept.d.ts +8 -8
- package/lib/api/iscomputed.d.ts +3 -3
- package/lib/api/isobservable.d.ts +2 -2
- package/lib/api/object-api.d.ts +34 -34
- package/lib/api/observable.d.ts +44 -44
- package/lib/api/observabledecorator.d.ts +6 -6
- package/lib/api/observe.d.ts +8 -8
- package/lib/api/tojs.d.ts +11 -11
- package/lib/api/trace.d.ts +3 -3
- package/lib/api/transaction.d.ts +8 -8
- package/lib/api/when.d.ts +15 -15
- package/lib/core/action.d.ts +22 -22
- package/lib/core/atom.d.ts +37 -37
- package/lib/core/computedvalue.d.ts +95 -95
- package/lib/core/derivation.d.ts +74 -74
- package/lib/core/globalstate.d.ts +107 -107
- package/lib/core/observable.d.ts +45 -45
- package/lib/core/reaction.d.ts +63 -63
- package/lib/core/spy.d.ts +6 -6
- package/lib/index.js +7 -0
- package/lib/internal.d.ts +45 -45
- package/lib/mobx.d.ts +18 -18
- package/lib/mobx.es6.js +4206 -4190
- package/lib/mobx.js +4344 -4377
- package/lib/mobx.js.flow +6 -4
- package/lib/mobx.min.js +1 -1
- package/lib/mobx.module.js +4393 -4379
- package/lib/mobx.umd.js +4393 -4377
- package/lib/mobx.umd.min.js +1 -1
- package/lib/types/dynamicobject.d.ts +1 -1
- package/lib/types/intercept-utils.d.ts +9 -9
- package/lib/types/listen-utils.d.ts +8 -8
- package/lib/types/modifiers.d.ts +7 -7
- package/lib/types/observablearray.d.ts +42 -42
- package/lib/types/observablemap.d.ts +83 -83
- package/lib/types/observableobject.d.ts +67 -67
- package/lib/types/observableset.d.ts +49 -49
- package/lib/types/observablevalue.d.ts +38 -38
- package/lib/types/type-utils.d.ts +4 -4
- package/lib/utils/comparer.d.ts +14 -14
- package/lib/utils/decorators.d.ts +9 -9
- package/lib/utils/eq.d.ts +1 -1
- package/lib/utils/iterable.d.ts +1 -1
- package/lib/utils/utils.d.ts +43 -43
- package/package.json +6 -91
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
# 5.15.4 / 4.15.4
|
|
2
|
+
|
|
3
|
+
- Fix process.env replacement in build [#2267](https://github.com/mobxjs/mobx/pull/2267) by [@fredyc](https://github.com/fredyc)
|
|
4
|
+
|
|
5
|
+
# 5.15.3 / 4.15.3
|
|
6
|
+
|
|
7
|
+
- Define action name to be as the function name [#2262](https://github.com/mobxjs/mobx/pull/2262) by [@nadavkaner](https://github.com/nadavkaner)
|
|
8
|
+
|
|
9
|
+
# 5.15.2 / 4.15.2
|
|
10
|
+
|
|
11
|
+
- Fixed [#2230](https://github.com/mobxjs/mobx/issue/2230) computedvalue: throw error object instead of string when options is empty [#2243](https://github.com/mobxjs/mobx/pull/2243) by [@ramkumarvenkat](https://github.com/ramkumarvenkat)
|
|
12
|
+
- supports ES6 Sets and Maps in shallow comparer. [#2238](https://github.com/mobxjs/mobx/pull/2238) by [@hearnden](https://github.com/hearnden)
|
|
13
|
+
- `extendObservable`: can be used existing properties again. Fixes [#2250](https://github.com/mobxjs/mobx/issue/2250) through [#2252](https://github.com/mobxjs/mobx/pull/2252) by [@davefeucht](https://github.com/davefeucht)
|
|
14
|
+
|
|
15
|
+
# 5.15.1 / 4.15.1
|
|
16
|
+
|
|
17
|
+
- Make initial values of observable set accept readonly array [#2202](https://github.com/mobxjs/mobx/pull/2202)
|
|
18
|
+
- Expose `_allowStateReadsStart` & `_allowStateReadsEnd`. This is low level stuff you shouldn't need that's mostly useful for library creators. [#2233](https://github.com/mobxjs/mobx/pull/2233)
|
|
19
|
+
- Fixed an issue with `observableRequiresReaction` and updating observable during reaction [#2195](https://github.com/mobxjs/mobx/pull/2196)
|
|
20
|
+
- Improved type inference for `action` [#2213](https://github.com/mobxjs/mobx/pull/2213) ([see detailed explanation](https://github.com/mobxjs/mobx/pull/2218#discussion_r349889440))
|
|
21
|
+
|
|
1
22
|
# 5.15.0
|
|
2
23
|
|
|
3
24
|
**The minimum required TypeScript version is now 3.6**
|
|
@@ -5,7 +26,7 @@
|
|
|
5
26
|
- Fixed flow typings with Typescript v3.6. This means that version of Typescript is required when using flows.
|
|
6
27
|
- Cancelled flows now reject with a `FlowCancellationError` instance whose error message is the same as in previous versions (`"FLOW_CANCELLED"`) so this is not breaking. [#2172](https://github.com/mobxjs/mobx/pull/2172) by [@vonovak](https://github.com/vonovak)
|
|
7
28
|
- Fix running mobx in web worker [#2184](https://github.com/mobxjs/mobx/pull/2184/files) by [@shahata](https://github.com/shahata)
|
|
8
|
-
- Fixed flow typings for Facebook's Flow. A new `CancellablePromise` Flow type is exported. [#
|
|
29
|
+
- Fixed flow typings for Facebook's Flow. A new `CancellablePromise` Flow type is exported. [#2164](https://github.com/mobxjs/mobx/pull/2164) by [@vonovak](https://github.com/vonovak)
|
|
9
30
|
- Added support for symbol keys on observable properties (MobX 5 only). [#2175](https://github.com/mobxjs/mobx/pull/2175) by [@StephenHaney](https://github.com/StephenHaney)
|
|
10
31
|
|
|
11
32
|
# 5.14.2
|
|
@@ -371,7 +392,7 @@ The changes mentioned here are discussed in detail in the [migration notes](http
|
|
|
371
392
|
- `observable.shallowObject(values)` has been removed, instead use `observable.object(values, {}, { deep: false })`
|
|
372
393
|
- `extendShallowObservable(target, props)`, instead use `extendObservable(target, props, {}, { deep: false })`
|
|
373
394
|
- The decorators `observable.ref`, `observable.shallow`, `observable.deep`, `observable.struct` can no longer be used as functions. Instead, they should be passed as part of the `decorators` param to resp. `observable.object` and `extendObservable`
|
|
374
|
-
- The new signature of `extendObservable` is `extendObservable(target, props, decorators?, options?)`. This also means it is no longer possible to pass multiple bags of properties to `extendObservable`.
|
|
395
|
+
- The new signature of `extendObservable` is `extendObservable(target, props, decorators?, options?)`. This also means it is no longer possible to pass multiple bags of properties to `extendObservable`. ~~`extendObservable` can no longer be used to re-declare properties. Use `set` instead to update existing properties (or introduce new ones).~~ Update 13-01-2020: the latter limitation has been reverted in MobX 4.15.2 / 5.15.2
|
|
375
396
|
- Iterating maps now follows the spec, that is, `map.values()`, `map.entries()`, `map.keys()`, `map[@@iterator]()` and `array[@@iterator]()` no longer return an array, but an iterator. Use `mobx.values(map)` or `Array.from(map)` to convert the iterators to arrays.
|
|
376
397
|
- dropped `@computed.equals`, instead, you can now use `@computed({ equals: ... })`
|
|
377
398
|
- `useStrict(boolean)` was dropped, use `configure({ enforceActions: boolean })` instead
|
package/README.md
CHANGED
|
@@ -79,7 +79,8 @@ _Tip: Consider using the faster and smaller ES6 build if targetting a modern env
|
|
|
79
79
|
- LearnCode.academy MobX tutorial [Part I: MobX + React is AWESOME (7m)](https://www.youtube.com/watch?v=_q50BXqkAfI) [Part II: Computed Values and Nested/Referenced Observables (12m.)](https://www.youtube.com/watch?v=nYvNqKrl69s)
|
|
80
80
|
- [Screencast: intro to MobX](https://www.youtube.com/watch?v=K8dr8BMU7-8) - 8m
|
|
81
81
|
- [Talk: State Management Is Easy, React Amsterdam 2016 conf](https://www.youtube.com/watch?v=ApmSsu3qnf0&feature=youtu.be) ([slides](https://speakerdeck.com/mweststrate/state-management-is-easy-introduction-to-mobx))
|
|
82
|
-
-
|
|
82
|
+
- Boilerplates [MobX awesome list](https://github.com/mobxjs/awesome-mobx#boilerplates)
|
|
83
|
+
- Related projects [MobX awesome list](https://github.com/mobxjs/awesome-mobx#related-projects-and-utilities)
|
|
83
84
|
- More tutorials, blogs, videos, and other helpful resources can be found on the [MobX awesome list](https://github.com/mobxjs/awesome-mobx#awesome-mobx)
|
|
84
85
|
|
|
85
86
|
## Introduction
|
|
@@ -312,11 +313,13 @@ And finally, kudos to all the people that believed in, tried, validated and even
|
|
|
312
313
|
## Further resources and documentation
|
|
313
314
|
|
|
314
315
|
- <img src="docs/assets/book.jpg" height="80px"/> [The MobX book](https://books.google.nl/books?id=ALFmDwAAQBAJ&pg=PP1&lpg=PP1&dq=michel+weststrate+mobx+quick+start+guide:+supercharge+the+client+state+in+your+react+apps+with+mobx&source=bl&ots=D460fxti0F&sig=ivDGTxsPNwlOjLHrpKF1nweZFl8&hl=nl&sa=X&ved=2ahUKEwiwl8XO--ncAhWPmbQKHWOYBqIQ6AEwAnoECAkQAQ#v=onepage&q=michel%20weststrate%20mobx%20quick%20start%20guide%3A%20supercharge%20the%20client%20state%20in%20your%20react%20apps%20with%20mobx&f=false) by Pavan Podila and Michel Weststrate (which despite its name is in-depth!)
|
|
315
|
-
- [MobX homepage](http://mobxjs.github.io
|
|
316
|
+
- [MobX homepage](http://mobxjs.github.io)
|
|
316
317
|
- [API overview](http://mobxjs.github.io/mobx/refguide/api.html)
|
|
317
|
-
- [Tutorials
|
|
318
|
-
- [
|
|
319
|
-
- [
|
|
318
|
+
- [Tutorials](https://github.com/mobxjs/awesome-mobx#tutorials)
|
|
319
|
+
- [Blogs](https://github.com/mobxjs/awesome-mobx#blogs)
|
|
320
|
+
- [Videos](https://github.com/mobxjs/awesome-mobx#videos)
|
|
321
|
+
- [Boilerplates](https://github.com/mobxjs/awesome-mobx#boilerplates)
|
|
322
|
+
- [MobX awesome list](https://github.com/mobxjs/awesome-mobx#awesome-mobx)
|
|
320
323
|
|
|
321
324
|
## What others are saying...
|
|
322
325
|
|
package/lib/api/action.d.ts
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
import { IAction } from "../internal";
|
|
2
|
-
export interface IActionFactory {
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<A1, A2, A3, A4, A5, A6, R, T extends (a1: A1, a2: A2, a3: A3, a4: A4, a6: A6) => R>(name: string, fn: T): T & IAction;
|
|
15
|
-
<T extends Function>(fn: T): T & IAction;
|
|
16
|
-
<T extends Function>(name: string, fn: T): T & IAction;
|
|
17
|
-
(customName: string): (target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor) => void;
|
|
18
|
-
(target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): void;
|
|
19
|
-
bound(target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): void;
|
|
20
|
-
}
|
|
21
|
-
export declare const action: IActionFactory;
|
|
22
|
-
export declare function runInAction<T>(block: () => T): T;
|
|
23
|
-
export declare function runInAction<T>(name: string, block: () => T): T;
|
|
24
|
-
export declare function isAction(thing: any): boolean;
|
|
25
|
-
export declare function defineBoundAction(target: any, propertyName: string, fn: Function): void;
|
|
1
|
+
import { IAction } from "../internal";
|
|
2
|
+
export interface IActionFactory {
|
|
3
|
+
<T extends Function | null | undefined>(fn: T): T & IAction;
|
|
4
|
+
<T extends Function | null | undefined>(name: string, fn: T): T & IAction;
|
|
5
|
+
(customName: string): (target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor) => void;
|
|
6
|
+
(target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): void;
|
|
7
|
+
bound(target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const action: IActionFactory;
|
|
10
|
+
export declare function runInAction<T>(block: () => T): T;
|
|
11
|
+
export declare function runInAction<T>(name: string, block: () => T): T;
|
|
12
|
+
export declare function isAction(thing: any): boolean;
|
|
13
|
+
export declare function defineBoundAction(target: any, propertyName: string, fn: Function): void;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { BabelDescriptor } from "../internal";
|
|
2
|
-
declare function dontReassignFields(): void;
|
|
3
|
-
export declare function namedActionDecorator(name: string): (target: any, prop: any, descriptor: BabelDescriptor) => void | {
|
|
4
|
-
value: Function & import("../internal").IAction;
|
|
5
|
-
enumerable: boolean;
|
|
6
|
-
configurable: boolean;
|
|
7
|
-
writable: boolean;
|
|
8
|
-
} | {
|
|
9
|
-
enumerable: boolean;
|
|
10
|
-
configurable: boolean;
|
|
11
|
-
writable: boolean;
|
|
12
|
-
initializer(): Function & import("../internal").IAction;
|
|
13
|
-
value?: undefined;
|
|
14
|
-
};
|
|
15
|
-
export declare function actionFieldDecorator(name: string): (target: any, prop: any, descriptor: any) => void;
|
|
16
|
-
export declare function boundActionDecorator(target: any, propertyName: any, descriptor: any, applyToInstance?: boolean): {
|
|
17
|
-
configurable: boolean;
|
|
18
|
-
enumerable: boolean;
|
|
19
|
-
get(): any;
|
|
20
|
-
set: typeof dontReassignFields;
|
|
21
|
-
} | {
|
|
22
|
-
enumerable: boolean;
|
|
23
|
-
configurable: boolean;
|
|
24
|
-
set(v: any): void;
|
|
25
|
-
get(): undefined;
|
|
26
|
-
} | null;
|
|
27
|
-
export {};
|
|
1
|
+
import { BabelDescriptor } from "../internal";
|
|
2
|
+
declare function dontReassignFields(): void;
|
|
3
|
+
export declare function namedActionDecorator(name: string): (target: any, prop: any, descriptor: BabelDescriptor) => void | {
|
|
4
|
+
value: Function & import("../internal").IAction;
|
|
5
|
+
enumerable: boolean;
|
|
6
|
+
configurable: boolean;
|
|
7
|
+
writable: boolean;
|
|
8
|
+
} | {
|
|
9
|
+
enumerable: boolean;
|
|
10
|
+
configurable: boolean;
|
|
11
|
+
writable: boolean;
|
|
12
|
+
initializer(): Function & import("../internal").IAction;
|
|
13
|
+
value?: undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare function actionFieldDecorator(name: string): (target: any, prop: any, descriptor: any) => void;
|
|
16
|
+
export declare function boundActionDecorator(target: any, propertyName: any, descriptor: any, applyToInstance?: boolean): {
|
|
17
|
+
configurable: boolean;
|
|
18
|
+
enumerable: boolean;
|
|
19
|
+
get(): any;
|
|
20
|
+
set: typeof dontReassignFields;
|
|
21
|
+
} | {
|
|
22
|
+
enumerable: boolean;
|
|
23
|
+
configurable: boolean;
|
|
24
|
+
set(v: any): void;
|
|
25
|
+
get(): undefined;
|
|
26
|
+
} | null;
|
|
27
|
+
export {};
|
package/lib/api/autorun.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { IEqualsComparer, IReactionDisposer, IReactionPublic } from "../internal";
|
|
2
|
-
export interface IAutorunOptions {
|
|
3
|
-
delay?: number;
|
|
4
|
-
name?: string;
|
|
5
|
-
/**
|
|
6
|
-
* Experimental.
|
|
7
|
-
* Warns if the view doesn't track observables
|
|
8
|
-
*/
|
|
9
|
-
requiresObservable?: boolean;
|
|
10
|
-
scheduler?: (callback: () => void) => any;
|
|
11
|
-
onError?: (error: any) => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Creates a named reactive view and keeps it alive, so that the view is always
|
|
15
|
-
* updated if one of the dependencies changes, even when the view is not further used by something else.
|
|
16
|
-
* @param view The reactive view
|
|
17
|
-
* @returns disposer function, which can be used to stop the view from being updated in the future.
|
|
18
|
-
*/
|
|
19
|
-
export declare function autorun(view: (r: IReactionPublic) => any, opts?: IAutorunOptions): IReactionDisposer;
|
|
20
|
-
export declare type IReactionOptions = IAutorunOptions & {
|
|
21
|
-
fireImmediately?: boolean;
|
|
22
|
-
equals?: IEqualsComparer<any>;
|
|
23
|
-
};
|
|
24
|
-
export declare function reaction<T>(expression: (r: IReactionPublic) => T, effect: (arg: T, r: IReactionPublic) => void, opts?: IReactionOptions): IReactionDisposer;
|
|
1
|
+
import { IEqualsComparer, IReactionDisposer, IReactionPublic } from "../internal";
|
|
2
|
+
export interface IAutorunOptions {
|
|
3
|
+
delay?: number;
|
|
4
|
+
name?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Experimental.
|
|
7
|
+
* Warns if the view doesn't track observables
|
|
8
|
+
*/
|
|
9
|
+
requiresObservable?: boolean;
|
|
10
|
+
scheduler?: (callback: () => void) => any;
|
|
11
|
+
onError?: (error: any) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a named reactive view and keeps it alive, so that the view is always
|
|
15
|
+
* updated if one of the dependencies changes, even when the view is not further used by something else.
|
|
16
|
+
* @param view The reactive view
|
|
17
|
+
* @returns disposer function, which can be used to stop the view from being updated in the future.
|
|
18
|
+
*/
|
|
19
|
+
export declare function autorun(view: (r: IReactionPublic) => any, opts?: IAutorunOptions): IReactionDisposer;
|
|
20
|
+
export declare type IReactionOptions = IAutorunOptions & {
|
|
21
|
+
fireImmediately?: boolean;
|
|
22
|
+
equals?: IEqualsComparer<any>;
|
|
23
|
+
};
|
|
24
|
+
export declare function reaction<T>(expression: (r: IReactionPublic) => T, effect: (arg: T, r: IReactionPublic) => void, opts?: IReactionOptions): IReactionDisposer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IComputedValue, IObservable, IObservableArray, Lambda, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
-
export declare function onBecomeObserved(value: IObservable | IComputedValue<any> | IObservableArray<any> | ObservableMap<any, any> | ObservableSet<any>, listener: Lambda): Lambda;
|
|
3
|
-
export declare function onBecomeObserved<K, V = any>(value: ObservableMap<K, V> | Object, property: K, listener: Lambda): Lambda;
|
|
4
|
-
export declare function onBecomeUnobserved(value: IObservable | IComputedValue<any> | IObservableArray<any> | ObservableMap<any, any> | ObservableSet<any>, listener: Lambda): Lambda;
|
|
5
|
-
export declare function onBecomeUnobserved<K, V = any>(value: ObservableMap<K, V> | Object, property: K, listener: Lambda): Lambda;
|
|
1
|
+
import { IComputedValue, IObservable, IObservableArray, Lambda, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
+
export declare function onBecomeObserved(value: IObservable | IComputedValue<any> | IObservableArray<any> | ObservableMap<any, any> | ObservableSet<any>, listener: Lambda): Lambda;
|
|
3
|
+
export declare function onBecomeObserved<K, V = any>(value: ObservableMap<K, V> | Object, property: K, listener: Lambda): Lambda;
|
|
4
|
+
export declare function onBecomeUnobserved(value: IObservable | IComputedValue<any> | IObservableArray<any> | ObservableMap<any, any> | ObservableSet<any>, listener: Lambda): Lambda;
|
|
5
|
+
export declare function onBecomeUnobserved<K, V = any>(value: ObservableMap<K, V> | Object, property: K, listener: Lambda): Lambda;
|
package/lib/api/computed.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IComputedValue, IComputedValueOptions } from "../internal";
|
|
2
|
-
export interface IComputed {
|
|
3
|
-
<T>(options: IComputedValueOptions<T>): any;
|
|
4
|
-
<T>(func: () => T, setter: (v: T) => void): IComputedValue<T>;
|
|
5
|
-
<T>(func: () => T, options?: IComputedValueOptions<T>): IComputedValue<T>;
|
|
6
|
-
(target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor): void;
|
|
7
|
-
struct(target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor): void;
|
|
8
|
-
}
|
|
9
|
-
export declare const computedDecorator: Function;
|
|
10
|
-
/**
|
|
11
|
-
* Decorator for class properties: @computed get value() { return expr; }.
|
|
12
|
-
* For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;
|
|
13
|
-
*/
|
|
14
|
-
export declare const computed: IComputed;
|
|
1
|
+
import { IComputedValue, IComputedValueOptions } from "../internal";
|
|
2
|
+
export interface IComputed {
|
|
3
|
+
<T>(options: IComputedValueOptions<T>): any;
|
|
4
|
+
<T>(func: () => T, setter: (v: T) => void): IComputedValue<T>;
|
|
5
|
+
<T>(func: () => T, options?: IComputedValueOptions<T>): IComputedValue<T>;
|
|
6
|
+
(target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor): void;
|
|
7
|
+
struct(target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const computedDecorator: Function;
|
|
10
|
+
/**
|
|
11
|
+
* Decorator for class properties: @computed get value() { return expr; }.
|
|
12
|
+
* For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;
|
|
13
|
+
*/
|
|
14
|
+
export declare const computed: IComputed;
|
package/lib/api/configure.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare function configure(options: {
|
|
2
|
-
enforceActions?: boolean | "strict" | "never" | "always" | "observed";
|
|
3
|
-
computedRequiresReaction?: boolean;
|
|
4
|
-
/**
|
|
5
|
-
* (Experimental)
|
|
6
|
-
* Warn if you try to create to derivation / reactive context without accessing any observable.
|
|
7
|
-
*/
|
|
8
|
-
reactionRequiresObservable?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* (Experimental)
|
|
11
|
-
* Warn if observables are accessed outside a reactive context
|
|
12
|
-
*/
|
|
13
|
-
observableRequiresReaction?: boolean;
|
|
14
|
-
computedConfigurable?: boolean;
|
|
15
|
-
isolateGlobalState?: boolean;
|
|
16
|
-
disableErrorBoundaries?: boolean;
|
|
17
|
-
reactionScheduler?: (f: () => void) => void;
|
|
18
|
-
}): void;
|
|
1
|
+
export declare function configure(options: {
|
|
2
|
+
enforceActions?: boolean | "strict" | "never" | "always" | "observed";
|
|
3
|
+
computedRequiresReaction?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* (Experimental)
|
|
6
|
+
* Warn if you try to create to derivation / reactive context without accessing any observable.
|
|
7
|
+
*/
|
|
8
|
+
reactionRequiresObservable?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* (Experimental)
|
|
11
|
+
* Warn if observables are accessed outside a reactive context
|
|
12
|
+
*/
|
|
13
|
+
observableRequiresReaction?: boolean;
|
|
14
|
+
computedConfigurable?: boolean;
|
|
15
|
+
isolateGlobalState?: boolean;
|
|
16
|
+
disableErrorBoundaries?: boolean;
|
|
17
|
+
reactionScheduler?: (f: () => void) => void;
|
|
18
|
+
}): void;
|
package/lib/api/decorate.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function decorate<T>(clazz: new (...args: any[]) => T, decorators: {
|
|
2
|
-
[P in keyof T]?: MethodDecorator | PropertyDecorator | Array<MethodDecorator> | Array<PropertyDecorator>;
|
|
3
|
-
}): void;
|
|
4
|
-
export declare function decorate<T>(object: T, decorators: {
|
|
5
|
-
[P in keyof T]?: MethodDecorator | PropertyDecorator | Array<MethodDecorator> | Array<PropertyDecorator>;
|
|
6
|
-
}): T;
|
|
1
|
+
export declare function decorate<T>(clazz: new (...args: any[]) => T, decorators: {
|
|
2
|
+
[P in keyof T]?: MethodDecorator | PropertyDecorator | Array<MethodDecorator> | Array<PropertyDecorator>;
|
|
3
|
+
}): void;
|
|
4
|
+
export declare function decorate<T>(object: T, decorators: {
|
|
5
|
+
[P in keyof T]?: MethodDecorator | PropertyDecorator | Array<MethodDecorator> | Array<PropertyDecorator>;
|
|
6
|
+
}): T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CreateObservableOptions } from "../internal";
|
|
2
|
-
import { IObservableDecorator } from "./observabledecorator";
|
|
3
|
-
export declare function extendObservable<A extends Object, B extends Object>(target: A, properties?: B, decorators?: {
|
|
4
|
-
[K in keyof B]?: Function;
|
|
5
|
-
}, options?: CreateObservableOptions): A & B;
|
|
6
|
-
export declare function getDefaultDecoratorFromObjectOptions(options: CreateObservableOptions): IObservableDecorator;
|
|
7
|
-
export declare function extendObservableObjectWithProperties(target: any, properties: any, decorators: any, defaultDecorator: any): void;
|
|
1
|
+
import { CreateObservableOptions } from "../internal";
|
|
2
|
+
import { IObservableDecorator } from "./observabledecorator";
|
|
3
|
+
export declare function extendObservable<A extends Object, B extends Object>(target: A, properties?: B, decorators?: {
|
|
4
|
+
[K in keyof B]?: Function;
|
|
5
|
+
}, options?: CreateObservableOptions): A & B;
|
|
6
|
+
export declare function getDefaultDecoratorFromObjectOptions(options: CreateObservableOptions): IObservableDecorator;
|
|
7
|
+
export declare function extendObservableObjectWithProperties(target: any, properties: any, decorators: any, defaultDecorator: any): void;
|
package/lib/api/extras.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export interface IDependencyTree {
|
|
2
|
-
name: string;
|
|
3
|
-
dependencies?: IDependencyTree[];
|
|
4
|
-
}
|
|
5
|
-
export interface IObserverTree {
|
|
6
|
-
name: string;
|
|
7
|
-
observers?: IObserverTree[];
|
|
8
|
-
}
|
|
9
|
-
export declare function getDependencyTree(thing: any, property?: string): IDependencyTree;
|
|
10
|
-
export declare function getObserverTree(thing: any, property?: string): IObserverTree;
|
|
1
|
+
export interface IDependencyTree {
|
|
2
|
+
name: string;
|
|
3
|
+
dependencies?: IDependencyTree[];
|
|
4
|
+
}
|
|
5
|
+
export interface IObserverTree {
|
|
6
|
+
name: string;
|
|
7
|
+
observers?: IObserverTree[];
|
|
8
|
+
}
|
|
9
|
+
export declare function getDependencyTree(thing: any, property?: string): IDependencyTree;
|
|
10
|
+
export declare function getObserverTree(thing: any, property?: string): IObserverTree;
|
package/lib/api/flow.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export declare function FlowCancellationError(): void;
|
|
2
|
+
export declare namespace FlowCancellationError {
|
|
3
|
+
var prototype: any;
|
|
4
|
+
}
|
|
5
|
+
export declare function isFlowCancellationError(error: Error): boolean;
|
|
6
|
+
export declare type CancellablePromise<T> = Promise<T> & {
|
|
7
|
+
cancel(): void;
|
|
8
|
+
};
|
|
9
|
+
export declare function flow<R, Args extends any[]>(generator: (...args: Args) => Generator<any, R, any> | AsyncGenerator<any, R, any>): (...args: Args) => CancellablePromise<R>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IObservableArray, IObservableValue, Lambda, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
-
export declare type ReadInterceptor<T> = (value: any) => T;
|
|
3
|
-
/** Experimental feature right now, tested indirectly via Mobx-State-Tree */
|
|
4
|
-
export declare function interceptReads<T>(value: IObservableValue<T>, handler: ReadInterceptor<T>): Lambda;
|
|
5
|
-
export declare function interceptReads<T>(observableArray: IObservableArray<T>, handler: ReadInterceptor<T>): Lambda;
|
|
6
|
-
export declare function interceptReads<K, V>(observableMap: ObservableMap<K, V>, handler: ReadInterceptor<V>): Lambda;
|
|
7
|
-
export declare function interceptReads<V>(observableSet: ObservableSet<V>, handler: ReadInterceptor<V>): Lambda;
|
|
8
|
-
export declare function interceptReads(object: Object, property: string, handler: ReadInterceptor<any>): Lambda;
|
|
1
|
+
import { IObservableArray, IObservableValue, Lambda, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
+
export declare type ReadInterceptor<T> = (value: any) => T;
|
|
3
|
+
/** Experimental feature right now, tested indirectly via Mobx-State-Tree */
|
|
4
|
+
export declare function interceptReads<T>(value: IObservableValue<T>, handler: ReadInterceptor<T>): Lambda;
|
|
5
|
+
export declare function interceptReads<T>(observableArray: IObservableArray<T>, handler: ReadInterceptor<T>): Lambda;
|
|
6
|
+
export declare function interceptReads<K, V>(observableMap: ObservableMap<K, V>, handler: ReadInterceptor<V>): Lambda;
|
|
7
|
+
export declare function interceptReads<V>(observableSet: ObservableSet<V>, handler: ReadInterceptor<V>): Lambda;
|
|
8
|
+
export declare function interceptReads(object: Object, property: string, handler: ReadInterceptor<any>): Lambda;
|
package/lib/api/intercept.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IArrayWillChange, IArrayWillSplice, IInterceptor, IMapWillChange, IObjectWillChange, IObservableArray, IObservableValue, IValueWillChange, Lambda, ObservableMap, ObservableSet, ISetWillChange } from "../internal";
|
|
2
|
-
export declare function intercept<T>(value: IObservableValue<T>, handler: IInterceptor<IValueWillChange<T>>): Lambda;
|
|
3
|
-
export declare function intercept<T>(observableArray: IObservableArray<T>, handler: IInterceptor<IArrayWillChange<T> | IArrayWillSplice<T>>): Lambda;
|
|
4
|
-
export declare function intercept<K, V>(observableMap: ObservableMap<K, V>, handler: IInterceptor<IMapWillChange<K, V>>): Lambda;
|
|
5
|
-
export declare function intercept<V>(observableMap: ObservableSet<V>, handler: IInterceptor<ISetWillChange<V>>): Lambda;
|
|
6
|
-
export declare function intercept<K, V>(observableMap: ObservableMap<K, V>, property: K, handler: IInterceptor<IValueWillChange<V>>): Lambda;
|
|
7
|
-
export declare function intercept(object: Object, handler: IInterceptor<IObjectWillChange>): Lambda;
|
|
8
|
-
export declare function intercept<T extends Object, K extends keyof T>(object: T, property: K, handler: IInterceptor<IValueWillChange<any>>): Lambda;
|
|
1
|
+
import { IArrayWillChange, IArrayWillSplice, IInterceptor, IMapWillChange, IObjectWillChange, IObservableArray, IObservableValue, IValueWillChange, Lambda, ObservableMap, ObservableSet, ISetWillChange } from "../internal";
|
|
2
|
+
export declare function intercept<T>(value: IObservableValue<T>, handler: IInterceptor<IValueWillChange<T>>): Lambda;
|
|
3
|
+
export declare function intercept<T>(observableArray: IObservableArray<T>, handler: IInterceptor<IArrayWillChange<T> | IArrayWillSplice<T>>): Lambda;
|
|
4
|
+
export declare function intercept<K, V>(observableMap: ObservableMap<K, V>, handler: IInterceptor<IMapWillChange<K, V>>): Lambda;
|
|
5
|
+
export declare function intercept<V>(observableMap: ObservableSet<V>, handler: IInterceptor<ISetWillChange<V>>): Lambda;
|
|
6
|
+
export declare function intercept<K, V>(observableMap: ObservableMap<K, V>, property: K, handler: IInterceptor<IValueWillChange<V>>): Lambda;
|
|
7
|
+
export declare function intercept(object: Object, handler: IInterceptor<IObjectWillChange>): Lambda;
|
|
8
|
+
export declare function intercept<T extends Object, K extends keyof T>(object: T, property: K, handler: IInterceptor<IValueWillChange<any>>): Lambda;
|
package/lib/api/iscomputed.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function _isComputed(value: any, property?: string): boolean;
|
|
2
|
-
export declare function isComputed(value: any): boolean;
|
|
3
|
-
export declare function isComputedProp(value: any, propName: string): boolean;
|
|
1
|
+
export declare function _isComputed(value: any, property?: string): boolean;
|
|
2
|
+
export declare function isComputed(value: any): boolean;
|
|
3
|
+
export declare function isComputedProp(value: any, propName: string): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isObservable(value: any): boolean;
|
|
2
|
-
export declare function isObservableProp(value: any, propName: string): boolean;
|
|
1
|
+
export declare function isObservable(value: any): boolean;
|
|
2
|
+
export declare function isObservableProp(value: any, propName: string): boolean;
|
package/lib/api/object-api.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { IObservableArray, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
-
export declare function keys<K>(map: ObservableMap<K, any>): ReadonlyArray<K>;
|
|
3
|
-
export declare function keys<T>(ar: IObservableArray<T>): ReadonlyArray<number>;
|
|
4
|
-
export declare function keys<T>(set: ObservableSet<T>): ReadonlyArray<T>;
|
|
5
|
-
export declare function keys<T extends Object>(obj: T): ReadonlyArray<PropertyKey>;
|
|
6
|
-
export declare function values<K, T>(map: ObservableMap<K, T>): ReadonlyArray<T>;
|
|
7
|
-
export declare function values<T>(set: ObservableSet<T>): ReadonlyArray<T>;
|
|
8
|
-
export declare function values<T>(ar: IObservableArray<T>): ReadonlyArray<T>;
|
|
9
|
-
export declare function values<T = any>(obj: T): ReadonlyArray<T extends object ? T[keyof T] : any>;
|
|
10
|
-
export declare function entries<K, T>(map: ObservableMap<K, T>): ReadonlyArray<[K, T]>;
|
|
11
|
-
export declare function entries<T>(set: ObservableSet<T>): ReadonlyArray<[T, T]>;
|
|
12
|
-
export declare function entries<T>(ar: IObservableArray<T>): ReadonlyArray<[number, T]>;
|
|
13
|
-
export declare function entries<T = any>(obj: T): ReadonlyArray<[string, T extends object ? T[keyof T] : any]>;
|
|
14
|
-
export declare function set<V>(obj: ObservableMap<PropertyKey, V>, values: {
|
|
15
|
-
[key: string]: V;
|
|
16
|
-
}): any;
|
|
17
|
-
export declare function set<K, V>(obj: ObservableMap<K, V>, key: K, value: V): any;
|
|
18
|
-
export declare function set<T>(obj: ObservableSet<T>, value: T): any;
|
|
19
|
-
export declare function set<T>(obj: IObservableArray<T>, index: number, value: T): any;
|
|
20
|
-
export declare function set<T extends Object>(obj: T, values: {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}): any;
|
|
23
|
-
export declare function set<T extends Object>(obj: T, key: PropertyKey, value: any): any;
|
|
24
|
-
export declare function remove<K, V>(obj: ObservableMap<K, V>, key: K): any;
|
|
25
|
-
export declare function remove<T>(obj: ObservableSet<T>, key: T): any;
|
|
26
|
-
export declare function remove<T>(obj: IObservableArray<T>, index: number): any;
|
|
27
|
-
export declare function remove<T extends Object>(obj: T, key: string): any;
|
|
28
|
-
export declare function has<K>(obj: ObservableMap<K, any>, key: K): boolean;
|
|
29
|
-
export declare function has<T>(obj: ObservableSet<T>, key: T): boolean;
|
|
30
|
-
export declare function has<T>(obj: IObservableArray<T>, index: number): boolean;
|
|
31
|
-
export declare function has<T extends Object>(obj: T, key: string): boolean;
|
|
32
|
-
export declare function get<K, V>(obj: ObservableMap<K, V>, key: K): V | undefined;
|
|
33
|
-
export declare function get<T>(obj: IObservableArray<T>, index: number): T | undefined;
|
|
34
|
-
export declare function get<T extends Object>(obj: T, key: string): any;
|
|
1
|
+
import { IObservableArray, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
+
export declare function keys<K>(map: ObservableMap<K, any>): ReadonlyArray<K>;
|
|
3
|
+
export declare function keys<T>(ar: IObservableArray<T>): ReadonlyArray<number>;
|
|
4
|
+
export declare function keys<T>(set: ObservableSet<T>): ReadonlyArray<T>;
|
|
5
|
+
export declare function keys<T extends Object>(obj: T): ReadonlyArray<PropertyKey>;
|
|
6
|
+
export declare function values<K, T>(map: ObservableMap<K, T>): ReadonlyArray<T>;
|
|
7
|
+
export declare function values<T>(set: ObservableSet<T>): ReadonlyArray<T>;
|
|
8
|
+
export declare function values<T>(ar: IObservableArray<T>): ReadonlyArray<T>;
|
|
9
|
+
export declare function values<T = any>(obj: T): ReadonlyArray<T extends object ? T[keyof T] : any>;
|
|
10
|
+
export declare function entries<K, T>(map: ObservableMap<K, T>): ReadonlyArray<[K, T]>;
|
|
11
|
+
export declare function entries<T>(set: ObservableSet<T>): ReadonlyArray<[T, T]>;
|
|
12
|
+
export declare function entries<T>(ar: IObservableArray<T>): ReadonlyArray<[number, T]>;
|
|
13
|
+
export declare function entries<T = any>(obj: T): ReadonlyArray<[string, T extends object ? T[keyof T] : any]>;
|
|
14
|
+
export declare function set<V>(obj: ObservableMap<PropertyKey, V>, values: {
|
|
15
|
+
[key: string]: V;
|
|
16
|
+
}): any;
|
|
17
|
+
export declare function set<K, V>(obj: ObservableMap<K, V>, key: K, value: V): any;
|
|
18
|
+
export declare function set<T>(obj: ObservableSet<T>, value: T): any;
|
|
19
|
+
export declare function set<T>(obj: IObservableArray<T>, index: number, value: T): any;
|
|
20
|
+
export declare function set<T extends Object>(obj: T, values: {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}): any;
|
|
23
|
+
export declare function set<T extends Object>(obj: T, key: PropertyKey, value: any): any;
|
|
24
|
+
export declare function remove<K, V>(obj: ObservableMap<K, V>, key: K): any;
|
|
25
|
+
export declare function remove<T>(obj: ObservableSet<T>, key: T): any;
|
|
26
|
+
export declare function remove<T>(obj: IObservableArray<T>, index: number): any;
|
|
27
|
+
export declare function remove<T extends Object>(obj: T, key: string): any;
|
|
28
|
+
export declare function has<K>(obj: ObservableMap<K, any>, key: K): boolean;
|
|
29
|
+
export declare function has<T>(obj: ObservableSet<T>, key: T): boolean;
|
|
30
|
+
export declare function has<T>(obj: IObservableArray<T>, index: number): boolean;
|
|
31
|
+
export declare function has<T extends Object>(obj: T, key: string): boolean;
|
|
32
|
+
export declare function get<K, V>(obj: ObservableMap<K, V>, key: K): V | undefined;
|
|
33
|
+
export declare function get<T>(obj: IObservableArray<T>, index: number): T | undefined;
|
|
34
|
+
export declare function get<T extends Object>(obj: T, key: string): any;
|
package/lib/api/observable.d.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { IEnhancer, IEqualsComparer, IObservableArray, IObservableDecorator, IObservableMapInitialValues, IObservableSetInitialValues, IObservableObject, IObservableValue, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
-
export declare type CreateObservableOptions = {
|
|
3
|
-
name?: string;
|
|
4
|
-
equals?: IEqualsComparer<any>;
|
|
5
|
-
deep?: boolean;
|
|
6
|
-
defaultDecorator?: IObservableDecorator;
|
|
7
|
-
proxy?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export declare const defaultCreateObservableOptions: CreateObservableOptions;
|
|
10
|
-
export declare function asCreateObservableOptions(thing: any): CreateObservableOptions;
|
|
11
|
-
export declare const deepDecorator: IObservableDecorator;
|
|
12
|
-
export declare const refDecorator: IObservableDecorator;
|
|
13
|
-
export interface IObservableFactory {
|
|
14
|
-
(value: number | string | null | undefined | boolean): never;
|
|
15
|
-
(target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor): any;
|
|
16
|
-
<T = any>(value: T[], options?: CreateObservableOptions): IObservableArray<T>;
|
|
17
|
-
<T = any>(value: Set<T>, options?: CreateObservableOptions): ObservableSet<T>;
|
|
18
|
-
<K = any, V = any>(value: Map<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>;
|
|
19
|
-
<T extends Object>(value: T, decorators?: {
|
|
20
|
-
[K in keyof T]?: Function;
|
|
21
|
-
}, options?: CreateObservableOptions): T & IObservableObject;
|
|
22
|
-
}
|
|
23
|
-
export interface IObservableFactories {
|
|
24
|
-
box<T = any>(value?: T, options?: CreateObservableOptions): IObservableValue<T>;
|
|
25
|
-
array<T = any>(initialValues?: T[], options?: CreateObservableOptions): IObservableArray<T>;
|
|
26
|
-
set<T = any>(initialValues?: IObservableSetInitialValues<T>, options?: CreateObservableOptions): ObservableSet<T>;
|
|
27
|
-
map<K = any, V = any>(initialValues?: IObservableMapInitialValues<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>;
|
|
28
|
-
object<T = any>(props: T, decorators?: {
|
|
29
|
-
[K in keyof T]?: Function;
|
|
30
|
-
}, options?: CreateObservableOptions): T & IObservableObject;
|
|
31
|
-
/**
|
|
32
|
-
* Decorator that creates an observable that only observes the references, but doesn't try to turn the assigned value into an observable.ts.
|
|
33
|
-
*/
|
|
34
|
-
ref: IObservableDecorator;
|
|
35
|
-
/**
|
|
36
|
-
* Decorator that creates an observable converts its value (objects, maps or arrays) into a shallow observable structure
|
|
37
|
-
*/
|
|
38
|
-
shallow: IObservableDecorator;
|
|
39
|
-
deep: IObservableDecorator;
|
|
40
|
-
struct: IObservableDecorator;
|
|
41
|
-
}
|
|
42
|
-
export declare const observable: IObservableFactory & IObservableFactories & {
|
|
43
|
-
enhancer: IEnhancer<any>;
|
|
44
|
-
};
|
|
1
|
+
import { IEnhancer, IEqualsComparer, IObservableArray, IObservableDecorator, IObservableMapInitialValues, IObservableSetInitialValues, IObservableObject, IObservableValue, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
+
export declare type CreateObservableOptions = {
|
|
3
|
+
name?: string;
|
|
4
|
+
equals?: IEqualsComparer<any>;
|
|
5
|
+
deep?: boolean;
|
|
6
|
+
defaultDecorator?: IObservableDecorator;
|
|
7
|
+
proxy?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const defaultCreateObservableOptions: CreateObservableOptions;
|
|
10
|
+
export declare function asCreateObservableOptions(thing: any): CreateObservableOptions;
|
|
11
|
+
export declare const deepDecorator: IObservableDecorator;
|
|
12
|
+
export declare const refDecorator: IObservableDecorator;
|
|
13
|
+
export interface IObservableFactory {
|
|
14
|
+
(value: number | string | null | undefined | boolean): never;
|
|
15
|
+
(target: Object, key: string | symbol, baseDescriptor?: PropertyDescriptor): any;
|
|
16
|
+
<T = any>(value: T[], options?: CreateObservableOptions): IObservableArray<T>;
|
|
17
|
+
<T = any>(value: Set<T>, options?: CreateObservableOptions): ObservableSet<T>;
|
|
18
|
+
<K = any, V = any>(value: Map<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>;
|
|
19
|
+
<T extends Object>(value: T, decorators?: {
|
|
20
|
+
[K in keyof T]?: Function;
|
|
21
|
+
}, options?: CreateObservableOptions): T & IObservableObject;
|
|
22
|
+
}
|
|
23
|
+
export interface IObservableFactories {
|
|
24
|
+
box<T = any>(value?: T, options?: CreateObservableOptions): IObservableValue<T>;
|
|
25
|
+
array<T = any>(initialValues?: T[], options?: CreateObservableOptions): IObservableArray<T>;
|
|
26
|
+
set<T = any>(initialValues?: IObservableSetInitialValues<T>, options?: CreateObservableOptions): ObservableSet<T>;
|
|
27
|
+
map<K = any, V = any>(initialValues?: IObservableMapInitialValues<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>;
|
|
28
|
+
object<T = any>(props: T, decorators?: {
|
|
29
|
+
[K in keyof T]?: Function;
|
|
30
|
+
}, options?: CreateObservableOptions): T & IObservableObject;
|
|
31
|
+
/**
|
|
32
|
+
* Decorator that creates an observable that only observes the references, but doesn't try to turn the assigned value into an observable.ts.
|
|
33
|
+
*/
|
|
34
|
+
ref: IObservableDecorator;
|
|
35
|
+
/**
|
|
36
|
+
* Decorator that creates an observable converts its value (objects, maps or arrays) into a shallow observable structure
|
|
37
|
+
*/
|
|
38
|
+
shallow: IObservableDecorator;
|
|
39
|
+
deep: IObservableDecorator;
|
|
40
|
+
struct: IObservableDecorator;
|
|
41
|
+
}
|
|
42
|
+
export declare const observable: IObservableFactory & IObservableFactories & {
|
|
43
|
+
enhancer: IEnhancer<any>;
|
|
44
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IEnhancer } from "../internal";
|
|
2
|
-
export declare type IObservableDecorator = {
|
|
3
|
-
(target: Object, property: string | symbol, descriptor?: PropertyDescriptor): void;
|
|
4
|
-
enhancer: IEnhancer<any>;
|
|
5
|
-
};
|
|
6
|
-
export declare function createDecoratorForEnhancer(enhancer: IEnhancer<any>): IObservableDecorator;
|
|
1
|
+
import { IEnhancer } from "../internal";
|
|
2
|
+
export declare type IObservableDecorator = {
|
|
3
|
+
(target: Object, property: string | symbol, descriptor?: PropertyDescriptor): void;
|
|
4
|
+
enhancer: IEnhancer<any>;
|
|
5
|
+
};
|
|
6
|
+
export declare function createDecoratorForEnhancer(enhancer: IEnhancer<any>): IObservableDecorator;
|