1
我有以下類型的別名:如何註釋一個對象中屬性的函數?
type TestType = {
critical: string,
failProps: Object,
successProps: ?Object,
test: Function,
};
我想更具體與test
。該功能應該是這樣的簽名:
function (value: string): boolean { /* ... */ }
如何表明test
應該採取一個字符串參數並返回一個布爾值?