1import type * as rekognition from "@distilled.cloud/aws/rekognition";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
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 */
29export interface DetectText extends Binding.Service<
30 DetectText,
31 "AWS.Rekognition.DetectText",
32 () => Effect.Effect<
33 (
34 request: rekognition.DetectTextRequest,
35 ) => Effect.Effect<
36 rekognition.DetectTextResponse,
37 rekognition.DetectTextError
38 >
39 >
40> {}
41export const DetectText = Binding.Service<DetectText>(
42 "AWS.Rekognition.DetectText",
43);