import { LexicalEditor } from 'lexical'; import { DisplayMode } from './types'; export interface TranslateItem { sid: string; text: string; } export type TranslateService = ({ sourceItems, targetLanguage, useCache, }: { sourceItems: TranslateItem[]; targetLanguage: string; useCache?: boolean; }) => Promise; export interface EditorTranslatorOptions { displayMode: DisplayMode; } export declare class EditorTranslator { private editor; private options; private originalEditorState; private preprocessEditorState; private nodeKeyToSidMap; private sidToNodeKeyMap; private translations; private sourceItems; isTranslating: boolean; constructor(editor: LexicalEditor, options: EditorTranslatorOptions); get isTranslated(): boolean; setEditor(editor: LexicalEditor): void; updateOptions(options: EditorTranslatorOptions): void; updateDisplayMode(): void; translate({ targetLanguage, translateService, detectLanguage, useCache, }: { targetLanguage: string; translateService: TranslateService; detectLanguage: (text: string) => string | null; useCache?: boolean; }): Promise; applyTranslations(): void; restore(sid?: string): void; preprocessNodes(): Promise; getOriginalText(sid: string): string | undefined; getTranslationText(sid: string): string | undefined; } export declare function useEditorTranslator(options: EditorTranslatorOptions): EditorTranslator;