@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 43 lines 1.45 KB
Raw
1 import type * as geoPlaces from "@distilled.cloud/aws/geo-places";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Runtime binding for `geo-places:Autocomplete` — complete potential places
7 * and addresses as the user types, based on partial input.
8 *
9 * geo-places is a standalone, pay-per-call Amazon Location API with no
10 * resource to manage: the binding takes no arguments and grants the function
11 * `geo-places:Autocomplete`. Requests and responses are raw distilled types
12 * (no marshalling).
13 *
14 * ### Autocompleting Queries
15 * Provide the `AutocompleteHttp` implementation layer on the Function effect
16 * (`.pipe(Effect.provide(AWS.GeoPlaces.AutocompleteHttp))`), bind in the init
17 * phase, then call the client at runtime.
18 *
19 * **Example:** Autocomplete a partial address
20 * ```typescript
21 * // init
22 * const autocomplete = yield* AWS.GeoPlaces.Autocomplete();
23 *
24 * // runtime
25 * const result = yield* autocomplete({
26 * QueryText: "1600 Pennsylvania",
27 * MaxResults: 5,
28 * });
29 * const first = result.ResultItems?.[0]?.Title;
30 * ```
31 *
32 * @binding
33 */
34 export interface Autocomplete extends Binding.Service<
35 Autocomplete,
36 "AWS.GeoPlaces.Autocomplete",
37 () => Effect.Effect<
38 (
39 request: geoPlaces.AutocompleteRequest,
40 ) => Effect.Effect<geoPlaces.AutocompleteResponse, geoPlaces.AutocompleteError>
41 >
42 > {}
43 export const Autocomplete = Binding.Service<Autocomplete>("AWS.GeoPlaces.Autocomplete");