-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtypes.js
More file actions
64 lines (57 loc) · 1.46 KB
/
types.js
File metadata and controls
64 lines (57 loc) · 1.46 KB
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
/**
* @type {*}
*/
globalThis.chrome = {};
/**
* @typedef Language
* @property {string} code
* @property {string} friendlyName
*/
/**
* @typedef SupportedLanguages
* @property {Array<Language>} sourceLanguages
* @property {Array<Language>} targetLanguages
*/
/**
* @typedef Translator
* @property {string} uid
* @property {string} friendlyName
* @property {string} autoDetectLanguageCode
* @property {GetSupportedLanguagesAsyncFn} getSupportedLanguagesAsync
* @property {TranslateAsyncFn} translateAsync
*/
/**
* @callback GetSupportedLanguagesAsyncFn
* @param {string} uiLanguageCode
* @return {Promise<SupportedLanguages>}
*/
/**
* @typedef TranslateRequests
* @property {boolean} [translation]
* @property {boolean} [alternateTranslations]
* @property {boolean} [transcription]
* @property {boolean} [dictionary]
* @property {boolean} [definitions]
* @property {boolean} [synonyms]
* @property {boolean} [examples]
*/
/**
* @callback TranslateAsyncFn
* @param {string} sourceText
* @param {string} sourceLanguageCode
* @param {string} targetLanguageCode
* @param {string} uiLanguageCode
* @param {TranslateRequests} [requests]
* @return {Promise<{
* translatedText?: string,
* sourceLanguageCode: string,
* dictionary?: Array<{
* partOfSpeech: string,
* terms: Array<{
* word: string,
* reverseTranslation: Array<string>,
* }>
* }>
* }>}
*/
export {};