import { SpecialProperty } from './SpecialProperty'; import { ActionInstance } from './ActionInstance'; export interface SpecialPropertyFactory { (propertyName: string, instance: ActionInstance): T; } export const specialPropertyProxyFactory: SpecialPropertyFactory = (propertyName: string, instance: ActionInstance): T => { const propertyValue = instance[propertyName]; return new Proxy(propertyValue, { get(targetEvent, key: string) { return key === 'action' ? instance : targetEvent[key as keyof T]; }, }); };