UNPKG

2.31 kBTypeScriptView Raw
1import { PipeTransform, Type } from '@nestjs/common';
2import 'reflect-metadata';
3import { BaseTypeOptions } from '../interfaces';
4/**
5 * Interface defining options that can be passed to `@Args()` decorator.
6 */
7export type ArgsOptions<T = any> = BaseTypeOptions<T> & {
8 /**
9 * Name of the argument.
10 */
11 name?: string;
12 /**
13 * Description of the argument.
14 */
15 description?: string;
16 /**
17 * Argument deprecation reason (if deprecated).
18 */
19 deprecationReason?: string;
20 /**
21 * Function that returns a reference to the arguments host class.
22 */
23 type?: () => any;
24};
25/**
26 * Resolver method parameter decorator. Extracts the arguments
27 * object from the underlying platform and populates the decorated
28 * parameter with the value of either all arguments or a single specified argument.
29 */
30export declare function Args(): ParameterDecorator;
31/**
32 * Resolver method parameter decorator. Extracts the arguments
33 * object from the underlying platform and populates the decorated
34 * parameter with the value of either all arguments or a single specified argument.
35 */
36export declare function Args(...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator;
37/**
38 * Resolver method parameter decorator. Extracts the arguments
39 * object from the underlying platform and populates the decorated
40 * parameter with the value of either all arguments or a single specified argument.
41 */
42export declare function Args(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator;
43/**
44 * Resolver method parameter decorator. Extracts the arguments
45 * object from the underlying platform and populates the decorated
46 * parameter with the value of either all arguments or a single specified argument.
47 */
48export declare function Args(options: ArgsOptions, ...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator;
49/**
50 * Resolver method parameter decorator. Extracts the arguments
51 * object from the underlying platform and populates the decorated
52 * parameter with the value of either all arguments or a single specified argument.
53 */
54export declare function Args(property: string, options: ArgsOptions, ...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator;
55//# sourceMappingURL=args.decorator.d.ts.map
\No newline at end of file