/*! * Jodit Editor PRO (https://xdsoft.net/jodit/) * See LICENSE.md in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/ */ import type { IJodit } from "jodit/esm/types/index"; export interface ITranslateState { sourceLang: string; targetLang: string; } export interface ITranslateProviderFactory { (jodit: IJodit): ITranslateProvider; } export interface ITranslateProvider { translate(text: string, from: string, to: string): Promise; supportedLanguages(): Promise; } export interface ITranslateSupportedLanguages { langs: { [title: string]: string; } | Array<{ title: string; code: string; }>; } export interface ITranslateResponse { text: string; } export interface IGoogleTranslateProviderOptions { url: string; key: string; } export interface IGoogleTranslateResponse { data: { translations: [ { translatedText: string; } ]; }; } export interface ICloudTranslateProviderOptions { url: string; key: string; } export interface ICloudTranslateResponse { success: boolean; text: string; } declare module 'jodit/esm/types/jodit' { interface IJodit { /** * Translate plugin: Translate selection CMD+SHIFT+O */ execCommand(command: 'translate'): void; /** * Translate plugin: Open Translate options CMD+ALT+O */ execCommand(command: 'translateOptions'): void; } }