UNPKG

2.21 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 * Function that returns a reference to the arguments host class.
18 */
19 type?: () => any;
20};
21/**
22 * Resolver method parameter decorator. Extracts the arguments
23 * object from the underlying platform and populates the decorated
24 * parameter with the value of either all arguments or a single specified argument.
25 */
26export declare function Args(): ParameterDecorator;
27/**
28 * Resolver method parameter decorator. Extracts the arguments
29 * object from the underlying platform and populates the decorated
30 * parameter with the value of either all arguments or a single specified argument.
31 */
32export declare function Args(...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator;
33/**
34 * Resolver method parameter decorator. Extracts the arguments
35 * object from the underlying platform and populates the decorated
36 * parameter with the value of either all arguments or a single specified argument.
37 */
38export declare function Args(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator;
39/**
40 * Resolver method parameter decorator. Extracts the arguments
41 * object from the underlying platform and populates the decorated
42 * parameter with the value of either all arguments or a single specified argument.
43 */
44export declare function Args(options: ArgsOptions, ...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator;
45/**
46 * Resolver method parameter decorator. Extracts the arguments
47 * object from the underlying platform and populates the decorated
48 * parameter with the value of either all arguments or a single specified argument.
49 */
50export declare function Args(property: string, options: ArgsOptions, ...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator;
51//# sourceMappingURL=args.decorator.d.ts.map
\No newline at end of file