mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
| .. | ||
| gapi.client.webfonts-tests.ts | ||
| index.d.ts | ||
| readme.md | ||
| tsconfig.json | ||
| tslint.json | ||
TypeScript typings for Google Fonts Developer API v1
Accesses the metadata for all families served by Google Fonts, providing a list of families currently available (including available styles and a list of supported script subsets). For detailed description please check documentation.
Installing
Install typings for Google Fonts Developer API:
npm install @types/gapi.client.webfonts@v1 --save-dev
Usage
You need to initialize Google API client in your code:
gapi.load("client", () => {
// now we can use gapi.client
// ...
});
Then load api client wrapper:
gapi.client.load('webfonts', 'v1', () => {
// now we can use gapi.client.webfonts
// ...
});
After that you can use Google Fonts Developer API resources:
/*
Retrieves the list of fonts currently served by the Google Fonts Developer API
*/
await gapi.client.webfonts.list({ });