1 | import { ValidatorOptions } from 'class-validator';
|
2 | import { ActionMetadata } from './ActionMetadata';
|
3 | import { ParamMetadataArgs } from './args/ParamMetadataArgs';
|
4 | import { ParamType } from './types/ParamType';
|
5 | import { ClassTransformOptions } from 'class-transformer';
|
6 | import { Action } from '../Action';
|
7 | /**
|
8 | * Action Parameter metadata.
|
9 | */
|
10 | export declare class ParamMetadata {
|
11 | /**
|
12 | * Parameter's action.
|
13 | */
|
14 | actionMetadata: ActionMetadata;
|
15 | /**
|
16 | * Object on which's method's parameter this parameter is attached.
|
17 | */
|
18 | object: any;
|
19 | /**
|
20 | * Method on which's parameter is attached.
|
21 | */
|
22 | method: string;
|
23 | /**
|
24 | * Index (# number) of the parameter in the method signature.
|
25 | */
|
26 | index: number;
|
27 | /**
|
28 | * Parameter type.
|
29 | */
|
30 | type: ParamType;
|
31 | /**
|
32 | * Parameter name.
|
33 | */
|
34 | name: string;
|
35 | /**
|
36 | * Parameter target type.
|
37 | */
|
38 | targetType?: any;
|
39 | /**
|
40 | * Parameter target type's name in lowercase.
|
41 | */
|
42 | targetName: string;
|
43 | /**
|
44 | * Indicates if target type is an object.
|
45 | */
|
46 | isTargetObject: boolean;
|
47 | /**
|
48 | * Parameter target.
|
49 | */
|
50 | target: any;
|
51 | /**
|
52 | * Specifies if parameter should be parsed as json or not.
|
53 | */
|
54 | parse: boolean;
|
55 | /**
|
56 | * Indicates if this parameter is required or not
|
57 | */
|
58 | required: boolean;
|
59 | /**
|
60 | * Transforms the value.
|
61 | */
|
62 | transform: (action: Action, value?: any) => Promise<any> | any;
|
63 | /**
|
64 | * If true, string values are cast to arrays
|
65 | */
|
66 | isArray?: boolean;
|
67 | /**
|
68 | * Additional parameter options.
|
69 | * For example it can be uploader middleware options or body-parser middleware options.
|
70 | */
|
71 | extraOptions: any;
|
72 | /**
|
73 | * Class transform options used to perform plainToClass operation.
|
74 | */
|
75 | classTransform?: ClassTransformOptions;
|
76 | /**
|
77 | * If true, class-validator will be used to validate param object.
|
78 | * If validation options are given then it means validation will be applied (is true).
|
79 | */
|
80 | validate?: boolean | ValidatorOptions;
|
81 | constructor(actionMetadata: ActionMetadata, args: ParamMetadataArgs);
|
82 | }
|