UNPKG

mindee

Version:

Mindee Client Library for Node.js

45 lines (44 loc) 1.83 kB
import { PageOptions } from "../pageOptions"; import { InputSource, InputConstructor } from "./inputSource"; export declare abstract class LocalInputSource extends InputSource { inputType: string; filename: string; filepath?: string; mimeType: string; fileObject: Buffer | string; /** * @param {InputConstructor} constructor Constructor parameters. */ protected constructor({ inputType }: InputConstructor); isPdf(): boolean; checkMimetype(): Promise<string>; /** * Cut PDF pages. * @param pageOptions */ applyPageOptions(pageOptions: PageOptions): Promise<void>; /** * Cut PDF pages. * @param pageOptions * @deprecated Deprecated in favor of {@link LocalInputSource.applyPageOptions applyPageOptions()}. */ cutPdf(pageOptions: PageOptions): Promise<void>; /** * Compresses the file object, either as a PDF or an image. * * @param quality Quality of the compression. For images, this is the JPEG quality. * For PDFs, this affects image quality within the PDF. * @param maxWidth Maximum width for image resizing. Ignored for PDFs. * @param maxHeight Maximum height for image resizing. Ignored for PDFs. * @param forceSourceText For PDFs, whether to force compression even if source text is present. * @param disableSourceText For PDFs, whether to disable source text during compression. * * @returns A Promise that resolves when the compression is complete. */ compress(quality?: number, maxWidth?: number | null, maxHeight?: number | null, forceSourceText?: boolean, disableSourceText?: boolean): Promise<void>; /** * Returns true if the object is a PDF and has source text. False otherwise. * @return boolean */ hasSourceText(): Promise<boolean>; }