UNPKG

gas-types-detailed

Version:

Enhanced Google Apps Script Type Definitions with detailed documentation. Includes type definitions plus code snippets, return values, required authorization scopes, and other details not found in @types/google-apps-script.

63 lines (57 loc) 2.76 kB
// Type definitions for Google Apps Script 2025-11-10 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen <https://github.com/motemen/> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// <reference path="google-apps-script.types.d.ts" /> declare namespace GoogleAppsScript { namespace Language { /** * The Language service provides scripts a way to compute automatic translations of text. * * // The code below will write "Esta es una prueba" to the log. * const spanish = LanguageApp.translate('This is a test', 'en', 'es'); * Logger.log(spanish); */ interface LanguageApp { /** * Automatically translates some text from a source language to a destination language. * * // The code below will write "Esta es una prueba" to the log. * const spanish = LanguageApp.translate('This is a test', 'en', 'es'); * Logger.log(spanish); * * Return: * - String — the translated text * * https://developers.google.com/apps-script/reference/language/language-app#translate(String,String,String) * @param text the text to translate * @param sourceLanguage the language code in which text is written. If it is set to the empty string, the source language code will be auto-detected * @param targetLanguage the language code to which the text should be translated */ translate(text: string, sourceLanguage: string, targetLanguage: string): string; /** * Automatically translates some text from a source language to a destination language. * * // The code below will write "Esta es una <strong>prueba</strong>" to the log. * const spanish = LanguageApp.translate( * 'This is a &lt;strong&gt;test&lt;/strong&gt;', * 'en', * 'es', * {contentType: 'html'}, * ); * Logger.log(spanish); * * Return: * - String — the translated text * * https://developers.google.com/apps-script/reference/language/language-app#translate(String,String,String,Object) * @param text the text to translate * @param sourceLanguage the language code in which text is written. If it is set to the empty string, the source language code will be auto-detected * @param targetLanguage the language code to which the text should be translated * @param advancedArgs optional JavaScript object fields */ translate(text: string, sourceLanguage: string, targetLanguage: string, advancedArgs: any): string; } } } declare var LanguageApp: GoogleAppsScript.Language.LanguageApp;