标签:const test nbsp can use pre which define val
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.
[TypeScript] Define a function type
标签:const test nbsp can use pre which define val
原文地址:http://www.cnblogs.com/Answer1215/p/7226858.html