You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
1.1 KiB

// @ts-nocheck
export function method(opts?:string|Array<string>) {
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
target[propertyKey].$method = opts
}
}
export function route(route?:string) {
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
target[propertyKey].$route = route
}
}
export function config(options:Object) {
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
target[propertyKey].$options = options
}
}
export function auth(isAuth:boolean = true) {
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
target[propertyKey].$auth = isAuth
}
}
export function validate(validate:Object) {
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
target[propertyKey].$validate = validate
}
}
export function swagger(desc,notes,tags) {
return function (target, propertyKey: string, descriptor: PropertyDescriptor) {
target[propertyKey].$swagger = [desc,notes,tags]
}
}