@garagem-ai/site-sdk 0.7.0 → 0.9.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.
- package/README.md +329 -31
- package/dist/index.d.mts +305 -44
- package/dist/index.d.ts +305 -44
- package/dist/index.js +1282 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1233 -34
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +29 -2
- package/dist/react.d.ts +29 -2
- package/dist/react.js +639 -26
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +638 -26
- package/dist/react.mjs.map +1 -1
- package/dist/{types-photo-search-OeONNDxl.d.mts → types-photo-search-D88oevZv.d.mts} +400 -1
- package/dist/{types-photo-search-OeONNDxl.d.ts → types-photo-search-D88oevZv.d.ts} +400 -1
- package/package.json +1 -1
- package/src/client.ts +23 -0
- package/src/fetchers-photos.ts +98 -0
- package/src/fetchers.ts +96 -30
- package/src/index.ts +120 -2
- package/src/internal/sdk-http.ts +122 -0
- package/src/leads.ts +34 -3
- package/src/listing-photos.ts +312 -0
- package/src/map-search.ts +487 -0
- package/src/maps.ts +743 -0
- package/src/react/index.ts +2 -0
- package/src/react/types.ts +5 -0
- package/src/react/use-map-search.ts +101 -0
- package/src/react/use-public-search.ts +23 -5
- package/src/resolve-site-id.ts +3 -0
- package/src/studio-contract.ts +120 -0
- package/src/types-maps.ts +275 -0
- package/src/types-photos.ts +46 -0
- package/src/types.ts +23 -0
|
@@ -49,9 +49,20 @@ interface ListingMedia {
|
|
|
49
49
|
type: string;
|
|
50
50
|
category: string;
|
|
51
51
|
src: string;
|
|
52
|
+
/** Caption-based alt for photos with analysis; generic `"<title> - Foto N"` otherwise. */
|
|
52
53
|
alt?: string;
|
|
54
|
+
/** AI caption, falling back to the broker description. Photos only; absent when unanalyzed. */
|
|
53
55
|
caption?: string;
|
|
54
56
|
order?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Room the photo shows, free text from the analysis (`sala`, `quarto`,
|
|
59
|
+
* `cozinha`, …). Group with `listingPhotoGroups`.
|
|
60
|
+
*/
|
|
61
|
+
roomType?: string;
|
|
62
|
+
/** `interior` | `facade` | `building_exterior` | `amenity` | `view` | `floorplan` | `other`. */
|
|
63
|
+
sceneType?: string;
|
|
64
|
+
/** Visual highlights named for this photo. Aggregate with `listingVisualHighlights`. */
|
|
65
|
+
features?: string[];
|
|
55
66
|
}
|
|
56
67
|
/**
|
|
57
68
|
* Minimum information needed to render a listing on a grid or card.
|
|
@@ -268,6 +279,18 @@ interface QueryListingsParams {
|
|
|
268
279
|
q?: string;
|
|
269
280
|
filters?: QueryListingsFilters;
|
|
270
281
|
location?: QueryListingsLocation | QueryListingsLocation[];
|
|
282
|
+
/**
|
|
283
|
+
* Map viewport. The server builds a `coordinates:(…)` polygon from these
|
|
284
|
+
* numbers. Ignored when `polygon` is also set.
|
|
285
|
+
*/
|
|
286
|
+
bounds?: {
|
|
287
|
+
north: number;
|
|
288
|
+
south: number;
|
|
289
|
+
east: number;
|
|
290
|
+
west: number;
|
|
291
|
+
};
|
|
292
|
+
/** Drawn area as `[lat, lng]` pairs, not GeoJSON `[lng, lat]`. */
|
|
293
|
+
polygon?: Array<[number, number]>;
|
|
271
294
|
}
|
|
272
295
|
interface QueryListingsResult {
|
|
273
296
|
listings: Listing[];
|
|
@@ -409,6 +432,11 @@ interface BaseOptions {
|
|
|
409
432
|
* understand them.
|
|
410
433
|
*/
|
|
411
434
|
next?: RequestNextOptions;
|
|
435
|
+
/**
|
|
436
|
+
* Site publishable key (`pk_live_…`) from Configurações → Sites → API
|
|
437
|
+
* pública. Not a secret. Omit it and the request stays anonymous.
|
|
438
|
+
*/
|
|
439
|
+
publishableKey?: string;
|
|
412
440
|
}
|
|
413
441
|
interface GetListingsOptions extends BaseOptions {
|
|
414
442
|
siteId: string;
|
|
@@ -434,6 +462,8 @@ interface GetSearchUiOptions extends BaseOptions {
|
|
|
434
462
|
interface QueryListingsOptions extends BaseOptions {
|
|
435
463
|
siteId: string;
|
|
436
464
|
params?: QueryListingsParams;
|
|
465
|
+
/** Aborts the listings request. Stale map pans use this. */
|
|
466
|
+
signal?: AbortSignal;
|
|
437
467
|
}
|
|
438
468
|
interface GetSimilarListingsOptions extends BaseOptions {
|
|
439
469
|
siteId: string;
|
|
@@ -463,9 +493,18 @@ interface GetCmsEntryOptions extends BaseOptions {
|
|
|
463
493
|
declare class GaragemSdkError extends Error {
|
|
464
494
|
readonly status: number;
|
|
465
495
|
readonly url: string;
|
|
496
|
+
/** Machine reason from the JSON body (`invalid_publishable_key`, `rate_limited`, …). */
|
|
497
|
+
readonly reason: string | null;
|
|
498
|
+
/**
|
|
499
|
+
* Seconds to wait before retrying. Set on HTTP 429 from `Retry-After`
|
|
500
|
+
* or the body's `retryAfterSeconds`. `null` when the response has neither.
|
|
501
|
+
*/
|
|
502
|
+
readonly retryAfter: number | null;
|
|
466
503
|
constructor(message: string, info: {
|
|
467
504
|
status: number;
|
|
468
505
|
url: string;
|
|
506
|
+
reason?: string | null;
|
|
507
|
+
retryAfter?: number | null;
|
|
469
508
|
});
|
|
470
509
|
}
|
|
471
510
|
/**
|
|
@@ -543,6 +582,46 @@ declare function getCmsEntries(options: GetCmsEntriesOptions): Promise<CmsEntrie
|
|
|
543
582
|
/** Fetch one published CMS entry by slug. */
|
|
544
583
|
declare function getCmsEntry(options: GetCmsEntryOptions): Promise<CmsEntry>;
|
|
545
584
|
|
|
585
|
+
/** Fields every listing card must have — no JSX. */
|
|
586
|
+
type ListingCardModel = {
|
|
587
|
+
href: string;
|
|
588
|
+
title: string;
|
|
589
|
+
businessType: ListingBusinessType;
|
|
590
|
+
businessLabel: string;
|
|
591
|
+
priceVisibility: ListingPriceVisibility;
|
|
592
|
+
price: number | null;
|
|
593
|
+
priceLabel: string;
|
|
594
|
+
pricePeriod: string | null;
|
|
595
|
+
locationLabel: string;
|
|
596
|
+
propertyType: string | null;
|
|
597
|
+
coverSrc: string | null;
|
|
598
|
+
coverAlt: string;
|
|
599
|
+
bedrooms: number | null;
|
|
600
|
+
bathrooms: number | null;
|
|
601
|
+
parkingSpaces: number | null;
|
|
602
|
+
areaM2: number | null;
|
|
603
|
+
};
|
|
604
|
+
declare function listingLocationLabel(location: {
|
|
605
|
+
neighborhood?: string | null;
|
|
606
|
+
city?: string | null;
|
|
607
|
+
state?: string | null;
|
|
608
|
+
}): string;
|
|
609
|
+
declare function toListingCardModel(listing: Pick<Listing, "id" | "listingCode" | "path" | "title" | "businessType" | "price" | "currency" | "priceVisibility" | "coverImage"> & {
|
|
610
|
+
property?: {
|
|
611
|
+
type?: string | null;
|
|
612
|
+
bedrooms?: number | null;
|
|
613
|
+
bathrooms?: number | null;
|
|
614
|
+
parkingSpaces?: number | null;
|
|
615
|
+
usableArea?: number | null;
|
|
616
|
+
totalArea?: number | null;
|
|
617
|
+
};
|
|
618
|
+
location?: {
|
|
619
|
+
neighborhood?: string | null;
|
|
620
|
+
city?: string | null;
|
|
621
|
+
state?: string | null;
|
|
622
|
+
};
|
|
623
|
+
}): ListingCardModel;
|
|
624
|
+
|
|
546
625
|
/** Query keys that must never encode filters (Editor/Studio path contract). */
|
|
547
626
|
declare const FORBIDDEN_SEARCH_QUERY_KEYS: readonly ["tipo", "quartos", "tipo-imovel", "banheiros", "vagas"];
|
|
548
627
|
/** Default option: omit `ordenar` (API has no relevance token). */
|
|
@@ -624,6 +703,326 @@ type SearchChromeModel = {
|
|
|
624
703
|
};
|
|
625
704
|
declare function searchChromeModel(schema: SearchUi | null, pathFilters: SearchPathFilters, locationNames?: LocationNameTables | null): SearchChromeModel;
|
|
626
705
|
|
|
706
|
+
/**
|
|
707
|
+
* Types for the maps.fndn.ai helpers (`./maps`). Everything here works on
|
|
708
|
+
* the coordinates the public listings API already returns — those are
|
|
709
|
+
* masked per site (≈100 m by default) and the helpers never add precision.
|
|
710
|
+
*/
|
|
711
|
+
|
|
712
|
+
/** `{ lat, lng }` pair as returned on `listing.location.coordinates`. */
|
|
713
|
+
interface MapsCoordinates {
|
|
714
|
+
lat: number;
|
|
715
|
+
lng: number;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Anything carrying a public listing location: `Listing`, `ListingDetail`,
|
|
719
|
+
* a card model, or a bare `{ location: { coordinates } }`.
|
|
720
|
+
*/
|
|
721
|
+
type ListingWithLocation = {
|
|
722
|
+
location?: {
|
|
723
|
+
coordinates?: MapsCoordinates | null;
|
|
724
|
+
} | null;
|
|
725
|
+
} | null | undefined;
|
|
726
|
+
interface MapsBaseOptions {
|
|
727
|
+
/** maps.fndn.ai origin. Defaults to `https://maps.fndn.ai`. */
|
|
728
|
+
mapsBaseUrl?: string;
|
|
729
|
+
/**
|
|
730
|
+
* Site id (or publishable key) used to meter this site's usage on
|
|
731
|
+
* maps.fndn.ai. Sent as the `site` query param on image URLs and as the
|
|
732
|
+
* `X-Garagem-Site` header on fetches. Optional today; it only labels
|
|
733
|
+
* metrics and the per-site rate limit, it is not authentication.
|
|
734
|
+
*/
|
|
735
|
+
siteId?: string;
|
|
736
|
+
}
|
|
737
|
+
interface MapsFetchOptions extends MapsBaseOptions {
|
|
738
|
+
/** Override the fetch implementation (testing, edge runtimes, retries). */
|
|
739
|
+
fetch?: FetchLike;
|
|
740
|
+
}
|
|
741
|
+
/** Google Static Maps map type. `style` is the SDK-facing alias. */
|
|
742
|
+
type StaticMapStyle = "roadmap" | "satellite" | "terrain" | "hybrid";
|
|
743
|
+
interface StaticMapOptions extends MapsBaseOptions {
|
|
744
|
+
/** Pixels, 1–640 (Google Static Maps ceiling). Default 600. */
|
|
745
|
+
width?: number;
|
|
746
|
+
/** Pixels, 1–640. Default 300. */
|
|
747
|
+
height?: number;
|
|
748
|
+
/**
|
|
749
|
+
* 1–21. Default 15. Capped by the coordinate precision the API applied:
|
|
750
|
+
* a ≈100 m masked point is never rendered above zoom 16, so the pin does
|
|
751
|
+
* not pretend to know the exact building. See `maxZoomForCoordinates`.
|
|
752
|
+
*/
|
|
753
|
+
zoom?: number;
|
|
754
|
+
/** 1 or 2 (retina). Default 2. */
|
|
755
|
+
scale?: 1 | 2;
|
|
756
|
+
/** Map style. Default roadmap. */
|
|
757
|
+
style?: StaticMapStyle;
|
|
758
|
+
/** Marker color (Google color name or `0xRRGGBB`). Default red. */
|
|
759
|
+
markerColor?: string;
|
|
760
|
+
/** Hide points of interest. Default false. */
|
|
761
|
+
hidePoi?: boolean;
|
|
762
|
+
/**
|
|
763
|
+
* Max decimal places to send. Only ever *reduces* precision (e.g. send
|
|
764
|
+
* 2 decimals ≈ 1 km for a neighbourhood teaser); it cannot recover
|
|
765
|
+
* precision the API removed.
|
|
766
|
+
*/
|
|
767
|
+
maxDecimals?: number;
|
|
768
|
+
}
|
|
769
|
+
interface StreetViewOptions extends MapsBaseOptions {
|
|
770
|
+
/** Pixels, 1–640. Default 640. */
|
|
771
|
+
width?: number;
|
|
772
|
+
/** Pixels, 1–640. Default 640. */
|
|
773
|
+
height?: number;
|
|
774
|
+
/** Field of view in degrees, 10–120. Default 90. */
|
|
775
|
+
fov?: number;
|
|
776
|
+
/** Compass heading 0–360. Default 0. */
|
|
777
|
+
heading?: number;
|
|
778
|
+
/** Camera pitch -90–90. Default 10. */
|
|
779
|
+
pitch?: number;
|
|
780
|
+
/** See `StaticMapOptions.maxDecimals`. */
|
|
781
|
+
maxDecimals?: number;
|
|
782
|
+
}
|
|
783
|
+
interface StreetViewAvailabilityOptions extends MapsFetchOptions {
|
|
784
|
+
/** See `StaticMapOptions.maxDecimals`. */
|
|
785
|
+
maxDecimals?: number;
|
|
786
|
+
}
|
|
787
|
+
interface StreetViewAvailability {
|
|
788
|
+
/** `true` when Google has a panorama near the (masked) coordinates. */
|
|
789
|
+
available: boolean;
|
|
790
|
+
/** Google metadata status: `OK`, `ZERO_RESULTS`, `ERROR`, … */
|
|
791
|
+
status: string;
|
|
792
|
+
/** Panorama id when available. */
|
|
793
|
+
panoId?: string;
|
|
794
|
+
/** Capture date (`YYYY-MM`) when available. */
|
|
795
|
+
date?: string;
|
|
796
|
+
/** maps.fndn.ai metadata URL that was queried. */
|
|
797
|
+
url: string;
|
|
798
|
+
}
|
|
799
|
+
/** Cities with boundary layers on maps.fndn.ai. Other slugs pass through. */
|
|
800
|
+
type BoundaryCity = "sao_paulo" | "rio_de_janeiro" | (string & {});
|
|
801
|
+
type BoundaryLayerUrlKind =
|
|
802
|
+
/** `GET /v1/layers/:id` — layer descriptor JSON. */
|
|
803
|
+
"layer"
|
|
804
|
+
/** TileJSON for MapLibre `addSource({ type: "vector", url })`. */
|
|
805
|
+
| "tilejson"
|
|
806
|
+
/** `{z}/{x}/{y}` vector tile template. */
|
|
807
|
+
| "tiles"
|
|
808
|
+
/** Whole-city GeoJSON FeatureCollection. */
|
|
809
|
+
| "geojson";
|
|
810
|
+
interface BoundaryLayerOptions extends MapsBaseOptions {
|
|
811
|
+
kind?: BoundaryLayerUrlKind;
|
|
812
|
+
}
|
|
813
|
+
interface BoundarySourceLayer {
|
|
814
|
+
id: string;
|
|
815
|
+
label: string;
|
|
816
|
+
minzoom?: number;
|
|
817
|
+
maxzoom?: number;
|
|
818
|
+
}
|
|
819
|
+
/** Subset of the maps.fndn.ai `/v1/layers/:id` descriptor the SDK exposes. */
|
|
820
|
+
interface BoundaryLayer {
|
|
821
|
+
id: string;
|
|
822
|
+
name: string;
|
|
823
|
+
description: string;
|
|
824
|
+
city?: string;
|
|
825
|
+
/** `{z}/{x}/{y}` template. */
|
|
826
|
+
tiles: string;
|
|
827
|
+
tilejson: string;
|
|
828
|
+
/** Whole-city GeoJSON, when published. */
|
|
829
|
+
geojson?: string;
|
|
830
|
+
sourceLayers: BoundarySourceLayer[];
|
|
831
|
+
minzoom: number;
|
|
832
|
+
maxzoom: number;
|
|
833
|
+
attribution?: string;
|
|
834
|
+
available: boolean;
|
|
835
|
+
}
|
|
836
|
+
/** Minimal GeoJSON shapes so the SDK does not depend on `@types/geojson`. */
|
|
837
|
+
interface BoundaryGeometry {
|
|
838
|
+
type: string;
|
|
839
|
+
coordinates: unknown;
|
|
840
|
+
}
|
|
841
|
+
interface BoundaryFeature {
|
|
842
|
+
type: "Feature";
|
|
843
|
+
properties: Record<string, unknown> & {
|
|
844
|
+
name?: string;
|
|
845
|
+
level?: string;
|
|
846
|
+
};
|
|
847
|
+
geometry: BoundaryGeometry | null;
|
|
848
|
+
[key: string]: unknown;
|
|
849
|
+
}
|
|
850
|
+
interface BoundaryFeatureCollection {
|
|
851
|
+
type: "FeatureCollection";
|
|
852
|
+
features: BoundaryFeature[];
|
|
853
|
+
count?: number;
|
|
854
|
+
source?: string;
|
|
855
|
+
}
|
|
856
|
+
interface NeighborhoodBoundaryOptions extends MapsFetchOptions {
|
|
857
|
+
/**
|
|
858
|
+
* Boundary dataset. Default `listaaberta` (SP districts / RJ
|
|
859
|
+
* neighbourhoods with IPTU stats); `osm` covers more cities.
|
|
860
|
+
*/
|
|
861
|
+
source?: "listaaberta" | "osm" | "all";
|
|
862
|
+
}
|
|
863
|
+
interface NeighborhoodBoundary {
|
|
864
|
+
city: string;
|
|
865
|
+
neighborhood: string;
|
|
866
|
+
/** The matched outline, or `null` when nothing matched. */
|
|
867
|
+
feature: BoundaryFeature | null;
|
|
868
|
+
/** Every candidate when the name matched more than one feature. */
|
|
869
|
+
candidates: BoundaryFeature[];
|
|
870
|
+
/** GeoJSON URL that was queried (safe to pass to MapLibre `data`). */
|
|
871
|
+
url: string;
|
|
872
|
+
/** Vector tile template for the city's boundary layer. */
|
|
873
|
+
tiles: string;
|
|
874
|
+
}
|
|
875
|
+
type TravelMode = "driving" | "walking" | "bicycling" | "transit";
|
|
876
|
+
/** Coordinates, or a free-text address geocoded on maps.fndn.ai first. */
|
|
877
|
+
type TravelDestination = MapsCoordinates | string;
|
|
878
|
+
interface TravelTimeOptions extends MapsFetchOptions {
|
|
879
|
+
/** Default `driving`. */
|
|
880
|
+
mode?: TravelMode;
|
|
881
|
+
/** Client-side cache. Defaults to a module-level LRU; pass `null` to skip. */
|
|
882
|
+
cache?: TravelTimeCache | null;
|
|
883
|
+
/** See `StaticMapOptions.maxDecimals`. */
|
|
884
|
+
maxDecimals?: number;
|
|
885
|
+
}
|
|
886
|
+
interface TravelTime {
|
|
887
|
+
/** Rounded travel time in minutes (minimum 1 when a route exists). */
|
|
888
|
+
minutes: number;
|
|
889
|
+
seconds: number;
|
|
890
|
+
distanceMeters: number;
|
|
891
|
+
/** Distance rounded to one decimal. */
|
|
892
|
+
distanceKm: number;
|
|
893
|
+
mode: TravelMode;
|
|
894
|
+
origin: MapsCoordinates;
|
|
895
|
+
destination: MapsCoordinates;
|
|
896
|
+
/** `true` when served from the client-side cache. */
|
|
897
|
+
cached: boolean;
|
|
898
|
+
}
|
|
899
|
+
interface TravelTimesOptions extends MapsFetchOptions {
|
|
900
|
+
/** See `StaticMapOptions.maxDecimals`. */
|
|
901
|
+
maxDecimals?: number;
|
|
902
|
+
}
|
|
903
|
+
/** One route-matrix element; `null` when Google found no route. */
|
|
904
|
+
interface TravelTimeElement {
|
|
905
|
+
minutes: number;
|
|
906
|
+
seconds: number;
|
|
907
|
+
destination: MapsCoordinates;
|
|
908
|
+
}
|
|
909
|
+
interface TravelTimeCacheOptions {
|
|
910
|
+
/** Default 200 entries. */
|
|
911
|
+
maxEntries?: number;
|
|
912
|
+
/** Default 15 minutes. */
|
|
913
|
+
ttlMs?: number;
|
|
914
|
+
}
|
|
915
|
+
interface TravelTimeCache {
|
|
916
|
+
get(key: string): TravelTime | undefined;
|
|
917
|
+
set(key: string, value: TravelTime): void;
|
|
918
|
+
clear(): void;
|
|
919
|
+
readonly size: number;
|
|
920
|
+
}
|
|
921
|
+
/** Viewport rectangle in degrees. `east` must be greater than `west`. */
|
|
922
|
+
interface MapBounds {
|
|
923
|
+
north: number;
|
|
924
|
+
south: number;
|
|
925
|
+
east: number;
|
|
926
|
+
west: number;
|
|
927
|
+
}
|
|
928
|
+
/** `[lat, lng]` vertices. Not GeoJSON `[lng, lat]`. */
|
|
929
|
+
type MapPolygon = Array<[number, number]>;
|
|
930
|
+
/** Pin plotted from a public listing. Coordinates are already masked. */
|
|
931
|
+
interface MapPin {
|
|
932
|
+
id: string;
|
|
933
|
+
lat: number;
|
|
934
|
+
lng: number;
|
|
935
|
+
price: number | null;
|
|
936
|
+
coverImage: string | null;
|
|
937
|
+
}
|
|
938
|
+
/** One grid cell. `count === 1` keeps the pin's own coordinates. */
|
|
939
|
+
interface MapPinCluster {
|
|
940
|
+
id: string;
|
|
941
|
+
lat: number;
|
|
942
|
+
lng: number;
|
|
943
|
+
count: number;
|
|
944
|
+
pinIds: string[];
|
|
945
|
+
pin: MapPin | null;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Map search on top of the friendly public listings route.
|
|
950
|
+
*
|
|
951
|
+
* Bounds and polygons are structured numbers. The server (see
|
|
952
|
+
* `@garagem/site-search` `map-geo.ts`) turns them into one allowlisted
|
|
953
|
+
* `coordinates:(…)` clause. This module never sends `filter_by`,
|
|
954
|
+
* `vector_query`, or `nl_query`.
|
|
955
|
+
*
|
|
956
|
+
* Pins copy `listing.location.coordinates` as the API returned them.
|
|
957
|
+
* Those values are already masked. Nothing here adds precision.
|
|
958
|
+
*/
|
|
959
|
+
|
|
960
|
+
/** Matches `FRIENDLY_SEARCH_MAX_LIMIT` on the public listings route. */
|
|
961
|
+
declare const MAP_SEARCH_MAX_PAGE_SIZE = 100;
|
|
962
|
+
declare const MAP_SEARCH_DEFAULT_PAGE_SIZE = 100;
|
|
963
|
+
/** Same pause Foundation's `/imoveis` map uses before a viewport search. */
|
|
964
|
+
declare const MAP_VIEWPORT_DEBOUNCE_MS = 400;
|
|
965
|
+
/** Keep aligned with `MAP_GEO_MAX_VERTICES` in `@garagem/site-search`. */
|
|
966
|
+
declare const MAP_POLYGON_MAX_VERTICES = 64;
|
|
967
|
+
interface MapSearchRequest {
|
|
968
|
+
baseUrl?: string;
|
|
969
|
+
fetch?: FetchLike;
|
|
970
|
+
signal?: AbortSignal;
|
|
971
|
+
/**
|
|
972
|
+
* Same `pk_live_…` as `queryListings`. Without it the viewport search
|
|
973
|
+
* spends the anonymous listings budget.
|
|
974
|
+
*/
|
|
975
|
+
publishableKey?: string;
|
|
976
|
+
/** Next.js fetch cache hints, forwarded to `queryListings`. */
|
|
977
|
+
next?: RequestNextOptions;
|
|
978
|
+
/** Friendly list query. A moved map must keep these, not only `filters`. */
|
|
979
|
+
q?: string;
|
|
980
|
+
sort?: string;
|
|
981
|
+
location?: QueryListingsParams["location"];
|
|
982
|
+
filters?: QueryListingsFilters;
|
|
983
|
+
page?: number;
|
|
984
|
+
pageSize?: number;
|
|
985
|
+
/** Client hint for `clusterPins`. Not sent to the server. */
|
|
986
|
+
zoom?: number;
|
|
987
|
+
}
|
|
988
|
+
interface MapBoundsSearchOptions extends MapSearchRequest {
|
|
989
|
+
bounds: MapBounds;
|
|
990
|
+
}
|
|
991
|
+
interface MapPolygonSearchOptions extends MapSearchRequest {
|
|
992
|
+
polygon: MapPolygon;
|
|
993
|
+
}
|
|
994
|
+
interface MapSearchResult {
|
|
995
|
+
pins: MapPin[];
|
|
996
|
+
cards: ListingCardModel[];
|
|
997
|
+
listings: Listing[];
|
|
998
|
+
page: number;
|
|
999
|
+
pageSize: number;
|
|
1000
|
+
total: number;
|
|
1001
|
+
totalPages: number;
|
|
1002
|
+
}
|
|
1003
|
+
interface MapSearchSubscription extends MapSearchRequest {
|
|
1004
|
+
siteId: string;
|
|
1005
|
+
bounds?: MapBounds | null;
|
|
1006
|
+
polygon?: MapPolygon | null;
|
|
1007
|
+
}
|
|
1008
|
+
declare function capMapPageSize(value: number | undefined): number;
|
|
1009
|
+
declare function capMapPage(value: number | undefined): number;
|
|
1010
|
+
/** Rectangle the server will accept. `false` when it crosses the antimeridian. */
|
|
1011
|
+
declare function isMapBounds(bounds: MapBounds | null | undefined): bounds is MapBounds;
|
|
1012
|
+
declare function isMapPolygon(polygon: MapPolygon | null | undefined): polygon is MapPolygon;
|
|
1013
|
+
/** Pins from public listings. Coordinates are copied, never sharpened. */
|
|
1014
|
+
declare function mapSearchPins(listings: readonly Listing[]): MapPin[];
|
|
1015
|
+
declare function searchListingsInBounds(siteId: string, options: MapBoundsSearchOptions): Promise<MapSearchResult>;
|
|
1016
|
+
declare function searchListingsInPolygon(siteId: string, options: MapPolygonSearchOptions): Promise<MapSearchResult>;
|
|
1017
|
+
/** Degrees per grid cell: a quarter of one world tile at this zoom. */
|
|
1018
|
+
declare function mapClusterCellDegrees(zoom: number): number;
|
|
1019
|
+
/**
|
|
1020
|
+
* Headless grid cluster. A cell with one pin keeps that pin's coordinates.
|
|
1021
|
+
* A group centroid is rounded back to the coarsest member so clustering
|
|
1022
|
+
* cannot invent extra decimals.
|
|
1023
|
+
*/
|
|
1024
|
+
declare function clusterPins(pins: readonly MapPin[], zoom: number): MapPinCluster[];
|
|
1025
|
+
|
|
627
1026
|
/**
|
|
628
1027
|
* "Busca pelo que as fotos mostram": search a site's catalog by what the
|
|
629
1028
|
* public photos show (`GET /api/sites/{siteId}/search/photos`).
|
|
@@ -674,4 +1073,4 @@ type ListingWithMatchedPhoto = Listing & {
|
|
|
674
1073
|
matchedPhoto: MatchedListingPhoto | null;
|
|
675
1074
|
};
|
|
676
1075
|
|
|
677
|
-
export { type
|
|
1076
|
+
export { type CmsEntryStatus as $, type AppliedSearchQuery as A, type BoundaryCity as B, type CmsCollection as C, type TravelMode as D, type TravelTimeOptions as E, type FetchLike as F, type TravelTime as G, type TravelTimesOptions as H, type TravelTimeElement as I, type Listing as J, type PhotoSearchResult as K, type ListingDetail as L, type MapsCoordinates as M, type NeighborhoodBoundaryOptions as N, type PhotoSearchItem as O, type PhotoSearchParams as P, type QueryListingsFilters as Q, type RequestNextOptions as R, type SearchPathFilters as S, type TravelTimeCacheOptions as T, type ListingWithMatchedPhoto as U, type MatchedListingPhoto as V, type BoundaryFeature as W, type BoundaryFeatureCollection as X, type BoundaryGeometry as Y, type BoundaryLayerUrlKind as Z, type BoundarySourceLayer as _, type ListingLocation as a, hrefWithExplicitPage as a$, type CmsFieldDefinition as a0, type CmsFieldType as a1, type CmsSeoData as a2, FORBIDDEN_SEARCH_QUERY_KEYS as a3, GaragemSdkError as a4, type GetCmsCollectionOptions as a5, type GetCmsCollectionsOptions as a6, type GetCmsEntriesOptions as a7, type GetCmsEntryOptions as a8, type GetListingOptions as a9, type SearchListingsOptions as aA, type SearchPathLocation as aB, type SearchUiFilter as aC, type SearchUiOption as aD, type StaticMapStyle as aE, TOOLBAR_PRIMARY_FILTER_IDS as aF, applyPathFilter as aG, buildQueryListingsParams as aH, canonicalizeSearchHref as aI, capMapPage as aJ, capMapPageSize as aK, clearStagedPathFilters as aL, clusterPins as aM, countFacetChoices as aN, countOptionLabel as aO, displayPathLocation as aP, getCmsCollection as aQ, getCmsCollections as aR, getCmsEntries as aS, getCmsEntry as aT, getListing as aU, getListings as aV, getSearchUi as aW, getSimilarListings as aX, getSite as aY, hrefForAppliedChange as aZ, hrefForPathFilters as a_, type GetListingsOptions as aa, type GetSearchUiOptions as ab, type GetSimilarListingsOptions as ac, type GetSiteOptions as ad, type ListingBusinessType as ae, type ListingCardModel as af, type ListingPriceVisibility as ag, type ListingPropertySummary as ah, type LocationNameTables as ai, MAP_POLYGON_MAX_VERTICES as aj, MAP_SEARCH_DEFAULT_PAGE_SIZE as ak, MAP_SEARCH_MAX_PAGE_SIZE as al, MAP_VIEWPORT_DEBOUNCE_MS as am, type MapBounds as an, type MapBoundsSearchOptions as ao, type MapPin as ap, type MapPinCluster as aq, type MapPolygon as ar, type MapPolygonSearchOptions as as, type MapSearchResult as at, type MapsBaseOptions as au, type QueryListingsLocation as av, type QueryListingsOptions as aw, SEARCH_EMPTY_COPY as ax, SEARCH_SORT_RELEVANCE as ay, type SearchChromeModel as az, type ListingMedia as b, isListingDetailPath as b0, isMapBounds as b1, isMapPolygon as b2, listingLocationLabel as b3, mapClusterCellDegrees as b4, mapSearchPins as b5, paginationPages as b6, pathFilterHasOption as b7, pathFilterValue as b8, publicSearchHref as b9, queryListings as ba, rangeDraftFromPath as bb, readPublicSearch as bc, searchChromeModel as bd, searchHrefUsesLegacyFilterQuery as be, searchListings as bf, searchListingsInBounds as bg, searchListingsInPolygon as bh, searchResultsHeading as bi, searchSortOptions as bj, toListingCardModel as bk, toolbarFilterIds as bl, visibleSearchFilters as bm, type MapSearchSubscription as bn, type SearchUiDictionary as c, type AppliedSearchChange as d, type ListingFilters as e, type ListingsResult as f, type Site as g, type SearchListingsParams as h, type SearchListingsResult as i, type SearchUi as j, type QueryListingsParams as k, type QueryListingsResult as l, type SimilarListingsResult as m, type CmsEntriesResult as n, type CmsEntry as o, type BoundaryLayerOptions as p, type TravelTimeCache as q, type MapsFetchOptions as r, type BoundaryLayer as s, type ListingWithLocation as t, type StaticMapOptions as u, type StreetViewAvailabilityOptions as v, type StreetViewAvailability as w, type StreetViewOptions as x, type NeighborhoodBoundary as y, type TravelDestination as z };
|