anylang
Version:
A translator's kit that uses the free APIs of Google Translate, Yandex, Bing, ChatGPT, and other LLMs
18 lines (17 loc) • 785 B
TypeScript
import { BaseTranslator, TranslatorOptions } from '../BaseTranslator';
export type DeepLTranslatorOptions = {
apiKey: string;
};
export declare class DeepLTranslator extends BaseTranslator<DeepLTranslatorOptions> {
static readonly translatorName = "DeepLTranslator";
static isRequiredKey: () => boolean;
static isSupportedAutoFrom: () => boolean;
static getSupportedLanguages(): string[];
private readonly apiHost;
constructor(options: TranslatorOptions<DeepLTranslatorOptions>);
getLengthLimit(): number;
getRequestsTimeout(): number;
checkLimitExceeding(text: string | string[]): number;
translate(text: string, from: string, to: string): Promise<string>;
translateBatch(text: string[], from: string, to: string): Promise<string[]>;
}