Typescript Method Is Not A Function