Closed
Description
i want to extend the Object prototype by adding a method that returns a proxified version of any object
Object.defineProperty(Object.prototype, 'proxify, {
get: function(this: any) {
// creating a proxy for the darn object
}
});
const data = {
name: 'hey',
value: 123
};
const proxy = data.proxify();
declare global {
interface Object {
proxify(): {
[P in keyof this]: Proxied<this [p]>; // expected to work, actual: A 'this' type is available only in a non-static member of a class or interface.
}
}
}
what am i doing wrong?