UNPKG

2.29 kBTypeScriptView Raw
1/**
2 * @augments {Error}
3 */
4export declare interface DecoratorError extends Error {
5 constructor();
6}
7/**
8 * @class
9 */
10export declare interface HttpParamAttributeOptions {
11 name: string;
12 type?: string;
13 pattern?: any;
14 minValue?: any;
15 maxValue?: any;
16 minLength?: number;
17 maxLength?: number;
18 required?: boolean;
19 message?: string;
20}
21
22/**
23 * Defines an HTTP action that accepts any HTTP method
24 */
25export declare function httpAny();
26
27/**
28 * Defines an HTTP GET action
29 */
30export declare function httpGet();
31
32/**
33 * Defines an HTTP POST action
34 */
35export declare function httpPost();
36
37/**
38 * Defines an HTTP PUT action
39 */
40export declare function httpPut();
41
42/**
43 * Defines an HTTP DELETE action
44 */
45export declare function httpDelete();
46
47/**
48 * Defines an HTTP APTCH action
49 */
50export declare function httpPatch();
51
52/**
53 * Defines an HTTP HEAD action
54 */
55export declare function httpHead();
56
57/**
58 * Defines an HTTP OPTIONS action
59 */
60export declare function httpOptions();
61
62/**
63 * Defines an HTTP action by declaring action name
64 * @param {string} name - The name of the HTTP action
65 */
66export declare function httpAction(name: string);
67/**
68 * Defines an HTTP action parameter
69 * @param {HttpParamAttributeOptions} attrs
70 */
71export declare function httpParam(attrs: HttpParamAttributeOptions);
72/**
73 * Defines an HTTP authorize attribute
74 */
75export declare function httpAuthorize();
76/**
77 * Defines an HTTP controller
78 * @param {string=} name
79 */
80export declare function httpController(name?: string);
81
82/**
83 * Defines an http route that is going to be registered by an http controller
84 * @param {string} url
85 * @param {string=} format
86 * @param {number=} index
87 */
88export declare function httpRoute(url, format, index);
89/**
90 *
91 * @param {Object|Function} proto - The constructor function of a class or the prototype of a class
92 * @param {string} key - The name of the property or method where the decorator will be included
93 * @param {Function} decorator - The decorator to be included
94 */
95export declare function defineDecorator(proto: any, key: string, decorator: void);
96/**
97 * Defines an HTTP action filter consumer
98 * @param {string} name
99 * @param {Function} consumer
100 * @returns {Function}
101 */
102export declare function httpActionConsumer(name, consumer);