doxum 0.1.1 → 0.1.2

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 (44) hide show
  1. package/README.md +45 -2
  2. package/dist/{dependency-BdEMyquf.js → access-5D4KKFm7.js} +4 -21
  3. package/dist/access-5D4KKFm7.js.map +1 -0
  4. package/dist/{dependency-DLcCvNKq.cjs → access-z56fVqZ2.cjs} +21 -32
  5. package/dist/access-z56fVqZ2.cjs.map +1 -0
  6. package/dist/{contract-Otb5W6cQ.d.cts → contract-DGkZcTiP.d.cts} +63 -5
  7. package/dist/{contract-DwNiKioc.d.ts → contract-Dh3az8aN.d.ts} +63 -5
  8. package/dist/dependency-BRn1TRDi.js +20 -0
  9. package/dist/dependency-BRn1TRDi.js.map +1 -0
  10. package/dist/dependency-DmQXyj7q.cjs +25 -0
  11. package/dist/dependency-DmQXyj7q.cjs.map +1 -0
  12. package/dist/index.cjs +46 -2341
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +8 -5
  15. package/dist/index.d.ts +8 -5
  16. package/dist/index.js +5 -2304
  17. package/dist/index.js.map +1 -1
  18. package/dist/integration.cjs +3 -2
  19. package/dist/integration.cjs.map +1 -1
  20. package/dist/integration.d.cts +2 -2
  21. package/dist/integration.d.ts +2 -2
  22. package/dist/integration.js +2 -1
  23. package/dist/integration.js.map +1 -1
  24. package/dist/local-sync.cjs +660 -0
  25. package/dist/local-sync.cjs.map +1 -0
  26. package/dist/local-sync.d.cts +79 -0
  27. package/dist/local-sync.d.ts +79 -0
  28. package/dist/local-sync.js +653 -0
  29. package/dist/local-sync.js.map +1 -0
  30. package/dist/react.cjs.map +1 -1
  31. package/dist/react.d.cts +2 -2
  32. package/dist/react.d.ts +2 -2
  33. package/dist/react.js.map +1 -1
  34. package/dist/readable-B8E3FMq6.cjs +2614 -0
  35. package/dist/readable-B8E3FMq6.cjs.map +1 -0
  36. package/dist/readable-CIj02gIj.js +2579 -0
  37. package/dist/readable-CIj02gIj.js.map +1 -0
  38. package/package.json +14 -8
  39. package/skills/doxum-runtime/references/guide.en.md +9 -5
  40. package/skills/doxum-runtime/references/guide.zh-CN.md +3 -2
  41. package/skills/doxum-runtime/references/invariants.en.md +13 -8
  42. package/skills/doxum-runtime/references/invariants.zh-CN.md +2 -2
  43. package/dist/dependency-BdEMyquf.js.map +0 -1
  44. package/dist/dependency-DLcCvNKq.cjs.map +0 -1
@@ -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 DocumentRuntime<TSchema extends DocumentSchema> = {
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,15 @@ 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> & {
462
520
  update<TResult>(run: (transaction: DocumentTransaction<TSchema>) => TResult, options?: {
463
521
  readonly source?: Extract<CommitSource, 'local' | 'system'>;
464
522
  readonly history?: boolean;
465
523
  }): TransactionResult<TResult, DocumentCommit<TSchema>>;
524
+ prepare<TResult>(run: (transaction: DocumentTransaction<TSchema>) => TResult): PreparedUpdateResult<TResult, TSchema>;
466
525
  apply(operations: unknown, options?: {
467
526
  readonly source?: Exclude<CommitSource, 'history'>;
468
527
  readonly history?: boolean;
@@ -470,11 +529,10 @@ type DocumentRuntime<TSchema extends DocumentSchema> = {
470
529
  replace(document: ReadonlyDocument<TSchema>, options?: {
471
530
  readonly source?: Extract<CommitSource, 'system' | 'remote'>;
472
531
  }): OperationResult<DocumentCommit<TSchema>>;
473
- subscribe(listener: CommitListener<TSchema>): Unsubscribe;
474
- subscribe(target: ImpactTarget<unknown> | readonly [ImpactTarget<unknown>, ...ImpactTarget<unknown>[]], listener: CommitListener<TSchema>): Unsubscribe;
532
+ snapshot(): ReadonlyDocument<TSchema>;
475
533
  readonly history: LocalHistory<DocumentCommit<TSchema>>;
476
534
  dispose(): void;
477
535
  };
478
536
  //#endregion
479
- export { ListInsertOperation as $, ListWriter as A, TableNode as At, TreeReader as B, optional as Bt, MutationIssue as C, ObjectNode as Ct, DocumentWriter as D, RecordNode as Dt, DictionaryWriter as E, ReadonlyDocument as Et, DocumentReader as F, dict as Ft, DocumentOperation as G, tree as Gt, DictReplaceOperation as H, schema as Ht, EntityReader as I, field as It, EntityEntry as J, DocumentOperationUnion as K, variant as Kt, FieldReader as L, list as Lt, TreeWriter as M, ValueSelector as Mt, WriterOfNode as N, VariantNode as Nt, EntityWriter as O, SchemaPath as Ot, CollectionReader as P, VariantShape as Pt, FieldSetOperation as Q, ListReader as R, map as Rt, DocumentImpact as S, MapNode as St, CollectionWriter as T, OptionalNode as Tt, DictSetOperation as U, single as Ut, DictDeleteOperation as V, record as Vt, DocumentAnchor as W, table as Wt, EntityRemoveOperation as X, EntityMoveOperation as Y, FieldClearOperation as Z, debugKey as _, DocumentValueOfNode as _t, DocumentProblem as a, TreeRemoveOperation as at, resolveAddress as b, ImpactTarget as bt, DocumentTransaction as c, VariantReplaceOperation as ct, ObserverError as d, DocumentAddress as dt, ListMoveOperation as et, OperationResult as f, DocumentListConfig as ft, contains as g, DocumentTreeValue as gt, AddressRef as h, DocumentTreeNode as ht, DocumentDisposedError as i, TreeMoveOperation as it, MapWriter as j, TreeNode as jt, FieldWriter as k, SingleNode as kt, HistoryState as l, CollectionSelector as lt, Unsubscribe as m, DocumentSchema as mt, DocumentCommit as n, ListReplaceOperation as nt, DocumentReentrancyError as o, TreeReplaceOperation as ot, TransactionResult as p, DocumentNode as pt, EntityCreateOperation as q, DocumentDiagnostic as r, TreeInsertOperation as rt, DocumentRuntime as s, TreeSetOperation as st, CommitSource as t, ListRemoveOperation as tt, LocalHistory as u, DictNode as ut, overlaps as v, DocumentValueOfShape as vt, MutationIssueCode as w, ObjectShape as wt, CollectionImpact as x, ListNode as xt, read as y, FieldNode as yt, ReaderOfNode as z, object as zt };
480
- //# sourceMappingURL=contract-Otb5W6cQ.d.cts.map
537
+ 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 };
538
+ //# sourceMappingURL=contract-DGkZcTiP.d.cts.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 DocumentRuntime<TSchema extends DocumentSchema> = {
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,15 @@ 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> & {
462
520
  update<TResult>(run: (transaction: DocumentTransaction<TSchema>) => TResult, options?: {
463
521
  readonly source?: Extract<CommitSource, 'local' | 'system'>;
464
522
  readonly history?: boolean;
465
523
  }): TransactionResult<TResult, DocumentCommit<TSchema>>;
524
+ prepare<TResult>(run: (transaction: DocumentTransaction<TSchema>) => TResult): PreparedUpdateResult<TResult, TSchema>;
466
525
  apply(operations: unknown, options?: {
467
526
  readonly source?: Exclude<CommitSource, 'history'>;
468
527
  readonly history?: boolean;
@@ -470,11 +529,10 @@ type DocumentRuntime<TSchema extends DocumentSchema> = {
470
529
  replace(document: ReadonlyDocument<TSchema>, options?: {
471
530
  readonly source?: Extract<CommitSource, 'system' | 'remote'>;
472
531
  }): OperationResult<DocumentCommit<TSchema>>;
473
- subscribe(listener: CommitListener<TSchema>): Unsubscribe;
474
- subscribe(target: ImpactTarget<unknown> | readonly [ImpactTarget<unknown>, ...ImpactTarget<unknown>[]], listener: CommitListener<TSchema>): Unsubscribe;
532
+ snapshot(): ReadonlyDocument<TSchema>;
475
533
  readonly history: LocalHistory<DocumentCommit<TSchema>>;
476
534
  dispose(): void;
477
535
  };
478
536
  //#endregion
479
- export { ListInsertOperation as $, ListWriter as A, TableNode as At, TreeReader as B, optional as Bt, MutationIssue as C, ObjectNode as Ct, DocumentWriter as D, RecordNode as Dt, DictionaryWriter as E, ReadonlyDocument as Et, DocumentReader as F, dict as Ft, DocumentOperation as G, tree as Gt, DictReplaceOperation as H, schema as Ht, EntityReader as I, field as It, EntityEntry as J, DocumentOperationUnion as K, variant as Kt, FieldReader as L, list as Lt, TreeWriter as M, ValueSelector as Mt, WriterOfNode as N, VariantNode as Nt, EntityWriter as O, SchemaPath as Ot, CollectionReader as P, VariantShape as Pt, FieldSetOperation as Q, ListReader as R, map as Rt, DocumentImpact as S, MapNode as St, CollectionWriter as T, OptionalNode as Tt, DictSetOperation as U, single as Ut, DictDeleteOperation as V, record as Vt, DocumentAnchor as W, table as Wt, EntityRemoveOperation as X, EntityMoveOperation as Y, FieldClearOperation as Z, debugKey as _, DocumentValueOfNode as _t, DocumentProblem as a, TreeRemoveOperation as at, resolveAddress as b, ImpactTarget as bt, DocumentTransaction as c, VariantReplaceOperation as ct, ObserverError as d, DocumentAddress as dt, ListMoveOperation as et, OperationResult as f, DocumentListConfig as ft, contains as g, DocumentTreeValue as gt, AddressRef as h, DocumentTreeNode as ht, DocumentDisposedError as i, TreeMoveOperation as it, MapWriter as j, TreeNode as jt, FieldWriter as k, SingleNode as kt, HistoryState as l, CollectionSelector as lt, Unsubscribe as m, DocumentSchema as mt, DocumentCommit as n, ListReplaceOperation as nt, DocumentReentrancyError as o, TreeReplaceOperation as ot, TransactionResult as p, DocumentNode as pt, EntityCreateOperation as q, DocumentDiagnostic as r, TreeInsertOperation as rt, DocumentRuntime as s, TreeSetOperation as st, CommitSource as t, ListRemoveOperation as tt, LocalHistory as u, DictNode as ut, overlaps as v, DocumentValueOfShape as vt, MutationIssueCode as w, ObjectShape as wt, CollectionImpact as x, ListNode as xt, read as y, FieldNode as yt, ReaderOfNode as z, object as zt };
480
- //# sourceMappingURL=contract-DwNiKioc.d.ts.map
537
+ 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 };
538
+ //# sourceMappingURL=contract-Dh3az8aN.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { w as same } from "./access-5D4KKFm7.js";
2
+ //#region core/src/access/dependency.ts
3
+ const createDependencyTracker = () => {
4
+ const targets = [];
5
+ return {
6
+ record: (value) => {
7
+ if (!targets.some((entry) => same(entry, value))) targets.push(value);
8
+ },
9
+ clear: () => {
10
+ targets.length = 0;
11
+ },
12
+ size: () => targets.length,
13
+ some: (test) => targets.some(test),
14
+ snapshot: () => Object.freeze(targets.slice())
15
+ };
16
+ };
17
+ //#endregion
18
+ export { createDependencyTracker as t };
19
+
20
+ //# sourceMappingURL=dependency-BRn1TRDi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-BRn1TRDi.js","names":["impactTarget.same"],"sources":["../core/src/access/dependency.ts"],"sourcesContent":["import type { ImpactTarget } from '../schema';\nimport * as impactTarget from '../impact-target';\n\nexport type DependencyTracker = {\n readonly record: (target: ImpactTarget<unknown>) => void;\n readonly clear: () => void;\n readonly size: () => number;\n readonly some: (test: (target: ImpactTarget<unknown>) => boolean) => boolean;\n readonly snapshot: () => readonly ImpactTarget<unknown>[];\n};\n\nexport const createDependencyTracker = (): DependencyTracker => {\n const targets: ImpactTarget<unknown>[] = [];\n return {\n record: value => {\n if (!targets.some(entry => impactTarget.same(entry, value))) targets.push(value);\n },\n clear: () => {\n targets.length = 0;\n },\n size: () => targets.length,\n some: test => targets.some(test),\n snapshot: () => Object.freeze(targets.slice()),\n };\n};\n"],"mappings":";;AAWA,MAAa,gCAAmD;CAC9D,MAAM,UAAmC,EAAE;AAC3C,QAAO;EACL,SAAQ,UAAS;AACf,OAAI,CAAC,QAAQ,MAAK,UAASA,KAAkB,OAAO,MAAM,CAAC,CAAE,SAAQ,KAAK,MAAM;;EAElF,aAAa;AACX,WAAQ,SAAS;;EAEnB,YAAY,QAAQ;EACpB,OAAM,SAAQ,QAAQ,KAAK,KAAK;EAChC,gBAAgB,OAAO,OAAO,QAAQ,OAAO,CAAC;EAC/C"}
@@ -0,0 +1,25 @@
1
+ const require_access = require("./access-z56fVqZ2.cjs");
2
+ //#region core/src/access/dependency.ts
3
+ const createDependencyTracker = () => {
4
+ const targets = [];
5
+ return {
6
+ record: (value) => {
7
+ if (!targets.some((entry) => require_access.same(entry, value))) targets.push(value);
8
+ },
9
+ clear: () => {
10
+ targets.length = 0;
11
+ },
12
+ size: () => targets.length,
13
+ some: (test) => targets.some(test),
14
+ snapshot: () => Object.freeze(targets.slice())
15
+ };
16
+ };
17
+ //#endregion
18
+ Object.defineProperty(exports, "createDependencyTracker", {
19
+ enumerable: true,
20
+ get: function() {
21
+ return createDependencyTracker;
22
+ }
23
+ });
24
+
25
+ //# sourceMappingURL=dependency-DmQXyj7q.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-DmQXyj7q.cjs","names":[],"sources":["../core/src/access/dependency.ts"],"sourcesContent":["import type { ImpactTarget } from '../schema';\nimport * as impactTarget from '../impact-target';\n\nexport type DependencyTracker = {\n readonly record: (target: ImpactTarget<unknown>) => void;\n readonly clear: () => void;\n readonly size: () => number;\n readonly some: (test: (target: ImpactTarget<unknown>) => boolean) => boolean;\n readonly snapshot: () => readonly ImpactTarget<unknown>[];\n};\n\nexport const createDependencyTracker = (): DependencyTracker => {\n const targets: ImpactTarget<unknown>[] = [];\n return {\n record: value => {\n if (!targets.some(entry => impactTarget.same(entry, value))) targets.push(value);\n },\n clear: () => {\n targets.length = 0;\n },\n size: () => targets.length,\n some: test => targets.some(test),\n snapshot: () => Object.freeze(targets.slice()),\n };\n};\n"],"mappings":";;AAWA,MAAa,gCAAmD;CAC9D,MAAM,UAAmC,EAAE;AAC3C,QAAO;EACL,SAAQ,UAAS;AACf,OAAI,CAAC,QAAQ,MAAK,UAAA,eAAA,KAA2B,OAAO,MAAM,CAAC,CAAE,SAAQ,KAAK,MAAM;;EAElF,aAAa;AACX,WAAQ,SAAS;;EAEnB,YAAY,QAAQ;EACpB,OAAM,SAAQ,QAAQ,KAAK,KAAK;EAChC,gBAAgB,OAAO,OAAO,QAAQ,OAAO,CAAC;EAC/C"}