Fix type error of typescript definition