| 1 | import type * as location from "@distilled.cloud/aws/location"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Map as LocationMap } from "./Map.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `GetMapStyleDescriptor` request with `MapName` injected from the bound |
| 8 | * resource. |
| 9 | */ |
| 10 | export interface GetMapStyleDescriptorRequest extends Omit< |
| 11 | location.GetMapStyleDescriptorRequest, |
| 12 | "MapName" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Retrieves the map's style descriptor document (the MapLibre/Mapbox GL style JSON). |
| 17 | * |
| 18 | * Runtime binding for the `GetMapStyleDescriptor` operation (IAM action |
| 19 | * `geo:GetMapStyleDescriptor`), scoped to one {@link LocationMap | Map}. Provide the implementation with |
| 20 | * `Effect.provide(AWS.Location.GetMapStyleDescriptorHttp)`. |
| 21 | * |
| 22 | * ### Serving Map Assets |
| 23 | * **Example:** Serve the Style Descriptor |
| 24 | * ```typescript |
| 25 | * const getStyle = yield* Location.GetMapStyleDescriptor(map); |
| 26 | * |
| 27 | * const style = yield* getStyle(); |
| 28 | * // style.Blob → style JSON bytes, style.ContentType → "application/json" |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GetMapStyleDescriptor extends Binding.Service< |
| 34 | GetMapStyleDescriptor, |
| 35 | "AWS.Location.GetMapStyleDescriptor", |
| 36 | ( |
| 37 | map: LocationMap, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request?: GetMapStyleDescriptorRequest, |
| 41 | ) => Effect.Effect< |
| 42 | location.GetMapStyleDescriptorResponse, |
| 43 | location.GetMapStyleDescriptorError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | export const GetMapStyleDescriptor = Binding.Service<GetMapStyleDescriptor>( |
| 48 | "AWS.Location.GetMapStyleDescriptor", |
| 49 | ); |