UNPKG

@briancullen/aws-textract-parser

Version:

Library for converting AWS Textract responses into a more usable structure.

13 lines (12 loc) 578 B
import { Block, Document } from '../types'; import { Textract } from 'aws-sdk'; import { Geometry } from '../model/Geometry'; export declare type ParserFactory<T extends Block> = (blocks: Map<string, Textract.Block>) => BlockParser<T>; export declare type GeometryParser = (geomtery: Textract.Block) => Geometry; export declare type BlockIdParser = (block: Textract.Block) => string; export interface BlockParser<T extends Block> { process(block: Textract.Block): T; } export interface DocumentFactory { process(blocks: Textract.DetectDocumentTextResponse): Document; }