I think I have seen similar question in stackoverflow. however I am unable to find the link to that for reference. However, please try initializing with a helper function - create
function create<T extends Enforcer>(instance: T, keys: (keyof T['keys'])[]): Inherit<T> {
return [instance, keys];
}
const h = create(p, ['a', 'b']);