@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 47 lines 1.49 KB
Raw
1 import type * as location from "@distilled.cloud/aws/location";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { RouteCalculator } from "./RouteCalculator.ts";
5
6 /**
7 * `CalculateRoute` request with `CalculatorName` injected from the bound
8 * resource.
9 */
10 export interface CalculateRouteRequest extends Omit<
11 location.CalculateRouteRequest,
12 "CalculatorName"
13 > {}
14
15 /**
16 * Calculates a route (distance, duration, and legs) between a departure and a destination position.
17 *
18 * Runtime binding for the `CalculateRoute` operation (IAM action
19 * `geo:CalculateRoute`), scoped to one {@link RouteCalculator}. Provide the implementation with
20 * `Effect.provide(AWS.Location.CalculateRouteHttp)`.
21 *
22 * ### Calculating Routes
23 * **Example:** Calculate a Route
24 * ```typescript
25 * const calculateRoute = yield* Location.CalculateRoute(calculator);
26 *
27 * const route = yield* calculateRoute({
28 * DeparturePosition: [-122.3493, 47.6205],
29 * DestinationPosition: [-122.3321, 47.6062],
30 * });
31 * // route.Summary.Distance, route.Summary.DurationSeconds
32 * ```
33 *
34 * @binding
35 */
36 export interface CalculateRoute extends Binding.Service<
37 CalculateRoute,
38 "AWS.Location.CalculateRoute",
39 (
40 calculator: RouteCalculator,
41 ) => Effect.Effect<
42 (
43 request: CalculateRouteRequest,
44 ) => Effect.Effect<location.CalculateRouteResponse, location.CalculateRouteError>
45 >
46 > {}
47 export const CalculateRoute = Binding.Service<CalculateRoute>("AWS.Location.CalculateRoute");