// 这是ts内部定义的方法装饰器类型
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
const Logger: MethodDecorator = function(target, property, descriptor) {
descriptor.value = function() {} // 报错,我如何将Function传入MethodDecorator
console.log('logger...')
}
class User {
@Logger
create() {
console.log('create...')
}
}