export class UiKeyPressableMock implements Xrm . Controls . UiKeyPressable { constructor ( public keyPressHandlers ? ) { this . keyPressHandlers = keyPressHandlers || [ ] ; } public addOnKeyPress ( handler ) { this . keyPressHandlers . push ( handler ) ; } public fireOnKeyPress ( eventContext ? ) { this . keyPressHandlers . forEach ( ( k ) => { k ( eventContext ) ; } ) ; } public removeOnKeyPress ( handler ) { const index = this . keyPressHandlers . indexOf ( handler ) ; if ( index > - 1 ) { this . keyPressHandlers . splice ( index ) ; } } }