improve typescript declaration.