Typescript Error Is Not A Function Typeerror