TypeScript typings for Travel Impact Model API v1
Travel Impact Model API lets you query travel carbon emission estimates.
For detailed description please check documentation.
Installing
Install typings for Travel Impact Model API:
npm install @types/gapi.client.travelimpactmodel-v1 --save-dev
Usage
You need to initialize Google API client in your code:
gapi.load('client', () => {
});
Then load api client wrapper:
gapi.client.load(
'https://travelimpactmodel.googleapis.com/$discovery/rest?version=v1',
() => {
}
);
gapi.client.load('travelimpactmodel', 'v1', () => {
});
After that you can use Travel Impact Model API resources:
await gapi.client.travelimpactmodel.flights.computeFlightEmissions({});