reactronic 0.94.25037 → 0.95.25040
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 +67 -66
- package/build/dist/source/Enums.d.ts +3 -3
- package/build/dist/source/Enums.js +3 -3
- package/build/dist/source/OperationEx.d.ts +2 -2
- package/build/dist/source/OperationEx.js +5 -5
- package/build/dist/source/Options.d.ts +2 -2
- package/build/dist/source/Pipe.d.ts +2 -2
- package/build/dist/source/Pipe.js +2 -2
- package/build/dist/source/Ref.d.ts +2 -2
- package/build/dist/source/Ref.js +5 -5
- package/build/dist/source/System.d.ts +14 -14
- package/build/dist/source/System.js +22 -22
- package/build/dist/source/api.d.ts +7 -7
- package/build/dist/source/api.js +6 -6
- package/build/dist/source/core/Changeset.js +1 -1
- package/build/dist/source/core/Data.d.ts +1 -1
- package/build/dist/source/core/Indicator.d.ts +2 -2
- package/build/dist/source/core/Indicator.js +2 -2
- package/build/dist/source/core/Journal.d.ts +2 -2
- package/build/dist/source/core/Journal.js +2 -2
- package/build/dist/source/core/Mvcc.d.ts +10 -10
- package/build/dist/source/core/Mvcc.js +19 -19
- package/build/dist/source/core/MvccArray.d.ts +3 -3
- package/build/dist/source/core/MvccArray.js +4 -4
- package/build/dist/source/core/MvccMap.d.ts +3 -3
- package/build/dist/source/core/MvccMap.js +4 -4
- package/build/dist/source/core/MvccReconciliationList.d.ts +12 -11
- package/build/dist/source/core/MvccReconciliationList.js +12 -11
- package/build/dist/source/core/Operation.d.ts +8 -8
- package/build/dist/source/core/Operation.js +41 -41
- package/build/dist/source/core/Transaction.js +28 -28
- package/build/dist/source/core/TreeNode.d.ts +17 -17
- package/build/dist/source/core/TreeNode.js +52 -52
- package/build/dist/source/util/LinkedList.d.ts +52 -0
- package/build/dist/source/util/LinkedList.js +177 -0
- package/build/dist/source/util/LinkedListRenovation.d.ts +20 -0
- package/build/dist/source/util/LinkedListRenovation.js +134 -0
- package/build/dist/source/util/ReconciliationList.d.ts +10 -8
- package/build/dist/source/util/ReconciliationList.js +59 -58
- package/package.json +10 -9
|
@@ -125,7 +125,7 @@ export class Changeset {
|
|
|
125
125
|
}
|
|
126
126
|
isNewObjectVersionRequired(h, ov, fk, existing, value, token) {
|
|
127
127
|
if (this.sealed && ov.changeset !== EMPTY_OBJECT_VERSION.changeset)
|
|
128
|
-
throw misuse(`
|
|
128
|
+
throw misuse(`signal property ${Dump.obj(h, fk)} can only be modified inside transaction`);
|
|
129
129
|
if (fk !== Meta.Handle) {
|
|
130
130
|
if (value !== Meta.Handle) {
|
|
131
131
|
if (ov.changeset !== this || ov.former.objectVersion !== EMPTY_OBJECT_VERSION) {
|
|
@@ -14,7 +14,7 @@ export declare class ContentFootprint<T = any> {
|
|
|
14
14
|
}
|
|
15
15
|
export type OperationFootprint = {
|
|
16
16
|
readonly order: number;
|
|
17
|
-
readonly
|
|
17
|
+
readonly signals: Map<ContentFootprint, Subscription> | undefined;
|
|
18
18
|
readonly obsoleteSince: number;
|
|
19
19
|
hint(nop?: boolean): string;
|
|
20
20
|
markObsoleteDueTo(footprint: ContentFootprint, fk: FieldKey, changeset: AbstractChangeset, h: ObjectHandle, outer: string, since: number, collector: Array<OperationFootprint>): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Worker } from "../Worker.js";
|
|
2
|
-
import {
|
|
3
|
-
export declare abstract class Indicator extends
|
|
2
|
+
import { SxObject } from "./Mvcc.js";
|
|
3
|
+
export declare abstract class Indicator extends SxObject {
|
|
4
4
|
abstract readonly isBusy: boolean;
|
|
5
5
|
abstract readonly counter: number;
|
|
6
6
|
abstract readonly workers: ReadonlySet<Worker>;
|
|
@@ -8,9 +8,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { Isolation } from "../Enums.js";
|
|
11
|
-
import {
|
|
11
|
+
import { SxObject, Mvcc } from "./Mvcc.js";
|
|
12
12
|
import { Transaction } from "./Transaction.js";
|
|
13
|
-
export class Indicator extends
|
|
13
|
+
export class Indicator extends SxObject {
|
|
14
14
|
static create(hint, activationDelay, deactivationDelay, durationResolution) {
|
|
15
15
|
return IndicatorImpl.createImpl(hint, activationDelay, deactivationDelay, durationResolution);
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SxObject } from "./Mvcc.js";
|
|
2
2
|
import { ObjectHandle, ObjectVersion, PatchSet } from "./Data.js";
|
|
3
3
|
export type Saver = (patch: PatchSet) => Promise<void>;
|
|
4
|
-
export declare abstract class Journal extends
|
|
4
|
+
export declare abstract class Journal extends SxObject {
|
|
5
5
|
abstract capacity: number;
|
|
6
6
|
abstract readonly edits: ReadonlyArray<PatchSet>;
|
|
7
7
|
abstract readonly unsaved: PatchSet;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { misuse } from "../util/Dbg.js";
|
|
2
2
|
import { Isolation } from "../Enums.js";
|
|
3
|
-
import {
|
|
3
|
+
import { SxObject } from "./Mvcc.js";
|
|
4
4
|
import { Meta, ContentFootprint } from "./Data.js";
|
|
5
5
|
import { Changeset, EMPTY_OBJECT_VERSION } from "./Changeset.js";
|
|
6
6
|
import { Transaction } from "./Transaction.js";
|
|
7
7
|
import { Sealant } from "../util/Sealant.js";
|
|
8
|
-
export class Journal extends
|
|
8
|
+
export class Journal extends SxObject {
|
|
9
9
|
static create() { return new JournalImpl(); }
|
|
10
10
|
}
|
|
11
11
|
export class JournalImpl extends Journal {
|
|
@@ -6,13 +6,13 @@ import { FieldKey, ObjectHandle } from "./Data.js";
|
|
|
6
6
|
import { Journal } from "./Journal.js";
|
|
7
7
|
import { Indicator } from "./Indicator.js";
|
|
8
8
|
export declare abstract class MvccObject {
|
|
9
|
-
protected constructor(
|
|
9
|
+
protected constructor(isSignal: boolean);
|
|
10
10
|
[Symbol.toStringTag](): string;
|
|
11
11
|
}
|
|
12
|
-
export declare abstract class
|
|
12
|
+
export declare abstract class TxObject extends MvccObject {
|
|
13
13
|
constructor();
|
|
14
14
|
}
|
|
15
|
-
export declare abstract class
|
|
15
|
+
export declare abstract class SxObject extends MvccObject {
|
|
16
16
|
constructor();
|
|
17
17
|
}
|
|
18
18
|
export declare class OptionsImpl implements ReactivityOptions {
|
|
@@ -22,7 +22,7 @@ export declare class OptionsImpl implements ReactivityOptions {
|
|
|
22
22
|
readonly isolation: Isolation;
|
|
23
23
|
readonly order: number;
|
|
24
24
|
readonly noSideEffects: boolean;
|
|
25
|
-
readonly
|
|
25
|
+
readonly signalArgs: boolean;
|
|
26
26
|
readonly throttling: number;
|
|
27
27
|
readonly reentrance: Reentrance;
|
|
28
28
|
readonly allowObsoleteToFinish: boolean;
|
|
@@ -38,10 +38,10 @@ export declare class Mvcc implements ProxyHandler<ObjectHandle> {
|
|
|
38
38
|
static mainThreadBlockingWarningThreshold: number;
|
|
39
39
|
static asyncActionDurationWarningThreshold: number;
|
|
40
40
|
static sensitivity: boolean;
|
|
41
|
-
static readonly
|
|
42
|
-
static readonly
|
|
43
|
-
readonly
|
|
44
|
-
constructor(
|
|
41
|
+
static readonly tx: Mvcc;
|
|
42
|
+
static readonly sx: Mvcc;
|
|
43
|
+
readonly isSignal: boolean;
|
|
44
|
+
constructor(isSignal: boolean);
|
|
45
45
|
getPrototypeOf(h: ObjectHandle): object | null;
|
|
46
46
|
get(h: ObjectHandle, fk: FieldKey, receiver: any): any;
|
|
47
47
|
set(h: ObjectHandle, fk: FieldKey, value: any, receiver: any): boolean;
|
|
@@ -49,11 +49,11 @@ export declare class Mvcc implements ProxyHandler<ObjectHandle> {
|
|
|
49
49
|
defineProperty?(h: ObjectHandle, name: string | symbol, attributes: PropertyDescriptor): boolean;
|
|
50
50
|
getOwnPropertyDescriptor(h: ObjectHandle, fk: FieldKey): PropertyDescriptor | undefined;
|
|
51
51
|
ownKeys(h: ObjectHandle): Array<string | symbol>;
|
|
52
|
-
static decorateData(
|
|
52
|
+
static decorateData(isSignal: boolean, proto: any, fk: FieldKey): any;
|
|
53
53
|
static decorateOperation(implicit: boolean, decorator: Function, options: Partial<ReactivityOptions>, proto: any, member: FieldKey, pd: PropertyDescriptor | undefined): any;
|
|
54
54
|
static decorateOperationParametrized(decorator: Function, options: Partial<ReactivityOptions>): F<any>;
|
|
55
55
|
static acquireHandle(obj: any): ObjectHandle;
|
|
56
|
-
static createHandleForMvccObject(proto: any, data: any, blank: any, hint: string,
|
|
56
|
+
static createHandleForMvccObject(proto: any, data: any, blank: any, hint: string, isSignal: boolean): ObjectHandle;
|
|
57
57
|
static setProfilingMode(isOn: boolean, options?: Partial<ProfilingOptions>): void;
|
|
58
58
|
static sensitive<T>(sensitivity: boolean, func: F<T>, ...args: any[]): T;
|
|
59
59
|
static setHint<T>(obj: T, hint: string | undefined): T;
|
|
@@ -4,10 +4,10 @@ import { Kind, Reentrance, Isolation } from "../Enums.js";
|
|
|
4
4
|
import { ObjectVersion, ObjectHandle, ContentFootprint, Meta } from "./Data.js";
|
|
5
5
|
import { Changeset, Dump, EMPTY_OBJECT_VERSION } from "./Changeset.js";
|
|
6
6
|
export class MvccObject {
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(isSignal) {
|
|
8
8
|
const proto = new.target.prototype;
|
|
9
9
|
const initial = Meta.getFrom(proto, Meta.Initial);
|
|
10
|
-
const h = Mvcc.createHandleForMvccObject(proto, this, initial, new.target.name,
|
|
10
|
+
const h = Mvcc.createHandleForMvccObject(proto, this, initial, new.target.name, isSignal);
|
|
11
11
|
return h.proxy;
|
|
12
12
|
}
|
|
13
13
|
[Symbol.toStringTag]() {
|
|
@@ -15,12 +15,12 @@ export class MvccObject {
|
|
|
15
15
|
return Dump.obj(h);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
export class
|
|
18
|
+
export class TxObject extends MvccObject {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(false);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
export class
|
|
23
|
+
export class SxObject extends MvccObject {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(true);
|
|
26
26
|
}
|
|
@@ -30,7 +30,7 @@ const DEFAULT_OPTIONS = Object.freeze({
|
|
|
30
30
|
isolation: Isolation.joinToCurrentTransaction,
|
|
31
31
|
order: 0,
|
|
32
32
|
noSideEffects: false,
|
|
33
|
-
|
|
33
|
+
signalArgs: false,
|
|
34
34
|
throttling: Number.MAX_SAFE_INTEGER,
|
|
35
35
|
reentrance: Reentrance.preventWithError,
|
|
36
36
|
allowObsoleteToFinish: false,
|
|
@@ -46,7 +46,7 @@ export class OptionsImpl {
|
|
|
46
46
|
this.isolation = merge(DEFAULT_OPTIONS.isolation, existing.isolation, patch.isolation, implicit);
|
|
47
47
|
this.order = merge(DEFAULT_OPTIONS.order, existing.order, patch.order, implicit);
|
|
48
48
|
this.noSideEffects = merge(DEFAULT_OPTIONS.noSideEffects, existing.noSideEffects, patch.noSideEffects, implicit);
|
|
49
|
-
this.
|
|
49
|
+
this.signalArgs = merge(DEFAULT_OPTIONS.signalArgs, existing.signalArgs, patch.signalArgs, implicit);
|
|
50
50
|
this.throttling = merge(DEFAULT_OPTIONS.throttling, existing.throttling, patch.throttling, implicit);
|
|
51
51
|
this.reentrance = merge(DEFAULT_OPTIONS.reentrance, existing.reentrance, patch.reentrance, implicit);
|
|
52
52
|
this.allowObsoleteToFinish = merge(DEFAULT_OPTIONS.allowObsoleteToFinish, existing.allowObsoleteToFinish, patch.allowObsoleteToFinish, implicit);
|
|
@@ -62,8 +62,8 @@ function merge(def, existing, patch, implicit) {
|
|
|
62
62
|
return patch !== undefined && (existing === def || !implicit) ? patch : existing;
|
|
63
63
|
}
|
|
64
64
|
export class Mvcc {
|
|
65
|
-
constructor(
|
|
66
|
-
this.
|
|
65
|
+
constructor(isSignal) {
|
|
66
|
+
this.isSignal = isSignal;
|
|
67
67
|
}
|
|
68
68
|
getPrototypeOf(h) {
|
|
69
69
|
return Reflect.getPrototypeOf(h.data);
|
|
@@ -75,7 +75,7 @@ export class Mvcc {
|
|
|
75
75
|
const ov = cs.getObjectVersion(h, fk);
|
|
76
76
|
result = ov.data[fk];
|
|
77
77
|
if (result instanceof ContentFootprint && !result.isComputed) {
|
|
78
|
-
if (this.
|
|
78
|
+
if (this.isSignal)
|
|
79
79
|
Changeset.markUsed(result, ov, fk, h, Kind.plain, false);
|
|
80
80
|
result = result.content;
|
|
81
81
|
}
|
|
@@ -122,16 +122,16 @@ export class Mvcc {
|
|
|
122
122
|
}
|
|
123
123
|
return result;
|
|
124
124
|
}
|
|
125
|
-
static decorateData(
|
|
126
|
-
if (
|
|
125
|
+
static decorateData(isSignal, proto, fk) {
|
|
126
|
+
if (isSignal) {
|
|
127
127
|
Meta.acquire(proto, Meta.Initial)[fk] = new ContentFootprint(undefined, 0);
|
|
128
128
|
const get = function () {
|
|
129
129
|
const h = Mvcc.acquireHandle(this);
|
|
130
|
-
return Mvcc.
|
|
130
|
+
return Mvcc.sx.get(h, fk, this);
|
|
131
131
|
};
|
|
132
132
|
const set = function (value) {
|
|
133
133
|
const h = Mvcc.acquireHandle(this);
|
|
134
|
-
return Mvcc.
|
|
134
|
+
return Mvcc.sx.set(h, fk, value, this);
|
|
135
135
|
};
|
|
136
136
|
const enumerable = true;
|
|
137
137
|
const configurable = false;
|
|
@@ -177,19 +177,19 @@ export class Mvcc {
|
|
|
177
177
|
let h = obj[Meta.Handle];
|
|
178
178
|
if (!h) {
|
|
179
179
|
if (obj !== Object(obj) || Array.isArray(obj))
|
|
180
|
-
throw misuse("only objects can be
|
|
180
|
+
throw misuse("only objects can be signalling");
|
|
181
181
|
const initial = Meta.getFrom(Object.getPrototypeOf(obj), Meta.Initial);
|
|
182
182
|
const ov = new ObjectVersion(EMPTY_OBJECT_VERSION.changeset, EMPTY_OBJECT_VERSION, Object.assign({}, initial));
|
|
183
|
-
h = new ObjectHandle(obj, obj, Mvcc.
|
|
183
|
+
h = new ObjectHandle(obj, obj, Mvcc.sx, ov, obj.constructor.name);
|
|
184
184
|
Meta.set(ov.data, Meta.Handle, h);
|
|
185
185
|
Meta.set(obj, Meta.Handle, h);
|
|
186
186
|
Meta.set(ov.data, Meta.Revision, new ContentFootprint(1, 0));
|
|
187
187
|
}
|
|
188
188
|
return h;
|
|
189
189
|
}
|
|
190
|
-
static createHandleForMvccObject(proto, data, blank, hint,
|
|
190
|
+
static createHandleForMvccObject(proto, data, blank, hint, isSignal) {
|
|
191
191
|
const ctx = Changeset.edit();
|
|
192
|
-
const mvcc =
|
|
192
|
+
const mvcc = isSignal ? Mvcc.sx : Mvcc.tx;
|
|
193
193
|
const h = new ObjectHandle(data, undefined, mvcc, EMPTY_OBJECT_VERSION, hint);
|
|
194
194
|
ctx.getEditableObjectVersion(h, Meta.Handle, blank);
|
|
195
195
|
if (!Mvcc.reactivityAutoStartDisabled)
|
|
@@ -238,8 +238,8 @@ Mvcc.repetitiveUsageWarningThreshold = Number.MAX_SAFE_INTEGER;
|
|
|
238
238
|
Mvcc.mainThreadBlockingWarningThreshold = Number.MAX_SAFE_INTEGER;
|
|
239
239
|
Mvcc.asyncActionDurationWarningThreshold = Number.MAX_SAFE_INTEGER;
|
|
240
240
|
Mvcc.sensitivity = false;
|
|
241
|
-
Mvcc.
|
|
242
|
-
Mvcc.
|
|
241
|
+
Mvcc.tx = new Mvcc(false);
|
|
242
|
+
Mvcc.sx = new Mvcc(true);
|
|
243
243
|
Mvcc.createOperationDescriptor = function (h, fk, options) {
|
|
244
244
|
throw misuse("this implementation of createOperationDescriptor should never be called");
|
|
245
245
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MvccObject } from "./Mvcc.js";
|
|
2
2
|
export declare class MvccArray<T> extends MvccObject {
|
|
3
3
|
private impl;
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(isSignalling: boolean, array: Array<T>);
|
|
5
5
|
get length(): number;
|
|
6
6
|
set length(n: number);
|
|
7
7
|
getItem(n: number): T;
|
|
@@ -47,13 +47,13 @@ export declare class MvccArray<T> extends MvccObject {
|
|
|
47
47
|
values(): IterableIterator<T>;
|
|
48
48
|
private get mutable();
|
|
49
49
|
}
|
|
50
|
-
export declare class
|
|
50
|
+
export declare class TxArray<T> extends MvccArray<T> {
|
|
51
51
|
constructor();
|
|
52
52
|
constructor(arrayLength: number);
|
|
53
53
|
constructor(arrayLength?: number);
|
|
54
54
|
constructor(...items: T[]);
|
|
55
55
|
}
|
|
56
|
-
export declare class
|
|
56
|
+
export declare class SxArray<T> extends MvccArray<T> {
|
|
57
57
|
constructor();
|
|
58
58
|
constructor(arrayLength: number);
|
|
59
59
|
constructor(arrayLength?: number);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Sealant } from "../util/Sealant.js";
|
|
2
2
|
import { MvccObject } from "./Mvcc.js";
|
|
3
3
|
export class MvccArray extends MvccObject {
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(isSignalling, array) {
|
|
5
|
+
super(isSignalling);
|
|
6
6
|
this.impl = array;
|
|
7
7
|
}
|
|
8
8
|
get length() { return this.impl.length; }
|
|
@@ -46,12 +46,12 @@ export class MvccArray extends MvccObject {
|
|
|
46
46
|
return this.impl;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
export class
|
|
49
|
+
export class TxArray extends MvccArray {
|
|
50
50
|
constructor(...args) {
|
|
51
51
|
super(false, new Array(...args));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
export class
|
|
54
|
+
export class SxArray extends MvccArray {
|
|
55
55
|
constructor(...args) {
|
|
56
56
|
super(true, new Array(...args));
|
|
57
57
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MvccObject } from "./Mvcc.js";
|
|
2
2
|
export declare class MvccMap<K, V> extends MvccObject {
|
|
3
3
|
private impl;
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(isSignalling: boolean, map: Map<K, V>);
|
|
5
5
|
clear(): void;
|
|
6
6
|
delete(key: K): boolean;
|
|
7
7
|
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
@@ -15,11 +15,11 @@ export declare class MvccMap<K, V> extends MvccObject {
|
|
|
15
15
|
[Symbol.toStringTag](): string;
|
|
16
16
|
private get mutable();
|
|
17
17
|
}
|
|
18
|
-
export declare class
|
|
18
|
+
export declare class TxMap<K, V> extends MvccMap<K, V> {
|
|
19
19
|
constructor();
|
|
20
20
|
constructor(iterable?: Iterable<readonly [K, V]> | null);
|
|
21
21
|
}
|
|
22
|
-
export declare class
|
|
22
|
+
export declare class SxMap<K, V> extends MvccMap<K, V> {
|
|
23
23
|
constructor();
|
|
24
24
|
constructor(iterable?: Iterable<readonly [K, V]> | null);
|
|
25
25
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Sealant } from "../util/Sealant.js";
|
|
2
2
|
import { MvccObject } from "./Mvcc.js";
|
|
3
3
|
export class MvccMap extends MvccObject {
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(isSignalling, map) {
|
|
5
|
+
super(isSignalling);
|
|
6
6
|
this.impl = map;
|
|
7
7
|
}
|
|
8
8
|
clear() { this.mutable.clear(); }
|
|
@@ -23,12 +23,12 @@ export class MvccMap extends MvccObject {
|
|
|
23
23
|
return this.impl;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
export class
|
|
26
|
+
export class TxMap extends MvccMap {
|
|
27
27
|
constructor(args) {
|
|
28
28
|
super(false, args !== undefined ? new Map(args) : new Map());
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
export class
|
|
31
|
+
export class SxMap extends MvccMap {
|
|
32
32
|
constructor(args) {
|
|
33
33
|
super(true, args !== undefined ? new Map(args) : new Map());
|
|
34
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReconciliationList, LinkedItem, ReconciliationListReader } from "../util/ReconciliationList.js";
|
|
2
|
-
import {
|
|
3
|
-
export declare abstract class
|
|
2
|
+
import { SxObject } from "./Mvcc.js";
|
|
3
|
+
export declare abstract class SxReconciliationList<T> extends SxObject implements ReconciliationListReader<T> {
|
|
4
4
|
protected abstract impl: ReconciliationList<T>;
|
|
5
5
|
get isStrict(): boolean;
|
|
6
6
|
get count(): number;
|
|
@@ -8,20 +8,21 @@ export declare abstract class ObservableReconciliationList<T> extends Observable
|
|
|
8
8
|
get countOfRemoved(): number;
|
|
9
9
|
get isReconciliationInProgress(): boolean;
|
|
10
10
|
lookup(key: string): LinkedItem<T> | undefined;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
tryReuse(key: string): LinkedItem<T> | undefined;
|
|
12
|
+
add(instance: T): LinkedItem<T>;
|
|
13
|
+
remove(item: LinkedItem<T>): void;
|
|
14
14
|
move(item: LinkedItem<T>, after: LinkedItem<T>): void;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
beginReconciliation(): void;
|
|
16
|
+
endReconciliation(error?: unknown): void;
|
|
17
|
+
clearAddedAndRemovedLists(): void;
|
|
18
18
|
firstItem(): LinkedItem<T> | undefined;
|
|
19
19
|
lastItem(): LinkedItem<T> | undefined;
|
|
20
20
|
items(): Generator<LinkedItem<T>>;
|
|
21
|
-
itemsAdded(
|
|
22
|
-
itemsRemoved(
|
|
21
|
+
itemsAdded(clear?: boolean): Generator<LinkedItem<T>>;
|
|
22
|
+
itemsRemoved(clear?: boolean): Generator<LinkedItem<T>>;
|
|
23
23
|
isAdded(item: LinkedItem<T>): boolean;
|
|
24
24
|
isMoved(item: LinkedItem<T>): boolean;
|
|
25
25
|
isRemoved(item: LinkedItem<T>): boolean;
|
|
26
|
-
|
|
26
|
+
isActual(item: LinkedItem<T>): boolean;
|
|
27
|
+
isExternal(item: LinkedItem<T>): boolean;
|
|
27
28
|
}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export class
|
|
1
|
+
import { SxObject } from "./Mvcc.js";
|
|
2
|
+
export class SxReconciliationList extends SxObject {
|
|
3
3
|
get isStrict() { return this.impl.isStrict; }
|
|
4
4
|
get count() { return this.impl.count; }
|
|
5
5
|
get countOfAdded() { return this.impl.countOfAdded; }
|
|
6
6
|
get countOfRemoved() { return this.impl.countOfRemoved; }
|
|
7
7
|
get isReconciliationInProgress() { return this.impl.isReconciliationInProgress; }
|
|
8
8
|
lookup(key) { return this.impl.lookup(key); }
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
tryReuse(key) { return this.impl.tryReuse(key); }
|
|
10
|
+
add(instance) { return this.impl.add(instance); }
|
|
11
|
+
remove(item) { return this.impl.remove(item); }
|
|
12
12
|
move(item, after) { this.impl.move(item, after); }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
beginReconciliation() { this.impl.beginReconciliation(); }
|
|
14
|
+
endReconciliation(error) { this.impl.endReconciliation(error); }
|
|
15
|
+
clearAddedAndRemovedLists() { this.impl.clearAddedAndRemoved(); }
|
|
16
16
|
firstItem() { return this.impl.firstItem(); }
|
|
17
17
|
lastItem() { return this.impl.lastItem(); }
|
|
18
18
|
items() { return this.impl.items(); }
|
|
19
|
-
itemsAdded(
|
|
20
|
-
itemsRemoved(
|
|
19
|
+
itemsAdded(clear) { return this.impl.itemsAdded(clear); }
|
|
20
|
+
itemsRemoved(clear) { return this.impl.itemsRemoved(clear); }
|
|
21
21
|
isAdded(item) { return this.impl.isAdded(item); }
|
|
22
22
|
isMoved(item) { return this.impl.isMoved(item); }
|
|
23
23
|
isRemoved(item) { return this.impl.isRemoved(item); }
|
|
24
|
-
|
|
24
|
+
isActual(item) { return this.impl.isActual(item); }
|
|
25
|
+
isExternal(item) { return this.impl.isExternal(item); }
|
|
25
26
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { F } from "../util/Utils.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Reaction, ReactivityOptions } from "../Options.js";
|
|
3
3
|
import { FieldKey, ObjectHandle, ContentFootprint, OperationFootprint, Subscription, AbstractChangeset } from "./Data.js";
|
|
4
4
|
import { Transaction } from "./Transaction.js";
|
|
5
5
|
import { OptionsImpl } from "./Mvcc.js";
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class ReactionImpl implements Reaction<any> {
|
|
7
7
|
readonly ownerHandle: ObjectHandle;
|
|
8
8
|
readonly fieldKey: FieldKey;
|
|
9
9
|
configure(options: Partial<ReactivityOptions>): ReactivityOptions;
|
|
@@ -18,8 +18,8 @@ export declare class ReactiveOperationImpl implements ReactiveOperation<any> {
|
|
|
18
18
|
pullLastResult(args?: any[]): any;
|
|
19
19
|
constructor(h: ObjectHandle, fk: FieldKey);
|
|
20
20
|
reuseOrRelaunch(weak: boolean, args: any[] | undefined): OperationFootprintImpl;
|
|
21
|
-
static
|
|
22
|
-
static configureImpl(self:
|
|
21
|
+
static manageReaction(method: F<any>): Reaction<any>;
|
|
22
|
+
static configureImpl(self: ReactionImpl | undefined, options: Partial<ReactivityOptions>): ReactivityOptions;
|
|
23
23
|
static proceedWithinGivenLaunch<T>(footprint: OperationFootprintImpl | undefined, func: F<T>, ...args: any[]): T;
|
|
24
24
|
static why(): string;
|
|
25
25
|
static briefWhy(): string;
|
|
@@ -37,9 +37,9 @@ declare class OperationFootprintImpl extends ContentFootprint implements Operati
|
|
|
37
37
|
static deferredReactions: Array<OperationFootprintImpl>;
|
|
38
38
|
readonly margin: number;
|
|
39
39
|
readonly transaction: Transaction;
|
|
40
|
-
readonly descriptor:
|
|
40
|
+
readonly descriptor: ReactionImpl;
|
|
41
41
|
readonly changeset: AbstractChangeset;
|
|
42
|
-
|
|
42
|
+
signals: Map<ContentFootprint, Subscription> | undefined;
|
|
43
43
|
options: OptionsImpl;
|
|
44
44
|
cause: string | undefined;
|
|
45
45
|
args: any[];
|
|
@@ -49,7 +49,7 @@ declare class OperationFootprintImpl extends ContentFootprint implements Operati
|
|
|
49
49
|
obsoleteDueTo: string | undefined;
|
|
50
50
|
obsoleteSince: number;
|
|
51
51
|
successor: OperationFootprintImpl | undefined;
|
|
52
|
-
constructor(transaction: Transaction, descriptor:
|
|
52
|
+
constructor(transaction: Transaction, descriptor: ReactionImpl, changeset: AbstractChangeset, former: OperationFootprintImpl | OptionsImpl, clone: boolean);
|
|
53
53
|
get isComputed(): boolean;
|
|
54
54
|
hint(): string;
|
|
55
55
|
get order(): number;
|
|
@@ -81,7 +81,7 @@ declare class OperationFootprintImpl extends ContentFootprint implements Operati
|
|
|
81
81
|
private static enqueueReactionsToRun;
|
|
82
82
|
private static migrateContentFootprint;
|
|
83
83
|
private static processQueuedReactions;
|
|
84
|
-
private
|
|
84
|
+
private unsubscribeFromAllSignals;
|
|
85
85
|
private subscribeTo;
|
|
86
86
|
private static canSubscribeTo;
|
|
87
87
|
private static createOperationDescriptor;
|