fix pointer types in Typescript