@omnic/widget-locations 1.1.90 → 1.1.91

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.
@@ -22,6 +22,12 @@ interface State {
22
22
  */
23
23
  locationPin: LocationPin;
24
24
  mapKey: string;
25
+ /**
26
+ * Monotonically increasing counter bumped on every `resetSearch()` call.
27
+ * Consumers (e.g. `usePlaceAutocomplete`) subscribe to it to drop their
28
+ * local React state in lock-step with the global reset.
29
+ */
30
+ searchResetEpoch: number;
25
31
  }
26
32
  interface Action {
27
33
  /**
@@ -61,6 +67,15 @@ interface Action {
61
67
  setLocationPinCoordinates(coordinates: Coordinates): void;
62
68
  setMapKey(mapKey: string): void;
63
69
  hideLocationPin(): void;
70
+ /**
71
+ * Wipes every piece of session state that came from the user's selection
72
+ * (search input, pinned location, picked delivery/warehouse point, opened
73
+ * details, opened location aside) and bumps `searchResetEpoch` so that
74
+ * component-local state held in `usePlaceAutocomplete` instances is dropped
75
+ * as well. Map zoom/center, loaded points and filters are intentionally
76
+ * preserved.
77
+ */
78
+ resetSearch(): void;
64
79
  }
65
80
  /**
66
81
  * Selects the delivery address from the state.
@@ -84,5 +99,13 @@ export declare const selectedAddressLocality: (state: State) => google.maps.Geoc
84
99
  * place mutations (map clicks, geocoding, etc.).
85
100
  */
86
101
  export declare const selectLocationPin: (state: State) => LocationPin;
102
+ /**
103
+ * Selects the monotonically increasing search-reset counter.
104
+ *
105
+ * Components/hooks subscribe to this to wipe any local state they hold in
106
+ * sync with a global `resetSearch()` (e.g. when the user navigates away from
107
+ * the map page).
108
+ */
109
+ export declare const selectSearchResetEpoch: (state: State) => number;
87
110
  export declare const useDeliveryAddressStore: import("zustand").UseBoundStore<import("zustand").StoreApi<State & Action>>;
88
111
  export {};