@maxim_mazurok/gapi.client.translate-v3
Advanced tools
Comparing version 0.0.20231013 to 0.0.20231201
{ | ||
"name": "@maxim_mazurok/gapi.client.translate-v3", | ||
"version": "0.0.20231013", | ||
"version": "0.0.20231201", | ||
"description": "TypeScript typings for Cloud Translation API v3", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git" | ||
}, | ||
"license": "MIT", | ||
"author": { | ||
"name": "Maxim Mazurok", | ||
"email": "maxim@mazurok.com", | ||
"name": "Maxim Mazurok", | ||
"url": "https://maxim.mazurok.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git" | ||
}, | ||
"types": "index.d.ts", | ||
@@ -16,0 +16,0 @@ "dependencies": { |
@@ -28,6 +28,9 @@ # TypeScript typings for Cloud Translation API v3 | ||
```typescript | ||
gapi.client.load('https://translation.googleapis.com/$discovery/rest?version=v3', () => { | ||
// now we can use: | ||
// gapi.client.translate | ||
}); | ||
gapi.client.load( | ||
'https://translation.googleapis.com/$discovery/rest?version=v3', | ||
() => { | ||
// now we can use: | ||
// gapi.client.translate | ||
} | ||
); | ||
``` | ||
@@ -49,20 +52,21 @@ | ||
scope = [ | ||
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. | ||
'https://www.googleapis.com/auth/cloud-platform', | ||
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. | ||
'https://www.googleapis.com/auth/cloud-platform', | ||
// Translate text from one language to another using Google Translate | ||
'https://www.googleapis.com/auth/cloud-translation', | ||
], | ||
immediate = true; | ||
// Translate text from one language to another using Google Translate | ||
'https://www.googleapis.com/auth/cloud-translation', | ||
], | ||
immediate = true; | ||
// ... | ||
gapi.auth.authorize( | ||
{ client_id: client_id, scope: scope, immediate: immediate }, | ||
{client_id: client_id, scope: scope, immediate: immediate}, | ||
authResult => { | ||
if (authResult && !authResult.error) { | ||
/* handle successful authorization */ | ||
/* handle successful authorization */ | ||
} else { | ||
/* handle authorization error */ | ||
/* handle authorization error */ | ||
} | ||
}); | ||
} | ||
); | ||
``` | ||
@@ -73,7 +77,6 @@ | ||
```typescript | ||
/* | ||
Detects the language of text within a request. | ||
*/ | ||
await gapi.client.translate.projects.detectLanguage({ parent: "parent", }); | ||
await gapi.client.translate.projects.detectLanguage({parent: 'parent'}); | ||
@@ -83,3 +86,3 @@ /* | ||
*/ | ||
await gapi.client.translate.projects.getSupportedLanguages({ parent: "parent", }); | ||
await gapi.client.translate.projects.getSupportedLanguages({parent: 'parent'}); | ||
@@ -89,3 +92,3 @@ /* | ||
*/ | ||
await gapi.client.translate.projects.romanizeText({ parent: "parent", }); | ||
await gapi.client.translate.projects.romanizeText({parent: 'parent'}); | ||
@@ -95,3 +98,3 @@ /* | ||
*/ | ||
await gapi.client.translate.projects.translateText({ parent: "parent", }); | ||
await gapi.client.translate.projects.translateText({parent: 'parent'}); | ||
``` |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95
168912
3
2767