message: Improve typing of dynamic method lookup for keyboard handlers
  Thanks for the assist!
diff: @@ -29,9 +29,7 @@ abstract class BaseKeyboardHandler implements KeyboardHandler {
  handle(ev: KeyboardEvent): void {
  let unhandled = false;
  - let handlerMethodName = `on${ev.code}`;
  - //@ts-expect-error dynamic method lookup
  - let handlerMethod = this[handlerMethodName];
  + let handlerMethod = this.handlerMethodFromEventCode(ev.code);
  if (handlerMethod) {
  handlerMethod.call(this);
  } else if (/^Digit[0-9]$/.test(ev.code)) {
  @@ -59,6 +57,25 @@ abstract class BaseKeyboardHandler implements KeyboardHandler {
  this.component.setMeridian('pm');
  }
  + private handlerMethodFromEventCode(eventCode: string) {
  + type ValidStringKey = Extract<keyof this, string>;
  +
  + const isValidMethodKey = (
  + methodName: string
  + ): methodName is ValidStringKey => {
  + return Object.keys(this).includes(methodName);
  + };
  +
  + let handlerMethodName = `on${eventCode}`;
  + if (isValidMethodKey(handlerMethodName)) {
  + let candidate = this[handlerMethodName];
  + if (typeof candidate === 'function') {
  + return candidate;
  + }
  + }
  + return undefined;
  + }
  +
  abstract onNumberKey(ev: KeyboardEvent): void;
  }
  