express-image-validator
Version:
Validator of various image parameters in Express.js applications
15 lines (14 loc) • 690 B
TypeScript
import type { RequestHandler } from 'express';
import type { FieldNameSet } from '../types/field';
import type { ValidationOptions } from '../types/options';
type IsImageOptions = Partial<Pick<ValidationOptions, 'limit' | 'required' | 'allowedMimeTypes'>>;
/**
* Express middleware to check if uploaded files are images.
*
* Supports optional `required` and `limit` settings.
* @param { FieldNameSet } field Field name or array of field names to validate.
* @param { IsImageOptions } [options] Validation options.
* @returns { RequestHandler } Express middleware function.
*/
export declare function isImage(field: FieldNameSet, options?: IsImageOptions): RequestHandler;
export {};