UNPKG

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