UNPKG

mindee

Version:

Mindee Client Library for Node.js

32 lines (31 loc) 995 B
import { Buffer } from "node:buffer"; import { BufferInput } from "../input/index.js"; /** * Generic class for image extraction. */ export declare class ExtractedImage { buffer: Buffer; filename: string; readonly pageId: number; readonly elementId: number; constructor(buffer: Uint8Array, fileName: string, pageId: number, elementId: number); /** * Saves the document to a file. * * @param outputPath Path to save the file to. */ saveToFileAsync(outputPath: string): Promise<void>; /** * Attempts to saves the document to a file synchronously. * Throws an error if the file extension is not supported or if the file could not be saved to disk for some reason. * * @param outputPath Path to save the file to. */ saveToFile(outputPath: string): void; /** * Return the file as a Mindee-compatible BufferInput source. * * @returns A BufferInput source. */ asInputSource(): BufferInput; }