forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gapi.translate.d.ts
117 lines (96 loc) · 2.38 KB
/
gapi.translate.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// Type definitions for Google Translate API
// Project: https://developers.google.com/translate/
// Definitions by: Frank M <https://github.com/sgtfrankieboy>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../gapi/gapi.d.ts" />
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<GoogleApiTranslateDetectionListResponse>;
}
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<GoogleApiTranslateLanguageListResponse>
}
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<GoogleApiTranslateTranslationListResponse>;
}
}
interface GoogleApiTranslateTranslationListResponse {
data: {
translations: {
translatedText: string;
detectedSourceLanguage: string;
}[];
}
}
interface GoogleApiTranslateLanguageListResponse {
data: {
languages: {
language: string;
name: string;
}[];
}
}
interface GoogleApiTranslateDetectionListResponse {
data: {
detections: {
language: string;
confidence: number;
}[][];
}
}