j-templates 8.1.2 → 9.0.0

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 (40) hide show
  1. package/SYNTAX_PRIMER.md +3 -4
  2. package/Store/Diff/diffTree.d.ts +39 -33
  3. package/Store/Diff/diffTree.js +147 -435
  4. package/Store/Diff/diffTree.types.d.ts +5 -79
  5. package/Store/Diff/diffTree.types.js +1 -3
  6. package/Store/Diff/diffTreeWorker.d.ts +4 -0
  7. package/Store/Diff/diffTreeWorker.js +17 -39
  8. package/Store/Diff/diffTreeWriter.d.ts +27 -38
  9. package/Store/Diff/diffTreeWriter.js +44 -95
  10. package/Store/Diff/index.d.ts +2 -0
  11. package/Store/Diff/index.js +2 -0
  12. package/Store/Diff/utils/diffTree.types.d.ts +113 -0
  13. package/Store/Diff/utils/diffTree.types.js +1 -0
  14. package/Store/Diff/utils/homes.d.ts +46 -0
  15. package/Store/Diff/utils/homes.js +213 -0
  16. package/Store/Diff/utils/paths.d.ts +42 -0
  17. package/Store/Diff/utils/paths.js +87 -0
  18. package/Store/Diff/utils/projections.d.ts +55 -0
  19. package/Store/Diff/utils/projections.js +290 -0
  20. package/Store/Diff/utils/routes.d.ts +27 -0
  21. package/Store/Diff/utils/routes.js +168 -0
  22. package/Store/Diff/utils/state.d.ts +56 -0
  23. package/Store/Diff/utils/state.js +155 -0
  24. package/Store/Store/pushStore.d.ts +1 -5
  25. package/Store/Store/pushStore.js +3 -22
  26. package/Store/Store/store.d.ts +10 -4
  27. package/Store/Store/store.js +25 -11
  28. package/Store/Store/storeAsync.d.ts +4 -5
  29. package/Store/Store/storeAsync.js +19 -36
  30. package/Store/Store/storeSync.d.ts +14 -9
  31. package/Store/Store/storeSync.js +27 -22
  32. package/Store/Tree/observableNode.d.ts +2 -23
  33. package/Store/Tree/observableNode.js +46 -183
  34. package/Store/Tree/snapshot.d.ts +68 -0
  35. package/Store/Tree/snapshot.js +147 -0
  36. package/Utils/json.d.ts +180 -10
  37. package/Utils/json.js +532 -67
  38. package/package.json +1 -1
  39. package/Store/Diff/diffSync.d.ts +0 -36
  40. package/Store/Diff/diffSync.js +0 -43
@@ -1,36 +0,0 @@
1
- import { JsonDiffResult } from "../../Utils/json";
2
- import { DiffSpliceResult, DiffTreeProjectionMap, IDiffTree } from "./diffTree.types";
3
- /**
4
- * Synchronous diff implementation.
5
- * Computes diffs immediately without queuing or workers.
6
- *
7
- * @see StoreSync
8
- * @see StoreAsync
9
- */
10
- export declare class DiffSync implements IDiffTree {
11
- private diffTree;
12
- /**
13
- * Creates a DiffSync instance.
14
- * @param keyFunc - Optional function to extract a key from objects
15
- * @param projections - Optional map of derived-value projections, keyed by id
16
- */
17
- constructor(keyFunc?: {
18
- (val: any): string;
19
- }, projections?: DiffTreeProjectionMap);
20
- /**
21
- * Computes the diff between a new value and the current value at a path.
22
- * @param path - Dot-separated path to the value
23
- * @param value - The new value to compare
24
- * @returns Diff results showing changes
25
- */
26
- DiffPath(path: string, value: any): {
27
- path: (string | number)[];
28
- value: unknown;
29
- }[];
30
- PatchPath(path: string, patch: any): {
31
- path: (string | number)[];
32
- value: unknown;
33
- }[];
34
- PushPath(path: string, items: any[]): JsonDiffResult;
35
- SplicePath(path: string, start: number, deleteCount: number | undefined, items: any[]): DiffSpliceResult;
36
- }
@@ -1,43 +0,0 @@
1
- import { DiffTree } from "./diffTree";
2
- /**
3
- * Synchronous diff implementation.
4
- * Computes diffs immediately without queuing or workers.
5
- *
6
- * @see StoreSync
7
- * @see StoreAsync
8
- */
9
- export class DiffSync {
10
- /**
11
- * Creates a DiffSync instance.
12
- * @param keyFunc - Optional function to extract a key from objects
13
- * @param projections - Optional map of derived-value projections, keyed by id
14
- */
15
- constructor(keyFunc, projections) {
16
- this.diffTree = new DiffTree(keyFunc, projections);
17
- }
18
- /**
19
- * Computes the diff between a new value and the current value at a path.
20
- * @param path - Dot-separated path to the value
21
- * @param value - The new value to compare
22
- * @returns Diff results showing changes
23
- */
24
- DiffPath(path, value) {
25
- const diff = this.diffTree.DiffPath(path, value);
26
- return diff.concat(this.diffTree.RunProjections());
27
- }
28
- PatchPath(path, patch) {
29
- const diff = this.diffTree.PatchPath(path, patch);
30
- return diff.concat(this.diffTree.RunProjections());
31
- }
32
- PushPath(path, items) {
33
- const diff = this.diffTree.PushPath(path, items);
34
- return diff.concat(this.diffTree.RunProjections());
35
- }
36
- SplicePath(path, start, deleteCount, items) {
37
- const spliceResult = this.diffTree.SplicePath(path, start, deleteCount, items);
38
- const projectionDiff = this.diffTree.RunProjections();
39
- spliceResult.diffResult = spliceResult.diffResult.concat(projectionDiff);
40
- // spliceResult.diffResult.push(...this.diffTree.RunProjections());
41
- return spliceResult;
42
- }
43
- }