Represents the options for translation.

interface RequestOptions {
    from: string;
    to: string;
    text: string;
    timeout?: number;
    retry?: number;
}

Properties

from: string

The language name/ISO 639-1 code to translate from. If none is given, it will auto-detect the source language

to: string

The language name/ISO 639-1 code to translate to. If none is given, it will translate to English

text: string

Source text / word

timeout?: number

Timeout duration for the translation request in milliseconds (default: 30000)

retry?: number

Retry attempts for the translation request in case of failure (default: 0)