1import type * as location from "@distilled.cloud/aws/location";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { PlaceIndex } from "./PlaceIndex.ts";
5
6/**
7 * `SearchPlaceIndexForSuggestions` request with `IndexName` injected from the bound
8 * resource.
9 */
10export interface SearchPlaceIndexForSuggestionsRequest extends Omit<
11 location.SearchPlaceIndexForSuggestionsRequest,
12 "IndexName"
13> {}
14
15/**
16 * Returns typeahead suggestions for a partial text query (autocomplete).
17 *
18 * Runtime binding for the `SearchPlaceIndexForSuggestions` operation (IAM action
19 * `geo:SearchPlaceIndexForSuggestions`), scoped to one {@link PlaceIndex}. Provide the implementation with
20 * `Effect.provide(AWS.Location.SearchPlaceIndexForSuggestionsHttp)`.
21 *
22 * ### Searching Places
23 * **Example:** Autocomplete a Query
24 * ```typescript
25 * const suggest = yield* Location.SearchPlaceIndexForSuggestions(index);
26 *
27 * const results = yield* suggest({
28 * Text: "coffee",
29 * BiasPosition: [-122.3493, 47.6205],
30 * MaxResults: 5,
31 * });
32 * // results.Results → [{ Text, PlaceId }, …]
33 * ```
34 *
35 * @binding
36 */
37export interface SearchPlaceIndexForSuggestions extends Binding.Service<
38 SearchPlaceIndexForSuggestions,
39 "AWS.Location.SearchPlaceIndexForSuggestions",
40 (
41 index: PlaceIndex,
42 ) => Effect.Effect<
43 (
44 request: SearchPlaceIndexForSuggestionsRequest,
45 ) => Effect.Effect<
46 location.SearchPlaceIndexForSuggestionsResponse,
47 location.SearchPlaceIndexForSuggestionsError
48 >
49 >
50> {}
51export const SearchPlaceIndexForSuggestions =
52 Binding.Service<SearchPlaceIndexForSuggestions>(
53 "AWS.Location.SearchPlaceIndexForSuggestions",
54 );