1 | import { IFile } from './interfaces';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export declare abstract class FileValidator<TValidationOptions = Record<string, any>, TFile extends IFile = IFile> {
|
9 | protected readonly validationOptions: TValidationOptions;
|
10 | constructor(validationOptions: TValidationOptions);
|
11 | /**
|
12 | * Indicates if this file should be considered valid, according to the options passed in the constructor.
|
13 | * @param file the file from the request object
|
14 | */
|
15 | abstract isValid(file?: TFile | TFile[] | Record<string, TFile[]>): boolean | Promise<boolean>;
|
16 | /**
|
17 | * Builds an error message in case the validation fails.
|
18 | * @param file the file from the request object
|
19 | */
|
20 | abstract buildErrorMessage(file: any): string;
|
21 | }
|