1 | import { ArgumentMetadata, PipeTransform } from '../interfaces/features/pipe-transform.interface';
|
2 | import { ErrorHttpStatusCode } from '../utils/http-error-by-code.util';
|
3 | export interface ParseBoolPipeOptions {
|
4 | errorHttpStatusCode?: ErrorHttpStatusCode;
|
5 | exceptionFactory?: (error: string) => any;
|
6 | }
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | export declare class ParseBoolPipe implements PipeTransform<string | boolean, Promise<boolean>> {
|
15 | protected exceptionFactory: (error: string) => any;
|
16 | constructor(options?: ParseBoolPipeOptions);
|
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 | boolean, metadata: ArgumentMetadata): Promise<boolean>;
|
25 | /**
|
26 | * @param value currently processed route argument
|
27 | * @returns `true` if `value` is said 'true', ie., if it is equal to the boolean
|
28 | * `true` or the string `"true"`
|
29 | */
|
30 | protected isTrue(value: string | boolean): boolean;
|
31 | /**
|
32 | * @param value currently processed route argument
|
33 | * @returns `true` if `value` is said 'false', ie., if it is equal to the boolean
|
34 | * `false` or the string `"false"`
|
35 | */
|
36 | protected isFalse(value: string | boolean): boolean;
|
37 | }
|