First of all, I think you shouldn’t use jQuery in an Angular application, since it won’t make your code any nicer and there’s nothing Angular can’t do that jQuery can. If you do think that’s the case or if you think it’s convenient to use, please try some Angular2 tutorials (loading jquery like this also makes your app slower and dependant).
Secondly for scoping reasons I would never use var but let instead. Then the last one: cannot find name gapi is very logical, since it isn’t a known type. As says the description typescript error. It means you must somehow let the typescript compiler know you’re using an unknown type. You could add this in your declarations.d.ts or in your component:
declare var gapi any
Or even better, google if there’s a gapi typescript package which you can install for the missing typings.