UNPKG

@nutrient-sdk/dws-client-typescript

Version:

Node.js TypeScript client library for Nutrient Document Web Services (DWS) API

41 lines 1.55 kB
import type { FileInput, UrlInput } from './types'; /** * Normalized file data for internal processing (Node.js only) */ export interface NormalizedFileData { data: Buffer | Uint8Array | NodeJS.ReadableStream; filename: string; contentType?: string; } /** * Processes various file input types into a normalized format (Node.js only) */ export declare function processFileInput(input: Exclude<FileInput, UrlInput>): Promise<NormalizedFileData>; /** * Validates that the input is a supported file type (Node.js only) */ export declare function validateFileInput(input: unknown): input is FileInput; /** * Validation that the input is a remote file type */ export declare function isRemoteFileInput(input: FileInput): input is UrlInput | string; /** * Process Remote File Input */ export declare function processRemoteFileInput(input: UrlInput | string): Promise<NormalizedFileData>; /** * Zero dependency way to get the number of pages in a PDF. * * @param pdfData - Normalized file data of a PDF file * @returns Number of pages in a PDF * @throws {ValidationError} If the input is not a valid PDF or if the page count cannot be determined */ export declare function getPdfPageCount(pdfData: NormalizedFileData): Promise<number>; /** * Zero dependency way to check if a file is a valid PDF. * * @param fileData - Normalized file data to check * @returns Boolean indicating if the input is a valid PDF */ export declare function isValidPdf(fileData: NormalizedFileData): Promise<boolean>; //# sourceMappingURL=inputs.d.ts.map