| 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:GetSprites` — fetch a map style's sprite |
| 7 | * sheet (PNG) or sprite index (JSON) used to render map iconography. |
| 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:GetSprites`. Requests and responses are raw distilled types; the |
| 12 | * sprite payload is returned as `Blob` (`Uint8Array`). |
| 13 | * |
| 14 | * ### Fetching Sprites |
| 15 | * Provide the `GetSpritesHttp` implementation layer on the Function effect |
| 16 | * (`.pipe(Effect.provide(AWS.GeoMaps.GetSpritesHttp))`), bind in the init |
| 17 | * phase, then call the client at runtime. |
| 18 | * |
| 19 | * **Example:** Fetch the Standard style's sprite sheet |
| 20 | * ```typescript |
| 21 | * // init |
| 22 | * const getSprites = yield* AWS.GeoMaps.GetSprites(); |
| 23 | * |
| 24 | * // runtime — FileName follows `sprites(@2x)?.(png|json)` |
| 25 | * const sprites = yield* getSprites({ |
| 26 | * FileName: "sprites.png", |
| 27 | * Style: "Standard", |
| 28 | * ColorScheme: "Light", |
| 29 | * Variant: "Default", |
| 30 | * }); |
| 31 | * const bytes = sprites.Blob; // Uint8Array | undefined (PNG or JSON) |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface GetSprites extends Binding.Service< |
| 37 | GetSprites, |
| 38 | "AWS.GeoMaps.GetSprites", |
| 39 | () => Effect.Effect< |
| 40 | ( |
| 41 | request: geoMaps.GetSpritesRequest, |
| 42 | ) => Effect.Effect<geoMaps.GetSpritesResponse, geoMaps.GetSpritesError> |
| 43 | > |
| 44 | > {} |
| 45 | export const GetSprites = Binding.Service<GetSprites>("AWS.GeoMaps.GetSprites"); |