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 | export interface ParseEnumPipeOptions {
|
5 | errorHttpStatusCode?: ErrorHttpStatusCode;
|
6 | exceptionFactory?: (error: string) => any;
|
7 | }
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare class ParseEnumPipe<T = any> implements PipeTransform<T> {
|
16 | protected readonly enumType: T;
|
17 | protected exceptionFactory: (error: string) => any;
|
18 | constructor(enumType: T, options?: ParseEnumPipeOptions);
|
19 | /**
|
20 | * Method that accesses and performs optional transformation on argument for
|
21 | * in-flight requests.
|
22 | *
|
23 | * @param value currently processed route argument
|
24 | * @param metadata contains metadata about the currently processed route argument
|
25 | */
|
26 | transform(value: T, metadata: ArgumentMetadata): Promise<T>;
|
27 | protected isEnum(value: T): boolean;
|
28 | }
|