reactronic 0.24.275 → 0.24.302

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.
@@ -1,6 +1,7 @@
1
+ import { Isolation } from "../Options.js";
1
2
  import { ObservableObject } from "./Mvcc.js";
2
- import { Meta, ValueSnapshot } from "./Data.js";
3
- import { Changeset, EMPTY_SNAPSHOT } from "./Changeset.js";
3
+ import { Meta, FieldVersion } from "./Data.js";
4
+ import { Changeset, EMPTY_OBJECT_VERSION } from "./Changeset.js";
4
5
  import { Transaction } from "./Transaction.js";
5
6
  import { Sealant } from "../util/Sealant.js";
6
7
  export class Journal extends ObservableObject {
@@ -22,7 +23,7 @@ export class JournalImpl extends Journal {
22
23
  get canUndo() { return this._edits.length > 0 && this._position > 0; }
23
24
  get canRedo() { return this._position < this._edits.length; }
24
25
  edited(p) {
25
- Transaction.run({ hint: "EditJournal.edited", separation: "isolated" }, () => {
26
+ Transaction.run({ hint: "EditJournal.edited", isolation: Isolation.disjoinFromOuterAndInnerTransactions }, () => {
26
27
  const items = this._edits = this._edits.toMutable();
27
28
  if (items.length >= this._capacity)
28
29
  items.shift();
@@ -40,7 +41,7 @@ export class JournalImpl extends Journal {
40
41
  throw new Error("not implemented");
41
42
  }
42
43
  undo(count = 1) {
43
- Transaction.run({ hint: "Journal.undo", separation: "isolated" }, () => {
44
+ Transaction.run({ hint: "Journal.undo", isolation: Isolation.disjoinFromOuterAndInnerTransactions }, () => {
44
45
  let i = this._position - 1;
45
46
  while (i >= 0 && count > 0) {
46
47
  const patch = this._edits[i];
@@ -52,7 +53,7 @@ export class JournalImpl extends Journal {
52
53
  });
53
54
  }
54
55
  redo(count = 1) {
55
- Transaction.run({ hint: "Journal.redo", separation: "isolated" }, () => {
56
+ Transaction.run({ hint: "Journal.redo", isolation: Isolation.disjoinFromOuterAndInnerTransactions }, () => {
56
57
  let i = this._position;
57
58
  while (i < this._edits.length && count > 0) {
58
59
  const patch = this._edits[i];
@@ -65,22 +66,22 @@ export class JournalImpl extends Journal {
65
66
  }
66
67
  static buildPatch(hint, items) {
67
68
  const patch = new Map();
68
- items.forEach((os, h) => {
69
+ items.forEach((ov, h) => {
69
70
  const op = new Map();
70
- const former = os.former.snapshot !== EMPTY_SNAPSHOT ? os.former.snapshot.data : undefined;
71
- os.changes.forEach(m => {
71
+ const former = ov.former.objectVersion !== EMPTY_OBJECT_VERSION ? ov.former.objectVersion.data : undefined;
72
+ ov.changes.forEach(fk => {
72
73
  const vp = {
73
- memberName: m, patchKind: "update",
74
- freshValue: unseal(os.data[m]), formerValue: undefined,
74
+ fieldKey: fk, patchKind: "update",
75
+ freshContent: unseal(ov.data[fk]), formerContent: undefined,
75
76
  };
76
77
  if (former)
77
- vp.formerValue = unseal(former[m]);
78
- op.set(m, vp);
78
+ vp.formerContent = unseal(former[fk]);
79
+ op.set(fk, vp);
79
80
  });
80
81
  if (!former) {
81
82
  const vp = {
82
- memberName: Meta.Revision, patchKind: "remove",
83
- freshValue: Meta.Undefined, formerValue: undefined,
83
+ fieldKey: Meta.Revision, patchKind: "remove",
84
+ freshContent: Meta.Undefined, formerContent: undefined,
84
85
  };
85
86
  op.set(Meta.Revision, vp);
86
87
  }
@@ -93,15 +94,15 @@ export class JournalImpl extends Journal {
93
94
  patch.forEach((op, obj) => {
94
95
  const h = Meta.get(obj, Meta.Handle);
95
96
  const rev = op.get(Meta.Revision);
96
- const disposed = rev && (undoing ? rev.formerValue : rev.freshValue) === Meta.Undefined;
97
+ const disposed = rev && (undoing ? rev.formerContent : rev.freshContent) === Meta.Undefined;
97
98
  if (!disposed) {
98
- op.forEach((vp, m) => {
99
- const value = undoing ? vp.formerValue : vp.freshValue;
100
- const os = ctx.getEditableObjectSnapshot(h, m, value);
101
- if (os.changeset === ctx) {
102
- os.data[m] = new ValueSnapshot(value);
103
- const existing = os.former.snapshot.data[m];
104
- Changeset.markEdited(existing, value, existing !== value, os, m, h);
99
+ op.forEach((vp, fk) => {
100
+ const content = undoing ? vp.formerContent : vp.freshContent;
101
+ const ov = ctx.getEditableObjectVersion(h, fk, content);
102
+ if (ov.changeset === ctx) {
103
+ ov.data[fk] = new FieldVersion(content, ctx.id);
104
+ const existing = ov.former.objectVersion.data[fk];
105
+ Changeset.markEdited(existing, content, existing !== content, ov, fk, h);
105
106
  }
106
107
  });
107
108
  }
@@ -115,21 +116,21 @@ export class JournalImpl extends Journal {
115
116
  let result = unsaved.get(obj);
116
117
  if (!result)
117
118
  unsaved.set(obj, result = new Map());
118
- op.forEach((vp, m) => {
119
- let merged = result.get(m);
119
+ op.forEach((vp, fk) => {
120
+ let merged = result.get(fk);
120
121
  if (!merged)
121
- result.set(m, merged = {
122
- memberName: m, patchKind: "update",
123
- freshValue: undefined, formerValue: undefined,
122
+ result.set(fk, merged = {
123
+ fieldKey: fk, patchKind: "update",
124
+ freshContent: undefined, formerContent: undefined,
124
125
  });
125
- const value = undoing ? vp.formerValue : vp.freshValue;
126
- const former = undoing ? vp.freshValue : vp.formerValue;
127
- if (value !== merged.formerValue) {
128
- merged.freshValue = value;
129
- merged.formerValue = former;
126
+ const value = undoing ? vp.formerContent : vp.freshContent;
127
+ const former = undoing ? vp.freshContent : vp.formerContent;
128
+ if (value !== merged.formerContent) {
129
+ merged.freshContent = value;
130
+ merged.formerContent = former;
130
131
  }
131
132
  else {
132
- result.delete(m);
133
+ result.delete(fk);
133
134
  if (result.size === 0)
134
135
  unsaved.delete(obj);
135
136
  }
@@ -137,8 +138,8 @@ export class JournalImpl extends Journal {
137
138
  });
138
139
  }
139
140
  }
140
- function unseal(o) {
141
- const result = o.content;
141
+ function unseal(fv) {
142
+ const result = fv.content;
142
143
  const createCopy = result === null || result === void 0 ? void 0 : result[Sealant.CreateCopy];
143
144
  return createCopy !== undefined ? createCopy.call(result) : result;
144
145
  }
@@ -1,7 +1,7 @@
1
1
  import { F } from "../util/Utils.js";
2
- import { MemberOptions, Kind, Reentrance } from "../Options.js";
2
+ import { MemberOptions, Kind, Reentrance, Isolation } from "../Options.js";
3
3
  import { LoggingOptions, ProfilingOptions } from "../Logging.js";
4
- import { MemberName, ObjectHandle, SeparationMode } from "./Data.js";
4
+ import { FieldKey, ObjectHandle } from "./Data.js";
5
5
  import { Journal } from "./Journal.js";
6
6
  import { Indicator } from "./Indicator.js";
7
7
  export declare abstract class MvccObject {
@@ -18,7 +18,7 @@ export declare class OptionsImpl implements MemberOptions {
18
18
  readonly getter: Function;
19
19
  readonly setter: Function;
20
20
  readonly kind: Kind;
21
- readonly separation: SeparationMode;
21
+ readonly isolation: Isolation;
22
22
  readonly order: number;
23
23
  readonly noSideEffects: boolean;
24
24
  readonly triggeringArgs: boolean;
@@ -41,14 +41,14 @@ export declare class Mvcc implements ProxyHandler<ObjectHandle> {
41
41
  readonly isObservable: boolean;
42
42
  constructor(isObservable: boolean);
43
43
  getPrototypeOf(h: ObjectHandle): object | null;
44
- get(h: ObjectHandle, m: MemberName, receiver: any): any;
45
- set(h: ObjectHandle, m: MemberName, value: any, receiver: any): boolean;
46
- has(h: ObjectHandle, m: MemberName): boolean;
47
- defineProperty?(h: ObjectHandle, m: string | symbol, attributes: PropertyDescriptor): boolean;
48
- getOwnPropertyDescriptor(h: ObjectHandle, m: MemberName): PropertyDescriptor | undefined;
44
+ get(h: ObjectHandle, fk: FieldKey, receiver: any): any;
45
+ set(h: ObjectHandle, fk: FieldKey, value: any, receiver: any): boolean;
46
+ has(h: ObjectHandle, fk: FieldKey): boolean;
47
+ defineProperty?(h: ObjectHandle, name: string | symbol, attributes: PropertyDescriptor): boolean;
48
+ getOwnPropertyDescriptor(h: ObjectHandle, fk: FieldKey): PropertyDescriptor | undefined;
49
49
  ownKeys(h: ObjectHandle): Array<string | symbol>;
50
- static decorateData(isObservable: boolean, proto: any, member: MemberName): any;
51
- static decorateOperation(implicit: boolean, decorator: Function, options: Partial<MemberOptions>, proto: any, member: MemberName, pd: PropertyDescriptor | undefined): any;
50
+ static decorateData(isObservable: boolean, proto: any, fk: FieldKey): any;
51
+ static decorateOperation(implicit: boolean, decorator: Function, options: Partial<MemberOptions>, proto: any, member: FieldKey, pd: PropertyDescriptor | undefined): any;
52
52
  static decorateOperationParametrized(decorator: Function, options: Partial<MemberOptions>): F<any>;
53
53
  static acquireHandle(obj: any): ObjectHandle;
54
54
  static createHandleForMvccObject(proto: any, data: any, blank: any, hint: string, isObservable: boolean): ObjectHandle;
@@ -56,6 +56,6 @@ export declare class Mvcc implements ProxyHandler<ObjectHandle> {
56
56
  static sensitive<T>(sensitivity: boolean, func: F<T>, ...args: any[]): T;
57
57
  static setHint<T>(obj: T, hint: string | undefined): T;
58
58
  static getHint<T>(obj: T): string;
59
- static createOperation: (h: ObjectHandle, m: MemberName, options: OptionsImpl) => F<any>;
60
- static rememberOperationOptions: (proto: any, m: MemberName, getter: Function | undefined, setter: Function | undefined, enumerable: boolean, configurable: boolean, options: Partial<MemberOptions>, implicit: boolean) => OptionsImpl;
59
+ static createOperation: (h: ObjectHandle, fk: FieldKey, options: OptionsImpl) => F<any>;
60
+ static rememberOperationOptions: (proto: any, fk: FieldKey, getter: Function | undefined, setter: Function | undefined, enumerable: boolean, configurable: boolean, options: Partial<MemberOptions>, implicit: boolean) => OptionsImpl;
61
61
  }
@@ -1,8 +1,8 @@
1
1
  import { UNDEF } from "../util/Utils.js";
2
2
  import { Log, misuse } from "../util/Dbg.js";
3
- import { Kind, Reentrance } from "../Options.js";
4
- import { ObjectSnapshot, ObjectHandle, ValueSnapshot, Meta } from "./Data.js";
5
- import { Changeset, Dump, EMPTY_SNAPSHOT } from "./Changeset.js";
3
+ import { Kind, Reentrance, Isolation } from "../Options.js";
4
+ import { ObjectVersion, ObjectHandle, FieldVersion, Meta } from "./Data.js";
5
+ import { Changeset, Dump, EMPTY_OBJECT_VERSION } from "./Changeset.js";
6
6
  export class MvccObject {
7
7
  constructor(observable) {
8
8
  const proto = new.target.prototype;
@@ -27,7 +27,7 @@ export class ObservableObject extends MvccObject {
27
27
  }
28
28
  const DEFAULT_OPTIONS = Object.freeze({
29
29
  kind: Kind.plain,
30
- separation: false,
30
+ isolation: Isolation.joinToCurrentTransaction,
31
31
  order: 0,
32
32
  noSideEffects: false,
33
33
  triggeringArgs: false,
@@ -42,7 +42,7 @@ export class OptionsImpl {
42
42
  this.getter = getter !== undefined ? getter : existing.getter;
43
43
  this.setter = setter !== undefined ? setter : existing.setter;
44
44
  this.kind = merge(DEFAULT_OPTIONS.kind, existing.kind, patch.kind, implicit);
45
- this.separation = merge(DEFAULT_OPTIONS.separation, existing.separation, patch.separation, implicit);
45
+ this.isolation = merge(DEFAULT_OPTIONS.isolation, existing.isolation, patch.isolation, implicit);
46
46
  this.order = merge(DEFAULT_OPTIONS.order, existing.order, patch.order, implicit);
47
47
  this.noSideEffects = merge(DEFAULT_OPTIONS.noSideEffects, existing.noSideEffects, patch.noSideEffects, implicit);
48
48
  this.triggeringArgs = merge(DEFAULT_OPTIONS.triggeringArgs, existing.triggeringArgs, patch.triggeringArgs, implicit);
@@ -66,92 +66,77 @@ export class Mvcc {
66
66
  getPrototypeOf(h) {
67
67
  return Reflect.getPrototypeOf(h.data);
68
68
  }
69
- get(h, m, receiver) {
69
+ get(h, fk, receiver) {
70
70
  let result;
71
- if (m !== Meta.Handle) {
71
+ if (fk !== Meta.Handle) {
72
72
  const cs = Changeset.current();
73
- const os = cs.getObjectSnapshot(h, m);
74
- result = os.data[m];
75
- if (result instanceof ValueSnapshot && !result.isOperation) {
73
+ const ov = cs.getObjectVersion(h, fk);
74
+ result = ov.data[fk];
75
+ if (result instanceof FieldVersion && !result.isLaunch) {
76
76
  if (this.isObservable)
77
- Changeset.markUsed(result, os, m, h, Kind.plain, false);
77
+ Changeset.markUsed(result, ov, fk, h, Kind.plain, false);
78
78
  result = result.content;
79
79
  }
80
80
  else
81
- result = Reflect.get(h.data, m, receiver);
81
+ result = Reflect.get(h.data, fk, receiver);
82
82
  }
83
83
  else
84
84
  result = h;
85
85
  return result;
86
86
  }
87
- set(h, m, value, receiver) {
88
- const os = Changeset.edit().getEditableObjectSnapshot(h, m, value);
89
- if (os !== EMPTY_SNAPSHOT) {
90
- let curr = os.data[m];
91
- if (curr !== undefined || (os.former.snapshot.changeset === EMPTY_SNAPSHOT.changeset && (m in h.data) === false)) {
92
- if (curr === undefined || curr.content !== value || Mvcc.sensitivity) {
93
- const existing = curr === null || curr === void 0 ? void 0 : curr.content;
94
- if (os.former.snapshot.data[m] === curr) {
95
- curr = os.data[m] = new ValueSnapshot(value);
96
- Changeset.markEdited(existing, value, true, os, m, h);
97
- }
98
- else {
99
- curr.content = value;
100
- Changeset.markEdited(existing, value, true, os, m, h);
101
- }
102
- }
103
- }
104
- else
105
- Reflect.set(h.data, m, value, receiver);
106
- }
87
+ set(h, fk, value, receiver) {
88
+ const cs = Changeset.edit();
89
+ const ov = cs.getEditableObjectVersion(h, fk, value);
90
+ if (ov !== EMPTY_OBJECT_VERSION)
91
+ cs.setFieldContent(h, fk, ov, value, receiver, Mvcc.sensitivity);
107
92
  else
108
- h.data[m] = value;
93
+ h.data[fk] = value;
109
94
  return true;
110
95
  }
111
- has(h, m) {
112
- const os = Changeset.current().getObjectSnapshot(h, m);
113
- return m in os.data || m in h.data;
96
+ has(h, fk) {
97
+ const ov = Changeset.current().getObjectVersion(h, fk);
98
+ return fk in ov.data || fk in h.data;
114
99
  }
115
- defineProperty(h, m, attributes) {
100
+ defineProperty(h, name, attributes) {
116
101
  const result = attributes.get !== undefined && attributes.set !== undefined;
117
102
  if (result)
118
- Object.defineProperty(h.data, m, attributes);
103
+ Object.defineProperty(h.data, name, attributes);
119
104
  return result;
120
105
  }
121
- getOwnPropertyDescriptor(h, m) {
122
- const os = Changeset.current().getObjectSnapshot(h, m);
123
- const pd = Reflect.getOwnPropertyDescriptor(os.data, m);
106
+ getOwnPropertyDescriptor(h, fk) {
107
+ const ov = Changeset.current().getObjectVersion(h, fk);
108
+ const pd = Reflect.getOwnPropertyDescriptor(ov.data, fk);
124
109
  if (pd)
125
110
  pd.configurable = pd.writable = true;
126
111
  return pd;
127
112
  }
128
113
  ownKeys(h) {
129
- const os = Changeset.current().getObjectSnapshot(h, Meta.Handle);
114
+ const ov = Changeset.current().getObjectVersion(h, Meta.Handle);
130
115
  const result = [];
131
- for (const m of Object.getOwnPropertyNames(os.data)) {
132
- const value = os.data[m];
133
- if (!(value instanceof ValueSnapshot) || !value.isOperation)
134
- result.push(m);
116
+ for (const fk of Object.getOwnPropertyNames(ov.data)) {
117
+ const field = ov.data[fk];
118
+ if (!(field instanceof FieldVersion) || !field.isLaunch)
119
+ result.push(fk);
135
120
  }
136
121
  return result;
137
122
  }
138
- static decorateData(isObservable, proto, member) {
123
+ static decorateData(isObservable, proto, fk) {
139
124
  if (isObservable) {
140
- Meta.acquire(proto, Meta.Initial)[member] = new ValueSnapshot(undefined);
125
+ Meta.acquire(proto, Meta.Initial)[fk] = new FieldVersion(undefined, 0);
141
126
  const get = function () {
142
127
  const h = Mvcc.acquireHandle(this);
143
- return Mvcc.observable.get(h, member, this);
128
+ return Mvcc.observable.get(h, fk, this);
144
129
  };
145
130
  const set = function (value) {
146
131
  const h = Mvcc.acquireHandle(this);
147
- return Mvcc.observable.set(h, member, value, this);
132
+ return Mvcc.observable.set(h, fk, value, this);
148
133
  };
149
134
  const enumerable = true;
150
135
  const configurable = false;
151
- return Object.defineProperty(proto, member, { get, set, enumerable, configurable });
136
+ return Object.defineProperty(proto, fk, { get, set, enumerable, configurable });
152
137
  }
153
138
  else
154
- Meta.acquire(proto, Meta.Initial)[member] = Meta.Raw;
139
+ Meta.acquire(proto, Meta.Initial)[fk] = Meta.Raw;
155
140
  }
156
141
  static decorateOperation(implicit, decorator, options, proto, member, pd) {
157
142
  var _a, _b, _c, _d;
@@ -192,22 +177,22 @@ export class Mvcc {
192
177
  if (obj !== Object(obj) || Array.isArray(obj))
193
178
  throw misuse("only objects can be observable");
194
179
  const initial = Meta.getFrom(Object.getPrototypeOf(obj), Meta.Initial);
195
- const os = new ObjectSnapshot(EMPTY_SNAPSHOT.changeset, EMPTY_SNAPSHOT, Object.assign({}, initial));
196
- h = new ObjectHandle(obj, obj, Mvcc.observable, os, obj.constructor.name);
197
- Meta.set(os.data, Meta.Handle, h);
180
+ const ov = new ObjectVersion(EMPTY_OBJECT_VERSION.changeset, EMPTY_OBJECT_VERSION, Object.assign({}, initial));
181
+ h = new ObjectHandle(obj, obj, Mvcc.observable, ov, obj.constructor.name);
182
+ Meta.set(ov.data, Meta.Handle, h);
198
183
  Meta.set(obj, Meta.Handle, h);
199
- Meta.set(os.data, Meta.Revision, new ValueSnapshot(1));
184
+ Meta.set(ov.data, Meta.Revision, new FieldVersion(1, 0));
200
185
  }
201
186
  return h;
202
187
  }
203
188
  static createHandleForMvccObject(proto, data, blank, hint, isObservable) {
204
189
  const ctx = Changeset.edit();
205
190
  const mvcc = isObservable ? Mvcc.observable : Mvcc.transactional;
206
- const h = new ObjectHandle(data, undefined, mvcc, EMPTY_SNAPSHOT, hint);
207
- ctx.getEditableObjectSnapshot(h, Meta.Handle, blank);
191
+ const h = new ObjectHandle(data, undefined, mvcc, EMPTY_OBJECT_VERSION, hint);
192
+ ctx.getEditableObjectVersion(h, Meta.Handle, blank);
208
193
  if (!Mvcc.reactivityAutoStartDisabled)
209
- for (const m in Meta.getFrom(proto, Meta.Reactive))
210
- h.proxy[m][Meta.Controller].markObsolete();
194
+ for (const fk in Meta.getFrom(proto, Meta.Reactive))
195
+ h.proxy[fk][Meta.Controller].markObsolete();
211
196
  return h;
212
197
  }
213
198
  static setProfilingMode(isOn, options) {
@@ -253,10 +238,10 @@ Mvcc.asyncActionDurationWarningThreshold = Number.MAX_SAFE_INTEGER;
253
238
  Mvcc.sensitivity = false;
254
239
  Mvcc.transactional = new Mvcc(false);
255
240
  Mvcc.observable = new Mvcc(true);
256
- Mvcc.createOperation = function (h, m, options) {
241
+ Mvcc.createOperation = function (h, fk, options) {
257
242
  throw misuse("this implementation of createOperation should never be called");
258
243
  };
259
- Mvcc.rememberOperationOptions = function (proto, m, getter, setter, enumerable, configurable, options, implicit) {
244
+ Mvcc.rememberOperationOptions = function (proto, fk, getter, setter, enumerable, configurable, options, implicit) {
260
245
  throw misuse("this implementation of rememberOperationOptions should never be called");
261
246
  };
262
247
  const EMPTY_PROP_DESCRIPTOR = {
@@ -36,6 +36,7 @@ export declare class MvccArray<T> extends MvccObject {
36
36
  reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
37
37
  reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
38
38
  reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
39
+ find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;
39
40
  find<S extends T>(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
40
41
  findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
41
42
  fill(value: T, start?: number, end?: number): this;
@@ -47,12 +47,12 @@ export class MvccArray extends MvccObject {
47
47
  }
48
48
  }
49
49
  export class TransactionalArray extends MvccArray {
50
- constructor(args) {
51
- super(false, args !== undefined ? new Array(args) : new Array());
50
+ constructor(...args) {
51
+ super(false, new Array(...args));
52
52
  }
53
53
  }
54
54
  export class ObservableArray extends MvccArray {
55
- constructor(args) {
56
- super(true, args !== undefined ? new Array(args) : new Array());
55
+ constructor(...args) {
56
+ super(true, new Array(...args));
57
57
  }
58
58
  }
@@ -1,11 +1,11 @@
1
1
  import { F } from "../util/Utils.js";
2
- import { AbstractReaction, MemberOptions } from "../Options.js";
3
- import { MemberName, ObjectHandle, ValueSnapshot, Observer, Subscription, AbstractChangeset } from "./Data.js";
2
+ import { Operation, MemberOptions } from "../Options.js";
3
+ import { FieldKey, ObjectHandle, FieldVersion, Observer, Subscription, AbstractChangeset } from "./Data.js";
4
4
  import { Transaction } from "./Transaction.js";
5
5
  import { OptionsImpl } from "./Mvcc.js";
6
- export declare class ReactionImpl implements AbstractReaction<any> {
7
- readonly objectHandle: ObjectHandle;
8
- readonly memberName: MemberName;
6
+ export declare class OperationImpl implements Operation<any> {
7
+ readonly ownerHandle: ObjectHandle;
8
+ readonly fieldKey: FieldKey;
9
9
  configure(options: Partial<MemberOptions>): MemberOptions;
10
10
  get options(): MemberOptions;
11
11
  get unobs(): any;
@@ -16,10 +16,10 @@ export declare class ReactionImpl implements AbstractReaction<any> {
16
16
  get isUpToDate(): boolean;
17
17
  markObsolete(): void;
18
18
  pullLastResult(args?: any[]): any;
19
- constructor(h: ObjectHandle, m: MemberName);
19
+ constructor(h: ObjectHandle, fk: FieldKey);
20
20
  reuseOrRelaunch(weak: boolean, args: any[] | undefined): Launch;
21
- static getControllerOf(method: F<any>): AbstractReaction<any>;
22
- static configureImpl(self: ReactionImpl | undefined, options: Partial<MemberOptions>): MemberOptions;
21
+ static getControllerOf(method: F<any>): Operation<any>;
22
+ static configureImpl(self: OperationImpl | undefined, options: Partial<MemberOptions>): MemberOptions;
23
23
  static proceedWithinGivenLaunch<T>(launch: Launch | undefined, func: F<T>, ...args: any[]): T;
24
24
  static why(): string;
25
25
  static briefWhy(): string;
@@ -27,19 +27,19 @@ export declare class ReactionImpl implements AbstractReaction<any> {
27
27
  private peek;
28
28
  private use;
29
29
  private edit;
30
- private acquireFromSnapshot;
30
+ private acquireFromObjectVersion;
31
31
  private relaunch;
32
32
  private static markObsolete;
33
33
  }
34
- declare class Launch extends ValueSnapshot implements Observer {
34
+ declare class Launch extends FieldVersion implements Observer {
35
35
  static current?: Launch;
36
- static queuedReactiveFunctions: Array<Observer>;
37
- static deferredReactiveFunctions: Array<Launch>;
36
+ static queuedReactiveOperations: Array<Observer>;
37
+ static deferredReactiveOperations: Array<Launch>;
38
38
  readonly margin: number;
39
39
  readonly transaction: Transaction;
40
- readonly reaction: ReactionImpl;
40
+ readonly operation: OperationImpl;
41
41
  readonly changeset: AbstractChangeset;
42
- observables: Map<ValueSnapshot, Subscription> | undefined;
42
+ observables: Map<FieldVersion, Subscription> | undefined;
43
43
  options: OptionsImpl;
44
44
  cause: string | undefined;
45
45
  args: any[];
@@ -49,18 +49,18 @@ declare class Launch extends ValueSnapshot implements Observer {
49
49
  obsoleteDueTo: string | undefined;
50
50
  obsoleteSince: number;
51
51
  successor: Launch | undefined;
52
- constructor(reaction: ReactionImpl, changeset: AbstractChangeset, former: Launch | OptionsImpl);
53
- get isOperation(): boolean;
54
- get originSnapshotId(): number;
52
+ constructor(transaction: Transaction, operation: OperationImpl, changeset: AbstractChangeset, former: Launch | OptionsImpl, clone: boolean);
53
+ get isLaunch(): boolean;
55
54
  hint(): string;
56
55
  get order(): number;
57
56
  get ["#this#"](): string;
57
+ clone(t: Transaction, cs: AbstractChangeset): FieldVersion;
58
58
  why(): string;
59
59
  briefWhy(): string;
60
60
  dependencies(): string[];
61
61
  wrap<T>(func: F<T>): F<T>;
62
62
  proceed(proxy: any, args: any[] | undefined): void;
63
- markObsoleteDueTo(observable: ValueSnapshot, m: MemberName, changeset: AbstractChangeset, h: ObjectHandle, outer: string, since: number, obsolete: Observer[]): void;
63
+ markObsoleteDueTo(observable: FieldVersion, fk: FieldKey, changeset: AbstractChangeset, h: ObjectHandle, outer: string, since: number, obsolete: Observer[]): void;
64
64
  relaunchIfNotUpToDate(now: boolean, nothrow: boolean): void;
65
65
  isNotUpToDate(): boolean;
66
66
  reenterOver(head: Launch): this;
@@ -77,9 +77,10 @@ declare class Launch extends ValueSnapshot implements Observer {
77
77
  private static isConflicting;
78
78
  private static propagateAllChangesThroughSubscriptions;
79
79
  private static revokeAllSubscriptions;
80
- private static propagateMemberChangeThroughSubscriptions;
80
+ private static propagateFieldChangeThroughSubscriptions;
81
81
  private static enqueueReactiveFunctionsToRun;
82
- private static processQueuedReactiveFunctions;
82
+ private static migrateFieldVersion;
83
+ private static processQueuedReactiveOperations;
83
84
  private unsubscribeFromAllObservables;
84
85
  private subscribeTo;
85
86
  private static canSubscribeTo;