| 1 | import type * as geoMaps from "@distilled.cloud/aws/geo-maps"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `geo-maps:GetStaticMap` — render a static map image |
| 7 | * with customizable size, center, zoom, and overlays. |
| 8 | * |
| 9 | * geo-maps is a standalone, pay-per-call Amazon Location API with no resource |
| 10 | * to manage: the binding takes no arguments and grants the function |
| 11 | * `geo-maps:GetStaticMap`. Requests and responses are raw distilled types; |
| 12 | * the image payload is returned as `Blob` (`Uint8Array`). |
| 13 | * |
| 14 | * ### Rendering Static Maps |
| 15 | * Provide the `GetStaticMapHttp` implementation layer on the Function effect |
| 16 | * (`.pipe(Effect.provide(AWS.GeoMaps.GetStaticMapHttp))`), bind in the init |
| 17 | * phase, then call the client at runtime. |
| 18 | * |
| 19 | * **Example:** Render a static map centered on a point |
| 20 | * ```typescript |
| 21 | * // init |
| 22 | * const getStaticMap = yield* AWS.GeoMaps.GetStaticMap(); |
| 23 | * |
| 24 | * // runtime — Center is "longitude,latitude"; FileName must be "map" or "map@2x" |
| 25 | * const image = yield* getStaticMap({ |
| 26 | * FileName: "map", |
| 27 | * Center: "-122.3493,47.6205", |
| 28 | * Zoom: 12, |
| 29 | * Width: 400, |
| 30 | * Height: 300, |
| 31 | * }); |
| 32 | * const bytes = image.Blob; // Uint8Array | undefined (PNG) |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface GetStaticMap extends Binding.Service< |
| 38 | GetStaticMap, |
| 39 | "AWS.GeoMaps.GetStaticMap", |
| 40 | () => Effect.Effect< |
| 41 | ( |
| 42 | request: geoMaps.GetStaticMapRequest, |
| 43 | ) => Effect.Effect<geoMaps.GetStaticMapResponse, geoMaps.GetStaticMapError> |
| 44 | > |
| 45 | > {} |
| 46 | export const GetStaticMap = Binding.Service<GetStaticMap>( |
| 47 | "AWS.GeoMaps.GetStaticMap", |
| 48 | ); |