Here's a quick example illustrating my desired functionality.
// Every time, the ACL class will have a different name such as "UsersACL", etc.
export class EventsACL {
test(): { read: true, write: true } {
}
}
// This function acts as a decorator for other methods
function ACL(obj: {
aclClass: any,
wantedProperties: aclClass.test
});
// Calling it
ACL({ acl: EventsACL, { read: true, write: false });
This means that if I modify the EventsACL test function, it should dynamically update the request value in wantedProperties. I prefer not to use predefined interfaces as I want this to be adaptable for any class.