It would be a bit more troublesome for TypeScript or JavaScript to have this, because in their world a method is just an Object attribute that holds a function reference instead of Ruby's way where the entire interface of an object consists of methods.
It might however be possible to implement something like this using a Proxy
class. MDN describes it as follows:
The Proxy object allows you to create an object that can be used in
place of the original object, but which may redefine fundamental
Object operations like getting, setting, and defining properties.
Proxy objects are commonly used to log property accesses, validate,
format, or sanitize inputs, and so on.
I've heard that this feature supposedly could not be transpiled down to ECMAScript 5 platforms. I have not confirmed this yet, but better test this, so that you don't lock yourself out of platforms that are mandatory for you by considering this feature.