1 | import { ArgumentMetadata } from '../index';
|
2 | import { PipeTransform } from '../interfaces/features/pipe-transform.interface';
|
3 | import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util';
|
4 |
|
5 |
|
6 |
|
7 | export interface ParseEnumPipeOptions {
|
8 | optional?: boolean;
|
9 | errorHttpStatusCode?: ErrorHttpStatusCode;
|
10 | exceptionFactory?: (error: string) => any;
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare class ParseEnumPipe<T = any> implements PipeTransform<T> {
|
20 | protected readonly enumType: T;
|
21 | protected readonly options?: ParseEnumPipeOptions;
|
22 | protected exceptionFactory: (error: string) => any;
|
23 | constructor(enumType: T, options?: ParseEnumPipeOptions);
|
24 | /**
|
25 | * Method that accesses and performs optional transformation on argument for
|
26 | * in-flight requests.
|
27 | *
|
28 | * @param value currently processed route argument
|
29 | * @param metadata contains metadata about the currently processed route argument
|
30 | */
|
31 | transform(value: T, metadata: ArgumentMetadata): Promise<T>;
|
32 | protected isEnum(value: T): boolean;
|
33 | }
|