@maxim_mazurok/gapi.client.webfonts-v1
v0.0.20241113
Published
TypeScript typings for Web Fonts Developer API v1
Downloads
4,530
Readme
TypeScript typings for Web Fonts Developer API v1
The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google. For detailed description please check documentation.
Installing
Install typings for Web 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(
'https://webfonts.googleapis.com/$discovery/rest?version=v1',
() => {
// now we can use:
// gapi.client.webfonts
}
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('webfonts', 'v1', () => {
// now we can use:
// gapi.client.webfonts
});
After that you can use Web Fonts Developer API resources:
/*
Retrieves the list of fonts currently served by the Google Fonts Developer API.
*/
await gapi.client.webfonts.webfonts.list({});