doxum 0.1.1 → 0.1.3
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 +77 -2
- package/dist/{contract-DwNiKioc.d.ts → contract-BsY1XLiG.d.ts} +64 -5
- package/dist/{contract-Otb5W6cQ.d.cts → contract-D8kjdfqT.d.cts} +64 -5
- package/dist/{dependency-BdEMyquf.js → dependency-C5_R1tvQ.js} +24 -263
- package/dist/dependency-C5_R1tvQ.js.map +1 -0
- package/dist/{dependency-DLcCvNKq.cjs → dependency-Dfzs3khk.cjs} +48 -341
- package/dist/dependency-Dfzs3khk.cjs.map +1 -0
- package/dist/driver-CNxqMVFH.cjs +69 -0
- package/dist/driver-CNxqMVFH.cjs.map +1 -0
- package/dist/driver-CbzfW5MR.js +46 -0
- package/dist/driver-CbzfW5MR.js.map +1 -0
- package/dist/index.cjs +428 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +352 -61
- package/dist/index.js.map +1 -1
- package/dist/integration.cjs +1 -1
- package/dist/integration.cjs.map +1 -1
- package/dist/integration.d.cts +2 -2
- package/dist/integration.d.ts +2 -2
- package/dist/integration.js +1 -1
- package/dist/integration.js.map +1 -1
- package/dist/local-sync.cjs +485 -0
- package/dist/local-sync.cjs.map +1 -0
- package/dist/local-sync.d.cts +74 -0
- package/dist/local-sync.d.ts +74 -0
- package/dist/local-sync.js +476 -0
- package/dist/local-sync.js.map +1 -0
- package/dist/ownership-B-VAPcce.js +242 -0
- package/dist/ownership-B-VAPcce.js.map +1 -0
- package/dist/ownership-CU-9DKJQ.cjs +301 -0
- package/dist/ownership-CU-9DKJQ.cjs.map +1 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js.map +1 -1
- package/package.json +14 -8
- package/skills/doxum-runtime/references/guide.en.md +60 -5
- package/skills/doxum-runtime/references/guide.zh-CN.md +48 -2
- package/skills/doxum-runtime/references/invariants.en.md +23 -8
- package/skills/doxum-runtime/references/invariants.zh-CN.md +2 -2
- package/dist/dependency-BdEMyquf.js.map +0 -1
- package/dist/dependency-DLcCvNKq.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -6,12 +6,18 @@ undo/redo, precise change notifications, and incremental derived data.
|
|
|
6
6
|
|
|
7
7
|
Licensed under the [MIT License](LICENSE).
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
The `doxum` core entry is a local in-memory runtime. The optional
|
|
10
|
+
`doxum/local-sync` browser attachment adds IndexedDB persistence and
|
|
11
|
+
same-origin cross-tab synchronization with one writable tab at a time; network
|
|
12
|
+
collaboration, authorization, and conflict resolution remain separate
|
|
13
|
+
application concerns.
|
|
11
14
|
|
|
12
15
|
## Packages
|
|
13
16
|
|
|
14
17
|
- `doxum` defines schemas, mutations, history, subscriptions, and views.
|
|
18
|
+
- `doxum/local-sync` lets one Web-Lock leader write a runtime synchronously,
|
|
19
|
+
persists its commands asynchronously to IndexedDB, and makes other tabs
|
|
20
|
+
ordered read-only mirrors.
|
|
15
21
|
- `doxum/react` binds Doxum read models to React 18+ with fine-grained external
|
|
16
22
|
store subscriptions.
|
|
17
23
|
|
|
@@ -145,6 +151,75 @@ Observer failures do not turn a completed write into a rejection: committed
|
|
|
145
151
|
results expose them in `observerErrors`, after history and canonical state have
|
|
146
152
|
already settled.
|
|
147
153
|
|
|
154
|
+
## Local Persistence And Cross-Tab Sync
|
|
155
|
+
|
|
156
|
+
`doxum/local-sync` is an optional browser attachment for a document that needs
|
|
157
|
+
offline persistence and same-origin, cross-tab convergence. It uses IndexedDB
|
|
158
|
+
as the ordered checkpoint and commit log, Web Locks to serialize background
|
|
159
|
+
confirmation, and BroadcastChannel only to notify other tabs to catch up from
|
|
160
|
+
IndexedDB. It does not need a server or Yjs.
|
|
161
|
+
|
|
162
|
+
The attachment deliberately uses a simple single-writer model. It hydrates the
|
|
163
|
+
runtime from the IndexedDB checkpoint and ordered command log, then attempts to
|
|
164
|
+
hold a Web Lock for that document. The lock holder is the `leader` and may use
|
|
165
|
+
the normal synchronous runtime APIs. All other attached tabs are `follower`
|
|
166
|
+
mirrors: they read the durable tail in order after a BroadcastChannel hint, and
|
|
167
|
+
their direct writes throw `LocalSyncReadOnlyError`. When the leader disposes,
|
|
168
|
+
a follower catches up and becomes the next leader.
|
|
169
|
+
|
|
170
|
+
The leader's `runtime.update`, normal `runtime.apply`, and
|
|
171
|
+
`runtime.history.undo()` / `redo()` stay synchronous and immediately visible.
|
|
172
|
+
Local-sync observes the resulting local, system, and history commits and writes
|
|
173
|
+
their JSON operation batches to IndexedDB in the background. It deliberately
|
|
174
|
+
rejects `runtime.replace()` and an externally supplied `apply(..., {
|
|
175
|
+
source: 'remote' })` while attached: neither is a local operation command that
|
|
176
|
+
the log can faithfully append. `flush()` is the explicit point that waits for
|
|
177
|
+
commits observed before the call to persist (or, in a follower, waits to catch
|
|
178
|
+
up to the durable head). A browser crash, quota failure, or malformed JSON
|
|
179
|
+
payload can therefore leave an already visible leader commit unpersisted;
|
|
180
|
+
inspect `state()` or use `onError` to surface that condition.
|
|
181
|
+
|
|
182
|
+
```ts
|
|
183
|
+
import { createDocument, select } from 'doxum';
|
|
184
|
+
import { attachLocalSync } from 'doxum/local-sync';
|
|
185
|
+
|
|
186
|
+
const runtime = createDocument({
|
|
187
|
+
schema: taskSchema,
|
|
188
|
+
initial: {
|
|
189
|
+
title: 'Launch',
|
|
190
|
+
tasks: { ids: [], byId: {} },
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const localSync = await attachLocalSync({
|
|
195
|
+
runtime,
|
|
196
|
+
database: 'my-app',
|
|
197
|
+
documentId: 'project-1',
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
if (localSync.state().status === 'leader') {
|
|
201
|
+
runtime.update(tx => {
|
|
202
|
+
tx.write.title.set('Ship Doxum');
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
runtime.history.undo();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
select(runtime, read => read.title.get()); // leader write or follower replay
|
|
209
|
+
await localSync.flush(); // persist observed leader commands / catch up a follower
|
|
210
|
+
|
|
211
|
+
await localSync.dispose();
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
`attachLocalSync` first hydrates the passed runtime from IndexedDB; await it
|
|
215
|
+
before allowing reads or edits. It does not make runtime mutation asynchronous,
|
|
216
|
+
does not own `runtime.dispose()`, and does not expose a second undo API. Runtime
|
|
217
|
+
history is in-memory only: hydration and remote tail application invalidate it,
|
|
218
|
+
so an undo stack never transfers to a new leader or survives reopening a tab.
|
|
219
|
+
Local-sync data must be JSON. Because command validation happens after the
|
|
220
|
+
runtime commit, a non-JSON payload is reported as a post-commit attachment error
|
|
221
|
+
rather than rolling back an already observed document change.
|
|
222
|
+
|
|
148
223
|
## React
|
|
149
224
|
|
|
150
225
|
`useDocumentSelector` learns the paths read by its selector and re-renders only
|
|
@@ -376,6 +376,44 @@ declare const contains: (parent: DocumentAddress, child: DocumentAddress) => boo
|
|
|
376
376
|
declare const overlaps: (a: DocumentAddress, b: DocumentAddress) => boolean;
|
|
377
377
|
declare const debugKey: (address: DocumentAddress) => string;
|
|
378
378
|
//#endregion
|
|
379
|
+
//#region core/src/mutation/footprint.d.ts
|
|
380
|
+
type CommandFootprintTarget = {
|
|
381
|
+
readonly kind: 'value';
|
|
382
|
+
readonly at: DocumentAddress;
|
|
383
|
+
} | {
|
|
384
|
+
readonly kind: 'dictionary';
|
|
385
|
+
readonly at: DocumentAddress;
|
|
386
|
+
} | {
|
|
387
|
+
readonly kind: 'dictionary-key';
|
|
388
|
+
readonly at: DocumentAddress;
|
|
389
|
+
readonly key: string;
|
|
390
|
+
} | {
|
|
391
|
+
readonly kind: 'collection';
|
|
392
|
+
readonly at: DocumentAddress;
|
|
393
|
+
} | {
|
|
394
|
+
readonly kind: 'entity';
|
|
395
|
+
readonly at: DocumentAddress;
|
|
396
|
+
readonly id: string;
|
|
397
|
+
} | {
|
|
398
|
+
readonly kind: 'list';
|
|
399
|
+
readonly at: DocumentAddress;
|
|
400
|
+
} | {
|
|
401
|
+
readonly kind: 'list-item';
|
|
402
|
+
readonly at: DocumentAddress;
|
|
403
|
+
readonly key: string;
|
|
404
|
+
} | {
|
|
405
|
+
readonly kind: 'tree';
|
|
406
|
+
readonly at: DocumentAddress;
|
|
407
|
+
} | {
|
|
408
|
+
readonly kind: 'tree-node';
|
|
409
|
+
readonly at: DocumentAddress;
|
|
410
|
+
readonly id: string;
|
|
411
|
+
};
|
|
412
|
+
type CommandFootprint = readonly CommandFootprintTarget[];
|
|
413
|
+
declare const commandFootprint: (operations: readonly DocumentOperationUnion[]) => CommandFootprint;
|
|
414
|
+
declare const footprintsOverlap: (left: CommandFootprint, right: CommandFootprint) => boolean;
|
|
415
|
+
declare const decodeCommandFootprint: (value: unknown) => CommandFootprint | undefined;
|
|
416
|
+
//#endregion
|
|
379
417
|
//#region core/src/runtime/contract.d.ts
|
|
380
418
|
type Unsubscribe = () => void;
|
|
381
419
|
type CommitSource = 'local' | 'system' | 'history' | 'remote';
|
|
@@ -420,6 +458,22 @@ type TransactionResult<TValue, TCommit> = {
|
|
|
420
458
|
readonly issues: readonly DocumentProblem[];
|
|
421
459
|
readonly revision: number;
|
|
422
460
|
};
|
|
461
|
+
type PreparedUpdateResult<TValue, TSchema extends DocumentSchema> = {
|
|
462
|
+
readonly status: 'prepared';
|
|
463
|
+
readonly value: TValue;
|
|
464
|
+
readonly operations: readonly DocumentOperationUnion<TSchema>[];
|
|
465
|
+
readonly inverse: readonly DocumentOperationUnion<TSchema>[];
|
|
466
|
+
readonly impact: DocumentImpact<TSchema>;
|
|
467
|
+
readonly footprint: CommandFootprint;
|
|
468
|
+
readonly reports: readonly DocumentDiagnostic[];
|
|
469
|
+
} | {
|
|
470
|
+
readonly status: 'unchanged';
|
|
471
|
+
readonly value: TValue;
|
|
472
|
+
readonly reports: readonly DocumentDiagnostic[];
|
|
473
|
+
} | {
|
|
474
|
+
readonly status: 'rejected';
|
|
475
|
+
readonly issues: readonly DocumentProblem[];
|
|
476
|
+
};
|
|
423
477
|
type OperationResult<TCommit> = {
|
|
424
478
|
readonly status: 'committed';
|
|
425
479
|
readonly commit: TCommit;
|
|
@@ -450,7 +504,7 @@ type DocumentTransaction<TSchema extends DocumentSchema> = {
|
|
|
450
504
|
readonly report: (issue: DocumentDiagnostic) => void;
|
|
451
505
|
};
|
|
452
506
|
type CommitListener<TSchema extends DocumentSchema> = (commit: DocumentCommit<TSchema>) => void;
|
|
453
|
-
type
|
|
507
|
+
type DocumentReadable<TSchema extends DocumentSchema> = {
|
|
454
508
|
readonly address: {
|
|
455
509
|
readonly resolve: (address: DocumentAddress) => AddressRef | undefined;
|
|
456
510
|
readonly read: (address: DocumentAddress) => unknown;
|
|
@@ -459,10 +513,16 @@ type DocumentRuntime<TSchema extends DocumentSchema> = {
|
|
|
459
513
|
readonly debugKey: (address: DocumentAddress) => string;
|
|
460
514
|
};
|
|
461
515
|
revision(): number;
|
|
516
|
+
subscribe(listener: CommitListener<TSchema>): Unsubscribe;
|
|
517
|
+
subscribe(target: ImpactTarget<unknown> | readonly [ImpactTarget<unknown>, ...ImpactTarget<unknown>[]], listener: CommitListener<TSchema>): Unsubscribe;
|
|
518
|
+
};
|
|
519
|
+
type DocumentRuntime<TSchema extends DocumentSchema> = DocumentReadable<TSchema> & {
|
|
520
|
+
/** Schema configuration captured when this runtime was created. */readonly schema: TSchema;
|
|
462
521
|
update<TResult>(run: (transaction: DocumentTransaction<TSchema>) => TResult, options?: {
|
|
463
522
|
readonly source?: Extract<CommitSource, 'local' | 'system'>;
|
|
464
523
|
readonly history?: boolean;
|
|
465
524
|
}): TransactionResult<TResult, DocumentCommit<TSchema>>;
|
|
525
|
+
prepare<TResult>(run: (transaction: DocumentTransaction<TSchema>) => TResult): PreparedUpdateResult<TResult, TSchema>;
|
|
466
526
|
apply(operations: unknown, options?: {
|
|
467
527
|
readonly source?: Exclude<CommitSource, 'history'>;
|
|
468
528
|
readonly history?: boolean;
|
|
@@ -470,11 +530,10 @@ type DocumentRuntime<TSchema extends DocumentSchema> = {
|
|
|
470
530
|
replace(document: ReadonlyDocument<TSchema>, options?: {
|
|
471
531
|
readonly source?: Extract<CommitSource, 'system' | 'remote'>;
|
|
472
532
|
}): OperationResult<DocumentCommit<TSchema>>;
|
|
473
|
-
|
|
474
|
-
subscribe(target: ImpactTarget<unknown> | readonly [ImpactTarget<unknown>, ...ImpactTarget<unknown>[]], listener: CommitListener<TSchema>): Unsubscribe;
|
|
533
|
+
snapshot(): ReadonlyDocument<TSchema>;
|
|
475
534
|
readonly history: LocalHistory<DocumentCommit<TSchema>>;
|
|
476
535
|
dispose(): void;
|
|
477
536
|
};
|
|
478
537
|
//#endregion
|
|
479
|
-
export {
|
|
480
|
-
//# sourceMappingURL=contract-
|
|
538
|
+
export { DocumentOperationUnion as $, variant as $t, MutationIssue as A, ObjectNode as At, WriterOfNode as B, VariantNode as Bt, contains as C, DocumentTreeValue as Ct, resolveAddress as D, ImpactTarget as Dt, read as E, FieldNode as Et, EntityWriter as F, SchemaPath as Ft, ListReader as G, map as Gt, DocumentReader as H, dict as Ht, FieldWriter as I, SingleNode as It, DictDeleteOperation as J, record as Jt, ReaderOfNode as K, object as Kt, ListWriter as L, TableNode as Lt, CollectionWriter as M, OptionalNode as Mt, DictionaryWriter as N, ReadonlyDocument as Nt, CollectionImpact as O, ListNode as Ot, DocumentWriter as P, RecordNode as Pt, DocumentOperation as Q, tree as Qt, MapWriter as R, TreeNode as Rt, AddressRef as S, DocumentTreeNode as St, overlaps as T, DocumentValueOfShape as Tt, EntityReader as U, field as Ut, CollectionReader as V, VariantShape as Vt, FieldReader as W, list as Wt, DictSetOperation as X, single as Xt, DictReplaceOperation as Y, schema as Yt, DocumentAnchor as Z, table as Zt, CommandFootprint as _, DictNode as _t, DocumentProblem as a, FieldSetOperation as at, decodeCommandFootprint as b, DocumentNode as bt, DocumentRuntime as c, ListRemoveOperation as ct, LocalHistory as d, TreeMoveOperation as dt, EntityCreateOperation as et, ObserverError as f, TreeRemoveOperation as ft, Unsubscribe as g, CollectionSelector as gt, TransactionResult as h, VariantReplaceOperation as ht, DocumentDisposedError as i, FieldClearOperation as it, MutationIssueCode as j, ObjectShape as jt, DocumentImpact as k, MapNode as kt, DocumentTransaction as l, ListReplaceOperation as lt, PreparedUpdateResult as m, TreeSetOperation as mt, DocumentCommit as n, EntityMoveOperation as nt, DocumentReadable as o, ListInsertOperation as ot, OperationResult as p, TreeReplaceOperation as pt, TreeReader as q, optional as qt, DocumentDiagnostic as r, EntityRemoveOperation as rt, DocumentReentrancyError as s, ListMoveOperation as st, CommitSource as t, EntityEntry as tt, HistoryState as u, TreeInsertOperation as ut, CommandFootprintTarget as v, DocumentAddress as vt, debugKey as w, DocumentValueOfNode as wt, footprintsOverlap as x, DocumentSchema as xt, commandFootprint as y, DocumentListConfig as yt, TreeWriter as z, ValueSelector as zt };
|
|
539
|
+
//# sourceMappingURL=contract-BsY1XLiG.d.ts.map
|
|
@@ -376,6 +376,44 @@ declare const contains: (parent: DocumentAddress, child: DocumentAddress) => boo
|
|
|
376
376
|
declare const overlaps: (a: DocumentAddress, b: DocumentAddress) => boolean;
|
|
377
377
|
declare const debugKey: (address: DocumentAddress) => string;
|
|
378
378
|
//#endregion
|
|
379
|
+
//#region core/src/mutation/footprint.d.ts
|
|
380
|
+
type CommandFootprintTarget = {
|
|
381
|
+
readonly kind: 'value';
|
|
382
|
+
readonly at: DocumentAddress;
|
|
383
|
+
} | {
|
|
384
|
+
readonly kind: 'dictionary';
|
|
385
|
+
readonly at: DocumentAddress;
|
|
386
|
+
} | {
|
|
387
|
+
readonly kind: 'dictionary-key';
|
|
388
|
+
readonly at: DocumentAddress;
|
|
389
|
+
readonly key: string;
|
|
390
|
+
} | {
|
|
391
|
+
readonly kind: 'collection';
|
|
392
|
+
readonly at: DocumentAddress;
|
|
393
|
+
} | {
|
|
394
|
+
readonly kind: 'entity';
|
|
395
|
+
readonly at: DocumentAddress;
|
|
396
|
+
readonly id: string;
|
|
397
|
+
} | {
|
|
398
|
+
readonly kind: 'list';
|
|
399
|
+
readonly at: DocumentAddress;
|
|
400
|
+
} | {
|
|
401
|
+
readonly kind: 'list-item';
|
|
402
|
+
readonly at: DocumentAddress;
|
|
403
|
+
readonly key: string;
|
|
404
|
+
} | {
|
|
405
|
+
readonly kind: 'tree';
|
|
406
|
+
readonly at: DocumentAddress;
|
|
407
|
+
} | {
|
|
408
|
+
readonly kind: 'tree-node';
|
|
409
|
+
readonly at: DocumentAddress;
|
|
410
|
+
readonly id: string;
|
|
411
|
+
};
|
|
412
|
+
type CommandFootprint = readonly CommandFootprintTarget[];
|
|
413
|
+
declare const commandFootprint: (operations: readonly DocumentOperationUnion[]) => CommandFootprint;
|
|
414
|
+
declare const footprintsOverlap: (left: CommandFootprint, right: CommandFootprint) => boolean;
|
|
415
|
+
declare const decodeCommandFootprint: (value: unknown) => CommandFootprint | undefined;
|
|
416
|
+
//#endregion
|
|
379
417
|
//#region core/src/runtime/contract.d.ts
|
|
380
418
|
type Unsubscribe = () => void;
|
|
381
419
|
type CommitSource = 'local' | 'system' | 'history' | 'remote';
|
|
@@ -420,6 +458,22 @@ type TransactionResult<TValue, TCommit> = {
|
|
|
420
458
|
readonly issues: readonly DocumentProblem[];
|
|
421
459
|
readonly revision: number;
|
|
422
460
|
};
|
|
461
|
+
type PreparedUpdateResult<TValue, TSchema extends DocumentSchema> = {
|
|
462
|
+
readonly status: 'prepared';
|
|
463
|
+
readonly value: TValue;
|
|
464
|
+
readonly operations: readonly DocumentOperationUnion<TSchema>[];
|
|
465
|
+
readonly inverse: readonly DocumentOperationUnion<TSchema>[];
|
|
466
|
+
readonly impact: DocumentImpact<TSchema>;
|
|
467
|
+
readonly footprint: CommandFootprint;
|
|
468
|
+
readonly reports: readonly DocumentDiagnostic[];
|
|
469
|
+
} | {
|
|
470
|
+
readonly status: 'unchanged';
|
|
471
|
+
readonly value: TValue;
|
|
472
|
+
readonly reports: readonly DocumentDiagnostic[];
|
|
473
|
+
} | {
|
|
474
|
+
readonly status: 'rejected';
|
|
475
|
+
readonly issues: readonly DocumentProblem[];
|
|
476
|
+
};
|
|
423
477
|
type OperationResult<TCommit> = {
|
|
424
478
|
readonly status: 'committed';
|
|
425
479
|
readonly commit: TCommit;
|
|
@@ -450,7 +504,7 @@ type DocumentTransaction<TSchema extends DocumentSchema> = {
|
|
|
450
504
|
readonly report: (issue: DocumentDiagnostic) => void;
|
|
451
505
|
};
|
|
452
506
|
type CommitListener<TSchema extends DocumentSchema> = (commit: DocumentCommit<TSchema>) => void;
|
|
453
|
-
type
|
|
507
|
+
type DocumentReadable<TSchema extends DocumentSchema> = {
|
|
454
508
|
readonly address: {
|
|
455
509
|
readonly resolve: (address: DocumentAddress) => AddressRef | undefined;
|
|
456
510
|
readonly read: (address: DocumentAddress) => unknown;
|
|
@@ -459,10 +513,16 @@ type DocumentRuntime<TSchema extends DocumentSchema> = {
|
|
|
459
513
|
readonly debugKey: (address: DocumentAddress) => string;
|
|
460
514
|
};
|
|
461
515
|
revision(): number;
|
|
516
|
+
subscribe(listener: CommitListener<TSchema>): Unsubscribe;
|
|
517
|
+
subscribe(target: ImpactTarget<unknown> | readonly [ImpactTarget<unknown>, ...ImpactTarget<unknown>[]], listener: CommitListener<TSchema>): Unsubscribe;
|
|
518
|
+
};
|
|
519
|
+
type DocumentRuntime<TSchema extends DocumentSchema> = DocumentReadable<TSchema> & {
|
|
520
|
+
/** Schema configuration captured when this runtime was created. */readonly schema: TSchema;
|
|
462
521
|
update<TResult>(run: (transaction: DocumentTransaction<TSchema>) => TResult, options?: {
|
|
463
522
|
readonly source?: Extract<CommitSource, 'local' | 'system'>;
|
|
464
523
|
readonly history?: boolean;
|
|
465
524
|
}): TransactionResult<TResult, DocumentCommit<TSchema>>;
|
|
525
|
+
prepare<TResult>(run: (transaction: DocumentTransaction<TSchema>) => TResult): PreparedUpdateResult<TResult, TSchema>;
|
|
466
526
|
apply(operations: unknown, options?: {
|
|
467
527
|
readonly source?: Exclude<CommitSource, 'history'>;
|
|
468
528
|
readonly history?: boolean;
|
|
@@ -470,11 +530,10 @@ type DocumentRuntime<TSchema extends DocumentSchema> = {
|
|
|
470
530
|
replace(document: ReadonlyDocument<TSchema>, options?: {
|
|
471
531
|
readonly source?: Extract<CommitSource, 'system' | 'remote'>;
|
|
472
532
|
}): OperationResult<DocumentCommit<TSchema>>;
|
|
473
|
-
|
|
474
|
-
subscribe(target: ImpactTarget<unknown> | readonly [ImpactTarget<unknown>, ...ImpactTarget<unknown>[]], listener: CommitListener<TSchema>): Unsubscribe;
|
|
533
|
+
snapshot(): ReadonlyDocument<TSchema>;
|
|
475
534
|
readonly history: LocalHistory<DocumentCommit<TSchema>>;
|
|
476
535
|
dispose(): void;
|
|
477
536
|
};
|
|
478
537
|
//#endregion
|
|
479
|
-
export {
|
|
480
|
-
//# sourceMappingURL=contract-
|
|
538
|
+
export { DocumentOperationUnion as $, variant as $t, MutationIssue as A, ObjectNode as At, WriterOfNode as B, VariantNode as Bt, contains as C, DocumentTreeValue as Ct, resolveAddress as D, ImpactTarget as Dt, read as E, FieldNode as Et, EntityWriter as F, SchemaPath as Ft, ListReader as G, map as Gt, DocumentReader as H, dict as Ht, FieldWriter as I, SingleNode as It, DictDeleteOperation as J, record as Jt, ReaderOfNode as K, object as Kt, ListWriter as L, TableNode as Lt, CollectionWriter as M, OptionalNode as Mt, DictionaryWriter as N, ReadonlyDocument as Nt, CollectionImpact as O, ListNode as Ot, DocumentWriter as P, RecordNode as Pt, DocumentOperation as Q, tree as Qt, MapWriter as R, TreeNode as Rt, AddressRef as S, DocumentTreeNode as St, overlaps as T, DocumentValueOfShape as Tt, EntityReader as U, field as Ut, CollectionReader as V, VariantShape as Vt, FieldReader as W, list as Wt, DictSetOperation as X, single as Xt, DictReplaceOperation as Y, schema as Yt, DocumentAnchor as Z, table as Zt, CommandFootprint as _, DictNode as _t, DocumentProblem as a, FieldSetOperation as at, decodeCommandFootprint as b, DocumentNode as bt, DocumentRuntime as c, ListRemoveOperation as ct, LocalHistory as d, TreeMoveOperation as dt, EntityCreateOperation as et, ObserverError as f, TreeRemoveOperation as ft, Unsubscribe as g, CollectionSelector as gt, TransactionResult as h, VariantReplaceOperation as ht, DocumentDisposedError as i, FieldClearOperation as it, MutationIssueCode as j, ObjectShape as jt, DocumentImpact as k, MapNode as kt, DocumentTransaction as l, ListReplaceOperation as lt, PreparedUpdateResult as m, TreeSetOperation as mt, DocumentCommit as n, EntityMoveOperation as nt, DocumentReadable as o, ListInsertOperation as ot, OperationResult as p, TreeReplaceOperation as pt, TreeReader as q, optional as qt, DocumentDiagnostic as r, EntityRemoveOperation as rt, DocumentReentrancyError as s, ListMoveOperation as st, CommitSource as t, EntityEntry as tt, HistoryState as u, TreeInsertOperation as ut, CommandFootprintTarget as v, DocumentAddress as vt, debugKey as w, DocumentValueOfNode as wt, footprintsOverlap as x, DocumentSchema as xt, commandFootprint as y, DocumentListConfig as yt, TreeWriter as z, ValueSelector as zt };
|
|
539
|
+
//# sourceMappingURL=contract-D8kjdfqT.d.cts.map
|