conversion to typescript