UNPKG

@adonisjs/bodyparser

Version:

AdonisJs body parser to read and parse HTTP request bodies

34 lines (33 loc) 929 B
/// <reference path="../../../adonis-typings/bodyparser.d.ts" /> import { MultipartFileContract } from '@ioc:Adonis/Core/BodyParser'; /** * Validates the file extension */ export declare class ExtensionValidator { private file; private allowedExtensions?; validated: boolean; /** * Update the expected file extensions */ get extensions(): string[] | undefined; set extensions(extnames: string[] | undefined); constructor(file: MultipartFileContract); /** * Report error to the file */ private reportError; /** * Validating the file in the streaming mode. During this mode * we defer the validation, until we get the file extname. */ private validateWhenGettingStreamed; /** * Validate the file extension after it has been streamed */ private validateAfterConsumed; /** * Validate the file */ validate(): void; }