UNPKG

jodit-pro

Version:

PRO Version of Jodit Editor

51 lines (50 loc) 1.4 kB
/*! * 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<ITranslateResponse>; supportedLanguages(): Promise<ITranslateSupportedLanguages>; } export interface ITranslateSupportedLanguages { langs: { [title: string]: string; }; } export interface ITranslateResponse { text: string; } export interface IGoogleTranslateProviderOptions { url: string; key: string; } export interface IGoogleTranslateResponse { data: { translations: [ { translatedText: 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; } }