@translated/lara
Version:
Official Lara SDK for JavaScript and Node.js
33 lines (32 loc) • 1.31 kB
TypeScript
import type { LaraClient } from "./net/lara";
import type { MultiPartFile } from "./net/lara/client";
import type { LaraStream } from "./net/s3/laraStream";
import type { NGGlossaryMatch, NGMemoryMatch, TranslationStyle } from "./translator";
export type ImageParagraph = {
readonly text: string;
readonly translation: string;
readonly adaptedToMatches?: NGMemoryMatch[];
readonly glossariesMatches?: NGGlossaryMatch[];
};
export type ImageTextResult = {
readonly sourceLanguage: string;
readonly adaptedTo?: string[];
readonly glossaries?: string[];
readonly paragraphs: ImageParagraph[];
};
export type ImageTextTranslationOptions = {
adaptTo?: string[];
glossaries?: string[];
style?: TranslationStyle;
noTrace?: boolean;
verbose?: boolean;
};
export type ImageTranslationOptions = Omit<ImageTextTranslationOptions & {
textRemoval?: "overlay" | "inpainting";
}, "verbose">;
export declare class ImageTranslator {
private readonly client;
constructor(client: LaraClient);
translate(file: MultiPartFile, source: string | null, target: string, options?: ImageTranslationOptions): Promise<LaraStream>;
translateText(file: MultiPartFile, source: string | null, target: string, options?: ImageTextTranslationOptions): Promise<ImageTextResult>;
}