The best way to control Claude Code, Codex and more from any computer or phone

main
ts 37 lines 1.3 KB
Raw
1 import type * as textract from "@distilled.cloud/aws/textract";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Runtime binding for `textract:AnalyzeDocument` — synchronous analysis of
7 * relationships in a document: forms (key-value pairs), tables, layout,
8 * signatures, and natural-language queries. Pass the document as raw bytes
9 * or as an S3 object reference; the caller needs `s3:GetObject` on the
10 * bucket for S3 input (bind `AWS.S3.GetObject(bucket)` alongside).
11 *
12 * ### Synchronous Analysis
13 * **Example:** Analyze Forms and Tables
14 * ```typescript
15 * // init
16 * const analyzeDocument = yield* AWS.Textract.AnalyzeDocument();
17 *
18 * // runtime
19 * const result = yield* analyzeDocument({
20 * Document: { Bytes: documentBytes },
21 * FeatureTypes: ["FORMS", "TABLES"],
22 * });
23 * const tables = (result.Blocks ?? []).filter((b) => b.BlockType === "TABLE");
24 * ```
25 *
26 * @binding
27 */
28 export interface AnalyzeDocument extends Binding.Service<
29 AnalyzeDocument,
30 "AWS.Textract.AnalyzeDocument",
31 () => Effect.Effect<
32 (
33 request: textract.AnalyzeDocumentRequest,
34 ) => Effect.Effect<textract.AnalyzeDocumentResponse, textract.AnalyzeDocumentError>
35 >
36 > {}
37 export const AnalyzeDocument = Binding.Service<AnalyzeDocument>("AWS.Textract.AnalyzeDocument");