typescript extract interface from class