UNPKG

965 BTypeScriptView Raw
1import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface';
2import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util';
3export interface ParseIntPipeOptions {
4 errorHttpStatusCode?: ErrorHttpStatusCode;
5 exceptionFactory?: (error: string) => any;
6}
7/**
8 * Defines the built-in ParseInt Pipe
9 *
10 * @see [Built-in Pipes](https://docs.nestjs.com/pipes#built-in-pipes)
11 *
12 * @publicApi
13 */
14export declare class ParseIntPipe implements PipeTransform<string> {
15 protected exceptionFactory: (error: string) => any;
16 constructor(options?: ParseIntPipeOptions);
17 /**
18 * Method that accesses and performs optional transformation on argument for
19 * in-flight requests.
20 *
21 * @param value currently processed route argument
22 * @param metadata contains metadata about the currently processed route argument
23 */
24 transform(value: string, metadata: ArgumentMetadata): Promise<number>;
25}