type DigitValidator = (char) => boolean; const numericValidator = (char) => /[0-9]{1}/.test(char); export const digitValidators: {[key: string]: DigitValidator} = { '9': numericValidator };
We can use 'type' keyword to define a function type.
'digitValidators', is a mapping object, return a function which type is DigitValidator.