From e84da7a230038a1d2c2ddc7771e2c1fe11c6619d Mon Sep 17 00:00:00 2001 From: sgtfrankieboy Date: Sun, 7 Jul 2013 10:41:44 +0200 Subject: [PATCH] Google Translate API --- gapi.translate/gapi.translate.d.ts | 117 +++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 gapi.translate/gapi.translate.d.ts diff --git a/gapi.translate/gapi.translate.d.ts b/gapi.translate/gapi.translate.d.ts new file mode 100644 index 000000000..e1d43fed8 --- /dev/null +++ b/gapi.translate/gapi.translate.d.ts @@ -0,0 +1,117 @@ + +/// + + /** + * + */ + +declare module gapi.client.language { + + export interface detections { + + /** + * Detect the language of text. + */ + list(object: { + /** + * The text to detect + */ + q: string; + /** + * Selector specifying which fields to include in a partial response. + */ + fields?: string; + }): HttpRequest; + } + + export interface languages { + + + /** + * List the source/target languages supported by the API + */ + list(object: { + /** + * the language and collation in which the localized results should be returned + */ + target?: string; + /** + * Selector specifying which fields to include in a partial response. + */ + fields?: string; + }): HttpRequest + + } + + export interface translations { + + /** + * Returns text translations from one language to another. + */ + list(object: { + /** + * The text to translate + */ + q: string; + /** + * The target language into which the text should be translated + */ + target: string; + /** + * The customization id for translate + */ + cid?: string; + /** + * This optional parameter allows you to indicate that the text to be translated is either plain-text or HTML. A value of html indicates HTML and a value of text indicates plain-text + */ + format?: string; + /** + * The source language of the text + */ + source?: string; + /** + * Selector specifying which fields to include in a partial response. + */ + fields?: string; + /** + * If prettyprint=true, the results returned by the server will be human readable (pretty printed). + */ + prettyprint?: string; + }): HttpRequest; + + } +} + + +interface GoogleApiTranslateTranslationListResponse { + + data: { + translations: { + translatedText: string; + detectedSourceLanguage: string; + }[]; + } + +} + +interface GoogleApiTranslateLanguageListResponse { + + data: { + languages: { + language: string; + name: string; + }[]; + } + +} + +interface GoogleApiTranslateDetectionListResponse { + + data: { + detections: { + language: string; + confidence: number; + }[][]; + } + +} \ No newline at end of file