mobx 6.10.2 → 6.11.0
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 +9 -0
- package/README.md +2 -2
- package/dist/api/action.d.ts +16 -15
- package/dist/api/annotation.d.ts +19 -18
- package/dist/api/autorun.d.ts +25 -25
- package/dist/api/become-observed.d.ts +5 -5
- package/dist/api/computed.d.ts +14 -13
- package/dist/api/configure.d.ts +17 -17
- package/dist/api/decorators.d.ts +20 -17
- package/dist/api/extendobservable.d.ts +2 -2
- package/dist/api/extras.d.ts +10 -10
- package/dist/api/flow.d.ts +19 -18
- package/dist/api/intercept-read.d.ts +8 -8
- package/dist/api/intercept.d.ts +8 -8
- package/dist/api/iscomputed.d.ts +3 -3
- package/dist/api/isobservable.d.ts +2 -2
- package/dist/api/makeObservable.d.ts +6 -6
- package/dist/api/object-api.d.ts +36 -36
- package/dist/api/observable.d.ts +45 -44
- package/dist/api/observe.d.ts +8 -8
- package/dist/api/tojs.d.ts +7 -7
- package/dist/api/trace.d.ts +3 -3
- package/dist/api/transaction.d.ts +8 -8
- package/dist/api/when.d.ts +11 -11
- package/dist/core/action.d.ts +20 -20
- package/dist/core/atom.d.ts +37 -37
- package/dist/core/computedvalue.d.ts +99 -99
- package/dist/core/derivation.d.ts +73 -73
- package/dist/core/globalstate.d.ts +121 -121
- package/dist/core/observable.d.ts +45 -45
- package/dist/core/reaction.d.ts +62 -62
- package/dist/core/spy.d.ts +37 -37
- package/dist/errors.d.ts +42 -42
- package/dist/internal.d.ts +54 -54
- package/dist/mobx.cjs.development.js +419 -252
- package/dist/mobx.cjs.development.js.map +1 -1
- package/dist/mobx.cjs.production.min.js +1 -1
- package/dist/mobx.cjs.production.min.js.map +1 -1
- package/dist/mobx.d.ts +2 -2
- package/dist/mobx.esm.development.js +419 -252
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +419 -252
- package/dist/mobx.esm.js.map +1 -1
- package/dist/mobx.esm.production.min.js +1 -1
- package/dist/mobx.esm.production.min.js.map +1 -1
- package/dist/mobx.umd.development.js +419 -252
- package/dist/mobx.umd.development.js.map +1 -1
- package/dist/mobx.umd.production.min.js +1 -1
- package/dist/mobx.umd.production.min.js.map +1 -1
- package/dist/types/actionannotation.d.ts +8 -8
- package/dist/types/autoannotation.d.ts +3 -3
- package/dist/types/computedannotation.d.ts +2 -2
- package/dist/types/decorator_fills.d.ts +6 -0
- package/dist/types/dynamicobject.d.ts +2 -2
- package/dist/types/flowannotation.d.ts +2 -2
- package/dist/types/generic-abort-signal.d.ts +6 -6
- package/dist/types/intercept-utils.d.ts +8 -8
- package/dist/types/legacyobservablearray.d.ts +14 -3
- package/dist/types/listen-utils.d.ts +7 -7
- package/dist/types/modifiers.d.ts +7 -7
- package/dist/types/observableannotation.d.ts +2 -2
- package/dist/types/observablearray.d.ts +85 -85
- package/dist/types/observablemap.d.ts +78 -78
- package/dist/types/observableobject.d.ts +98 -98
- package/dist/types/observableset.d.ts +53 -53
- package/dist/types/observablevalue.d.ts +49 -49
- package/dist/types/overrideannotation.d.ts +4 -3
- package/dist/types/type-utils.d.ts +11 -11
- package/dist/utils/comparer.d.ts +14 -14
- package/dist/utils/eq.d.ts +1 -1
- package/dist/utils/global.d.ts +1 -1
- package/dist/utils/iterable.d.ts +1 -1
- package/dist/utils/utils.d.ts +45 -45
- package/package.json +1 -1
- package/src/api/action.ts +21 -4
- package/src/api/annotation.ts +1 -0
- package/src/api/computed.ts +11 -4
- package/src/api/decorators.ts +33 -8
- package/src/api/flow.ts +10 -3
- package/src/api/observable.ts +20 -6
- package/src/types/actionannotation.ts +48 -2
- package/src/types/autoannotation.ts +8 -2
- package/src/types/computedannotation.ts +39 -2
- package/src/types/decorator_fills.ts +33 -0
- package/src/types/flowannotation.ts +28 -2
- package/src/types/legacyobservablearray.ts +1 -1
- package/src/types/observableannotation.ts +75 -2
- package/src/types/overrideannotation.ts +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# mobx
|
|
2
2
|
|
|
3
|
+
## 6.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`c9260974`](https://github.com/mobxjs/mobx/commit/c9260974f726f58de0fd4974ea024c644d9b7c6f) [#3790](https://github.com/mobxjs/mobx/pull/3790) Thanks [@mweststrate](https://github.com/mweststrate)! - Added support for modern 2022.3 Decorators. [#3790](https://github.com/mobxjs/mobx/pull/3790)
|
|
8
|
+
- [Installation / usage instruction](https://mobx.js.org/enabling-decorators.html).
|
|
9
|
+
- [Introduction announcement](https://michel.codes/blogs/mobx-decorators)
|
|
10
|
+
- Original PR by [@Matchlighter](https://github.com/Matchlighter) in [#3638](https://github.com/mobxjs/mobx/pull/3638),
|
|
11
|
+
|
|
3
12
|
## 6.10.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ MobX is made possible by the generosity of the sponsors below, and many other [i
|
|
|
35
35
|
<a href="https://coinbase.com/"><img src="https://mobx.js.org/assets/coinbase.jpeg" align="center" width="100" title="Coinbase" alt="Coinbase" /></a>
|
|
36
36
|
<a href="https://curology.com/blog/tech"><img src="https://mobx.js.org/assets/curology.png" align="center" width="100" title="Curology" alt="Curology"/></a>
|
|
37
37
|
<a href="https://opensource.facebook.com/"><img src="https://mobx.js.org/assets/fbos.jpeg" align="center" width="100" title="Facebook Open Source" alt="Facebook Open Source" /></a>
|
|
38
|
-
<a href="https://www.canva.com/"><img src="https://mobx.js.org/assets/canva.
|
|
38
|
+
<a href="https://www.canva.com/"><img src="https://mobx.js.org/assets/canva.svg" align="center" width="100" title="Canva" alt="Canva" /></a>
|
|
39
39
|
|
|
40
40
|
**🥈 Silver sponsors (\$100+ per month):**<br/>
|
|
41
41
|
|
|
@@ -58,7 +58,7 @@ MobX is made possible by the generosity of the sponsors below, and many other [i
|
|
|
58
58
|
|
|
59
59
|
_Anything that can be derived from the application state, should be. Automatically._
|
|
60
60
|
|
|
61
|
-
MobX is a battle-tested library that makes state management simple and scalable by transparently applying functional reactive programming.
|
|
61
|
+
MobX is a signal based, battle-tested library that makes state management simple and scalable by transparently applying functional reactive programming.
|
|
62
62
|
The philosophy behind MobX is simple:
|
|
63
63
|
|
|
64
64
|
<div class="benefits">
|
package/dist/api/action.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Annotation } from "../internal";
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
<T extends Function | undefined | null>(
|
|
9
|
-
(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare const
|
|
14
|
-
export declare
|
|
15
|
-
export declare function
|
|
1
|
+
import { Annotation } from "../internal";
|
|
2
|
+
import type { ClassFieldDecorator, ClassMethodDecorator } from "../types/decorator_fills";
|
|
3
|
+
export declare const ACTION = "action";
|
|
4
|
+
export declare const ACTION_BOUND = "action.bound";
|
|
5
|
+
export declare const AUTOACTION = "autoAction";
|
|
6
|
+
export declare const AUTOACTION_BOUND = "autoAction.bound";
|
|
7
|
+
export interface IActionFactory extends Annotation, PropertyDecorator, ClassMethodDecorator, ClassFieldDecorator {
|
|
8
|
+
<T extends Function | undefined | null>(fn: T): T;
|
|
9
|
+
<T extends Function | undefined | null>(name: string, fn: T): T;
|
|
10
|
+
(customName: string): PropertyDecorator & Annotation & ClassMethodDecorator & ClassFieldDecorator;
|
|
11
|
+
bound: Annotation & PropertyDecorator & ClassMethodDecorator & ClassFieldDecorator;
|
|
12
|
+
}
|
|
13
|
+
export declare const action: IActionFactory;
|
|
14
|
+
export declare const autoAction: IActionFactory;
|
|
15
|
+
export declare function runInAction<T>(fn: () => T): T;
|
|
16
|
+
export declare function isAction(thing: any): boolean;
|
package/dist/api/annotation.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { ObservableObjectAdministration } from "../internal";
|
|
2
|
-
export declare const enum MakeResult {
|
|
3
|
-
Cancel = 0,
|
|
4
|
-
Break = 1,
|
|
5
|
-
Continue = 2
|
|
6
|
-
}
|
|
7
|
-
export
|
|
8
|
-
annotationType_: string;
|
|
9
|
-
make_(adm: ObservableObjectAdministration, key: PropertyKey, descriptor: PropertyDescriptor, source: object): MakeResult;
|
|
10
|
-
extend_(adm: ObservableObjectAdministration, key: PropertyKey, descriptor: PropertyDescriptor, proxyTrap: boolean): boolean | null;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare function
|
|
1
|
+
import { ObservableObjectAdministration } from "../internal";
|
|
2
|
+
export declare const enum MakeResult {
|
|
3
|
+
Cancel = 0,
|
|
4
|
+
Break = 1,
|
|
5
|
+
Continue = 2
|
|
6
|
+
}
|
|
7
|
+
export type Annotation = {
|
|
8
|
+
annotationType_: string;
|
|
9
|
+
make_(adm: ObservableObjectAdministration, key: PropertyKey, descriptor: PropertyDescriptor, source: object): MakeResult;
|
|
10
|
+
extend_(adm: ObservableObjectAdministration, key: PropertyKey, descriptor: PropertyDescriptor, proxyTrap: boolean): boolean | null;
|
|
11
|
+
decorate_20223_(value: any, context: DecoratorContext): any;
|
|
12
|
+
options_?: any;
|
|
13
|
+
};
|
|
14
|
+
export type AnnotationMapEntry = Annotation | true | false;
|
|
15
|
+
export type AnnotationsMap<T, AdditionalFields extends PropertyKey> = {
|
|
16
|
+
[P in Exclude<keyof T, "toString">]?: AnnotationMapEntry;
|
|
17
|
+
} & Record<AdditionalFields, AnnotationMapEntry>;
|
|
18
|
+
export declare function isAnnotation(thing: any): boolean;
|
|
19
|
+
export declare function isAnnotationMapEntry(thing: any): boolean;
|
package/dist/api/autorun.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { IEqualsComparer, IReactionDisposer, IReactionPublic, GenericAbortSignal } 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
|
-
signal?: GenericAbortSignal;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Creates a named reactive view and keeps it alive, so that the view is always
|
|
16
|
-
* updated if one of the dependencies changes, even when the view is not further used by something else.
|
|
17
|
-
* @param view The reactive view
|
|
18
|
-
* @returns disposer function, which can be used to stop the view from being updated in the future.
|
|
19
|
-
*/
|
|
20
|
-
export declare function autorun(view: (r: IReactionPublic) => any, opts?: IAutorunOptions): IReactionDisposer;
|
|
21
|
-
export
|
|
22
|
-
fireImmediately?: FireImmediately;
|
|
23
|
-
equals?: IEqualsComparer<T>;
|
|
24
|
-
};
|
|
25
|
-
export declare function reaction<T, FireImmediately extends boolean = false>(expression: (r: IReactionPublic) => T, effect: (arg: T, prev: FireImmediately extends true ? T | undefined : T, r: IReactionPublic) => void, opts?: IReactionOptions<T, FireImmediately>): IReactionDisposer;
|
|
1
|
+
import { IEqualsComparer, IReactionDisposer, IReactionPublic, GenericAbortSignal } 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
|
+
signal?: GenericAbortSignal;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates a named reactive view and keeps it alive, so that the view is always
|
|
16
|
+
* updated if one of the dependencies changes, even when the view is not further used by something else.
|
|
17
|
+
* @param view The reactive view
|
|
18
|
+
* @returns disposer function, which can be used to stop the view from being updated in the future.
|
|
19
|
+
*/
|
|
20
|
+
export declare function autorun(view: (r: IReactionPublic) => any, opts?: IAutorunOptions): IReactionDisposer;
|
|
21
|
+
export type IReactionOptions<T, FireImmediately extends boolean> = IAutorunOptions & {
|
|
22
|
+
fireImmediately?: FireImmediately;
|
|
23
|
+
equals?: IEqualsComparer<T>;
|
|
24
|
+
};
|
|
25
|
+
export declare function reaction<T, FireImmediately extends boolean = false>(expression: (r: IReactionPublic) => T, effect: (arg: T, prev: FireImmediately extends true ? T | undefined : T, r: IReactionPublic) => void, opts?: IReactionOptions<T, FireImmediately>): IReactionDisposer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IComputedValue, IObservable, IObservableArray, Lambda, ObservableMap, ObservableSet, IObservableValue } from "../internal";
|
|
2
|
-
export declare function onBecomeObserved(value: IObservable | IComputedValue<any> | IObservableArray<any> | ObservableMap<any, any> | ObservableSet<any> | IObservableValue<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> | IObservableValue<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, IObservableValue } from "../internal";
|
|
2
|
+
export declare function onBecomeObserved(value: IObservable | IComputedValue<any> | IObservableArray<any> | ObservableMap<any, any> | ObservableSet<any> | IObservableValue<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> | IObservableValue<any>, listener: Lambda): Lambda;
|
|
5
|
+
export declare function onBecomeUnobserved<K, V = any>(value: ObservableMap<K, V> | Object, property: K, listener: Lambda): Lambda;
|
package/dist/api/computed.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { IComputedValueOptions, Annotation, IComputedValue } from "../internal";
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
<T>(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { IComputedValueOptions, Annotation, IComputedValue } from "../internal";
|
|
2
|
+
import type { ClassGetterDecorator } from "../types/decorator_fills";
|
|
3
|
+
export declare const COMPUTED = "computed";
|
|
4
|
+
export declare const COMPUTED_STRUCT = "computed.struct";
|
|
5
|
+
export interface IComputedFactory extends Annotation, PropertyDecorator, ClassGetterDecorator {
|
|
6
|
+
<T>(options: IComputedValueOptions<T>): Annotation & PropertyDecorator & ClassGetterDecorator;
|
|
7
|
+
<T>(func: () => T, options?: IComputedValueOptions<T>): IComputedValue<T>;
|
|
8
|
+
struct: Annotation & PropertyDecorator & ClassGetterDecorator;
|
|
9
|
+
}
|
|
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: IComputedFactory;
|
package/dist/api/configure.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export declare function configure(options: {
|
|
2
|
-
enforceActions?: "never" | "always" | "observed";
|
|
3
|
-
computedRequiresReaction?: boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Warn if you try to create to derivation / reactive context without accessing any observable.
|
|
6
|
-
*/
|
|
7
|
-
reactionRequiresObservable?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Warn if observables are accessed outside a reactive context
|
|
10
|
-
*/
|
|
11
|
-
observableRequiresReaction?: boolean;
|
|
12
|
-
isolateGlobalState?: boolean;
|
|
13
|
-
disableErrorBoundaries?: boolean;
|
|
14
|
-
safeDescriptors?: boolean;
|
|
15
|
-
reactionScheduler?: (f: () => void) => void;
|
|
16
|
-
useProxies?: "always" | "never" | "ifavailable";
|
|
17
|
-
}): void;
|
|
1
|
+
export declare function configure(options: {
|
|
2
|
+
enforceActions?: "never" | "always" | "observed";
|
|
3
|
+
computedRequiresReaction?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Warn if you try to create to derivation / reactive context without accessing any observable.
|
|
6
|
+
*/
|
|
7
|
+
reactionRequiresObservable?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Warn if observables are accessed outside a reactive context
|
|
10
|
+
*/
|
|
11
|
+
observableRequiresReaction?: boolean;
|
|
12
|
+
isolateGlobalState?: boolean;
|
|
13
|
+
disableErrorBoundaries?: boolean;
|
|
14
|
+
safeDescriptors?: boolean;
|
|
15
|
+
reactionScheduler?: (f: () => void) => void;
|
|
16
|
+
useProxies?: "always" | "never" | "ifavailable";
|
|
17
|
+
}): void;
|
package/dist/api/decorators.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { Annotation, AnnotationsMap } from "../internal";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { Annotation, AnnotationsMap } from "../internal";
|
|
2
|
+
import type { Decorator } from "../types/decorator_fills";
|
|
3
|
+
export declare const storedAnnotationsSymbol: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Creates a function that acts as
|
|
6
|
+
* - decorator
|
|
7
|
+
* - annotation object
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDecoratorAnnotation<D extends Decorator = Decorator>(annotation: Annotation): PropertyDecorator & Annotation & D;
|
|
10
|
+
/**
|
|
11
|
+
* Stores annotation to prototype,
|
|
12
|
+
* so it can be inspected later by `makeObservable` called from constructor
|
|
13
|
+
*/
|
|
14
|
+
export declare function storeAnnotation(prototype: any, key: PropertyKey, annotation: Annotation): void;
|
|
15
|
+
/**
|
|
16
|
+
* Collects annotations from prototypes and stores them on target (instance)
|
|
17
|
+
*/
|
|
18
|
+
export declare function collectStoredAnnotations(target: any): AnnotationsMap<any, any>;
|
|
19
|
+
export declare function is20223Decorator(context: any): context is DecoratorContext;
|
|
20
|
+
export declare function assert20223DecoratorType(context: DecoratorContext, types: DecoratorContext["kind"][]): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CreateObservableOptions, AnnotationsMap } from "../internal";
|
|
2
|
-
export declare function extendObservable<A extends Object, B extends Object>(target: A, properties: B, annotations?: AnnotationsMap<B, never>, options?: CreateObservableOptions): A & B;
|
|
1
|
+
import { CreateObservableOptions, AnnotationsMap } from "../internal";
|
|
2
|
+
export declare function extendObservable<A extends Object, B extends Object>(target: A, properties: B, annotations?: AnnotationsMap<B, never>, options?: CreateObservableOptions): A & B;
|
package/dist/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/dist/api/flow.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { Annotation } from "../internal";
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export declare
|
|
17
|
-
export declare function
|
|
18
|
-
export
|
|
1
|
+
import { Annotation } from "../internal";
|
|
2
|
+
import type { ClassMethodDecorator } from "../types/decorator_fills";
|
|
3
|
+
export declare const FLOW = "flow";
|
|
4
|
+
export declare function FlowCancellationError(): void;
|
|
5
|
+
export declare namespace FlowCancellationError {
|
|
6
|
+
var prototype: any;
|
|
7
|
+
}
|
|
8
|
+
export declare function isFlowCancellationError(error: Error): boolean;
|
|
9
|
+
export type CancellablePromise<T> = Promise<T> & {
|
|
10
|
+
cancel(): void;
|
|
11
|
+
};
|
|
12
|
+
interface Flow extends Annotation, PropertyDecorator, ClassMethodDecorator {
|
|
13
|
+
<R, Args extends any[]>(generator: (...args: Args) => Generator<any, R, any> | AsyncGenerator<any, R, any>): (...args: Args) => CancellablePromise<R>;
|
|
14
|
+
bound: Annotation & PropertyDecorator & ClassMethodDecorator;
|
|
15
|
+
}
|
|
16
|
+
export declare const flow: Flow;
|
|
17
|
+
export declare function flowResult<T>(result: T): T extends Generator<any, infer R, any> ? CancellablePromise<R> : T extends CancellablePromise<any> ? T : never;
|
|
18
|
+
export declare function isFlow(fn: any): boolean;
|
|
19
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IObservableArray, IObservableValue, Lambda, ObservableMap, ObservableSet } from "../internal";
|
|
2
|
-
export
|
|
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 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/dist/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> | Array<T>, handler: IInterceptor<IArrayWillChange<T> | IArrayWillSplice<T>>): Lambda;
|
|
4
|
-
export declare function intercept<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, handler: IInterceptor<IMapWillChange<K, V>>): Lambda;
|
|
5
|
-
export declare function intercept<V>(observableSet: ObservableSet<V> | Set<V>, handler: IInterceptor<ISetWillChange<V>>): Lambda;
|
|
6
|
-
export declare function intercept<K, V>(observableMap: ObservableMap<K, V> | Map<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<T[K]>>): 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> | Array<T>, handler: IInterceptor<IArrayWillChange<T> | IArrayWillSplice<T>>): Lambda;
|
|
4
|
+
export declare function intercept<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, handler: IInterceptor<IMapWillChange<K, V>>): Lambda;
|
|
5
|
+
export declare function intercept<V>(observableSet: ObservableSet<V> | Set<V>, handler: IInterceptor<ISetWillChange<V>>): Lambda;
|
|
6
|
+
export declare function intercept<K, V>(observableMap: ObservableMap<K, V> | Map<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<T[K]>>): Lambda;
|
package/dist/api/iscomputed.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function _isComputed(value: any, property?: PropertyKey): boolean;
|
|
2
|
-
export declare function isComputed(value: any): boolean;
|
|
3
|
-
export declare function isComputedProp(value: any, propName: PropertyKey): boolean;
|
|
1
|
+
export declare function _isComputed(value: any, property?: PropertyKey): boolean;
|
|
2
|
+
export declare function isComputed(value: any): boolean;
|
|
3
|
+
export declare function isComputedProp(value: any, propName: PropertyKey): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isObservable(value: any): boolean;
|
|
2
|
-
export declare function isObservableProp(value: any, propName: PropertyKey): boolean;
|
|
1
|
+
export declare function isObservable(value: any): boolean;
|
|
2
|
+
export declare function isObservableProp(value: any, propName: PropertyKey): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnnotationsMap, CreateObservableOptions } from "../internal";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare function makeObservable<T extends object, AdditionalKeys extends PropertyKey = never>(target: T, annotations?: AnnotationsMap<T, NoInfer<AdditionalKeys>>, options?: MakeObservableOptions): T;
|
|
5
|
-
export declare function makeAutoObservable<T extends object, AdditionalKeys extends PropertyKey = never>(target: T, overrides?: AnnotationsMap<T, NoInfer<AdditionalKeys>>, options?: MakeObservableOptions): T;
|
|
6
|
-
export {};
|
|
1
|
+
import { AnnotationsMap, CreateObservableOptions } from "../internal";
|
|
2
|
+
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
3
|
+
type MakeObservableOptions = Omit<CreateObservableOptions, "proxy">;
|
|
4
|
+
export declare function makeObservable<T extends object, AdditionalKeys extends PropertyKey = never>(target: T, annotations?: AnnotationsMap<T, NoInfer<AdditionalKeys>>, options?: MakeObservableOptions): T;
|
|
5
|
+
export declare function makeAutoObservable<T extends object, AdditionalKeys extends PropertyKey = never>(target: T, overrides?: AnnotationsMap<T, NoInfer<AdditionalKeys>>, options?: MakeObservableOptions): T;
|
|
6
|
+
export {};
|
package/dist/api/object-api.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
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;
|
|
35
|
-
export declare function apiDefineProperty(obj: Object, key: PropertyKey, descriptor: PropertyDescriptor): any;
|
|
36
|
-
export declare function apiOwnKeys(obj: Object): 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;
|
|
35
|
+
export declare function apiDefineProperty(obj: Object, key: PropertyKey, descriptor: PropertyDescriptor): any;
|
|
36
|
+
export declare function apiOwnKeys(obj: Object): any;
|
package/dist/api/observable.d.ts
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { IEnhancer, IEqualsComparer, IObservableArray, IObservableMapInitialValues, IObservableSetInitialValues, IObservableValue, ObservableMap, ObservableSet, Annotation, AnnotationsMap } from "../internal";
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
18
|
-
export declare function
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
<T>(value
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<T = any>(value:
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
import { IEnhancer, IEqualsComparer, IObservableArray, IObservableMapInitialValues, IObservableSetInitialValues, IObservableValue, ObservableMap, ObservableSet, Annotation, AnnotationsMap } from "../internal";
|
|
2
|
+
import type { ClassAccessorDecorator, ClassFieldDecorator } from "../types/decorator_fills";
|
|
3
|
+
export declare const OBSERVABLE = "observable";
|
|
4
|
+
export declare const OBSERVABLE_REF = "observable.ref";
|
|
5
|
+
export declare const OBSERVABLE_SHALLOW = "observable.shallow";
|
|
6
|
+
export declare const OBSERVABLE_STRUCT = "observable.struct";
|
|
7
|
+
export type CreateObservableOptions = {
|
|
8
|
+
name?: string;
|
|
9
|
+
equals?: IEqualsComparer<any>;
|
|
10
|
+
deep?: boolean;
|
|
11
|
+
defaultDecorator?: Annotation;
|
|
12
|
+
proxy?: boolean;
|
|
13
|
+
autoBind?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const defaultCreateObservableOptions: CreateObservableOptions;
|
|
16
|
+
export declare function asCreateObservableOptions(thing: any): CreateObservableOptions;
|
|
17
|
+
export declare function getEnhancerFromOptions(options: CreateObservableOptions): IEnhancer<any>;
|
|
18
|
+
export declare function getAnnotationFromOptions(options?: CreateObservableOptions): Annotation | undefined;
|
|
19
|
+
export declare function getEnhancerFromAnnotation(annotation?: Annotation): IEnhancer<any>;
|
|
20
|
+
export interface IObservableValueFactory {
|
|
21
|
+
<T>(value: T, options?: CreateObservableOptions): IObservableValue<T>;
|
|
22
|
+
<T>(value?: T, options?: CreateObservableOptions): IObservableValue<T | undefined>;
|
|
23
|
+
}
|
|
24
|
+
export interface IObservableFactory extends Annotation, PropertyDecorator, ClassAccessorDecorator, ClassFieldDecorator {
|
|
25
|
+
<T = any>(value: T[], options?: CreateObservableOptions): IObservableArray<T>;
|
|
26
|
+
<T = any>(value: Set<T>, options?: CreateObservableOptions): ObservableSet<T>;
|
|
27
|
+
<K = any, V = any>(value: Map<K, V>, options?: CreateObservableOptions): ObservableMap<K, V>;
|
|
28
|
+
<T extends object>(value: T, decorators?: AnnotationsMap<T, never>, options?: CreateObservableOptions): T;
|
|
29
|
+
box: IObservableValueFactory;
|
|
30
|
+
array: <T = any>(initialValues?: T[], options?: CreateObservableOptions) => IObservableArray<T>;
|
|
31
|
+
set: <T = any>(initialValues?: IObservableSetInitialValues<T>, options?: CreateObservableOptions) => ObservableSet<T>;
|
|
32
|
+
map: <K = any, V = any>(initialValues?: IObservableMapInitialValues<K, V>, options?: CreateObservableOptions) => ObservableMap<K, V>;
|
|
33
|
+
object: <T = any>(props: T, decorators?: AnnotationsMap<T, never>, options?: CreateObservableOptions) => T;
|
|
34
|
+
/**
|
|
35
|
+
* Decorator that creates an observable that only observes the references, but doesn't try to turn the assigned value into an observable.ts.
|
|
36
|
+
*/
|
|
37
|
+
ref: Annotation & PropertyDecorator & ClassAccessorDecorator & ClassFieldDecorator;
|
|
38
|
+
/**
|
|
39
|
+
* Decorator that creates an observable converts its value (objects, maps or arrays) into a shallow observable structure
|
|
40
|
+
*/
|
|
41
|
+
shallow: Annotation & PropertyDecorator & ClassAccessorDecorator & ClassFieldDecorator;
|
|
42
|
+
deep: Annotation & PropertyDecorator & ClassAccessorDecorator & ClassFieldDecorator;
|
|
43
|
+
struct: Annotation & PropertyDecorator & ClassAccessorDecorator & ClassFieldDecorator;
|
|
44
|
+
}
|
|
45
|
+
export declare var observable: IObservableFactory;
|
package/dist/api/observe.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IArrayDidChange, IComputedValue, IMapDidChange, IObjectDidChange, IObservableArray, IObservableValue, IValueDidChange, Lambda, ObservableMap, ObservableSet, ISetDidChange } from "../internal";
|
|
2
|
-
export declare function observe<T>(value: IObservableValue<T> | IComputedValue<T>, listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda;
|
|
3
|
-
export declare function observe<T>(observableArray: IObservableArray<T> | Array<T>, listener: (change: IArrayDidChange<T>) => void, fireImmediately?: boolean): Lambda;
|
|
4
|
-
export declare function observe<V>(observableSet: ObservableSet<V> | Set<V>, listener: (change: ISetDidChange<V>) => void, fireImmediately?: boolean): Lambda;
|
|
5
|
-
export declare function observe<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, listener: (change: IMapDidChange<K, V>) => void, fireImmediately?: boolean): Lambda;
|
|
6
|
-
export declare function observe<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, property: K, listener: (change: IValueDidChange<V>) => void, fireImmediately?: boolean): Lambda;
|
|
7
|
-
export declare function observe(object: Object, listener: (change: IObjectDidChange) => void, fireImmediately?: boolean): Lambda;
|
|
8
|
-
export declare function observe<T, K extends keyof T>(object: T, property: K, listener: (change: IValueDidChange<T[K]>) => void, fireImmediately?: boolean): Lambda;
|
|
1
|
+
import { IArrayDidChange, IComputedValue, IMapDidChange, IObjectDidChange, IObservableArray, IObservableValue, IValueDidChange, Lambda, ObservableMap, ObservableSet, ISetDidChange } from "../internal";
|
|
2
|
+
export declare function observe<T>(value: IObservableValue<T> | IComputedValue<T>, listener: (change: IValueDidChange<T>) => void, fireImmediately?: boolean): Lambda;
|
|
3
|
+
export declare function observe<T>(observableArray: IObservableArray<T> | Array<T>, listener: (change: IArrayDidChange<T>) => void, fireImmediately?: boolean): Lambda;
|
|
4
|
+
export declare function observe<V>(observableSet: ObservableSet<V> | Set<V>, listener: (change: ISetDidChange<V>) => void, fireImmediately?: boolean): Lambda;
|
|
5
|
+
export declare function observe<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, listener: (change: IMapDidChange<K, V>) => void, fireImmediately?: boolean): Lambda;
|
|
6
|
+
export declare function observe<K, V>(observableMap: ObservableMap<K, V> | Map<K, V>, property: K, listener: (change: IValueDidChange<V>) => void, fireImmediately?: boolean): Lambda;
|
|
7
|
+
export declare function observe(object: Object, listener: (change: IObjectDidChange) => void, fireImmediately?: boolean): Lambda;
|
|
8
|
+
export declare function observe<T, K extends keyof T>(object: T, property: K, listener: (change: IValueDidChange<T[K]>) => void, fireImmediately?: boolean): Lambda;
|