doxum 0.1.4 → 0.1.6

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.
Files changed (48) hide show
  1. package/README.md +46 -5
  2. package/dist/{contract-BsY1XLiG.d.ts → contract-I99DUMbN.d.ts} +53 -40
  3. package/dist/{contract-D8kjdfqT.d.cts → contract-uYJTmT8o.d.cts} +53 -40
  4. package/dist/index.cjs +244 -630
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +3 -64
  7. package/dist/index.d.ts +3 -64
  8. package/dist/index.js +182 -569
  9. package/dist/index.js.map +1 -1
  10. package/dist/integration-Bs3pOk65.cjs +35 -0
  11. package/dist/integration-Bs3pOk65.cjs.map +1 -0
  12. package/dist/integration-xupBIKjU.js +30 -0
  13. package/dist/integration-xupBIKjU.js.map +1 -0
  14. package/dist/integration.cjs +4 -14
  15. package/dist/integration.d.cts +3 -2
  16. package/dist/integration.d.ts +3 -2
  17. package/dist/integration.js +3 -14
  18. package/dist/local-sync.cjs +1 -1
  19. package/dist/local-sync.d.cts +1 -1
  20. package/dist/local-sync.d.ts +1 -1
  21. package/dist/local-sync.js +1 -1
  22. package/dist/{ownership-CU-9DKJQ.cjs → ownership-CY0nPXGF.cjs} +4 -1
  23. package/dist/ownership-CY0nPXGF.cjs.map +1 -0
  24. package/dist/{ownership-B-VAPcce.js → ownership-CduRygE7.js} +4 -1
  25. package/dist/ownership-CduRygE7.js.map +1 -0
  26. package/dist/react.cjs +1 -1
  27. package/dist/react.js +1 -1
  28. package/dist/runtime-BJRXF0gq.js +1735 -0
  29. package/dist/runtime-BJRXF0gq.js.map +1 -0
  30. package/dist/runtime-CRijXjYp.cjs +1991 -0
  31. package/dist/runtime-CRijXjYp.cjs.map +1 -0
  32. package/dist/runtime-CUcvhFNP.d.ts +152 -0
  33. package/dist/runtime-C_vKHmhy.d.cts +152 -0
  34. package/package.json +1 -1
  35. package/skills/doxum-runtime/references/guide.en.md +35 -18
  36. package/skills/doxum-runtime/references/guide.zh-CN.md +26 -14
  37. package/skills/doxum-runtime/references/invariants.en.md +12 -9
  38. package/skills/doxum-runtime/references/invariants.zh-CN.md +2 -2
  39. package/skills/doxum-runtime/references/patterns.en.md +36 -56
  40. package/skills/doxum-runtime/references/patterns.zh-CN.md +27 -45
  41. package/dist/dependency-C5_R1tvQ.js +0 -496
  42. package/dist/dependency-C5_R1tvQ.js.map +0 -1
  43. package/dist/dependency-Dfzs3khk.cjs +0 -722
  44. package/dist/dependency-Dfzs3khk.cjs.map +0 -1
  45. package/dist/integration.cjs.map +0 -1
  46. package/dist/integration.js.map +0 -1
  47. package/dist/ownership-B-VAPcce.js.map +0 -1
  48. package/dist/ownership-CU-9DKJQ.cjs.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
- import { $ as DocumentOperationUnion, $t as variant, A as MutationIssue, At as ObjectNode, B as WriterOfNode, Bt as VariantNode, C as contains, Ct as DocumentTreeValue, D as resolveAddress, Dt as ImpactTarget, E as read, Et as FieldNode, F as EntityWriter, Ft as SchemaPath, G as ListReader, Gt as map, H as DocumentReader, Ht as dict, I as FieldWriter, It as SingleNode, J as DictDeleteOperation, Jt as record, K as ReaderOfNode, Kt as object, L as ListWriter, Lt as TableNode, M as CollectionWriter, Mt as OptionalNode, N as DictionaryWriter, Nt as ReadonlyDocument, O as CollectionImpact, Ot as ListNode, P as DocumentWriter, Pt as RecordNode, Q as DocumentOperation, Qt as tree, R as MapWriter, Rt as TreeNode, S as AddressRef, St as DocumentTreeNode, T as overlaps, Tt as DocumentValueOfShape, U as EntityReader, Ut as field, V as CollectionReader, Vt as VariantShape, W as FieldReader, Wt as list, X as DictSetOperation, Xt as single, Y as DictReplaceOperation, Yt as schema, Z as DocumentAnchor, Zt as table, _ as CommandFootprint, _t as DictNode, a as DocumentProblem, at as FieldSetOperation, b as decodeCommandFootprint, bt as DocumentNode, c as DocumentRuntime, ct as ListRemoveOperation, d as LocalHistory, dt as TreeMoveOperation, et as EntityCreateOperation, f as ObserverError, ft as TreeRemoveOperation, g as Unsubscribe, gt as CollectionSelector, h as TransactionResult, ht as VariantReplaceOperation, i as DocumentDisposedError, it as FieldClearOperation, j as MutationIssueCode, jt as ObjectShape, k as DocumentImpact, kt as MapNode, l as DocumentTransaction, lt as ListReplaceOperation, m as PreparedUpdateResult, mt as TreeSetOperation, n as DocumentCommit, nt as EntityMoveOperation, o as DocumentReadable, ot as ListInsertOperation, p as OperationResult, pt as TreeReplaceOperation, q as TreeReader, qt as optional, r as DocumentDiagnostic, rt as EntityRemoveOperation, s as DocumentReentrancyError, st as ListMoveOperation, t as CommitSource, tt as EntityEntry, u as HistoryState, ut as TreeInsertOperation, v as CommandFootprintTarget, vt as DocumentAddress, w as debugKey, wt as DocumentValueOfNode, x as footprintsOverlap, xt as DocumentSchema, y as commandFootprint, yt as DocumentListConfig, z as TreeWriter, zt as ValueSelector } from "./contract-D8kjdfqT.cjs";
1
+ import { $ as EntityEntry, $t as tree, A as MutationIssue, At as MapNode, B as CollectionReader, Bt as ValueSelector, C as contains, Ct as DocumentTreeValue, D as resolveAddress, Dt as FieldNode, E as read, Et as EntitySchemaNode, F as FieldWriter, Ft as RecordNode, G as TreeReader, Gt as list, H as FieldReader, Ht as VariantShape, I as ListWriter, It as SchemaPath, J as DictSetOperation, Jt as optional, K as DictDeleteOperation, Kt as map, L as MapWriter, Lt as SingleNode, M as CollectionWriter, Mt as ObjectShape, N as DictionaryWriter, Nt as OptionalNode, O as CollectionImpact, Ot as ImpactTarget, P as DocumentWriter, Pt as ReadonlyDocument, Q as EntityCreateOperation, Qt as table, R as TreeWriter, Rt as TableNode, S as AddressRef, St as DocumentTreeNode, T as overlaps, Tt as DocumentValueOfShape, U as ListReader, Ut as dict, V as DocumentReader, Vt as VariantNode, W as ReaderOfNode, Wt as field, X as DocumentOperation, Xt as schema, Y as DocumentAnchor, Yt as record, Z as DocumentOperationUnion, Zt as single, _ as CommandFootprint, _t as DictNode, a as DocumentProblem, at as ListMoveOperation, b as decodeCommandFootprint, bt as DocumentNode, c as DocumentRuntime, ct as TreeInsertOperation, d as LocalHistory, dt as TreeReplaceOperation, en as variant, et as EntityMoveOperation, f as ObserverError, ft as TreeSetOperation, g as Unsubscribe, gt as CollectionSelector, h as TransactionResult, ht as CollectionNode, i as DocumentDisposedError, it as ListInsertOperation, j as MutationIssueCode, jt as ObjectNode, k as DocumentImpact, kt as ListNode, l as DocumentTransaction, lt as TreeMoveOperation, m as PreparedUpdateResult, mt as VariantReplaceOperation, n as DocumentCommit, nt as FieldClearOperation, o as DocumentReadable, ot as ListRemoveOperation, p as OperationResult, pt as ValueClearOperation, q as DictReplaceOperation, qt as object, r as DocumentDiagnostic, rt as FieldSetOperation, s as DocumentReentrancyError, st as ListReplaceOperation, t as CommitSource, tt as EntityRemoveOperation, u as HistoryState, ut as TreeRemoveOperation, v as CommandFootprintTarget, vt as DocumentAddress, w as debugKey, wt as DocumentValueOfNode, x as footprintsOverlap, xt as DocumentSchema, y as commandFootprint, yt as DocumentListConfig, z as WriterOfNode, zt as TreeNode } from "./contract-uYJTmT8o.cjs";
2
+ import { C as ValueUpdate, S as ValueSpec, _ as ProjectionRuntime, a as CollectionRead, b as ProjectionValue, c as DocumentCollectionSource, d as ProjectionCollection, f as ProjectionCollectionWriter, g as ProjectionInputs, h as ProjectionInput, i as CollectionProcess, l as DocumentInput, m as ProjectionError, o as CollectionSpec, p as ProjectionDisposedError, r as CollectionInput, s as DocumentCollectionInput, t as createProjectionRuntime, u as DocumentSource, v as ProjectionSource, w as Readable, x as ValueInput, y as ProjectionSources } from "./runtime-C_vKHmhy.cjs";
2
3
 
3
4
  //#region \0rolldown/runtime.js
4
5
  //#endregion
@@ -22,71 +23,9 @@ declare const belongs: (target: ImpactTarget<unknown>, schema: DocumentSchema) =
22
23
  declare const same: (left: ImpactTarget<unknown>, right: ImpactTarget<unknown>) => boolean;
23
24
  declare const bucket: (target: ImpactTarget<unknown>) => string | undefined;
24
25
  //#endregion
25
- //#region core/src/projection/readable.d.ts
26
- type Readable<TValue> = {
27
- current(): TValue;
28
- revision(): number;
29
- subscribe(listener: () => void): Unsubscribe;
30
- };
31
- //#endregion
32
26
  //#region core/src/projection/select.d.ts
33
27
  type DocumentSelector<TSchema extends DocumentSchema, TResult> = (read: DocumentReader<TSchema>) => TResult;
34
28
  declare const select: <TSchema extends DocumentSchema, TResult>(runtime: DocumentReadable<TSchema>, selector: DocumentSelector<TSchema, TResult>) => TResult;
35
29
  //#endregion
36
- //#region core/src/projection/collection-view.d.ts
37
- type CollectionView<TId extends string, TValue> = {
38
- readonly ids: Readable<readonly TId[]>;
39
- readonly all: Readable<readonly TValue[]>;
40
- readonly item: (id: TId) => Readable<TValue | undefined>;
41
- revision(): number;
42
- dispose(): void;
43
- };
44
- declare const createCollectionView: <TSchema extends DocumentSchema, TId extends string, TEntry, TValue>(input: {
45
- readonly runtime: DocumentReadable<TSchema>;
46
- readonly source: CollectionSelector<TId, TEntry>;
47
- readonly map: (id: TId, entry: EntityReader<TEntry>) => TValue;
48
- readonly isEqual?: (previous: TValue, next: TValue) => boolean;
49
- }) => CollectionView<TId, TValue>;
50
- //#endregion
51
- //#region core/src/projection/materialized-view.d.ts
52
- type MaterializedSource<TValue, TChange> = {
53
- readonly value: TValue;
54
- readonly change: TChange | undefined;
55
- };
56
- type MaterializedSources = Readonly<Record<string, MaterializedView<unknown, unknown>>>;
57
- type MaterializedSourceValues<TSources extends MaterializedSources> = { readonly [K in keyof TSources]: TSources[K] extends MaterializedView<infer TValue, infer TChange> ? MaterializedSource<TValue, TChange> : never };
58
- type MaterializedUpdateResult<TValue, TChange> = {
59
- readonly kind: 'changed';
60
- readonly value: TValue;
61
- readonly change: TChange;
62
- } | {
63
- readonly kind: 'unchanged';
64
- } | {
65
- readonly kind: 'rebuild';
66
- };
67
- type MaterializedViewUpdate<TSchema extends DocumentSchema, TSources extends MaterializedSources> = {
68
- readonly read: DocumentReader<TSchema>;
69
- readonly revision: number;
70
- readonly source: CommitSource;
71
- readonly impact: DocumentImpact<TSchema>;
72
- readonly sources: MaterializedSourceValues<TSources>;
73
- };
74
- type MaterializedViewSpec<TSchema extends DocumentSchema, TValue, TChange, TSources extends MaterializedSources> = {
75
- readonly sources?: TSources;
76
- readonly build: (input: {
77
- readonly read: DocumentReader<TSchema>;
78
- readonly sources: MaterializedSourceValues<TSources>;
79
- }) => {
80
- readonly value: TValue;
81
- readonly update: (update: MaterializedViewUpdate<TSchema, TSources>) => MaterializedUpdateResult<TValue, TChange>;
82
- };
83
- };
84
- type MaterializedView<TValue, TChange = void> = Readable<TValue> & {
85
- readonly __change?: TChange;
86
- rebuild(): void;
87
- dispose(): void;
88
- };
89
- declare const createMaterializedView: <TSchema extends DocumentSchema, TValue, TChange = void, TSources extends MaterializedSources = {}>(runtime: DocumentReadable<TSchema>, spec: MaterializedViewSpec<TSchema, TValue, TChange, TSources>) => MaterializedView<TValue, TChange>;
90
- //#endregion
91
- export { type AddressRef, type CollectionImpact, type CollectionReader, type CollectionSelector, type CollectionView, type CollectionWriter, type CommandFootprint, type CommandFootprintTarget, type CommitSource, type DictDeleteOperation, type DictNode, type DictReplaceOperation, type DictSetOperation, type DictionaryWriter, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentNode, type DocumentOperation, type DocumentOperationUnion, type DocumentProblem, type DocumentReadable, type DocumentReader, DocumentReentrancyError, type DocumentRuntime, type DocumentSchema, type DocumentSelector, type DocumentTransaction, type DocumentTreeNode, type DocumentTreeValue, type DocumentValueOfNode, type DocumentValueOfShape, type DocumentWriter, type EntityCreateOperation, type EntityEntry, type EntityMoveOperation, type EntityReader, type EntityRemoveOperation, type EntityWriter, type FieldClearOperation, type FieldNode, type FieldReader, type FieldSetOperation, type FieldWriter, type HistoryState, type ImpactTarget, type ListInsertOperation, type ListMoveOperation, type ListNode, type ListReader, type ListRemoveOperation, type ListReplaceOperation, type ListWriter, type LocalHistory, type MapNode, type MapWriter, type MaterializedSource, type MaterializedSourceValues, type MaterializedSources, type MaterializedUpdateResult, type MaterializedView, type MaterializedViewSpec, type MaterializedViewUpdate, type MutationIssue, type MutationIssueCode, type ObjectNode, type ObjectShape, type ObserverError, type OperationResult, type OptionalNode, type PreparedUpdateResult, type Readable, type ReaderOfNode, type ReadonlyDocument, type RecordNode, type SchemaPath, type SingleNode, type TableNode, type TransactionResult, type TreeInsertOperation, type TreeMoveOperation, type TreeNode, type TreeReader, type TreeRemoveOperation, type TreeReplaceOperation, type TreeSetOperation, type TreeWriter, type Unsubscribe, type ValueSelector, type VariantNode, type VariantReplaceOperation, type VariantShape, type WriterOfNode, asReadable, commandFootprint, contains, createCollectionView, createDocument, createMaterializedView, debugKey, decodeCommandFootprint, dict, field, footprintsOverlap, list, map, object, optional, overlaps, read as readAddress, record, resolveAddress, schema, select, single, table, impact_target_d_exports as target, tree, variant };
30
+ export { type AddressRef, type CollectionImpact, type CollectionInput, type CollectionNode, type CollectionProcess, type CollectionRead, type CollectionReader, type CollectionSelector, type CollectionSpec, type CollectionWriter, type CommandFootprint, type CommandFootprintTarget, type CommitSource, type DictDeleteOperation, type DictNode, type DictReplaceOperation, type DictSetOperation, type DictionaryWriter, type DocumentAddress, type DocumentAnchor, type DocumentCollectionInput, type DocumentCollectionSource, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentInput, type DocumentListConfig, type DocumentNode, type DocumentOperation, type DocumentOperationUnion, type DocumentProblem, type DocumentReadable, type DocumentReader, DocumentReentrancyError, type DocumentRuntime, type DocumentSchema, type DocumentSelector, type DocumentSource, type DocumentTransaction, type DocumentTreeNode, type DocumentTreeValue, type DocumentValueOfNode, type DocumentValueOfShape, type DocumentWriter, type EntityCreateOperation, type EntityEntry, type EntityMoveOperation, type EntityRemoveOperation, type EntitySchemaNode, type FieldClearOperation, type FieldNode, type FieldReader, type FieldSetOperation, type FieldWriter, type HistoryState, type ImpactTarget, type ListInsertOperation, type ListMoveOperation, type ListNode, type ListReader, type ListRemoveOperation, type ListReplaceOperation, type ListWriter, type LocalHistory, type MapNode, type MapWriter, type MutationIssue, type MutationIssueCode, type ObjectNode, type ObjectShape, type ObserverError, type OperationResult, type OptionalNode, type PreparedUpdateResult, type ProjectionCollection, type ProjectionCollectionWriter, ProjectionDisposedError, ProjectionError, type ProjectionInput, type ProjectionInputs, type ProjectionRuntime, type ProjectionSource, type ProjectionSources, type ProjectionValue, type Readable, type ReaderOfNode, type ReadonlyDocument, type RecordNode, type SchemaPath, type SingleNode, type TableNode, type TransactionResult, type TreeInsertOperation, type TreeMoveOperation, type TreeNode, type TreeReader, type TreeRemoveOperation, type TreeReplaceOperation, type TreeSetOperation, type TreeWriter, type Unsubscribe, type ValueClearOperation, type ValueInput, type ValueSelector, type ValueSpec, type ValueUpdate, type VariantNode, type VariantReplaceOperation, type VariantShape, type WriterOfNode, asReadable, commandFootprint, contains, createDocument, createProjectionRuntime, debugKey, decodeCommandFootprint, dict, field, footprintsOverlap, list, map, object, optional, overlaps, read as readAddress, record, resolveAddress, schema, select, single, table, impact_target_d_exports as target, tree, variant };
92
31
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { $ as DocumentOperationUnion, $t as variant, A as MutationIssue, At as ObjectNode, B as WriterOfNode, Bt as VariantNode, C as contains, Ct as DocumentTreeValue, D as resolveAddress, Dt as ImpactTarget, E as read, Et as FieldNode, F as EntityWriter, Ft as SchemaPath, G as ListReader, Gt as map, H as DocumentReader, Ht as dict, I as FieldWriter, It as SingleNode, J as DictDeleteOperation, Jt as record, K as ReaderOfNode, Kt as object, L as ListWriter, Lt as TableNode, M as CollectionWriter, Mt as OptionalNode, N as DictionaryWriter, Nt as ReadonlyDocument, O as CollectionImpact, Ot as ListNode, P as DocumentWriter, Pt as RecordNode, Q as DocumentOperation, Qt as tree, R as MapWriter, Rt as TreeNode, S as AddressRef, St as DocumentTreeNode, T as overlaps, Tt as DocumentValueOfShape, U as EntityReader, Ut as field, V as CollectionReader, Vt as VariantShape, W as FieldReader, Wt as list, X as DictSetOperation, Xt as single, Y as DictReplaceOperation, Yt as schema, Z as DocumentAnchor, Zt as table, _ as CommandFootprint, _t as DictNode, a as DocumentProblem, at as FieldSetOperation, b as decodeCommandFootprint, bt as DocumentNode, c as DocumentRuntime, ct as ListRemoveOperation, d as LocalHistory, dt as TreeMoveOperation, et as EntityCreateOperation, f as ObserverError, ft as TreeRemoveOperation, g as Unsubscribe, gt as CollectionSelector, h as TransactionResult, ht as VariantReplaceOperation, i as DocumentDisposedError, it as FieldClearOperation, j as MutationIssueCode, jt as ObjectShape, k as DocumentImpact, kt as MapNode, l as DocumentTransaction, lt as ListReplaceOperation, m as PreparedUpdateResult, mt as TreeSetOperation, n as DocumentCommit, nt as EntityMoveOperation, o as DocumentReadable, ot as ListInsertOperation, p as OperationResult, pt as TreeReplaceOperation, q as TreeReader, qt as optional, r as DocumentDiagnostic, rt as EntityRemoveOperation, s as DocumentReentrancyError, st as ListMoveOperation, t as CommitSource, tt as EntityEntry, u as HistoryState, ut as TreeInsertOperation, v as CommandFootprintTarget, vt as DocumentAddress, w as debugKey, wt as DocumentValueOfNode, x as footprintsOverlap, xt as DocumentSchema, y as commandFootprint, yt as DocumentListConfig, z as TreeWriter, zt as ValueSelector } from "./contract-BsY1XLiG.js";
1
+ import { $ as EntityEntry, $t as tree, A as MutationIssue, At as MapNode, B as CollectionReader, Bt as ValueSelector, C as contains, Ct as DocumentTreeValue, D as resolveAddress, Dt as FieldNode, E as read, Et as EntitySchemaNode, F as FieldWriter, Ft as RecordNode, G as TreeReader, Gt as list, H as FieldReader, Ht as VariantShape, I as ListWriter, It as SchemaPath, J as DictSetOperation, Jt as optional, K as DictDeleteOperation, Kt as map, L as MapWriter, Lt as SingleNode, M as CollectionWriter, Mt as ObjectShape, N as DictionaryWriter, Nt as OptionalNode, O as CollectionImpact, Ot as ImpactTarget, P as DocumentWriter, Pt as ReadonlyDocument, Q as EntityCreateOperation, Qt as table, R as TreeWriter, Rt as TableNode, S as AddressRef, St as DocumentTreeNode, T as overlaps, Tt as DocumentValueOfShape, U as ListReader, Ut as dict, V as DocumentReader, Vt as VariantNode, W as ReaderOfNode, Wt as field, X as DocumentOperation, Xt as schema, Y as DocumentAnchor, Yt as record, Z as DocumentOperationUnion, Zt as single, _ as CommandFootprint, _t as DictNode, a as DocumentProblem, at as ListMoveOperation, b as decodeCommandFootprint, bt as DocumentNode, c as DocumentRuntime, ct as TreeInsertOperation, d as LocalHistory, dt as TreeReplaceOperation, en as variant, et as EntityMoveOperation, f as ObserverError, ft as TreeSetOperation, g as Unsubscribe, gt as CollectionSelector, h as TransactionResult, ht as CollectionNode, i as DocumentDisposedError, it as ListInsertOperation, j as MutationIssueCode, jt as ObjectNode, k as DocumentImpact, kt as ListNode, l as DocumentTransaction, lt as TreeMoveOperation, m as PreparedUpdateResult, mt as VariantReplaceOperation, n as DocumentCommit, nt as FieldClearOperation, o as DocumentReadable, ot as ListRemoveOperation, p as OperationResult, pt as ValueClearOperation, q as DictReplaceOperation, qt as object, r as DocumentDiagnostic, rt as FieldSetOperation, s as DocumentReentrancyError, st as ListReplaceOperation, t as CommitSource, tt as EntityRemoveOperation, u as HistoryState, ut as TreeRemoveOperation, v as CommandFootprintTarget, vt as DocumentAddress, w as debugKey, wt as DocumentValueOfNode, x as footprintsOverlap, xt as DocumentSchema, y as commandFootprint, yt as DocumentListConfig, z as WriterOfNode, zt as TreeNode } from "./contract-I99DUMbN.js";
2
+ import { C as ValueUpdate, S as ValueSpec, _ as ProjectionRuntime, a as CollectionRead, b as ProjectionValue, c as DocumentCollectionSource, d as ProjectionCollection, f as ProjectionCollectionWriter, g as ProjectionInputs, h as ProjectionInput, i as CollectionProcess, l as DocumentInput, m as ProjectionError, o as CollectionSpec, p as ProjectionDisposedError, r as CollectionInput, s as DocumentCollectionInput, t as createProjectionRuntime, u as DocumentSource, v as ProjectionSource, w as Readable, x as ValueInput, y as ProjectionSources } from "./runtime-CUcvhFNP.js";
2
3
 
3
4
  //#region core/src/runtime.d.ts
4
5
  declare const createDocument: <TSchema extends DocumentSchema>(input: {
@@ -20,71 +21,9 @@ declare const belongs: (target: ImpactTarget<unknown>, schema: DocumentSchema) =
20
21
  declare const same: (left: ImpactTarget<unknown>, right: ImpactTarget<unknown>) => boolean;
21
22
  declare const bucket: (target: ImpactTarget<unknown>) => string | undefined;
22
23
  //#endregion
23
- //#region core/src/projection/readable.d.ts
24
- type Readable<TValue> = {
25
- current(): TValue;
26
- revision(): number;
27
- subscribe(listener: () => void): Unsubscribe;
28
- };
29
- //#endregion
30
24
  //#region core/src/projection/select.d.ts
31
25
  type DocumentSelector<TSchema extends DocumentSchema, TResult> = (read: DocumentReader<TSchema>) => TResult;
32
26
  declare const select: <TSchema extends DocumentSchema, TResult>(runtime: DocumentReadable<TSchema>, selector: DocumentSelector<TSchema, TResult>) => TResult;
33
27
  //#endregion
34
- //#region core/src/projection/collection-view.d.ts
35
- type CollectionView<TId extends string, TValue> = {
36
- readonly ids: Readable<readonly TId[]>;
37
- readonly all: Readable<readonly TValue[]>;
38
- readonly item: (id: TId) => Readable<TValue | undefined>;
39
- revision(): number;
40
- dispose(): void;
41
- };
42
- declare const createCollectionView: <TSchema extends DocumentSchema, TId extends string, TEntry, TValue>(input: {
43
- readonly runtime: DocumentReadable<TSchema>;
44
- readonly source: CollectionSelector<TId, TEntry>;
45
- readonly map: (id: TId, entry: EntityReader<TEntry>) => TValue;
46
- readonly isEqual?: (previous: TValue, next: TValue) => boolean;
47
- }) => CollectionView<TId, TValue>;
48
- //#endregion
49
- //#region core/src/projection/materialized-view.d.ts
50
- type MaterializedSource<TValue, TChange> = {
51
- readonly value: TValue;
52
- readonly change: TChange | undefined;
53
- };
54
- type MaterializedSources = Readonly<Record<string, MaterializedView<unknown, unknown>>>;
55
- type MaterializedSourceValues<TSources extends MaterializedSources> = { readonly [K in keyof TSources]: TSources[K] extends MaterializedView<infer TValue, infer TChange> ? MaterializedSource<TValue, TChange> : never };
56
- type MaterializedUpdateResult<TValue, TChange> = {
57
- readonly kind: 'changed';
58
- readonly value: TValue;
59
- readonly change: TChange;
60
- } | {
61
- readonly kind: 'unchanged';
62
- } | {
63
- readonly kind: 'rebuild';
64
- };
65
- type MaterializedViewUpdate<TSchema extends DocumentSchema, TSources extends MaterializedSources> = {
66
- readonly read: DocumentReader<TSchema>;
67
- readonly revision: number;
68
- readonly source: CommitSource;
69
- readonly impact: DocumentImpact<TSchema>;
70
- readonly sources: MaterializedSourceValues<TSources>;
71
- };
72
- type MaterializedViewSpec<TSchema extends DocumentSchema, TValue, TChange, TSources extends MaterializedSources> = {
73
- readonly sources?: TSources;
74
- readonly build: (input: {
75
- readonly read: DocumentReader<TSchema>;
76
- readonly sources: MaterializedSourceValues<TSources>;
77
- }) => {
78
- readonly value: TValue;
79
- readonly update: (update: MaterializedViewUpdate<TSchema, TSources>) => MaterializedUpdateResult<TValue, TChange>;
80
- };
81
- };
82
- type MaterializedView<TValue, TChange = void> = Readable<TValue> & {
83
- readonly __change?: TChange;
84
- rebuild(): void;
85
- dispose(): void;
86
- };
87
- declare const createMaterializedView: <TSchema extends DocumentSchema, TValue, TChange = void, TSources extends MaterializedSources = {}>(runtime: DocumentReadable<TSchema>, spec: MaterializedViewSpec<TSchema, TValue, TChange, TSources>) => MaterializedView<TValue, TChange>;
88
- //#endregion
89
- export { type AddressRef, type CollectionImpact, type CollectionReader, type CollectionSelector, type CollectionView, type CollectionWriter, type CommandFootprint, type CommandFootprintTarget, type CommitSource, type DictDeleteOperation, type DictNode, type DictReplaceOperation, type DictSetOperation, type DictionaryWriter, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentNode, type DocumentOperation, type DocumentOperationUnion, type DocumentProblem, type DocumentReadable, type DocumentReader, DocumentReentrancyError, type DocumentRuntime, type DocumentSchema, type DocumentSelector, type DocumentTransaction, type DocumentTreeNode, type DocumentTreeValue, type DocumentValueOfNode, type DocumentValueOfShape, type DocumentWriter, type EntityCreateOperation, type EntityEntry, type EntityMoveOperation, type EntityReader, type EntityRemoveOperation, type EntityWriter, type FieldClearOperation, type FieldNode, type FieldReader, type FieldSetOperation, type FieldWriter, type HistoryState, type ImpactTarget, type ListInsertOperation, type ListMoveOperation, type ListNode, type ListReader, type ListRemoveOperation, type ListReplaceOperation, type ListWriter, type LocalHistory, type MapNode, type MapWriter, type MaterializedSource, type MaterializedSourceValues, type MaterializedSources, type MaterializedUpdateResult, type MaterializedView, type MaterializedViewSpec, type MaterializedViewUpdate, type MutationIssue, type MutationIssueCode, type ObjectNode, type ObjectShape, type ObserverError, type OperationResult, type OptionalNode, type PreparedUpdateResult, type Readable, type ReaderOfNode, type ReadonlyDocument, type RecordNode, type SchemaPath, type SingleNode, type TableNode, type TransactionResult, type TreeInsertOperation, type TreeMoveOperation, type TreeNode, type TreeReader, type TreeRemoveOperation, type TreeReplaceOperation, type TreeSetOperation, type TreeWriter, type Unsubscribe, type ValueSelector, type VariantNode, type VariantReplaceOperation, type VariantShape, type WriterOfNode, asReadable, commandFootprint, contains, createCollectionView, createDocument, createMaterializedView, debugKey, decodeCommandFootprint, dict, field, footprintsOverlap, list, map, object, optional, overlaps, read as readAddress, record, resolveAddress, schema, select, single, table, impact_target_d_exports as target, tree, variant };
28
+ export { type AddressRef, type CollectionImpact, type CollectionInput, type CollectionNode, type CollectionProcess, type CollectionRead, type CollectionReader, type CollectionSelector, type CollectionSpec, type CollectionWriter, type CommandFootprint, type CommandFootprintTarget, type CommitSource, type DictDeleteOperation, type DictNode, type DictReplaceOperation, type DictSetOperation, type DictionaryWriter, type DocumentAddress, type DocumentAnchor, type DocumentCollectionInput, type DocumentCollectionSource, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentInput, type DocumentListConfig, type DocumentNode, type DocumentOperation, type DocumentOperationUnion, type DocumentProblem, type DocumentReadable, type DocumentReader, DocumentReentrancyError, type DocumentRuntime, type DocumentSchema, type DocumentSelector, type DocumentSource, type DocumentTransaction, type DocumentTreeNode, type DocumentTreeValue, type DocumentValueOfNode, type DocumentValueOfShape, type DocumentWriter, type EntityCreateOperation, type EntityEntry, type EntityMoveOperation, type EntityRemoveOperation, type EntitySchemaNode, type FieldClearOperation, type FieldNode, type FieldReader, type FieldSetOperation, type FieldWriter, type HistoryState, type ImpactTarget, type ListInsertOperation, type ListMoveOperation, type ListNode, type ListReader, type ListRemoveOperation, type ListReplaceOperation, type ListWriter, type LocalHistory, type MapNode, type MapWriter, type MutationIssue, type MutationIssueCode, type ObjectNode, type ObjectShape, type ObserverError, type OperationResult, type OptionalNode, type PreparedUpdateResult, type ProjectionCollection, type ProjectionCollectionWriter, ProjectionDisposedError, ProjectionError, type ProjectionInput, type ProjectionInputs, type ProjectionRuntime, type ProjectionSource, type ProjectionSources, type ProjectionValue, type Readable, type ReaderOfNode, type ReadonlyDocument, type RecordNode, type SchemaPath, type SingleNode, type TableNode, type TransactionResult, type TreeInsertOperation, type TreeMoveOperation, type TreeNode, type TreeReader, type TreeRemoveOperation, type TreeReplaceOperation, type TreeSetOperation, type TreeWriter, type Unsubscribe, type ValueClearOperation, type ValueInput, type ValueSelector, type ValueSpec, type ValueUpdate, type VariantNode, type VariantReplaceOperation, type VariantShape, type WriterOfNode, asReadable, commandFootprint, contains, createDocument, createProjectionRuntime, debugKey, decodeCommandFootprint, dict, field, footprintsOverlap, list, map, object, optional, overlaps, read as readAddress, record, resolveAddress, schema, select, single, table, impact_target_d_exports as target, tree, variant };
90
29
  //# sourceMappingURL=index.d.ts.map