Type is not assignable to type typescript