The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type * as rekognition from "@distilled.cloud/aws/rekognition"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `rekognition:DetectText` — detect and extract lines and words of text in an image. |
| 7 | * |
| 8 | * The binding takes no arguments and grants the function |
| 9 | * `rekognition:DetectText` on `*` (Rekognition data-plane resources such |
| 10 | * as collections, users, and jobs are routinely created at runtime, so |
| 11 | * their identifiers are unknown at deploy time). Provide the |
| 12 | * implementation with `Effect.provide(AWS.Rekognition.DetectTextHttp)`. |
| 13 | * |
| 14 | * ### Image Analysis |
| 15 | * **Example:** Extract Text from an Image |
| 16 | * ```typescript |
| 17 | * // init |
| 18 | * const detectText = yield* AWS.Rekognition.DetectText(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const result = yield* detectText({ Image: { Bytes: imageBytes } }); |
| 22 | * const lines = (result.TextDetections ?? []) |
| 23 | * .filter((t) => t.Type === "LINE") |
| 24 | * .map((t) => t.DetectedText); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface DetectText extends Binding.Service< |
| 30 | DetectText, |
| 31 | "AWS.Rekognition.DetectText", |
| 32 | () => Effect.Effect< |
| 33 | ( |
| 34 | request: rekognition.DetectTextRequest, |
| 35 | ) => Effect.Effect<rekognition.DetectTextResponse, rekognition.DetectTextError> |
| 36 | > |
| 37 | > {} |
| 38 | export const DetectText = Binding.Service<DetectText>("AWS.Rekognition.DetectText"); |