Add typescript extends method