Skip to content

no mapping for this #12507

Closed
Closed
@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design LimitationConstraints of the existing architecture prevent this from being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions