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 ParseBoolPipeOptions {
|
7 | |
8 |
|
9 |
|
10 | errorHttpStatusCode?: ErrorHttpStatusCode;
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | exceptionFactory?: (error: string) => any;
|
18 | |
19 |
|
20 |
|
21 |
|
22 | optional?: boolean;
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export declare class ParseBoolPipe implements PipeTransform<string | boolean, Promise<boolean>> {
|
32 | protected readonly options?: ParseBoolPipeOptions | undefined;
|
33 | protected exceptionFactory: (error: string) => any;
|
34 | constructor(options?: ParseBoolPipeOptions | undefined);
|
35 | /**
|
36 | * Method that accesses and performs optional transformation on argument for
|
37 | * in-flight requests.
|
38 | *
|
39 | * @param value currently processed route argument
|
40 | * @param metadata contains metadata about the currently processed route argument
|
41 | */
|
42 | transform(value: string | boolean, metadata: ArgumentMetadata): Promise<boolean>;
|
43 | /**
|
44 | * @param value currently processed route argument
|
45 | * @returns `true` if `value` is said 'true', ie., if it is equal to the boolean
|
46 | * `true` or the string `"true"`
|
47 | */
|
48 | protected isTrue(value: string | boolean): boolean;
|
49 | /**
|
50 | * @param value currently processed route argument
|
51 | * @returns `true` if `value` is said 'false', ie., if it is equal to the boolean
|
52 | * `false` or the string `"false"`
|
53 | */
|
54 | protected isFalse(value: string | boolean): boolean;
|
55 | }
|