UNPKG

mindee

Version:

Mindee Client Library for Node.js

33 lines (32 loc) 1.13 kB
import { Dispatcher, FormData } from "undici"; import { InputSource, PageOptions } from "../input/index.js"; export declare const TIMEOUT_SECS_DEFAULT: number; export interface RequestOptions { hostname?: string; path?: string; method: any; timeoutSecs: number; headers: any; body?: FormData | string; queryParams?: Record<string, string>; } export interface BaseHttpResponse { messageObj: any; data: { [key: string]: any; }; } /** * Cuts a document's pages according to the given options. * @param inputDoc input document. * @param pageOptions page cutting options. */ export declare function cutDocPages(inputDoc: InputSource, pageOptions: PageOptions): Promise<void>; /** * Reads a response from the API and processes it. * @param dispatcher custom dispatcher to use for the request. * @param options options related to the request itself. * @param url override the URL of the request. * @returns the processed request. */ export declare function sendRequestAndReadResponse(dispatcher: Dispatcher, options: RequestOptions, url?: string): Promise<BaseHttpResponse>;