@mapfirst.ai/core 0.0.11 → 0.0.12

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.
package/dist/index.d.mts CHANGED
@@ -348,22 +348,25 @@ type ApiFiltersResponse = Pick<FilterSchema, "amenities" | "hotelStyle" | "price
348
348
  */
349
349
  declare function processApiFilters(apiFilters: ApiFiltersResponse): SmartFilter[];
350
350
  /**
351
- * Converts SmartFilter objects back to API-compatible filter format.
351
+ * Converts filter objects (SmartFilter or React Filter) back to API-compatible filter format.
352
352
  * This is the inverse operation of processApiFilters.
353
+ * Accepts filters with label as string or ReactNode and normalizes them.
353
354
  *
354
- * @param smartFilters - Array of SmartFilter objects
355
- * @returns API-compatible filter object
355
+ * @param filters - Array of filter objects (SmartFilter or React Filter with ReactNode labels)
356
+ * @returns API-compatible SmartFilter array
356
357
  *
357
358
  * @example
358
359
  * ```typescript
359
- * const filters: SmartFilter[] = [
360
+ * const filters = [
360
361
  * { id: "amenity-pool", label: "Pool", type: "amenity", value: "Pool" }
361
362
  * ];
362
363
  * const apiFilters = convertToApiFilters(filters);
363
- * // apiFilters will contain { amenities: ["Pool"] }
364
+ * // apiFilters will contain normalized SmartFilter objects
364
365
  * ```
365
366
  */
366
- declare function convertToApiFilters(smartFilters: SmartFilter[]): SmartFilter[];
367
+ declare function convertToApiFilters(filters: Array<Omit<SmartFilter, "label"> & {
368
+ label: string | React.ReactNode | any;
369
+ }>): SmartFilter[];
367
370
 
368
371
  type Environment = "prod" | "test";
369
372
  declare class PropertiesFetchError extends Error {
package/dist/index.d.ts CHANGED
@@ -348,22 +348,25 @@ type ApiFiltersResponse = Pick<FilterSchema, "amenities" | "hotelStyle" | "price
348
348
  */
349
349
  declare function processApiFilters(apiFilters: ApiFiltersResponse): SmartFilter[];
350
350
  /**
351
- * Converts SmartFilter objects back to API-compatible filter format.
351
+ * Converts filter objects (SmartFilter or React Filter) back to API-compatible filter format.
352
352
  * This is the inverse operation of processApiFilters.
353
+ * Accepts filters with label as string or ReactNode and normalizes them.
353
354
  *
354
- * @param smartFilters - Array of SmartFilter objects
355
- * @returns API-compatible filter object
355
+ * @param filters - Array of filter objects (SmartFilter or React Filter with ReactNode labels)
356
+ * @returns API-compatible SmartFilter array
356
357
  *
357
358
  * @example
358
359
  * ```typescript
359
- * const filters: SmartFilter[] = [
360
+ * const filters = [
360
361
  * { id: "amenity-pool", label: "Pool", type: "amenity", value: "Pool" }
361
362
  * ];
362
363
  * const apiFilters = convertToApiFilters(filters);
363
- * // apiFilters will contain { amenities: ["Pool"] }
364
+ * // apiFilters will contain normalized SmartFilter objects
364
365
  * ```
365
366
  */
366
- declare function convertToApiFilters(smartFilters: SmartFilter[]): SmartFilter[];
367
+ declare function convertToApiFilters(filters: Array<Omit<SmartFilter, "label"> & {
368
+ label: string | React.ReactNode | any;
369
+ }>): SmartFilter[];
367
370
 
368
371
  type Environment = "prod" | "test";
369
372
  declare class PropertiesFetchError extends Error {