mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
18 lines
636 B
TypeScript
18 lines
636 B
TypeScript
import type { LanguageCode } from 'iso-639-1';
|
|
|
|
/** DittoTranslator class, used for status translation. */
|
|
export interface DittoTranslator {
|
|
/** Provider name, eg `DeepL.com` */
|
|
provider: string;
|
|
/** Translate the 'content' into 'targetLanguage'. */
|
|
translate(
|
|
/** Texts to translate. */
|
|
texts: string[],
|
|
/** The language of the source texts. */
|
|
sourceLanguage: LanguageCode | undefined,
|
|
/** The texts will be translated into this language. */
|
|
targetLanguage: LanguageCode,
|
|
/** Custom options. */
|
|
opts?: { signal?: AbortSignal },
|
|
): Promise<{ results: string[]; sourceLang: LanguageCode }>;
|
|
}
|