UNPKG

35.6 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class Textract extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: Textract.Types.ClientConfiguration)
13 config: Config & Textract.Types.ClientConfiguration;
14 /**
15 * Analyzes an input document for relationships between detected items. The types of information returned are as follows: Words and lines that are related to nearby lines and words. The related information is returned in two Block objects each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value. Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table. Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information about a selectable element. Lines and words of text. A LINE Block object contains one or more WORD Block objects. You can choose which type of analysis to perform by specifying the FeatureTypes list. The output is returned in a list of BLOCK objects. AnalyzeDocument is a synchronous operation. To analyze documents asynchronously, use StartDocumentAnalysis. For more information, see Document Text Analysis.
16 */
17 analyzeDocument(params: Textract.Types.AnalyzeDocumentRequest, callback?: (err: AWSError, data: Textract.Types.AnalyzeDocumentResponse) => void): Request<Textract.Types.AnalyzeDocumentResponse, AWSError>;
18 /**
19 * Analyzes an input document for relationships between detected items. The types of information returned are as follows: Words and lines that are related to nearby lines and words. The related information is returned in two Block objects each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value. Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table. Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information about a selectable element. Lines and words of text. A LINE Block object contains one or more WORD Block objects. You can choose which type of analysis to perform by specifying the FeatureTypes list. The output is returned in a list of BLOCK objects. AnalyzeDocument is a synchronous operation. To analyze documents asynchronously, use StartDocumentAnalysis. For more information, see Document Text Analysis.
20 */
21 analyzeDocument(callback?: (err: AWSError, data: Textract.Types.AnalyzeDocumentResponse) => void): Request<Textract.Types.AnalyzeDocumentResponse, AWSError>;
22 /**
23 * Detects text in the input document. Amazon Textract can detect lines of text and the words that make up a line of text. The input document must be an image in JPG or PNG format. DetectDocumentText returns the detected text in an array of Block objects. Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD. DetectDocumentText is a synchronous operation. To analyze documents asynchronously, use StartDocumentTextDetection. For more information, see Document Text Detection.
24 */
25 detectDocumentText(params: Textract.Types.DetectDocumentTextRequest, callback?: (err: AWSError, data: Textract.Types.DetectDocumentTextResponse) => void): Request<Textract.Types.DetectDocumentTextResponse, AWSError>;
26 /**
27 * Detects text in the input document. Amazon Textract can detect lines of text and the words that make up a line of text. The input document must be an image in JPG or PNG format. DetectDocumentText returns the detected text in an array of Block objects. Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD. DetectDocumentText is a synchronous operation. To analyze documents asynchronously, use StartDocumentTextDetection. For more information, see Document Text Detection.
28 */
29 detectDocumentText(callback?: (err: AWSError, data: Textract.Types.DetectDocumentTextResponse) => void): Request<Textract.Types.DetectDocumentTextResponse, AWSError>;
30 /**
31 * Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document. You start asynchronous text analysis by calling StartDocumentAnalysis, which returns a job identifier (JobId). When the text analysis operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentAnalysis. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentAnalysis, and pass the job identifier (JobId) from the initial call to StartDocumentAnalysis. GetDocumentAnalysis returns an array of Block objects. The following types of information are returned: Words and lines that are related to nearby lines and words. The related information is returned in two Block objects each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value. Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table. Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information about a selectable element. Lines and words of text. A LINE Block object contains one or more WORD Block objects. Use the MaxResults parameter to limit the number of blocks returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentAnalysis, and populate the NextToken request parameter with the token value that's returned from the previous call to GetDocumentAnalysis. For more information, see Document Text Analysis.
32 */
33 getDocumentAnalysis(params: Textract.Types.GetDocumentAnalysisRequest, callback?: (err: AWSError, data: Textract.Types.GetDocumentAnalysisResponse) => void): Request<Textract.Types.GetDocumentAnalysisResponse, AWSError>;
34 /**
35 * Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document. You start asynchronous text analysis by calling StartDocumentAnalysis, which returns a job identifier (JobId). When the text analysis operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentAnalysis. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentAnalysis, and pass the job identifier (JobId) from the initial call to StartDocumentAnalysis. GetDocumentAnalysis returns an array of Block objects. The following types of information are returned: Words and lines that are related to nearby lines and words. The related information is returned in two Block objects each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value. Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table. Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information about a selectable element. Lines and words of text. A LINE Block object contains one or more WORD Block objects. Use the MaxResults parameter to limit the number of blocks returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentAnalysis, and populate the NextToken request parameter with the token value that's returned from the previous call to GetDocumentAnalysis. For more information, see Document Text Analysis.
36 */
37 getDocumentAnalysis(callback?: (err: AWSError, data: Textract.Types.GetDocumentAnalysisResponse) => void): Request<Textract.Types.GetDocumentAnalysisResponse, AWSError>;
38 /**
39 * Gets the results for an Amazon Textract asynchronous operation that detects text in a document. Amazon Textract can detect lines of text and the words that make up a line of text. You start asynchronous text detection by calling StartDocumentTextDetection, which returns a job identifier (JobId). When the text detection operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentTextDetection. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentTextDetection, and pass the job identifier (JobId) from the initial call to StartDocumentTextDetection. GetDocumentTextDetection returns an array of Block objects. Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD. Use the MaxResults parameter to limit the number of blocks that are returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentTextDetection, and populate the NextToken request parameter with the token value that's returned from the previous call to GetDocumentTextDetection. For more information, see Document Text Detection.
40 */
41 getDocumentTextDetection(params: Textract.Types.GetDocumentTextDetectionRequest, callback?: (err: AWSError, data: Textract.Types.GetDocumentTextDetectionResponse) => void): Request<Textract.Types.GetDocumentTextDetectionResponse, AWSError>;
42 /**
43 * Gets the results for an Amazon Textract asynchronous operation that detects text in a document. Amazon Textract can detect lines of text and the words that make up a line of text. You start asynchronous text detection by calling StartDocumentTextDetection, which returns a job identifier (JobId). When the text detection operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentTextDetection. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentTextDetection, and pass the job identifier (JobId) from the initial call to StartDocumentTextDetection. GetDocumentTextDetection returns an array of Block objects. Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD. Use the MaxResults parameter to limit the number of blocks that are returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentTextDetection, and populate the NextToken request parameter with the token value that's returned from the previous call to GetDocumentTextDetection. For more information, see Document Text Detection.
44 */
45 getDocumentTextDetection(callback?: (err: AWSError, data: Textract.Types.GetDocumentTextDetectionResponse) => void): Request<Textract.Types.GetDocumentTextDetectionResponse, AWSError>;
46 /**
47 * Starts asynchronous analysis of an input document for relationships between detected items such as key and value pairs, tables, and selection elements. StartDocumentAnalysis can analyze text in documents that are in JPG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document. StartDocumentAnalysis returns a job identifier (JobId) that you use to get the results of the operation. When text analysis is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel. To get the results of the text analysis operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentAnalysis, and pass the job identifier (JobId) from the initial call to StartDocumentAnalysis. For more information, see Document Text Analysis.
48 */
49 startDocumentAnalysis(params: Textract.Types.StartDocumentAnalysisRequest, callback?: (err: AWSError, data: Textract.Types.StartDocumentAnalysisResponse) => void): Request<Textract.Types.StartDocumentAnalysisResponse, AWSError>;
50 /**
51 * Starts asynchronous analysis of an input document for relationships between detected items such as key and value pairs, tables, and selection elements. StartDocumentAnalysis can analyze text in documents that are in JPG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document. StartDocumentAnalysis returns a job identifier (JobId) that you use to get the results of the operation. When text analysis is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel. To get the results of the text analysis operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentAnalysis, and pass the job identifier (JobId) from the initial call to StartDocumentAnalysis. For more information, see Document Text Analysis.
52 */
53 startDocumentAnalysis(callback?: (err: AWSError, data: Textract.Types.StartDocumentAnalysisResponse) => void): Request<Textract.Types.StartDocumentAnalysisResponse, AWSError>;
54 /**
55 * Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of text and the words that make up a line of text. StartDocumentTextDetection can analyze text in documents that are in JPG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document. StartTextDetection returns a job identifier (JobId) that you use to get the results of the operation. When text detection is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel. To get the results of the text detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentTextDetection, and pass the job identifier (JobId) from the initial call to StartDocumentTextDetection. For more information, see Document Text Detection.
56 */
57 startDocumentTextDetection(params: Textract.Types.StartDocumentTextDetectionRequest, callback?: (err: AWSError, data: Textract.Types.StartDocumentTextDetectionResponse) => void): Request<Textract.Types.StartDocumentTextDetectionResponse, AWSError>;
58 /**
59 * Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of text and the words that make up a line of text. StartDocumentTextDetection can analyze text in documents that are in JPG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document. StartTextDetection returns a job identifier (JobId) that you use to get the results of the operation. When text detection is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel. To get the results of the text detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentTextDetection, and pass the job identifier (JobId) from the initial call to StartDocumentTextDetection. For more information, see Document Text Detection.
60 */
61 startDocumentTextDetection(callback?: (err: AWSError, data: Textract.Types.StartDocumentTextDetectionResponse) => void): Request<Textract.Types.StartDocumentTextDetectionResponse, AWSError>;
62}
63declare namespace Textract {
64 export interface AnalyzeDocumentRequest {
65 /**
66 * The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPG or PNG format. If you are using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field.
67 */
68 Document: Document;
69 /**
70 * A list of the types of analysis to perform. Add TABLES to the list to return information about the tables detected in the input document. Add FORMS to return detected fields and the associated text. To perform both types of analysis, add TABLES and FORMS to FeatureTypes.
71 */
72 FeatureTypes: FeatureTypes;
73 }
74 export interface AnalyzeDocumentResponse {
75 /**
76 * Metadata about the analyzed document. An example is the number of pages.
77 */
78 DocumentMetadata?: DocumentMetadata;
79 /**
80 * The text that's detected and analyzed by AnalyzeDocument.
81 */
82 Blocks?: BlockList;
83 }
84 export interface Block {
85 /**
86 * The type of text that's recognized in a block. In text-detection operations, the following types are returned: PAGE - Contains a list of the LINE Block objects that are detected on a document page. WORD - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces. LINE - A string of tab-delimited, contiguous words that's detected on a document page. In text analysis operations, the following types are returned: PAGE - Contains a list of child Block objects that are detected on a document page. KEY_VALUE_SET - Stores the KEY and VALUE Block objects for a field that's detected on a document page. Use the EntityType field to determine if a KEY_VALUE_SET object is a KEY Block object or a VALUE Block object. WORD - A word detected on a document page. A word is one or more ISO basic Latin script characters that aren't separated by spaces that's detected on a document page. LINE - A string of tab-delimited, contiguous words that's detected on a document page. TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or more rows or columns with a cell span of 1 row and 1 column each. CELL - A cell within a detected table. The cell is the parent of the block that contains the text in the cell. SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a document page. Use the value of SelectionStatus to determine the status of the selection element.
87 */
88 BlockType?: BlockType;
89 /**
90 * The confidence that Amazon Textract has in the accuracy of the recognized text and the accuracy of the geometry points around the recognized text.
91 */
92 Confidence?: Percent;
93 /**
94 * The word or line of text that's recognized by Amazon Textract.
95 */
96 Text?: String;
97 /**
98 * The row in which a table cell is located. The first row position is 1. RowIndex isn't returned by DetectDocumentText and GetDocumentTextDetection.
99 */
100 RowIndex?: UInteger;
101 /**
102 * The column in which a table cell appears. The first column position is 1. ColumnIndex isn't returned by DetectDocumentText and GetDocumentTextDetection.
103 */
104 ColumnIndex?: UInteger;
105 /**
106 * The number of rows that a table spans. RowSpan isn't returned by DetectDocumentText and GetDocumentTextDetection.
107 */
108 RowSpan?: UInteger;
109 /**
110 * The number of columns that a table cell spans. ColumnSpan isn't returned by DetectDocumentText and GetDocumentTextDetection.
111 */
112 ColumnSpan?: UInteger;
113 /**
114 * The location of the recognized text on the image. It includes an axis-aligned, coarse bounding box that surrounds the text, and a finer-grain polygon for more accurate spatial information.
115 */
116 Geometry?: Geometry;
117 /**
118 * The identifier for the recognized text. The identifier is only unique for a single operation.
119 */
120 Id?: NonEmptyString;
121 /**
122 * A list of child blocks of the current block. For example a LINE object has child blocks for each WORD block that's part of the line of text. There aren't Relationship objects in the list for relationships that don't exist, such as when the current block has no child blocks. The list size can be the following: 0 - The block has no child blocks. 1 - The block has child blocks.
123 */
124 Relationships?: RelationshipList;
125 /**
126 * The type of entity. The following can be returned: KEY - An identifier for a field on the document. VALUE - The field text. EntityTypes isn't returned by DetectDocumentText and GetDocumentTextDetection.
127 */
128 EntityTypes?: EntityTypes;
129 /**
130 * The selection status of a selectable element such as a radio button or checkbox.
131 */
132 SelectionStatus?: SelectionStatus;
133 /**
134 * The page in which a block was detected. Page is returned by asynchronous operations. Page values greater than 1 are only returned for multi-page documents that are in PDF format. A scanned image (JPG/PNG), even if it contains multiple document pages, is always considered to be a single-page document and the value of Page is always 1. Synchronous operations don't return Page as every input document is considered to be a single-page document.
135 */
136 Page?: UInteger;
137 }
138 export type BlockList = Block[];
139 export type BlockType = "KEY_VALUE_SET"|"PAGE"|"LINE"|"WORD"|"TABLE"|"CELL"|"SELECTION_ELEMENT"|string;
140 export interface BoundingBox {
141 /**
142 * The width of the bounding box as a ratio of the overall document page width.
143 */
144 Width?: Float;
145 /**
146 * The height of the bounding box as a ratio of the overall document page height.
147 */
148 Height?: Float;
149 /**
150 * The left coordinate of the bounding box as a ratio of overall document page width.
151 */
152 Left?: Float;
153 /**
154 * The top coordinate of the bounding box as a ratio of overall document page height.
155 */
156 Top?: Float;
157 }
158 export type ClientRequestToken = string;
159 export interface DetectDocumentTextRequest {
160 /**
161 * The input document as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Textract operations, you can't pass image bytes. The document must be an image in JPG or PNG format. If you are using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field.
162 */
163 Document: Document;
164 }
165 export interface DetectDocumentTextResponse {
166 /**
167 * Metadata about the document. Contains the number of pages that are detected in the document.
168 */
169 DocumentMetadata?: DocumentMetadata;
170 /**
171 * An array of Block objects containing the text detected in the document.
172 */
173 Blocks?: BlockList;
174 }
175 export interface Document {
176 /**
177 * A blob of base-64 encoded documents bytes. The maximum size of a document that's provided in a blob of bytes is 5 MB. The document bytes must be in PNG or JPG format. If you are using an AWS SDK to call Amazon Textract, you might not need to base64-encode image bytes passed using the Bytes field.
178 */
179 Bytes?: ImageBlob;
180 /**
181 * Identifies an S3 object as the document source. The maximum size of a document stored in an S3 bucket is 5 MB.
182 */
183 S3Object?: S3Object;
184 }
185 export interface DocumentLocation {
186 /**
187 * The Amazon S3 bucket that contains the input document.
188 */
189 S3Object?: S3Object;
190 }
191 export interface DocumentMetadata {
192 /**
193 * The number of pages detected in the document.
194 */
195 Pages?: UInteger;
196 }
197 export type EntityType = "KEY"|"VALUE"|string;
198 export type EntityTypes = EntityType[];
199 export type ErrorCode = string;
200 export type FeatureType = "TABLES"|"FORMS"|string;
201 export type FeatureTypes = FeatureType[];
202 export type Float = number;
203 export interface Geometry {
204 /**
205 * An axis-aligned coarse representation of the location of the recognized text on the document page.
206 */
207 BoundingBox?: BoundingBox;
208 /**
209 * Within the bounding box, a fine-grained polygon around the recognized text.
210 */
211 Polygon?: Polygon;
212 }
213 export interface GetDocumentAnalysisRequest {
214 /**
215 * A unique identifier for the text-detection job. The JobId is returned from StartDocumentAnalysis.
216 */
217 JobId: JobId;
218 /**
219 * The maximum number of results to return per paginated call. The largest value that you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.
220 */
221 MaxResults?: MaxResults;
222 /**
223 * If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.
224 */
225 NextToken?: PaginationToken;
226 }
227 export interface GetDocumentAnalysisResponse {
228 /**
229 * Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract video operation.
230 */
231 DocumentMetadata?: DocumentMetadata;
232 /**
233 * The current status of the text detection job.
234 */
235 JobStatus?: JobStatus;
236 /**
237 * If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text detection results.
238 */
239 NextToken?: PaginationToken;
240 /**
241 * The results of the text analysis operation.
242 */
243 Blocks?: BlockList;
244 /**
245 * A list of warnings that occurred during the document analysis operation.
246 */
247 Warnings?: Warnings;
248 /**
249 * The current status of an asynchronous document analysis operation.
250 */
251 StatusMessage?: StatusMessage;
252 }
253 export interface GetDocumentTextDetectionRequest {
254 /**
255 * A unique identifier for the text detection job. The JobId is returned from StartDocumentTextDetection.
256 */
257 JobId: JobId;
258 /**
259 * The maximum number of results to return per paginated call. The largest value you can specify is 1,000. If you specify a value greater than 1,000, a maximum of 1,000 results is returned. The default value is 1,000.
260 */
261 MaxResults?: MaxResults;
262 /**
263 * If the previous response was incomplete (because there are more blocks to retrieve), Amazon Textract returns a pagination token in the response. You can use this pagination token to retrieve the next set of blocks.
264 */
265 NextToken?: PaginationToken;
266 }
267 export interface GetDocumentTextDetectionResponse {
268 /**
269 * Information about a document that Amazon Textract processed. DocumentMetadata is returned in every page of paginated responses from an Amazon Textract video operation.
270 */
271 DocumentMetadata?: DocumentMetadata;
272 /**
273 * The current status of the text detection job.
274 */
275 JobStatus?: JobStatus;
276 /**
277 * If the response is truncated, Amazon Textract returns this token. You can use this token in the subsequent request to retrieve the next set of text-detection results.
278 */
279 NextToken?: PaginationToken;
280 /**
281 * The results of the text-detection operation.
282 */
283 Blocks?: BlockList;
284 /**
285 * A list of warnings that occurred during the document text-detection operation.
286 */
287 Warnings?: Warnings;
288 /**
289 * The current status of an asynchronous document text-detection operation.
290 */
291 StatusMessage?: StatusMessage;
292 }
293 export type IdList = NonEmptyString[];
294 export type ImageBlob = Buffer|Uint8Array|Blob|string;
295 export type JobId = string;
296 export type JobStatus = "IN_PROGRESS"|"SUCCEEDED"|"FAILED"|"PARTIAL_SUCCESS"|string;
297 export type JobTag = string;
298 export type MaxResults = number;
299 export type NonEmptyString = string;
300 export interface NotificationChannel {
301 /**
302 * The Amazon SNS topic that Amazon Textract posts the completion status to.
303 */
304 SNSTopicArn: SNSTopicArn;
305 /**
306 * The Amazon Resource Name (ARN) of an IAM role that gives Amazon Textract publishing permissions to the Amazon SNS topic.
307 */
308 RoleArn: RoleArn;
309 }
310 export type Pages = UInteger[];
311 export type PaginationToken = string;
312 export type Percent = number;
313 export interface Point {
314 /**
315 * The value of the X coordinate for a point on a Polygon.
316 */
317 X?: Float;
318 /**
319 * The value of the Y coordinate for a point on a Polygon.
320 */
321 Y?: Float;
322 }
323 export type Polygon = Point[];
324 export interface Relationship {
325 /**
326 * The type of relationship that the blocks in the IDs array have with the current block. The relationship can be VALUE or CHILD.
327 */
328 Type?: RelationshipType;
329 /**
330 * An array of IDs for related blocks. You can get the type of the relationship from the Type element.
331 */
332 Ids?: IdList;
333 }
334 export type RelationshipList = Relationship[];
335 export type RelationshipType = "VALUE"|"CHILD"|string;
336 export type RoleArn = string;
337 export type S3Bucket = string;
338 export interface S3Object {
339 /**
340 * The name of the S3 bucket.
341 */
342 Bucket?: S3Bucket;
343 /**
344 * The file name of the input document. It must be an image file (.JPG or .PNG format). Asynchronous operations also support PDF files.
345 */
346 Name?: S3ObjectName;
347 /**
348 * If the bucket has versioning enabled, you can specify the object version.
349 */
350 Version?: S3ObjectVersion;
351 }
352 export type S3ObjectName = string;
353 export type S3ObjectVersion = string;
354 export type SNSTopicArn = string;
355 export type SelectionStatus = "SELECTED"|"NOT_SELECTED"|string;
356 export interface StartDocumentAnalysisRequest {
357 /**
358 * The location of the document to be processed.
359 */
360 DocumentLocation: DocumentLocation;
361 /**
362 * A list of the types of analysis to perform. Add TABLES to the list to return information about the tables that are detected in the input document. Add FORMS to return detected fields and the associated text. To perform both types of analysis, add TABLES and FORMS to FeatureTypes. All selectable elements (SELECTION_ELEMENT) that are detected are returned, whatever the value of FeatureTypes.
363 */
364 FeatureTypes: FeatureTypes;
365 /**
366 * The idempotent token that you use to identify the start request. If you use the same token with multiple StartDocumentAnalysis requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once.
367 */
368 ClientRequestToken?: ClientRequestToken;
369 /**
370 * An identifier you specify that's included in the completion notification that's published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document, such as a tax form or a receipt, that the completion notification corresponds to.
371 */
372 JobTag?: JobTag;
373 /**
374 * The Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.
375 */
376 NotificationChannel?: NotificationChannel;
377 }
378 export interface StartDocumentAnalysisResponse {
379 /**
380 * The identifier for the document text detection job. Use JobId to identify the job in a subsequent call to GetDocumentAnalysis.
381 */
382 JobId?: JobId;
383 }
384 export interface StartDocumentTextDetectionRequest {
385 /**
386 * The location of the document to be processed.
387 */
388 DocumentLocation: DocumentLocation;
389 /**
390 * The idempotent token that's used to identify the start request. If you use the same token with multiple StartDocumentTextDetection requests, the same JobId is returned. Use ClientRequestToken to prevent the same job from being accidentally started more than once.
391 */
392 ClientRequestToken?: ClientRequestToken;
393 /**
394 * An identifier you specify that's included in the completion notification that's published to the Amazon SNS topic. For example, you can use JobTag to identify the type of document, such as a tax form or a receipt, that the completion notification corresponds to.
395 */
396 JobTag?: JobTag;
397 /**
398 * The Amazon SNS topic ARN that you want Amazon Textract to publish the completion status of the operation to.
399 */
400 NotificationChannel?: NotificationChannel;
401 }
402 export interface StartDocumentTextDetectionResponse {
403 /**
404 * The identifier for the document text-detection job. Use JobId to identify the job in a subsequent call to GetDocumentTextDetection.
405 */
406 JobId?: JobId;
407 }
408 export type StatusMessage = string;
409 export type String = string;
410 export type UInteger = number;
411 export interface Warning {
412 /**
413 * The error code for the warning.
414 */
415 ErrorCode?: ErrorCode;
416 /**
417 * A list of the pages that the warning applies to.
418 */
419 Pages?: Pages;
420 }
421 export type Warnings = Warning[];
422 /**
423 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
424 */
425 export type apiVersion = "2018-06-27"|"latest"|string;
426 export interface ClientApiVersions {
427 /**
428 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
429 */
430 apiVersion?: apiVersion;
431 }
432 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
433 /**
434 * Contains interfaces for use with the Textract client.
435 */
436 export import Types = Textract;
437}
438export = Textract;