import { Buffer } from "node:buffer"; import { PageOptions } from "./pageOptions.js"; import { InputSource, InputConstructor } from "./inputSource.js"; export declare const MIMETYPES: Map; export declare abstract class LocalInputSource extends InputSource { /** * Type of local input source (path, stream, bytes, ...). */ inputType: string; /** * Original filename associated with the input. */ filename: string; /** * Original filepath when available. */ filepath?: string; /** * MIME type detected for the source content. */ mimeType: string; /** * Binary payload for local sources. */ fileObject: Buffer | string; /** * @param {InputConstructor} constructor Constructor parameters. */ protected constructor({ inputType }: InputConstructor); /** * Detects and validates the MIME type from the current file object. */ protected checkMimetype(): Promise; /** * Returns the file object as a Buffer. * @returns Buffer representation of the file object * @protected */ protected getBuffer(): Buffer; /** * Determines whether the current file is a PDF. * @returns {boolean} Returns true if the file is a PDF; otherwise, returns false. */ isPdf(): boolean; /** * Cut PDF pages. * @param pageOptions */ applyPageOptions(pageOptions: PageOptions): Promise; /** * 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; /** * Returns true if the object is a PDF and has source text. False otherwise. * @return boolean */ hasSourceText(): Promise; /** * Returns the number of pages in the input source. * For PDFs, returns the actual page count. For images, returns 1. * @return Promise The number of pages */ getPageCount(): Promise; }