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