treege 3.0.0-beta.79 → 3.0.0-beta.80

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.
@@ -0,0 +1,18 @@
1
+ import { Flow } from '../../shared/types/node';
2
+ /**
3
+ * Returns a copy of `data` keeping only the entries that carry information:
4
+ * everything that is neither empty (see `isEmptyValue`) nor a redundant field
5
+ * default (see `DEFAULT_DATA_VALUES`). Meaningful falsy values like `false` and
6
+ * `0` are kept. Used before persisting an input node's form so toggling a single
7
+ * field doesn't flood the node — and the exported JSON — with empty defaults.
8
+ */
9
+ export declare const cleanEmptyData: (data: Record<string, unknown>) => Record<string, unknown>;
10
+ /**
11
+ * Returns a copy of the flow trimmed for export: every node's `data` is cleaned
12
+ * of empty values and field defaults (see `cleanEmptyData`), and transient
13
+ * editor UI state is dropped — nodes lose `selected`/`dragging`/`measured` and
14
+ * edges lose `selected`, all of which xyflow recomputes on mount. The input flow
15
+ * is never mutated, so the live editor canvas keeps its values — only the
16
+ * exported/saved artifact is trimmed, mirroring `stripSensitiveHeadersFromFlow`.
17
+ */
18
+ export declare const cleanFlowData: (flow: Flow) => Flow;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Returns a copy of `data` with config blocks that don't belong to `subType`
3
- * removed. Pure returns the same reference when nothing is dropped.
2
+ * Returns a copy of `data` keeping only the config blocks that belong to
3
+ * `subType` (non-config keys are always kept).
4
4
  */
5
- export declare const cleanConfigForSubType: <T extends Record<string, unknown>>(data: T, subType: string) => T;
5
+ export declare const cleanConfigForSubType: (data: Record<string, unknown>, subType: string) => Record<string, unknown>;