@react-querybuilder/core 8.22.2 → 8.22.4

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.
@@ -5893,6 +5893,50 @@ declare class QueryManager<RG extends RuleGroupTypeAny = RuleGroupType, F extend
5893
5893
  * `targetPathOrID` and `sourcePathOrID`.
5894
5894
  */
5895
5895
  group(sourcePathOrID: Path | string, targetPathOrID: Path | string, options?: GroupOptions & StrictOptions): this;
5896
+ /**
5897
+ * The options currently in effect, as a frozen shallow copy. Reflects everything applied by
5898
+ * the constructor and any subsequent {@link QueryManager.reconfigure} calls, but not the
5899
+ * defaults filled in for options that were never provided.
5900
+ */
5901
+ getOptions(): Readonly<QueryManagerOptions<F, O, C>>;
5902
+ /**
5903
+ * Updates the manager's configuration in place, keeping the current query, the undo/redo
5904
+ * history, and every subscriber. Use this to propagate new `translations`, `fields`,
5905
+ * `operators`, and so on without discarding state:
5906
+ *
5907
+ * ```ts
5908
+ * q.reconfigure({ translations: { fields: { placeholderLabel: 'Choisir un champ' } } });
5909
+ * ```
5910
+ *
5911
+ * The incoming options are shallow-merged over the current ones, so keys left out are
5912
+ * preserved. Passing a key explicitly as `undefined` resets it to its default. Object-valued
5913
+ * options like `translations` are replaced wholesale rather than deep-merged — spread the
5914
+ * current value in yourself to patch one key. Pass `{ replace: true }` to discard the
5915
+ * existing options entirely and start from the incoming set.
5916
+ *
5917
+ * The query is never rewritten, even when the new options no longer describe it: a rule whose
5918
+ * `field` is not in the new `fields` list is left as-is. Call
5919
+ * {@link QueryManager.validate validate} to detect that, or `setQuery(getQuery())` to
5920
+ * re-normalize.
5921
+ *
5922
+ * History options are honored immediately: lowering `maxHistory` trims the undo stack, and
5923
+ * turning history off clears both stacks. Subscribers are notified once, and
5924
+ * {@link QueryManager.getConfigVersion} is incremented, even inside a
5925
+ * {@link QueryManager.batch batch} — configuration is not part of a batch's rollback.
5926
+ */
5927
+ reconfigure(options: Partial<QueryManagerOptions<F, O, C>>, config?: {
5928
+ replace?: boolean;
5929
+ }): this;
5930
+ /**
5931
+ * A counter incremented by every {@link QueryManager.reconfigure} call. Because reconfiguring
5932
+ * leaves the query object untouched, subscribers that compare query identity alone cannot see
5933
+ * it; this provides a snapshot that does change.
5934
+ *
5935
+ * Bound to the instance, so it can be passed directly to `useSyncExternalStore` alongside
5936
+ * {@link QueryManager.subscribe}. The `useQueryManager` hook from `react-querybuilder`
5937
+ * already does this.
5938
+ */
5939
+ getConfigVersion: () => number;
5896
5940
  /**
5897
5941
  * Creates an independent manager with the same configuration and the current query.
5898
5942
  *