silvie
Version:
Typescript Back-end Framework
41 lines (40 loc) • 1.16 kB
TypeScript
export default class Controller {
}
/**
* Register class method as HTTP route
* @param method Defines HTTP verb
* @param url Specifies the url for accessing route
*/
export declare function route(method: string, url: string | RegExp): MethodDecorator;
/**
* Assigns one or more middlewares to a route
* @param middlewareNames
*/
export declare function withMiddleware(...middlewareNames: string[]): MethodDecorator;
/**
* Allow upload for a single file with specified field name
* @param fieldName
*/
export declare function singleUpload(fieldName: string): MethodDecorator;
/**
* Allow upload for multiple files with specified field name
* @param fieldName
* @param maxCount
*/
export declare function arrayUpload(fieldName: string, maxCount?: number): MethodDecorator;
/**
* Allow upload for multiple field names
* @param fields
*/
export declare function multipleUpload(...fields: {
name: string;
maxCount?: number;
}[]): MethodDecorator;
/**
* Allow upload without any restrictions
*/
export declare function allowUpload(): MethodDecorator;
/**
* Block any file upload
*/
export declare function preventUpload(): MethodDecorator;