import { Glossary } from "./glossary.js"; //#region src/prompt.d.ts /** * The media type of the input text. * * - `"text/plain"`: Plain text * - `"text/html"`: HTML content * - `"text/markdown"`: Markdown content */ type MediaType = "text/plain" | "text/html" | "text/markdown"; /** * The desired tone for the translated text. */ type TranslationTone = "formal" | "informal" | "technical" | "casual" | "professional" | "literary" | "journalistic"; /** * Gets the English display name for a language. * * @param language The language as an `Intl.Locale` or BCP 47 tag. * @returns The English display name for the language. */ declare function getLanguageName(language: Intl.Locale | string): string; /** * Options for building the system prompt. */ interface SystemPromptOptions { readonly sourceLanguage?: Intl.Locale | string; readonly tone?: TranslationTone; readonly domain?: string; readonly mediaType?: MediaType; readonly context?: string; readonly glossary?: Glossary; } /** * Builds the system prompt for the translation. * * @param targetLanguage The target language for translation. * @param options Additional options for the prompt. * @returns The system prompt string. */ declare function buildSystemPrompt(targetLanguage: Intl.Locale | string, options?: SystemPromptOptions): string; /** * Represents a previously translated chunk for context. */ interface TranslatedChunk { readonly source: string; readonly translation: string; } /** * Builds the user prompt for the translation. * * @param text The text to translate. * @param title An optional title to include. * @returns The user prompt string. */ declare function buildUserPrompt(text: string, title?: string): string; /** * Builds the user prompt with previous chunk context. * * @param text The text to translate. * @param previousChunks Previously translated chunks for context. * @returns The user prompt string with context. */ declare function buildUserPromptWithContext(text: string, previousChunks: readonly TranslatedChunk[]): string; /** * Extracts the translated title from the translated text. * * @param translatedText The translated text that may contain a title. * @returns The extracted title, or undefined if not found. */ declare function extractTitle(translatedText: string): string | undefined; //#endregion export { MediaType, SystemPromptOptions, TranslatedChunk, TranslationTone, buildSystemPrompt, buildUserPrompt, buildUserPromptWithContext, extractTitle, getLanguageName };