Improve the typescript's type definition.