Don´t forget to set up experimentalDecorators as a true value into the compileOptions attribute in the tsconfig.json file. Call this decorator before method as @decoratorName() export function decoratorName(paramName : boolean = false) { return function(target: any, propertyKey: string, descriptor: PropertyDescriptor) { const originalMethod = descriptor.value; descriptor.value = function(...args: any[]) { // do something here const return_values = originalMethod.apply(this, args), milissegundos); // do something here return return_values } return descriptor; } }
https://cursos.alura.com.br/course/typescript-parte2/task/27343