UNPKG

1.21 kBTypeScriptView Raw
1import { PipeTransform } from '../../interfaces/features/pipe-transform.interface';
2import { FileValidator } from './file-validator.interface';
3import { ParseFileOptions } from './parse-file-options.interface';
4/**
5 * Defines the built-in ParseFile Pipe. This pipe can be used to validate incoming files
6 * with `@UploadedFile()` decorator. You can use either other specific built-in validators
7 * or provide one of your own, simply implementing it through FileValidator interface
8 * and adding it to ParseFilePipe's constructor.
9 *
10 * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes)
11 *
12 * @publicApi
13 */
14export declare class ParseFilePipe implements PipeTransform<any> {
15 protected exceptionFactory: (error: string) => any;
16 private readonly validators;
17 private readonly fileIsRequired;
18 constructor(options?: ParseFileOptions);
19 transform(value: any): Promise<any>;
20 private validateFilesOrFile;
21 private thereAreNoFilesIn;
22 protected validate(file: any): Promise<any>;
23 private validateOrThrow;
24 /**
25 * @returns list of validators used in this pipe.
26 */
27 getValidators(): FileValidator<Record<string, any>, import("./interfaces").IFile>[];
28}