reactronic 0.22.313 → 0.22.316
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/README.md +6 -6
- package/build/dist/source/Buffer.d.ts +1 -1
- package/build/dist/source/Buffer.js +1 -1
- package/build/dist/source/Options.d.ts +3 -3
- package/build/dist/source/Rx.d.ts +2 -2
- package/build/dist/source/Rx.js +14 -14
- package/build/dist/source/api.d.ts +5 -2
- package/build/dist/source/api.js +5 -2
- package/build/dist/source/impl/Changeset.js +5 -5
- package/build/dist/source/impl/Data.d.ts +1 -1
- package/build/dist/source/impl/Journal.d.ts +1 -1
- package/build/dist/source/impl/Journal.js +4 -4
- package/build/dist/source/impl/Monitor.d.ts +1 -1
- package/build/dist/source/impl/Monitor.js +4 -4
- package/build/dist/source/impl/{Hooks.d.ts → Mvcc.d.ts} +14 -51
- package/build/dist/source/impl/{Hooks.js → Mvcc.js} +53 -100
- package/build/dist/source/impl/MvccArray.d.ts +60 -0
- package/build/dist/source/impl/MvccArray.js +58 -0
- package/build/dist/source/impl/MvccCollection.d.ts +25 -0
- package/build/dist/source/impl/MvccCollection.js +23 -0
- package/build/dist/source/impl/MvccMap.d.ts +25 -0
- package/build/dist/source/impl/MvccMap.js +35 -0
- package/build/dist/source/impl/Operation.d.ts +3 -3
- package/build/dist/source/impl/Operation.js +20 -20
- package/build/dist/source/impl/Transaction.d.ts +2 -2
- package/build/dist/source/impl/Transaction.js +9 -9
- package/build/dist/source/util/Collection.d.ts +63 -0
- package/build/dist/source/util/Collection.js +283 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -195,7 +195,7 @@ class Component<P> extends React.Component<P> {
|
|
|
195
195
|
@reaction // called immediately in response to changes
|
|
196
196
|
ensureUpToDate(): void {
|
|
197
197
|
if (this.shouldComponentUpdate())
|
|
198
|
-
Transaction.
|
|
198
|
+
Transaction.outside(() => this.setState({})) // ask React to re-render
|
|
199
199
|
} // ensureUpToDate is subscribed to render
|
|
200
200
|
|
|
201
201
|
shouldComponentUpdate(): boolean {
|
|
@@ -291,11 +291,12 @@ NPM: `npm install reactronic`
|
|
|
291
291
|
|
|
292
292
|
// Classes
|
|
293
293
|
|
|
294
|
+
class TransactionalObject { }
|
|
294
295
|
class ReactiveObject { }
|
|
295
296
|
|
|
296
297
|
// Decorators & Operators
|
|
297
298
|
|
|
298
|
-
function
|
|
299
|
+
function raw(proto, prop) // field only
|
|
299
300
|
function transaction(proto, prop, pd) // method only
|
|
300
301
|
function reaction(proto, prop, pd) // method only
|
|
301
302
|
function cached(proto, prop, pd) // method only
|
|
@@ -308,7 +309,7 @@ function sensitive<T>(sensitivity: Sensitivity, func: F<T>, ...args: any[]): T
|
|
|
308
309
|
|
|
309
310
|
export interface SnapshotOptions {
|
|
310
311
|
readonly hint?: string
|
|
311
|
-
readonly
|
|
312
|
+
readonly separation?: SeparationMode
|
|
312
313
|
readonly journal?: Journal
|
|
313
314
|
readonly logging?: Partial<LoggingOptions>
|
|
314
315
|
readonly token?: any
|
|
@@ -316,7 +317,7 @@ export interface SnapshotOptions {
|
|
|
316
317
|
|
|
317
318
|
interface MemberOptions {
|
|
318
319
|
readonly kind: Kind
|
|
319
|
-
readonly
|
|
320
|
+
readonly separation: SeparationMode
|
|
320
321
|
readonly order: number
|
|
321
322
|
readonly noSideEffects: boolean
|
|
322
323
|
readonly triggeringArgs: boolean
|
|
@@ -436,8 +437,7 @@ class Reactronic {
|
|
|
436
437
|
static why(short: boolean = false): string
|
|
437
438
|
static getMethodCache<T>(method: F<T>): Cache<T>
|
|
438
439
|
static configureCurrentOperation(options: Partial<Options>): Options
|
|
439
|
-
|
|
440
|
-
// static assign<T, P extends keyof T>(obj: T, prop: P, value: T[P], sensitivity: Sensitivity)
|
|
440
|
+
static getRevisionOf(obj: any): number
|
|
441
441
|
static takeSnapshot<T>(obj: T): T
|
|
442
442
|
static dispose(obj: any): void
|
|
443
443
|
static reactionsAutoStartDisabled: boolean
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { LoggingOptions } from './Logging';
|
|
2
|
-
import {
|
|
2
|
+
import { SeparationMode } from './impl/Data';
|
|
3
3
|
export { LoggingOptions, ProfilingOptions, LoggingLevel } from './Logging';
|
|
4
4
|
import { Journal } from './impl/Journal';
|
|
5
5
|
import { Monitor } from './impl/Monitor';
|
|
6
6
|
export interface SnapshotOptions {
|
|
7
7
|
readonly hint?: string;
|
|
8
|
-
readonly
|
|
8
|
+
readonly separation?: SeparationMode;
|
|
9
9
|
readonly journal?: Journal;
|
|
10
10
|
readonly logging?: Partial<LoggingOptions>;
|
|
11
11
|
readonly token?: any;
|
|
12
12
|
}
|
|
13
13
|
export interface MemberOptions {
|
|
14
14
|
readonly kind: Kind;
|
|
15
|
-
readonly
|
|
15
|
+
readonly separation: SeparationMode;
|
|
16
16
|
readonly order: number;
|
|
17
17
|
readonly noSideEffects: boolean;
|
|
18
18
|
readonly triggeringArgs: boolean;
|
|
@@ -2,11 +2,11 @@ import { F } from './util/Utils';
|
|
|
2
2
|
import { Controller } from './Controller';
|
|
3
3
|
import { MemberOptions, LoggingOptions, ProfilingOptions } from './Options';
|
|
4
4
|
export declare class Rx {
|
|
5
|
-
static getRevisionOf(obj: any): number;
|
|
6
5
|
static why(brief?: boolean): string;
|
|
7
6
|
static getController<T>(method: F<T>): Controller<T>;
|
|
8
7
|
static pullLastResult<T>(method: F<Promise<T>>, args?: any[]): T | undefined;
|
|
9
8
|
static configureCurrentOperation(options: Partial<MemberOptions>): MemberOptions;
|
|
9
|
+
static getRevisionOf(obj: any): number;
|
|
10
10
|
static takeSnapshot<T>(obj: T): T;
|
|
11
11
|
static dispose(obj: any): void;
|
|
12
12
|
static get reactionsAutoStartDisabled(): boolean;
|
|
@@ -20,7 +20,7 @@ export declare class Rx {
|
|
|
20
20
|
}
|
|
21
21
|
export declare function nonreactive<T>(func: F<T>, ...args: any[]): T;
|
|
22
22
|
export declare function sensitive<T>(sensitivity: boolean, func: F<T>, ...args: any[]): T;
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function raw(proto: object, prop: PropertyKey): any;
|
|
24
24
|
export declare function transaction(proto: object, prop: PropertyKey, pd: PropertyDescriptor): any;
|
|
25
25
|
export declare function reaction(proto: object, prop: PropertyKey, pd: PropertyDescriptor): any;
|
|
26
26
|
export declare function cached(proto: object, prop: PropertyKey, pd: PropertyDescriptor): any;
|
package/build/dist/source/Rx.js
CHANGED
|
@@ -2,46 +2,46 @@ import { Log } from './util/Dbg';
|
|
|
2
2
|
import { Kind } from './Options';
|
|
3
3
|
import { Meta, ObjectHandle } from './impl/Data';
|
|
4
4
|
import { Changeset } from './impl/Changeset';
|
|
5
|
-
import {
|
|
5
|
+
import { Mvcc } from './impl/Mvcc';
|
|
6
6
|
import { OperationController } from './impl/Operation';
|
|
7
7
|
export class Rx {
|
|
8
|
-
static getRevisionOf(obj) { return obj[Meta.Revision]; }
|
|
9
8
|
static why(brief = false) { return brief ? OperationController.briefWhy() : OperationController.why(); }
|
|
10
|
-
static getController(method) { return OperationController.
|
|
9
|
+
static getController(method) { return OperationController.getControllerOf(method); }
|
|
11
10
|
static pullLastResult(method, args) { return Rx.getController(method).pullLastResult(args); }
|
|
12
11
|
static configureCurrentOperation(options) { return OperationController.configureImpl(undefined, options); }
|
|
12
|
+
static getRevisionOf(obj) { return obj[Meta.Revision]; }
|
|
13
13
|
static takeSnapshot(obj) { return Changeset.takeSnapshot(obj); }
|
|
14
14
|
static dispose(obj) { Changeset.dispose(obj); }
|
|
15
|
-
static get reactionsAutoStartDisabled() { return
|
|
16
|
-
static set reactionsAutoStartDisabled(value) {
|
|
15
|
+
static get reactionsAutoStartDisabled() { return Mvcc.reactionsAutoStartDisabled; }
|
|
16
|
+
static set reactionsAutoStartDisabled(value) { Mvcc.reactionsAutoStartDisabled = value; }
|
|
17
17
|
static get isLogging() { return Log.isOn; }
|
|
18
18
|
static get loggingOptions() { return Log.opt; }
|
|
19
19
|
static setLoggingMode(isOn, options) { Log.setMode(isOn, options); }
|
|
20
|
-
static setLoggingHint(obj, name) {
|
|
20
|
+
static setLoggingHint(obj, name) { Mvcc.setHint(obj, name); }
|
|
21
21
|
static getLoggingHint(obj, full = false) { return ObjectHandle.getHint(obj, full); }
|
|
22
|
-
static setProfilingMode(isOn, options) {
|
|
22
|
+
static setProfilingMode(isOn, options) { Mvcc.setProfilingMode(isOn, options); }
|
|
23
23
|
}
|
|
24
24
|
export function nonreactive(func, ...args) {
|
|
25
25
|
return OperationController.runWithin(undefined, func, ...args);
|
|
26
26
|
}
|
|
27
27
|
export function sensitive(sensitivity, func, ...args) {
|
|
28
|
-
return
|
|
28
|
+
return Mvcc.sensitive(sensitivity, func, ...args);
|
|
29
29
|
}
|
|
30
|
-
export function
|
|
31
|
-
return
|
|
30
|
+
export function raw(proto, prop) {
|
|
31
|
+
return Mvcc.decorateData(false, proto, prop);
|
|
32
32
|
}
|
|
33
33
|
export function transaction(proto, prop, pd) {
|
|
34
34
|
const opts = { kind: Kind.Transaction };
|
|
35
|
-
return
|
|
35
|
+
return Mvcc.decorateOperation(true, transaction, opts, proto, prop, pd);
|
|
36
36
|
}
|
|
37
37
|
export function reaction(proto, prop, pd) {
|
|
38
38
|
const opts = { kind: Kind.Reaction, throttling: -1 };
|
|
39
|
-
return
|
|
39
|
+
return Mvcc.decorateOperation(true, reaction, opts, proto, prop, pd);
|
|
40
40
|
}
|
|
41
41
|
export function cached(proto, prop, pd) {
|
|
42
42
|
const opts = { kind: Kind.Cache, noSideEffects: true };
|
|
43
|
-
return
|
|
43
|
+
return Mvcc.decorateOperation(true, cached, opts, proto, prop, pd);
|
|
44
44
|
}
|
|
45
45
|
export function options(value) {
|
|
46
|
-
return
|
|
46
|
+
return Mvcc.decorateOperationParametrized(options, value);
|
|
47
47
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { all, pause } from './util/Utils';
|
|
2
|
+
export { Collection, Item, CollectionReader } from './util/Collection';
|
|
2
3
|
export { SealedArray } from './util/SealedArray';
|
|
3
4
|
export { SealedMap } from './util/SealedMap';
|
|
4
5
|
export { SealedSet } from './util/SealedSet';
|
|
@@ -6,9 +7,11 @@ export { MemberOptions, SnapshotOptions, Kind, Reentrance, LoggingOptions, Profi
|
|
|
6
7
|
export { Worker } from './Worker';
|
|
7
8
|
export { Controller } from './Controller';
|
|
8
9
|
export { Ref, ToggleRef, BoolOnly, GivenTypeOnly } from './Ref';
|
|
9
|
-
export {
|
|
10
|
+
export { TransactionalObject, ReactiveObject } from './impl/Mvcc';
|
|
11
|
+
export { TransactionalArray, ReactiveArray } from './impl/MvccArray';
|
|
12
|
+
export { TransactionalMap, ReactiveMap } from './impl/MvccMap';
|
|
10
13
|
export { Changeset } from './impl/Changeset';
|
|
11
14
|
export { Transaction } from './impl/Transaction';
|
|
12
15
|
export { Monitor } from './impl/Monitor';
|
|
13
16
|
export { Journal } from './impl/Journal';
|
|
14
|
-
export { Rx, nonreactive, sensitive,
|
|
17
|
+
export { Rx, nonreactive, sensitive, raw, transaction, reaction, cached, options } from './Rx';
|
package/build/dist/source/api.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
export { all, pause } from './util/Utils';
|
|
2
|
+
export { Collection } from './util/Collection';
|
|
2
3
|
export { SealedArray } from './util/SealedArray';
|
|
3
4
|
export { SealedMap } from './util/SealedMap';
|
|
4
5
|
export { SealedSet } from './util/SealedSet';
|
|
5
6
|
export { Kind, Reentrance, LoggingLevel } from './Options';
|
|
6
7
|
export { Controller } from './Controller';
|
|
7
8
|
export { Ref, ToggleRef } from './Ref';
|
|
8
|
-
export {
|
|
9
|
+
export { TransactionalObject, ReactiveObject } from './impl/Mvcc';
|
|
10
|
+
export { TransactionalArray, ReactiveArray } from './impl/MvccArray';
|
|
11
|
+
export { TransactionalMap, ReactiveMap } from './impl/MvccMap';
|
|
9
12
|
export { Changeset } from './impl/Changeset';
|
|
10
13
|
export { Transaction } from './impl/Transaction';
|
|
11
14
|
export { Monitor } from './impl/Monitor';
|
|
12
15
|
export { Journal } from './impl/Journal';
|
|
13
|
-
export { Rx, nonreactive, sensitive,
|
|
16
|
+
export { Rx, nonreactive, sensitive, raw, transaction, reaction, cached, options } from './Rx';
|
|
@@ -7,11 +7,11 @@ import { SealedSet } from '../util/SealedSet';
|
|
|
7
7
|
import { ObjectSnapshot, ObjectHandle, Subscription, Meta } from './Data';
|
|
8
8
|
export const MAX_REVISION = Number.MAX_SAFE_INTEGER;
|
|
9
9
|
export const UNDEFINED_REVISION = MAX_REVISION - 1;
|
|
10
|
-
Object.defineProperty(ObjectHandle.prototype, '#this', {
|
|
10
|
+
Object.defineProperty(ObjectHandle.prototype, '#this#', {
|
|
11
11
|
configurable: false, enumerable: false,
|
|
12
12
|
get() {
|
|
13
13
|
const result = {};
|
|
14
|
-
const data = Changeset.current().getObjectSnapshot(this, '#this').data;
|
|
14
|
+
const data = Changeset.current().getObjectSnapshot(this, '#this#').data;
|
|
15
15
|
for (const m in data) {
|
|
16
16
|
const v = data[m];
|
|
17
17
|
if (v instanceof Subscription)
|
|
@@ -81,7 +81,7 @@ export class Changeset {
|
|
|
81
81
|
return os;
|
|
82
82
|
}
|
|
83
83
|
static takeSnapshot(obj) {
|
|
84
|
-
return obj[Meta.Handle]['#this'];
|
|
84
|
+
return obj[Meta.Handle]['#this#'];
|
|
85
85
|
}
|
|
86
86
|
static dispose(obj) {
|
|
87
87
|
const ctx = Changeset.edit();
|
|
@@ -165,7 +165,7 @@ export class Changeset {
|
|
|
165
165
|
merged[m] = ours.data[m];
|
|
166
166
|
if (headDisposed || oursDisposed) {
|
|
167
167
|
if (headDisposed !== oursDisposed) {
|
|
168
|
-
if (headDisposed || this.options.
|
|
168
|
+
if (headDisposed || this.options.separation !== 'disposal') {
|
|
169
169
|
if (Log.isOn && Log.opt.change)
|
|
170
170
|
Log.write('║╠', '', `${Dump.snapshot2(h, ours.changeset, m)} <> ${Dump.snapshot2(h, head.changeset, m)}`, 0, ' *** CONFLICT ***');
|
|
171
171
|
ours.conflicts.set(m, head);
|
|
@@ -351,7 +351,7 @@ Dump.valueHint = (value, m) => '???';
|
|
|
351
351
|
export const EMPTY_SNAPSHOT = new ObjectSnapshot(new Changeset({ hint: '<empty>' }), undefined, {});
|
|
352
352
|
export const DefaultSnapshotOptions = Object.freeze({
|
|
353
353
|
hint: 'noname',
|
|
354
|
-
|
|
354
|
+
separation: false,
|
|
355
355
|
journal: undefined,
|
|
356
356
|
logging: undefined,
|
|
357
357
|
token: undefined,
|
|
@@ -12,7 +12,7 @@ export declare class Subscription {
|
|
|
12
12
|
get originSnapshotId(): number | undefined;
|
|
13
13
|
constructor(content: any);
|
|
14
14
|
}
|
|
15
|
-
export declare type
|
|
15
|
+
export declare type SeparationMode = boolean | 'isolated' | 'disposal';
|
|
16
16
|
export interface Subscriber {
|
|
17
17
|
readonly order: number;
|
|
18
18
|
readonly subscriptions: Map<Subscription, SubscriptionInfo> | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactiveObject } from './
|
|
1
|
+
import { ReactiveObject } from './Mvcc';
|
|
2
2
|
import { ObjectHandle, ObjectSnapshot, PatchSet } from './Data';
|
|
3
3
|
export declare type Saver = (patch: PatchSet) => Promise<void>;
|
|
4
4
|
export declare abstract class Journal extends ReactiveObject {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactiveObject } from './
|
|
1
|
+
import { ReactiveObject } from './Mvcc';
|
|
2
2
|
import { Meta, Subscription } from './Data';
|
|
3
3
|
import { Changeset, EMPTY_SNAPSHOT } from './Changeset';
|
|
4
4
|
import { Transaction } from './Transaction';
|
|
@@ -22,7 +22,7 @@ export class JournalImpl extends Journal {
|
|
|
22
22
|
get canUndo() { return this._edits.length > 0 && this._position > 0; }
|
|
23
23
|
get canRedo() { return this._position < this._edits.length; }
|
|
24
24
|
edited(p) {
|
|
25
|
-
Transaction.run({ hint: 'EditJournal.edited',
|
|
25
|
+
Transaction.run({ hint: 'EditJournal.edited', separation: 'isolated' }, () => {
|
|
26
26
|
const items = this._edits = this._edits.toMutable();
|
|
27
27
|
if (items.length >= this._capacity)
|
|
28
28
|
items.shift();
|
|
@@ -40,7 +40,7 @@ export class JournalImpl extends Journal {
|
|
|
40
40
|
throw new Error('not implemented');
|
|
41
41
|
}
|
|
42
42
|
undo(count = 1) {
|
|
43
|
-
Transaction.run({ hint: 'Journal.undo',
|
|
43
|
+
Transaction.run({ hint: 'Journal.undo', separation: 'isolated' }, () => {
|
|
44
44
|
let i = this._position - 1;
|
|
45
45
|
while (i >= 0 && count > 0) {
|
|
46
46
|
const patch = this._edits[i];
|
|
@@ -52,7 +52,7 @@ export class JournalImpl extends Journal {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
redo(count = 1) {
|
|
55
|
-
Transaction.run({ hint: 'Journal.redo',
|
|
55
|
+
Transaction.run({ hint: 'Journal.redo', separation: 'isolated' }, () => {
|
|
56
56
|
let i = this._position;
|
|
57
57
|
while (i < this._edits.length && count > 0) {
|
|
58
58
|
const patch = this._edits[i];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactiveObject,
|
|
1
|
+
import { ReactiveObject, Mvcc } from './Mvcc';
|
|
2
2
|
import { Transaction } from './Transaction';
|
|
3
3
|
export class Monitor extends ReactiveObject {
|
|
4
4
|
static create(hint, activationDelay, deactivationDelay, durationResolution) {
|
|
@@ -44,7 +44,7 @@ export class MonitorImpl extends Monitor {
|
|
|
44
44
|
}
|
|
45
45
|
static doCreate(hint, activationDelay, deactivationDelay, durationResolution) {
|
|
46
46
|
const m = new MonitorImpl();
|
|
47
|
-
|
|
47
|
+
Mvcc.setHint(m, hint);
|
|
48
48
|
m.internals.activationDelay = activationDelay;
|
|
49
49
|
m.internals.deactivationDelay = deactivationDelay;
|
|
50
50
|
m.internals.durationResolution = durationResolution;
|
|
@@ -59,7 +59,7 @@ export class MonitorImpl extends Monitor {
|
|
|
59
59
|
}
|
|
60
60
|
if (delay >= 0) {
|
|
61
61
|
if (mon.internals.activationTimeout === undefined)
|
|
62
|
-
mon.internals.activationTimeout = setTimeout(() => Transaction.run({ hint: 'Monitor.activate',
|
|
62
|
+
mon.internals.activationTimeout = setTimeout(() => Transaction.run({ hint: 'Monitor.activate', separation: 'isolated' }, MonitorImpl.activate, mon, -1), delay);
|
|
63
63
|
}
|
|
64
64
|
else if (active)
|
|
65
65
|
mon.isActive = true;
|
|
@@ -67,7 +67,7 @@ export class MonitorImpl extends Monitor {
|
|
|
67
67
|
static deactivate(mon, delay) {
|
|
68
68
|
if (delay >= 0) {
|
|
69
69
|
clearTimeout(mon.internals.deactivationTimeout);
|
|
70
|
-
mon.internals.deactivationTimeout = setTimeout(() => Transaction.run({ hint: 'Monitor.deactivate',
|
|
70
|
+
mon.internals.deactivationTimeout = setTimeout(() => Transaction.run({ hint: 'Monitor.deactivate', separation: 'isolated' }, MonitorImpl.deactivate, mon, -1), delay);
|
|
71
71
|
}
|
|
72
72
|
else if (mon.counter <= 0) {
|
|
73
73
|
mon.isActive = false;
|
|
@@ -1,64 +1,24 @@
|
|
|
1
1
|
import { F } from '../util/Utils';
|
|
2
2
|
import { MemberOptions, Kind, Reentrance } from '../Options';
|
|
3
3
|
import { LoggingOptions, ProfilingOptions } from '../Logging';
|
|
4
|
-
import { MemberName, ObjectHandle,
|
|
4
|
+
import { MemberName, ObjectHandle, SeparationMode } from './Data';
|
|
5
5
|
import { Journal } from './Journal';
|
|
6
6
|
import { Monitor } from './Monitor';
|
|
7
|
-
export declare abstract class
|
|
8
|
-
constructor();
|
|
7
|
+
export declare abstract class MvccObject {
|
|
8
|
+
protected constructor(reactive: boolean);
|
|
9
9
|
[Symbol.toStringTag](): string;
|
|
10
10
|
}
|
|
11
|
-
export declare class
|
|
12
|
-
|
|
13
|
-
get length(): number;
|
|
14
|
-
set length(n: number);
|
|
15
|
-
get(n: number): T;
|
|
16
|
-
set(n: number, item: T): void;
|
|
17
|
-
toString(): string;
|
|
18
|
-
toLocaleString(): string;
|
|
19
|
-
pop(): T | undefined;
|
|
20
|
-
push(...items: T[]): number;
|
|
21
|
-
concat(...items: (T | ConcatArray<T>)[]): T[];
|
|
22
|
-
join(separator?: string): string;
|
|
23
|
-
reverse(): T[];
|
|
24
|
-
shift(): T | undefined;
|
|
25
|
-
slice(start?: number, end?: number): T[];
|
|
26
|
-
sort(compareFn?: (a: T, b: T) => number): this;
|
|
27
|
-
splice(start: number, deleteCount?: number): T[];
|
|
28
|
-
unshift(...items: T[]): number;
|
|
29
|
-
indexOf(searchElement: T, fromIndex?: number): number;
|
|
30
|
-
lastIndexOf(searchElement: T, fromIndex?: number): number;
|
|
31
|
-
every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
|
|
32
|
-
some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
|
|
33
|
-
forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
|
|
34
|
-
map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
|
|
35
|
-
filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
|
|
36
|
-
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
|
|
37
|
-
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
|
|
38
|
-
entries(): IterableIterator<[number, T]>;
|
|
39
|
-
keys(): IterableIterator<number>;
|
|
40
|
-
values(): IterableIterator<T>;
|
|
41
|
-
private get mutable();
|
|
11
|
+
export declare abstract class TransactionalObject extends MvccObject {
|
|
12
|
+
constructor();
|
|
42
13
|
}
|
|
43
|
-
export declare class
|
|
44
|
-
|
|
45
|
-
clear(): void;
|
|
46
|
-
delete(key: K): boolean;
|
|
47
|
-
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
48
|
-
get(key: K): V | undefined;
|
|
49
|
-
has(key: K): boolean;
|
|
50
|
-
set(key: K, value: V): this;
|
|
51
|
-
get size(): number;
|
|
52
|
-
entries(): IterableIterator<[K, V]>;
|
|
53
|
-
keys(): IterableIterator<K>;
|
|
54
|
-
values(): IterableIterator<V>;
|
|
55
|
-
private get mutable();
|
|
14
|
+
export declare abstract class ReactiveObject extends MvccObject {
|
|
15
|
+
constructor();
|
|
56
16
|
}
|
|
57
17
|
export declare class OptionsImpl implements MemberOptions {
|
|
58
18
|
readonly getter: Function;
|
|
59
19
|
readonly setter: Function;
|
|
60
20
|
readonly kind: Kind;
|
|
61
|
-
readonly
|
|
21
|
+
readonly separation: SeparationMode;
|
|
62
22
|
readonly order: number;
|
|
63
23
|
readonly noSideEffects: boolean;
|
|
64
24
|
readonly triggeringArgs: boolean;
|
|
@@ -70,13 +30,16 @@ export declare class OptionsImpl implements MemberOptions {
|
|
|
70
30
|
static readonly INITIAL: Readonly<OptionsImpl>;
|
|
71
31
|
constructor(getter: Function | undefined, setter: Function | undefined, existing: OptionsImpl, patch: Partial<OptionsImpl>, implicit: boolean);
|
|
72
32
|
}
|
|
73
|
-
export declare class
|
|
33
|
+
export declare class Mvcc implements ProxyHandler<ObjectHandle> {
|
|
74
34
|
static reactionsAutoStartDisabled: boolean;
|
|
75
35
|
static repetitiveUsageWarningThreshold: number;
|
|
76
36
|
static mainThreadBlockingWarningThreshold: number;
|
|
77
37
|
static asyncActionDurationWarningThreshold: number;
|
|
78
38
|
static sensitivity: boolean;
|
|
79
|
-
static readonly
|
|
39
|
+
static readonly transactional: Mvcc;
|
|
40
|
+
static readonly reactive: Mvcc;
|
|
41
|
+
readonly isReactive: boolean;
|
|
42
|
+
constructor(isReactive: boolean);
|
|
80
43
|
getPrototypeOf(h: ObjectHandle): object | null;
|
|
81
44
|
get(h: ObjectHandle, m: MemberName, receiver: any): any;
|
|
82
45
|
set(h: ObjectHandle, m: MemberName, value: any, receiver: any): boolean;
|
|
@@ -87,7 +50,7 @@ export declare class Hooks implements ProxyHandler<ObjectHandle> {
|
|
|
87
50
|
static decorateOperation(implicit: boolean, decorator: Function, options: Partial<MemberOptions>, proto: any, member: MemberName, pd: PropertyDescriptor | undefined): any;
|
|
88
51
|
static decorateOperationParametrized(decorator: Function, options: Partial<MemberOptions>): F<any>;
|
|
89
52
|
static acquireHandle(obj: any): ObjectHandle;
|
|
90
|
-
static
|
|
53
|
+
static createHandleForMvccObject(proto: any, data: any, blank: any, hint: string, reactive: boolean): ObjectHandle;
|
|
91
54
|
static setProfilingMode(isOn: boolean, options?: Partial<ProfilingOptions>): void;
|
|
92
55
|
static sensitive<T>(sensitivity: boolean, func: F<T>, ...args: any[]): T;
|
|
93
56
|
static setHint<T>(obj: T, hint: string | undefined): T;
|