mobx 6.10.2 → 6.11.0-pre
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/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 +422 -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 +422 -252
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +422 -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 +422 -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 +99 -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 +29 -8
- package/src/api/flow.ts +10 -3
- package/src/api/observable.ts +19 -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/observableobject.ts +16 -0
- package/src/types/overrideannotation.ts +15 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ObservableObjectAdministration, Annotation } from "../internal";
|
|
2
|
-
export declare function createActionAnnotation(name: string, options?: object): Annotation;
|
|
3
|
-
export declare function createActionDescriptor(adm: ObservableObjectAdministration, annotation: Annotation, key: PropertyKey, descriptor: PropertyDescriptor, safeDescriptors?: boolean): {
|
|
4
|
-
value: Function;
|
|
5
|
-
configurable: boolean;
|
|
6
|
-
enumerable: boolean;
|
|
7
|
-
writable: boolean;
|
|
8
|
-
};
|
|
1
|
+
import { ObservableObjectAdministration, Annotation } from "../internal";
|
|
2
|
+
export declare function createActionAnnotation(name: string, options?: object): Annotation;
|
|
3
|
+
export declare function createActionDescriptor(adm: ObservableObjectAdministration, annotation: Annotation, key: PropertyKey, descriptor: PropertyDescriptor, safeDescriptors?: boolean): {
|
|
4
|
+
value: Function;
|
|
5
|
+
configurable: boolean;
|
|
6
|
+
enumerable: boolean;
|
|
7
|
+
writable: boolean;
|
|
8
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Annotation } from "../internal";
|
|
2
|
-
export declare const autoAnnotation: Annotation;
|
|
3
|
-
export declare function createAutoAnnotation(options?: object): Annotation;
|
|
1
|
+
import { Annotation } from "../internal";
|
|
2
|
+
export declare const autoAnnotation: Annotation;
|
|
3
|
+
export declare function createAutoAnnotation(options?: object): Annotation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Annotation } from "../internal";
|
|
2
|
-
export declare function createComputedAnnotation(name: string, options?: object): Annotation;
|
|
1
|
+
import { Annotation } from "../internal";
|
|
2
|
+
export declare function createComputedAnnotation(name: string, options?: object): Annotation;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ClassAccessorDecorator<This = any, Value = any> = (value: ClassAccessorDecoratorTarget<This, Value>, context: ClassAccessorDecoratorContext) => ClassAccessorDecoratorResult<This, Value> | void;
|
|
2
|
+
export type ClassGetterDecorator<This = any, Value = any> = (value: (this: This) => Value, context: ClassGetterDecoratorContext) => ((this: This) => Value) | void;
|
|
3
|
+
export type ClassSetterDecorator<This = any, Value = any> = (value: (this: This, value: Value) => void, context: ClassSetterDecoratorContext) => ((this: This, value: Value) => void) | void;
|
|
4
|
+
export type ClassMethodDecorator<This = any, Value extends (...p: any[]) => any = any> = (value: Value, context: ClassMethodDecoratorContext<This, Value>) => Value | void;
|
|
5
|
+
export type ClassFieldDecorator<This = any, Value extends (...p: any[]) => any = any> = (value: Value, context: ClassFieldDecoratorContext<This, Value>) => Value | void;
|
|
6
|
+
export type Decorator = ClassAccessorDecorator | ClassGetterDecorator | ClassSetterDecorator | ClassMethodDecorator | ClassFieldDecorator;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IIsObservableObject, CreateObservableOptions } from "../internal";
|
|
2
|
-
export declare function asDynamicObservableObject(target: any, options?: CreateObservableOptions): IIsObservableObject;
|
|
1
|
+
import { IIsObservableObject, CreateObservableOptions } from "../internal";
|
|
2
|
+
export declare function asDynamicObservableObject(target: any, options?: CreateObservableOptions): IIsObservableObject;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Annotation } from "../internal";
|
|
2
|
-
export declare function createFlowAnnotation(name: string, options?: object): Annotation;
|
|
1
|
+
import { Annotation } from "../internal";
|
|
2
|
+
export declare function createFlowAnnotation(name: string, options?: object): Annotation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface GenericAbortSignal {
|
|
2
|
-
readonly aborted: boolean;
|
|
3
|
-
onabort?: ((...args: any) => any) | null;
|
|
4
|
-
addEventListener?: (...args: any) => any;
|
|
5
|
-
removeEventListener?: (...args: any) => any;
|
|
6
|
-
}
|
|
1
|
+
export interface GenericAbortSignal {
|
|
2
|
+
readonly aborted: boolean;
|
|
3
|
+
onabort?: ((...args: any) => any) | null;
|
|
4
|
+
addEventListener?: (...args: any) => any;
|
|
5
|
+
removeEventListener?: (...args: any) => any;
|
|
6
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Lambda } from "../internal";
|
|
2
|
-
export
|
|
3
|
-
export interface IInterceptable<T> {
|
|
4
|
-
interceptors_: IInterceptor<T>[] | undefined;
|
|
5
|
-
}
|
|
6
|
-
export declare function hasInterceptors(interceptable: IInterceptable<any>): boolean;
|
|
7
|
-
export declare function registerInterceptor<T>(interceptable: IInterceptable<T>, handler: IInterceptor<T>): Lambda;
|
|
8
|
-
export declare function interceptChange<T>(interceptable: IInterceptable<T | null>, change: T | null): T | null;
|
|
1
|
+
import { Lambda } from "../internal";
|
|
2
|
+
export type IInterceptor<T> = (change: T) => T | null;
|
|
3
|
+
export interface IInterceptable<T> {
|
|
4
|
+
interceptors_: IInterceptor<T>[] | undefined;
|
|
5
|
+
}
|
|
6
|
+
export declare function hasInterceptors(interceptable: IInterceptable<any>): boolean;
|
|
7
|
+
export declare function registerInterceptor<T>(interceptable: IInterceptable<T>, handler: IInterceptor<T>): Lambda;
|
|
8
|
+
export declare function interceptChange<T>(interceptable: IInterceptable<T | null>, change: T | null): T | null;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
import { IEnhancer, IObservableArray } from "../internal";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { IEnhancer, IObservableArray } from "../internal";
|
|
2
|
+
declare class StubArray {
|
|
3
|
+
}
|
|
4
|
+
export declare class LegacyObservableArray<T> extends StubArray {
|
|
5
|
+
constructor(initialValues: T[] | undefined, enhancer: IEnhancer<T>, name?: string, owned?: boolean);
|
|
6
|
+
concat(...arrays: T[][]): T[];
|
|
7
|
+
get length(): number;
|
|
8
|
+
set length(newLength: number);
|
|
9
|
+
get [Symbol.toStringTag](): string;
|
|
10
|
+
[Symbol.iterator](): IterableIterator<any>;
|
|
11
|
+
}
|
|
12
|
+
export declare function reserveArrayBuffer(max: number): void;
|
|
13
|
+
export declare function createLegacyArray<T>(initialValues: T[] | undefined, enhancer: IEnhancer<T>, name?: string): IObservableArray<T>;
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Lambda } from "../internal";
|
|
2
|
-
export interface IListenable {
|
|
3
|
-
changeListeners_: Function[] | undefined;
|
|
4
|
-
}
|
|
5
|
-
export declare function hasListeners(listenable: IListenable): boolean;
|
|
6
|
-
export declare function registerListener(listenable: IListenable, handler: Function): Lambda;
|
|
7
|
-
export declare function notifyListeners<T>(listenable: IListenable, change: T): void;
|
|
1
|
+
import { Lambda } from "../internal";
|
|
2
|
+
export interface IListenable {
|
|
3
|
+
changeListeners_: Function[] | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare function hasListeners(listenable: IListenable): boolean;
|
|
6
|
+
export declare function registerListener(listenable: IListenable, handler: Function): Lambda;
|
|
7
|
+
export declare function notifyListeners<T>(listenable: IListenable, change: T): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface IEnhancer<T> {
|
|
2
|
-
(newValue: T, oldValue: T | undefined, name: string): T;
|
|
3
|
-
}
|
|
4
|
-
export declare function deepEnhancer(v: any, _: any, name: any): any;
|
|
5
|
-
export declare function shallowEnhancer(v: any, _: any, name: any): any;
|
|
6
|
-
export declare function referenceEnhancer(newValue?: any): any;
|
|
7
|
-
export declare function refStructEnhancer(v: any, oldValue: any): any;
|
|
1
|
+
export interface IEnhancer<T> {
|
|
2
|
+
(newValue: T, oldValue: T | undefined, name: string): T;
|
|
3
|
+
}
|
|
4
|
+
export declare function deepEnhancer(v: any, _: any, name: any): any;
|
|
5
|
+
export declare function shallowEnhancer(v: any, _: any, name: any): any;
|
|
6
|
+
export declare function referenceEnhancer(newValue?: any): any;
|
|
7
|
+
export declare function refStructEnhancer(v: any, oldValue: any): any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Annotation } from "../internal";
|
|
2
|
-
export declare function createObservableAnnotation(name: string, options?: object): Annotation;
|
|
1
|
+
import { Annotation } from "../internal";
|
|
2
|
+
export declare function createObservableAnnotation(name: string, options?: object): Annotation;
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import { IAtom, IEnhancer, IInterceptable, IInterceptor, IListenable, Lambda } from "../internal";
|
|
2
|
-
export declare const UPDATE = "update";
|
|
3
|
-
export declare const MAX_SPLICE_SIZE = 10000;
|
|
4
|
-
export interface IObservableArray<T = any> extends Array<T> {
|
|
5
|
-
spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[];
|
|
6
|
-
clear(): T[];
|
|
7
|
-
replace(newItems: T[]): T[];
|
|
8
|
-
remove(value: T): boolean;
|
|
9
|
-
toJSON(): T[];
|
|
10
|
-
}
|
|
11
|
-
interface IArrayBaseChange<T> {
|
|
12
|
-
object: IObservableArray<T>;
|
|
13
|
-
observableKind: "array";
|
|
14
|
-
debugObjectName: string;
|
|
15
|
-
index: number;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
18
|
-
export interface IArrayUpdate<T = any> extends IArrayBaseChange<T> {
|
|
19
|
-
type: "update";
|
|
20
|
-
newValue: T;
|
|
21
|
-
oldValue: T;
|
|
22
|
-
}
|
|
23
|
-
export interface IArraySplice<T = any> extends IArrayBaseChange<T> {
|
|
24
|
-
type: "splice";
|
|
25
|
-
added: T[];
|
|
26
|
-
addedCount: number;
|
|
27
|
-
removed: T[];
|
|
28
|
-
removedCount: number;
|
|
29
|
-
}
|
|
30
|
-
export interface IArrayWillChange<T = any> {
|
|
31
|
-
object: IObservableArray<T>;
|
|
32
|
-
index: number;
|
|
33
|
-
type: "update";
|
|
34
|
-
newValue: T;
|
|
35
|
-
}
|
|
36
|
-
export interface IArrayWillSplice<T = any> {
|
|
37
|
-
object: IObservableArray<T>;
|
|
38
|
-
index: number;
|
|
39
|
-
type: "splice";
|
|
40
|
-
added: T[];
|
|
41
|
-
removedCount: number;
|
|
42
|
-
}
|
|
43
|
-
export declare class ObservableArrayAdministration implements IInterceptable<IArrayWillChange<any> | IArrayWillSplice<any>>, IListenable {
|
|
44
|
-
owned_: boolean;
|
|
45
|
-
legacyMode_: boolean;
|
|
46
|
-
atom_: IAtom;
|
|
47
|
-
readonly values_: any[];
|
|
48
|
-
interceptors_: any;
|
|
49
|
-
changeListeners_: any;
|
|
50
|
-
enhancer_: (newV: any, oldV: any | undefined) => any;
|
|
51
|
-
dehancer: any;
|
|
52
|
-
proxy_: IObservableArray<any>;
|
|
53
|
-
lastKnownLength_: number;
|
|
54
|
-
constructor(name: string | undefined, enhancer: IEnhancer<any>, owned_: boolean, legacyMode_: boolean);
|
|
55
|
-
dehanceValue_(value: any): any;
|
|
56
|
-
dehanceValues_(values: any[]): any[];
|
|
57
|
-
intercept_(handler: IInterceptor<IArrayWillChange<any> | IArrayWillSplice<any>>): Lambda;
|
|
58
|
-
observe_(listener: (changeData: IArrayDidChange<any>) => void, fireImmediately?: boolean): Lambda;
|
|
59
|
-
getArrayLength_(): number;
|
|
60
|
-
setArrayLength_(newLength: number): void;
|
|
61
|
-
updateArrayLength_(oldLength: number, delta: number): void;
|
|
62
|
-
spliceWithArray_(index: number, deleteCount?: number, newItems?: any[]): any[];
|
|
63
|
-
spliceItemsIntoValues_(index: number, deleteCount: number, newItems: any[]): any[];
|
|
64
|
-
notifyArrayChildUpdate_(index: number, newValue: any, oldValue: any): void;
|
|
65
|
-
notifyArraySplice_(index: number, added: any[], removed: any[]): void;
|
|
66
|
-
get_(index: number): any | undefined;
|
|
67
|
-
set_(index: number, newValue: any): void;
|
|
68
|
-
}
|
|
69
|
-
export declare function createObservableArray<T>(initialValues: T[] | undefined, enhancer: IEnhancer<T>, name?: string, owned?: boolean): IObservableArray<T>;
|
|
70
|
-
export declare var arrayExtensions: {
|
|
71
|
-
clear(): any[];
|
|
72
|
-
replace(newItems: any[]): any[];
|
|
73
|
-
toJSON(): any[];
|
|
74
|
-
splice(index: number, deleteCount?: number
|
|
75
|
-
spliceWithArray(index: number, deleteCount?: number
|
|
76
|
-
push(...items: any[]): number;
|
|
77
|
-
pop(): any;
|
|
78
|
-
shift(): any;
|
|
79
|
-
unshift(...items: any[]): number;
|
|
80
|
-
reverse(): any[];
|
|
81
|
-
sort(): any[];
|
|
82
|
-
remove(value: any): boolean;
|
|
83
|
-
};
|
|
84
|
-
export declare function isObservableArray(thing: any): thing is IObservableArray<any>;
|
|
85
|
-
export {};
|
|
1
|
+
import { IAtom, IEnhancer, IInterceptable, IInterceptor, IListenable, Lambda } from "../internal";
|
|
2
|
+
export declare const UPDATE = "update";
|
|
3
|
+
export declare const MAX_SPLICE_SIZE = 10000;
|
|
4
|
+
export interface IObservableArray<T = any> extends Array<T> {
|
|
5
|
+
spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[];
|
|
6
|
+
clear(): T[];
|
|
7
|
+
replace(newItems: T[]): T[];
|
|
8
|
+
remove(value: T): boolean;
|
|
9
|
+
toJSON(): T[];
|
|
10
|
+
}
|
|
11
|
+
interface IArrayBaseChange<T> {
|
|
12
|
+
object: IObservableArray<T>;
|
|
13
|
+
observableKind: "array";
|
|
14
|
+
debugObjectName: string;
|
|
15
|
+
index: number;
|
|
16
|
+
}
|
|
17
|
+
export type IArrayDidChange<T = any> = IArrayUpdate<T> | IArraySplice<T>;
|
|
18
|
+
export interface IArrayUpdate<T = any> extends IArrayBaseChange<T> {
|
|
19
|
+
type: "update";
|
|
20
|
+
newValue: T;
|
|
21
|
+
oldValue: T;
|
|
22
|
+
}
|
|
23
|
+
export interface IArraySplice<T = any> extends IArrayBaseChange<T> {
|
|
24
|
+
type: "splice";
|
|
25
|
+
added: T[];
|
|
26
|
+
addedCount: number;
|
|
27
|
+
removed: T[];
|
|
28
|
+
removedCount: number;
|
|
29
|
+
}
|
|
30
|
+
export interface IArrayWillChange<T = any> {
|
|
31
|
+
object: IObservableArray<T>;
|
|
32
|
+
index: number;
|
|
33
|
+
type: "update";
|
|
34
|
+
newValue: T;
|
|
35
|
+
}
|
|
36
|
+
export interface IArrayWillSplice<T = any> {
|
|
37
|
+
object: IObservableArray<T>;
|
|
38
|
+
index: number;
|
|
39
|
+
type: "splice";
|
|
40
|
+
added: T[];
|
|
41
|
+
removedCount: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class ObservableArrayAdministration implements IInterceptable<IArrayWillChange<any> | IArrayWillSplice<any>>, IListenable {
|
|
44
|
+
owned_: boolean;
|
|
45
|
+
legacyMode_: boolean;
|
|
46
|
+
atom_: IAtom;
|
|
47
|
+
readonly values_: any[];
|
|
48
|
+
interceptors_: any;
|
|
49
|
+
changeListeners_: any;
|
|
50
|
+
enhancer_: (newV: any, oldV: any | undefined) => any;
|
|
51
|
+
dehancer: any;
|
|
52
|
+
proxy_: IObservableArray<any>;
|
|
53
|
+
lastKnownLength_: number;
|
|
54
|
+
constructor(name: string | undefined, enhancer: IEnhancer<any>, owned_: boolean, legacyMode_: boolean);
|
|
55
|
+
dehanceValue_(value: any): any;
|
|
56
|
+
dehanceValues_(values: any[]): any[];
|
|
57
|
+
intercept_(handler: IInterceptor<IArrayWillChange<any> | IArrayWillSplice<any>>): Lambda;
|
|
58
|
+
observe_(listener: (changeData: IArrayDidChange<any>) => void, fireImmediately?: boolean): Lambda;
|
|
59
|
+
getArrayLength_(): number;
|
|
60
|
+
setArrayLength_(newLength: number): void;
|
|
61
|
+
updateArrayLength_(oldLength: number, delta: number): void;
|
|
62
|
+
spliceWithArray_(index: number, deleteCount?: number, newItems?: any[]): any[];
|
|
63
|
+
spliceItemsIntoValues_(index: number, deleteCount: number, newItems: any[]): any[];
|
|
64
|
+
notifyArrayChildUpdate_(index: number, newValue: any, oldValue: any): void;
|
|
65
|
+
notifyArraySplice_(index: number, added: any[], removed: any[]): void;
|
|
66
|
+
get_(index: number): any | undefined;
|
|
67
|
+
set_(index: number, newValue: any): void;
|
|
68
|
+
}
|
|
69
|
+
export declare function createObservableArray<T>(initialValues: T[] | undefined, enhancer: IEnhancer<T>, name?: string, owned?: boolean): IObservableArray<T>;
|
|
70
|
+
export declare var arrayExtensions: {
|
|
71
|
+
clear(): any[];
|
|
72
|
+
replace(newItems: any[]): any[];
|
|
73
|
+
toJSON(): any[];
|
|
74
|
+
splice(index: number, deleteCount?: number, ...newItems: any[]): any[];
|
|
75
|
+
spliceWithArray(index: number, deleteCount?: number, newItems?: any[]): any[];
|
|
76
|
+
push(...items: any[]): number;
|
|
77
|
+
pop(): any;
|
|
78
|
+
shift(): any;
|
|
79
|
+
unshift(...items: any[]): number;
|
|
80
|
+
reverse(): any[];
|
|
81
|
+
sort(): any[];
|
|
82
|
+
remove(value: any): boolean;
|
|
83
|
+
};
|
|
84
|
+
export declare function isObservableArray(thing: any): thing is IObservableArray<any>;
|
|
85
|
+
export {};
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { $mobx, IEnhancer, IInterceptable, IInterceptor, IListenable, Lambda, ObservableValue, IAtom } from "../internal";
|
|
2
|
-
export interface IKeyValueMap<V = any> {
|
|
3
|
-
[key: string]: V;
|
|
4
|
-
}
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
observableKind: "map";
|
|
11
|
-
debugObjectName: string;
|
|
12
|
-
} & ({
|
|
13
|
-
object: ObservableMap<K, V>;
|
|
14
|
-
name: K;
|
|
15
|
-
type: "update";
|
|
16
|
-
newValue: V;
|
|
17
|
-
oldValue: V;
|
|
18
|
-
} | {
|
|
19
|
-
object: ObservableMap<K, V>;
|
|
20
|
-
name: K;
|
|
21
|
-
type: "add";
|
|
22
|
-
newValue: V;
|
|
23
|
-
} | {
|
|
24
|
-
object: ObservableMap<K, V>;
|
|
25
|
-
name: K;
|
|
26
|
-
type: "delete";
|
|
27
|
-
oldValue: V;
|
|
28
|
-
});
|
|
29
|
-
export interface IMapWillChange<K = any, V = any> {
|
|
30
|
-
object: ObservableMap<K, V>;
|
|
31
|
-
type: "update" | "add" | "delete";
|
|
32
|
-
name: K;
|
|
33
|
-
newValue?: V;
|
|
34
|
-
}
|
|
35
|
-
export declare const ADD = "add";
|
|
36
|
-
export declare const DELETE = "delete";
|
|
37
|
-
export
|
|
38
|
-
export declare class ObservableMap<K = any, V = any> implements Map<K, V>, IInterceptable<IMapWillChange<K, V>>, IListenable {
|
|
39
|
-
enhancer_: IEnhancer<V>;
|
|
40
|
-
name_: string;
|
|
41
|
-
[$mobx]: {};
|
|
42
|
-
data_: Map<K, ObservableValue<V>>;
|
|
43
|
-
hasMap_: Map<K, ObservableValue<boolean>>;
|
|
44
|
-
keysAtom_: IAtom;
|
|
45
|
-
interceptors_: any;
|
|
46
|
-
changeListeners_: any;
|
|
47
|
-
dehancer: any;
|
|
48
|
-
constructor(initialData?: IObservableMapInitialValues<K, V>, enhancer_?: IEnhancer<V>, name_?: string);
|
|
49
|
-
private has_;
|
|
50
|
-
has(key: K): boolean;
|
|
51
|
-
set(key: K, value: V): this;
|
|
52
|
-
delete(key: K): boolean;
|
|
53
|
-
private updateValue_;
|
|
54
|
-
private addValue_;
|
|
55
|
-
get(key: K): V | undefined;
|
|
56
|
-
private dehanceValue_;
|
|
57
|
-
keys(): IterableIterator<K>;
|
|
58
|
-
values(): IterableIterator<V>;
|
|
59
|
-
entries(): IterableIterator<IMapEntry<K, V>>;
|
|
60
|
-
[Symbol.iterator](): IterableIterator<IMapEntry<K, V>>;
|
|
61
|
-
forEach(callback: (value: V, key: K, object: Map<K, V>) => void, thisArg?: any): void;
|
|
62
|
-
/** Merge another object into this object, returns this. */
|
|
63
|
-
merge(other?: IObservableMapInitialValues<K, V>): ObservableMap<K, V>;
|
|
64
|
-
clear(): void;
|
|
65
|
-
replace(values: IObservableMapInitialValues<K, V>): ObservableMap<K, V>;
|
|
66
|
-
get size(): number;
|
|
67
|
-
toString(): string;
|
|
68
|
-
toJSON(): [K, V][];
|
|
69
|
-
get [Symbol.toStringTag](): string;
|
|
70
|
-
/**
|
|
71
|
-
* Observes this object. Triggers for the events 'add', 'update' and 'delete'.
|
|
72
|
-
* See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe
|
|
73
|
-
* for callback details
|
|
74
|
-
*/
|
|
75
|
-
observe_(listener: (changes: IMapDidChange<K, V>) => void, fireImmediately?: boolean): Lambda;
|
|
76
|
-
intercept_(handler: IInterceptor<IMapWillChange<K, V>>): Lambda;
|
|
77
|
-
}
|
|
78
|
-
export declare var isObservableMap: (thing: any) => thing is ObservableMap<any, any>;
|
|
1
|
+
import { $mobx, IEnhancer, IInterceptable, IInterceptor, IListenable, Lambda, ObservableValue, IAtom } from "../internal";
|
|
2
|
+
export interface IKeyValueMap<V = any> {
|
|
3
|
+
[key: string]: V;
|
|
4
|
+
}
|
|
5
|
+
export type IMapEntry<K = any, V = any> = [K, V];
|
|
6
|
+
export type IReadonlyMapEntry<K = any, V = any> = readonly [K, V];
|
|
7
|
+
export type IMapEntries<K = any, V = any> = IMapEntry<K, V>[];
|
|
8
|
+
export type IReadonlyMapEntries<K = any, V = any> = IReadonlyMapEntry<K, V>[];
|
|
9
|
+
export type IMapDidChange<K = any, V = any> = {
|
|
10
|
+
observableKind: "map";
|
|
11
|
+
debugObjectName: string;
|
|
12
|
+
} & ({
|
|
13
|
+
object: ObservableMap<K, V>;
|
|
14
|
+
name: K;
|
|
15
|
+
type: "update";
|
|
16
|
+
newValue: V;
|
|
17
|
+
oldValue: V;
|
|
18
|
+
} | {
|
|
19
|
+
object: ObservableMap<K, V>;
|
|
20
|
+
name: K;
|
|
21
|
+
type: "add";
|
|
22
|
+
newValue: V;
|
|
23
|
+
} | {
|
|
24
|
+
object: ObservableMap<K, V>;
|
|
25
|
+
name: K;
|
|
26
|
+
type: "delete";
|
|
27
|
+
oldValue: V;
|
|
28
|
+
});
|
|
29
|
+
export interface IMapWillChange<K = any, V = any> {
|
|
30
|
+
object: ObservableMap<K, V>;
|
|
31
|
+
type: "update" | "add" | "delete";
|
|
32
|
+
name: K;
|
|
33
|
+
newValue?: V;
|
|
34
|
+
}
|
|
35
|
+
export declare const ADD = "add";
|
|
36
|
+
export declare const DELETE = "delete";
|
|
37
|
+
export type IObservableMapInitialValues<K = any, V = any> = IMapEntries<K, V> | IReadonlyMapEntries<K, V> | IKeyValueMap<V> | Map<K, V>;
|
|
38
|
+
export declare class ObservableMap<K = any, V = any> implements Map<K, V>, IInterceptable<IMapWillChange<K, V>>, IListenable {
|
|
39
|
+
enhancer_: IEnhancer<V>;
|
|
40
|
+
name_: string;
|
|
41
|
+
[$mobx]: {};
|
|
42
|
+
data_: Map<K, ObservableValue<V>>;
|
|
43
|
+
hasMap_: Map<K, ObservableValue<boolean>>;
|
|
44
|
+
keysAtom_: IAtom;
|
|
45
|
+
interceptors_: any;
|
|
46
|
+
changeListeners_: any;
|
|
47
|
+
dehancer: any;
|
|
48
|
+
constructor(initialData?: IObservableMapInitialValues<K, V>, enhancer_?: IEnhancer<V>, name_?: string);
|
|
49
|
+
private has_;
|
|
50
|
+
has(key: K): boolean;
|
|
51
|
+
set(key: K, value: V): this;
|
|
52
|
+
delete(key: K): boolean;
|
|
53
|
+
private updateValue_;
|
|
54
|
+
private addValue_;
|
|
55
|
+
get(key: K): V | undefined;
|
|
56
|
+
private dehanceValue_;
|
|
57
|
+
keys(): IterableIterator<K>;
|
|
58
|
+
values(): IterableIterator<V>;
|
|
59
|
+
entries(): IterableIterator<IMapEntry<K, V>>;
|
|
60
|
+
[Symbol.iterator](): IterableIterator<IMapEntry<K, V>>;
|
|
61
|
+
forEach(callback: (value: V, key: K, object: Map<K, V>) => void, thisArg?: any): void;
|
|
62
|
+
/** Merge another object into this object, returns this. */
|
|
63
|
+
merge(other?: IObservableMapInitialValues<K, V>): ObservableMap<K, V>;
|
|
64
|
+
clear(): void;
|
|
65
|
+
replace(values: IObservableMapInitialValues<K, V>): ObservableMap<K, V>;
|
|
66
|
+
get size(): number;
|
|
67
|
+
toString(): string;
|
|
68
|
+
toJSON(): [K, V][];
|
|
69
|
+
get [Symbol.toStringTag](): string;
|
|
70
|
+
/**
|
|
71
|
+
* Observes this object. Triggers for the events 'add', 'update' and 'delete'.
|
|
72
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe
|
|
73
|
+
* for callback details
|
|
74
|
+
*/
|
|
75
|
+
observe_(listener: (changes: IMapDidChange<K, V>) => void, fireImmediately?: boolean): Lambda;
|
|
76
|
+
intercept_(handler: IInterceptor<IMapWillChange<K, V>>): Lambda;
|
|
77
|
+
}
|
|
78
|
+
export declare var isObservableMap: (thing: any) => thing is ObservableMap<any, any>;
|