1 | import {Request} from '../lib/request';
|
2 | import {Response} from '../lib/response';
|
3 | import {AWSError} from '../lib/error';
|
4 | import {Service} from '../lib/service';
|
5 | import {ServiceConfigurationOptions} from '../lib/service';
|
6 | import {ConfigBase as Config} from '../lib/config';
|
7 | interface Blob {}
|
8 | declare class Textract extends Service {
|
9 | |
10 |
|
11 |
|
12 | constructor(options?: Textract.Types.ClientConfiguration)
|
13 | config: Config & Textract.Types.ClientConfiguration;
|
14 | /**
|
15 | * Analyzes an input document for relationships in the detected text and tables. Two 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: 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 contains information about a detected table. A CELL block is returned for each cell in a table. You can choose which type of analysis to perform by specifying the FeatureTypes list. The output is returned in a list of BLOCK objects (Blocks). For more information, see how-it-works-analyzing. AnalyzeDocument is a synchronous operation. To analyze documents asynchronously, use StartDocumentAnalysis.
|
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 in the detected text and tables. Two 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: 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 contains information about a detected table. A CELL block is returned for each cell in a table. You can choose which type of analysis to perform by specifying the FeatureTypes list. The output is returned in a list of BLOCK objects (Blocks). For more information, see how-it-works-analyzing. AnalyzeDocument is a synchronous operation. To analyze documents asynchronously, use StartDocumentAnalysis.
|
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. For more information, see how-it-works-detecting. DetectDocumentText is a synchronous operation. To analyze documents asynchronously, use StartDocumentTextDetection.
|
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. For more information, see how-it-works-detecting. DetectDocumentText is a synchronous operation. To analyze documents asynchronously, use StartDocumentTextDetection.
|
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 image. 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. For more information, see how-it-works-analyzing. 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.
|
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 image. 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. For more information, see how-it-works-analyzing. 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.
|
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 image. 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. For more information, see how-it-works-detecting. 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 in the Amazon Textract Developer Guide.
|
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 image. 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. For more information, see how-it-works-detecting. 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 in the Amazon Textract Developer Guide.
|
44 | */
|
45 | getDocumentTextDetection(callback?: (err: AWSError, data: Textract.Types.GetDocumentTextDetectionResponse) => void): Request<Textract.Types.GetDocumentTextDetectionResponse, AWSError>;
|
46 | /**
|
47 | * Starts asynchronous analysis of text for relationships in the text and tables that are detected in a document. Amazon Textract returns for two types of information: Words and lines that are related to nearby lines and words. The related information is returned in two Block objects: 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 contains information about a detected table. A CELL block is returned for each cell in a table. Amazon Textract can analyze text in document images and PDF files that are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document image. 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.
|
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 text for relationships in the text and tables that are detected in a document. Amazon Textract returns for two types of information: Words and lines that are related to nearby lines and words. The related information is returned in two Block objects: 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 contains information about a detected table. A CELL block is returned for each cell in a table. Amazon Textract can analyze text in document images and PDF files that are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document image. 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.
|
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. Amazon Textract can detect text in document images and PDF files that are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and the file name of the document image. 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 in the Amazon Textract Developer Guide.
|
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. Amazon Textract can detect text in document images and PDF files that are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and the file name of the document image. 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 in the Amazon Textract Developer Guide.
|
60 | */
|
61 | startDocumentTextDetection(callback?: (err: AWSError, data: Textract.Types.StartDocumentTextDetectionResponse) => void): Request<Textract.Types.StartDocumentTextDetectionResponse, AWSError>;
|
62 | }
|
63 | declare namespace Textract {
|
64 | export interface AnalyzeDocumentRequest {
|
65 | |
66 |
|
67 |
|
68 | Document: Document;
|
69 | |
70 |
|
71 |
|
72 | FeatureTypes: FeatureTypes;
|
73 | }
|
74 | export interface AnalyzeDocumentResponse {
|
75 | |
76 |
|
77 |
|
78 | DocumentMetadata?: DocumentMetadata;
|
79 | |
80 |
|
81 |
|
82 | Blocks?: BlockList;
|
83 | }
|
84 | export interface Block {
|
85 | |
86 |
|
87 |
|
88 | BlockType?: BlockType;
|
89 | |
90 |
|
91 |
|
92 | Confidence?: Percent;
|
93 | |
94 |
|
95 |
|
96 | Text?: String;
|
97 | |
98 |
|
99 |
|
100 | RowIndex?: UInteger;
|
101 | |
102 |
|
103 |
|
104 | ColumnIndex?: UInteger;
|
105 | |
106 |
|
107 |
|
108 | RowSpan?: UInteger;
|
109 | |
110 |
|
111 |
|
112 | ColumnSpan?: UInteger;
|
113 | |
114 |
|
115 |
|
116 | Geometry?: Geometry;
|
117 | |
118 |
|
119 |
|
120 | Id?: NonEmptyString;
|
121 | |
122 |
|
123 |
|
124 | Relationships?: RelationshipList;
|
125 | |
126 |
|
127 |
|
128 | EntityTypes?: EntityTypes;
|
129 | |
130 |
|
131 |
|
132 | Page?: UInteger;
|
133 | }
|
134 | export type BlockList = Block[];
|
135 | export type BlockType = "KEY_VALUE_SET"|"PAGE"|"LINE"|"WORD"|"TABLE"|"CELL"|string;
|
136 | export interface BoundingBox {
|
137 | |
138 |
|
139 |
|
140 | Width?: Float;
|
141 | |
142 |
|
143 |
|
144 | Height?: Float;
|
145 | |
146 |
|
147 |
|
148 | Left?: Float;
|
149 | |
150 |
|
151 |
|
152 | Top?: Float;
|
153 | }
|
154 | export type ClientRequestToken = string;
|
155 | export interface DetectDocumentTextRequest {
|
156 | |
157 |
|
158 |
|
159 | Document: Document;
|
160 | }
|
161 | export interface DetectDocumentTextResponse {
|
162 | |
163 |
|
164 |
|
165 | DocumentMetadata?: DocumentMetadata;
|
166 | |
167 |
|
168 |
|
169 | Blocks?: BlockList;
|
170 | }
|
171 | export interface Document {
|
172 | |
173 |
|
174 |
|
175 | Bytes?: ImageBlob;
|
176 | |
177 |
|
178 |
|
179 | S3Object?: S3Object;
|
180 | }
|
181 | export interface DocumentLocation {
|
182 | |
183 |
|
184 |
|
185 | S3Object?: S3Object;
|
186 | }
|
187 | export interface DocumentMetadata {
|
188 | |
189 |
|
190 |
|
191 | Pages?: UInteger;
|
192 | }
|
193 | export type EntityType = "KEY"|"VALUE"|string;
|
194 | export type EntityTypes = EntityType[];
|
195 | export type ErrorCode = string;
|
196 | export type FeatureType = "TABLES"|"FORMS"|string;
|
197 | export type FeatureTypes = FeatureType[];
|
198 | export type Float = number;
|
199 | export interface Geometry {
|
200 | |
201 |
|
202 |
|
203 | BoundingBox?: BoundingBox;
|
204 | |
205 |
|
206 |
|
207 | Polygon?: Polygon;
|
208 | }
|
209 | export interface GetDocumentAnalysisRequest {
|
210 | |
211 |
|
212 |
|
213 | JobId: JobId;
|
214 | |
215 |
|
216 |
|
217 | MaxResults?: MaxResults;
|
218 | |
219 |
|
220 |
|
221 | NextToken?: PaginationToken;
|
222 | }
|
223 | export interface GetDocumentAnalysisResponse {
|
224 | |
225 |
|
226 |
|
227 | DocumentMetadata?: DocumentMetadata;
|
228 | |
229 |
|
230 |
|
231 | JobStatus?: JobStatus;
|
232 | |
233 |
|
234 |
|
235 | NextToken?: PaginationToken;
|
236 | |
237 |
|
238 |
|
239 | Blocks?: BlockList;
|
240 | |
241 |
|
242 |
|
243 | Warnings?: Warnings;
|
244 | |
245 |
|
246 |
|
247 | StatusMessage?: StatusMessage;
|
248 | }
|
249 | export interface GetDocumentTextDetectionRequest {
|
250 | |
251 |
|
252 |
|
253 | JobId: JobId;
|
254 | |
255 |
|
256 |
|
257 | MaxResults?: MaxResults;
|
258 | |
259 |
|
260 |
|
261 | NextToken?: PaginationToken;
|
262 | }
|
263 | export interface GetDocumentTextDetectionResponse {
|
264 | |
265 |
|
266 |
|
267 | DocumentMetadata?: DocumentMetadata;
|
268 | |
269 |
|
270 |
|
271 | JobStatus?: JobStatus;
|
272 | |
273 |
|
274 |
|
275 | NextToken?: PaginationToken;
|
276 | |
277 |
|
278 |
|
279 | Blocks?: BlockList;
|
280 | |
281 |
|
282 |
|
283 | Warnings?: Warnings;
|
284 | |
285 |
|
286 |
|
287 | StatusMessage?: StatusMessage;
|
288 | }
|
289 | export type IdList = NonEmptyString[];
|
290 | export type ImageBlob = Buffer|Uint8Array|Blob|string;
|
291 | export type JobId = string;
|
292 | export type JobStatus = "IN_PROGRESS"|"SUCCEEDED"|"FAILED"|"PARTIAL_SUCCESS"|string;
|
293 | export type JobTag = string;
|
294 | export type MaxResults = number;
|
295 | export type NonEmptyString = string;
|
296 | export interface NotificationChannel {
|
297 | |
298 |
|
299 |
|
300 | SNSTopicArn: SNSTopicArn;
|
301 | |
302 |
|
303 |
|
304 | RoleArn: RoleArn;
|
305 | }
|
306 | export type Pages = UInteger[];
|
307 | export type PaginationToken = string;
|
308 | export type Percent = number;
|
309 | export interface Point {
|
310 | |
311 |
|
312 |
|
313 | X?: Float;
|
314 | |
315 |
|
316 |
|
317 | Y?: Float;
|
318 | }
|
319 | export type Polygon = Point[];
|
320 | export interface Relationship {
|
321 | |
322 |
|
323 |
|
324 | Type?: RelationshipType;
|
325 | |
326 |
|
327 |
|
328 | Ids?: IdList;
|
329 | }
|
330 | export type RelationshipList = Relationship[];
|
331 | export type RelationshipType = "VALUE"|"CHILD"|string;
|
332 | export type RoleArn = string;
|
333 | export type S3Bucket = string;
|
334 | export interface S3Object {
|
335 | |
336 |
|
337 |
|
338 | Bucket?: S3Bucket;
|
339 | |
340 |
|
341 |
|
342 | Name?: S3ObjectName;
|
343 | |
344 |
|
345 |
|
346 | Version?: S3ObjectVersion;
|
347 | }
|
348 | export type S3ObjectName = string;
|
349 | export type S3ObjectVersion = string;
|
350 | export type SNSTopicArn = string;
|
351 | export interface StartDocumentAnalysisRequest {
|
352 | |
353 |
|
354 |
|
355 | DocumentLocation: DocumentLocation;
|
356 | |
357 |
|
358 |
|
359 | FeatureTypes: FeatureTypes;
|
360 | |
361 |
|
362 |
|
363 | ClientRequestToken?: ClientRequestToken;
|
364 | |
365 |
|
366 |
|
367 | JobTag?: JobTag;
|
368 | |
369 |
|
370 |
|
371 | NotificationChannel?: NotificationChannel;
|
372 | }
|
373 | export interface StartDocumentAnalysisResponse {
|
374 | |
375 |
|
376 |
|
377 | JobId?: JobId;
|
378 | }
|
379 | export interface StartDocumentTextDetectionRequest {
|
380 | |
381 |
|
382 |
|
383 | DocumentLocation: DocumentLocation;
|
384 | |
385 |
|
386 |
|
387 | ClientRequestToken?: ClientRequestToken;
|
388 | |
389 |
|
390 |
|
391 | JobTag?: JobTag;
|
392 | |
393 |
|
394 |
|
395 | NotificationChannel?: NotificationChannel;
|
396 | }
|
397 | export interface StartDocumentTextDetectionResponse {
|
398 | |
399 |
|
400 |
|
401 | JobId?: JobId;
|
402 | }
|
403 | export type StatusMessage = string;
|
404 | export type String = string;
|
405 | export type UInteger = number;
|
406 | export interface Warning {
|
407 | |
408 |
|
409 |
|
410 | ErrorCode?: ErrorCode;
|
411 | |
412 |
|
413 |
|
414 | Pages?: Pages;
|
415 | }
|
416 | export type Warnings = Warning[];
|
417 | |
418 |
|
419 |
|
420 | export type apiVersion = "2018-06-27"|"latest"|string;
|
421 | export interface ClientApiVersions {
|
422 | |
423 |
|
424 |
|
425 | apiVersion?: apiVersion;
|
426 | }
|
427 | export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
|
428 | |
429 |
|
430 |
|
431 | export import Types = Textract;
|
432 | }
|
433 | export = Textract;
|