UNPKG

929 BTypeScriptView Raw
1/// <reference path="../../../adonis-typings/bodyparser.d.ts" />
2import { MultipartFileContract } from '@ioc:Adonis/Core/BodyParser';
3/**
4 * Validates the file extension
5 */
6export declare class ExtensionValidator {
7 private file;
8 private allowedExtensions?;
9 validated: boolean;
10 /**
11 * Update the expected file extensions
12 */
13 get extensions(): string[] | undefined;
14 set extensions(extnames: string[] | undefined);
15 constructor(file: MultipartFileContract);
16 /**
17 * Report error to the file
18 */
19 private reportError;
20 /**
21 * Validating the file in the streaming mode. During this mode
22 * we defer the validation, until we get the file extname.
23 */
24 private validateWhenGettingStreamed;
25 /**
26 * Validate the file extension after it has been streamed
27 */
28 private validateAfterConsumed;
29 /**
30 * Validate the file
31 */
32 validate(): void;
33}