結果 : typescript define function inside type