/// import { ChannelCredentials, ChannelOptions, UntypedServiceImplementation, handleServerStreamingCall, Client, CallOptions, ClientReadableStream, Metadata, handleUnaryCall, ClientUnaryCall, ServiceError } from '@grpc/grpc-js'; import _m0 from 'protobufjs/minimal'; import { TextAnnotation } from '../../../../../yandex/cloud/ai/ocr/v1/ocr'; import { Operation } from '../../../../../yandex/cloud/operation/operation'; export declare const protobufPackage = "yandex.cloud.ai.ocr.v1"; export interface RecognizeTextRequest { /** Bytes with data */ content: Buffer | undefined; /** * Specifications of the ([MIME type](https://en.wikipedia.org/wiki/Media_type)). Each specification contains the file to analyze and features to use for analysis. Restrictions: * * Supported file formats: `JPEG`, `PNG`, `PDF`. * * Maximum file size: see [documentation](/docs/vision/concepts/limits). * * Image size should not exceed 20M pixels (length x width). * * The number of pages in a PDF file should not exceed 1. */ mimeType: string; /** * [List of the languages](/docs/vision/concepts/ocr/supported-languages) to recognize text. * Specified in [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format (for example, `ru`). */ languageCodes: string[]; /** [Model](/docs/vision/concepts/ocr/template-recognition#models) to use for text detection. */ model: string; } export interface RecognizeTextResponse { /** Recognized text blocks in page or text from entities. */ textAnnotation?: TextAnnotation; /** Page number in PDF file. */ page: number; } export interface GetRecognitionRequest { /** Operation ID of async recognition request. */ operationId: string; } export declare const RecognizeTextRequest: { encode(message: RecognizeTextRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): RecognizeTextRequest; fromJSON(object: any): RecognizeTextRequest; toJSON(message: RecognizeTextRequest): unknown; fromPartial, never>) | undefined; model?: string | undefined; } & Record, never>>(object: I): RecognizeTextRequest; }; export declare const RecognizeTextResponse: { encode(message: RecognizeTextResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): RecognizeTextResponse; fromJSON(object: any): RecognizeTextResponse; toJSON(message: RecognizeTextResponse): unknown; fromPartial, never>)[] & Record, never>) | undefined; } & Record, never>) | undefined; lines?: ({ boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; text?: string | undefined; words?: { boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; text?: string | undefined; entityIndex?: number | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; }[] | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; orientation?: import("../../../../../yandex/cloud/ai/ocr/v1/ocr").Angle | undefined; }[] & ({ boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; text?: string | undefined; words?: { boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; text?: string | undefined; entityIndex?: number | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; }[] | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; orientation?: import("../../../../../yandex/cloud/ai/ocr/v1/ocr").Angle | undefined; } & { boundingBox?: ({ vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } & { vertices?: ({ x?: number | undefined; y?: number | undefined; }[] & ({ x?: number | undefined; y?: number | undefined; } & { x?: number | undefined; y?: number | undefined; } & Record, never>)[] & Record, never>) | undefined; } & Record, never>) | undefined; text?: string | undefined; words?: ({ boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; text?: string | undefined; entityIndex?: number | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; }[] & ({ boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; text?: string | undefined; entityIndex?: number | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; } & { boundingBox?: ({ vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } & { vertices?: ({ x?: number | undefined; y?: number | undefined; }[] & ({ x?: number | undefined; y?: number | undefined; } & { x?: number | undefined; y?: number | undefined; } & Record, never>)[] & Record, never>) | undefined; } & Record, never>) | undefined; text?: string | undefined; entityIndex?: number | undefined; textSegments?: ({ startIndex?: number | undefined; length?: number | undefined; }[] & ({ startIndex?: number | undefined; length?: number | undefined; } & { startIndex?: number | undefined; length?: number | undefined; } & Record, never>)[] & Record, never>) | undefined; } & Record, never>)[] & Record, never>) | undefined; textSegments?: ({ startIndex?: number | undefined; length?: number | undefined; }[] & ({ startIndex?: number | undefined; length?: number | undefined; } & { startIndex?: number | undefined; length?: number | undefined; } & Record, never>)[] & Record, never>) | undefined; orientation?: import("../../../../../yandex/cloud/ai/ocr/v1/ocr").Angle | undefined; } & Record, never>)[] & Record, never>) | undefined; languages?: ({ languageCode?: string | undefined; }[] & ({ languageCode?: string | undefined; } & { languageCode?: string | undefined; } & Record, never>)[] & Record, never>) | undefined; textSegments?: ({ startIndex?: number | undefined; length?: number | undefined; }[] & ({ startIndex?: number | undefined; length?: number | undefined; } & { startIndex?: number | undefined; length?: number | undefined; } & Record, never>)[] & Record, never>) | undefined; } & Record, never>)[] & Record, never>) | undefined; entities?: ({ name?: string | undefined; text?: string | undefined; }[] & ({ name?: string | undefined; text?: string | undefined; } & { name?: string | undefined; text?: string | undefined; } & Record, never>)[] & Record, never>) | undefined; tables?: ({ boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; rowCount?: number | undefined; columnCount?: number | undefined; cells?: { boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; rowIndex?: number | undefined; columnIndex?: number | undefined; columnSpan?: number | undefined; rowSpan?: number | undefined; text?: string | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; }[] | undefined; }[] & ({ boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; rowCount?: number | undefined; columnCount?: number | undefined; cells?: { boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; rowIndex?: number | undefined; columnIndex?: number | undefined; columnSpan?: number | undefined; rowSpan?: number | undefined; text?: string | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; }[] | undefined; } & { boundingBox?: ({ vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } & { vertices?: ({ x?: number | undefined; y?: number | undefined; }[] & ({ x?: number | undefined; y?: number | undefined; } & { x?: number | undefined; y?: number | undefined; } & Record, never>)[] & Record, never>) | undefined; } & Record, never>) | undefined; rowCount?: number | undefined; columnCount?: number | undefined; cells?: ({ boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; rowIndex?: number | undefined; columnIndex?: number | undefined; columnSpan?: number | undefined; rowSpan?: number | undefined; text?: string | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; }[] & ({ boundingBox?: { vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } | undefined; rowIndex?: number | undefined; columnIndex?: number | undefined; columnSpan?: number | undefined; rowSpan?: number | undefined; text?: string | undefined; textSegments?: { startIndex?: number | undefined; length?: number | undefined; }[] | undefined; } & { boundingBox?: ({ vertices?: { x?: number | undefined; y?: number | undefined; }[] | undefined; } & { vertices?: ({ x?: number | undefined; y?: number | undefined; }[] & ({ x?: number | undefined; y?: number | undefined; } & { x?: number | undefined; y?: number | undefined; } & Record, never>)[] & Record, never>) | undefined; } & Record, never>) | undefined; rowIndex?: number | undefined; columnIndex?: number | undefined; columnSpan?: number | undefined; rowSpan?: number | undefined; text?: string | undefined; textSegments?: ({ startIndex?: number | undefined; length?: number | undefined; }[] & ({ startIndex?: number | undefined; length?: number | undefined; } & { startIndex?: number | undefined; length?: number | undefined; } & Record, never>)[] & Record, never>) | undefined; } & Record, never>)[] & Record, never>) | undefined; } & Record, never>)[] & Record, never>) | undefined; fullText?: string | undefined; rotate?: import("../../../../../yandex/cloud/ai/ocr/v1/ocr").Angle | undefined; } & Record, never>) | undefined; page?: number | undefined; } & Record, never>>(object: I): RecognizeTextResponse; }; export declare const GetRecognitionRequest: { encode(message: GetRecognitionRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number): GetRecognitionRequest; fromJSON(object: any): GetRecognitionRequest; toJSON(message: GetRecognitionRequest): unknown; fromPartial, never>>(object: I): GetRecognitionRequest; }; /** A set of methods for the Vision OCR service. */ export declare const TextRecognitionServiceService: { /** To send the image for text recognition. */ readonly recognize: { readonly path: "/yandex.cloud.ai.ocr.v1.TextRecognitionService/Recognize"; readonly requestStream: false; readonly responseStream: true; readonly requestSerialize: (value: RecognizeTextRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => RecognizeTextRequest; readonly responseSerialize: (value: RecognizeTextResponse) => Buffer; readonly responseDeserialize: (value: Buffer) => RecognizeTextResponse; }; }; export interface TextRecognitionServiceServer extends UntypedServiceImplementation { /** To send the image for text recognition. */ recognize: handleServerStreamingCall; } export interface TextRecognitionServiceClient extends Client { /** To send the image for text recognition. */ recognize(request: RecognizeTextRequest, options?: Partial): ClientReadableStream; recognize(request: RecognizeTextRequest, metadata?: Metadata, options?: Partial): ClientReadableStream; } export declare const TextRecognitionServiceClient: { new (address: string, credentials: ChannelCredentials, options?: Partial): TextRecognitionServiceClient; service: typeof TextRecognitionServiceService; }; /** A set of methods for managing operations for asynchronous API requests. */ export declare const TextRecognitionAsyncServiceService: { /** To send the image for asynchronous text recognition. */ readonly recognize: { readonly path: "/yandex.cloud.ai.ocr.v1.TextRecognitionAsyncService/Recognize"; readonly requestStream: false; readonly responseStream: false; readonly requestSerialize: (value: RecognizeTextRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => RecognizeTextRequest; readonly responseSerialize: (value: Operation) => Buffer; readonly responseDeserialize: (value: Buffer) => Operation; }; /** To get recognition results. */ readonly getRecognition: { readonly path: "/yandex.cloud.ai.ocr.v1.TextRecognitionAsyncService/GetRecognition"; readonly requestStream: false; readonly responseStream: true; readonly requestSerialize: (value: GetRecognitionRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => GetRecognitionRequest; readonly responseSerialize: (value: RecognizeTextResponse) => Buffer; readonly responseDeserialize: (value: Buffer) => RecognizeTextResponse; }; }; export interface TextRecognitionAsyncServiceServer extends UntypedServiceImplementation { /** To send the image for asynchronous text recognition. */ recognize: handleUnaryCall; /** To get recognition results. */ getRecognition: handleServerStreamingCall; } export interface TextRecognitionAsyncServiceClient extends Client { /** To send the image for asynchronous text recognition. */ recognize(request: RecognizeTextRequest, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; recognize(request: RecognizeTextRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; recognize(request: RecognizeTextRequest, metadata: Metadata, options: Partial, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; /** To get recognition results. */ getRecognition(request: GetRecognitionRequest, options?: Partial): ClientReadableStream; getRecognition(request: GetRecognitionRequest, metadata?: Metadata, options?: Partial): ClientReadableStream; } export declare const TextRecognitionAsyncServiceClient: { new (address: string, credentials: ChannelCredentials, options?: Partial): TextRecognitionAsyncServiceClient; service: typeof TextRecognitionAsyncServiceService; }; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P : P & { [K in keyof P]: Exact; } & Record>, never>; export {};
= P extends Builtin ? P : P & { [K in keyof P]: Exact
; } & Record>, never>; export {};