import Z from 'zod';
import { LocaleCode } from '@replexica/spec';

declare const engineParamsSchema: Z.ZodObject<{
    apiKey: Z.ZodString;
    apiUrl: Z.ZodDefault<Z.ZodString>;
    batchSize: Z.ZodDefault<Z.ZodNumber>;
    idealBatchItemSize: Z.ZodDefault<Z.ZodNumber>;
}, "passthrough", Z.ZodTypeAny, Z.objectOutputType<{
    apiKey: Z.ZodString;
    apiUrl: Z.ZodDefault<Z.ZodString>;
    batchSize: Z.ZodDefault<Z.ZodNumber>;
    idealBatchItemSize: Z.ZodDefault<Z.ZodNumber>;
}, Z.ZodTypeAny, "passthrough">, Z.objectInputType<{
    apiKey: Z.ZodString;
    apiUrl: Z.ZodDefault<Z.ZodString>;
    batchSize: Z.ZodDefault<Z.ZodNumber>;
    idealBatchItemSize: Z.ZodDefault<Z.ZodNumber>;
}, Z.ZodTypeAny, "passthrough">>;
declare const payloadSchema: Z.ZodRecord<Z.ZodString, Z.ZodAny>;
declare const localizationParamsSchema: Z.ZodObject<{
    sourceLocale: Z.ZodEffects<Z.ZodString, string, string>;
    targetLocale: Z.ZodEffects<Z.ZodString, string, string>;
    fast: Z.ZodOptional<Z.ZodBoolean>;
}, "strip", Z.ZodTypeAny, {
    sourceLocale: string;
    targetLocale: string;
    fast?: boolean | undefined;
}, {
    sourceLocale: string;
    targetLocale: string;
    fast?: boolean | undefined;
}>;
declare const referenceSchema: Z.ZodRecord<Z.ZodEffects<Z.ZodString, string, string>, Z.ZodRecord<Z.ZodString, Z.ZodAny>>;
/**
 * ReplexicaEngine class for interacting with the Replexica API
 * A powerful localization engine that supports various content types including
 * plain text, objects, chat sequences, and HTML documents.
 */
declare class ReplexicaEngine {
    private config;
    /**
     * Create a new ReplexicaEngine instance
     * @param config - Configuration options for the Engine
     */
    constructor(config: Partial<Z.infer<typeof engineParamsSchema>>);
    /**
     * Localize content using the Replexica API
     * @param payload - The content to be localized
     * @param params - Localization parameters including source/target locales and fast mode option
     * @param reference - Optional reference translations to maintain consistency
     * @param progressCallback - Optional callback function to report progress (0-100)
     * @returns Localized content
     * @internal
     */
    _localizeRaw(payload: Z.infer<typeof payloadSchema>, params: Z.infer<typeof localizationParamsSchema>, reference?: Z.infer<typeof referenceSchema>, progressCallback?: (progress: number) => void): Promise<Record<string, string>>;
    /**
     * Localize a single chunk of content
     * @param sourceLocale - Source locale
     * @param targetLocale - Target locale
     * @param payload - Payload containing the chunk to be localized
     * @returns Localized chunk
     */
    private localizeChunk;
    /**
     * Extract payload chunks based on the ideal chunk size
     * @param payload - The payload to be chunked
     * @returns An array of payload chunks
     */
    private extractPayloadChunks;
    /**
     * Count words in a record or array
     * @param payload - The payload to count words in
     * @returns The total number of words
     */
    private countWordsInRecord;
    /**
     * Localize a typical JavaScript object
     * @param obj - The object to be localized (strings will be extracted and translated)
     * @param params - Localization parameters:
     *   - sourceLocale: The source language code (e.g., 'en')
     *   - targetLocale: The target language code (e.g., 'es')
     *   - fast: Optional boolean to enable fast mode (faster but potentially lower quality)
     * @param progressCallback - Optional callback function to report progress (0-100)
     * @returns A new object with the same structure but localized string values
     */
    localizeObject(obj: Record<string, any>, params: Z.infer<typeof localizationParamsSchema>, progressCallback?: (progress: number) => void): Promise<Record<string, any>>;
    /**
     * Localize a single text string
     * @param text - The text string to be localized
     * @param params - Localization parameters:
     *   - sourceLocale: The source language code (e.g., 'en')
     *   - targetLocale: The target language code (e.g., 'es')
     *   - fast: Optional boolean to enable fast mode (faster for bigger batches)
     * @param progressCallback - Optional callback function to report progress (0-100)
     * @returns The localized text string
     */
    localizeText(text: string, params: Z.infer<typeof localizationParamsSchema>, progressCallback?: (progress: number) => void): Promise<string>;
    /**
     * Localize a text string to multiple target locales
     * @param text - The text string to be localized
     * @param params - Localization parameters:
     *   - sourceLocale: The source language code (e.g., 'en')
     *   - targetLocales: An array of target language codes (e.g., ['es', 'fr'])
     *   - fast: Optional boolean to enable fast mode (for bigger batches)
     * @returns An array of localized text strings
     */
    batchLocalizeText(text: string, params: {
        sourceLocale: LocaleCode;
        targetLocales: LocaleCode[];
        fast?: boolean;
    }): Promise<string[]>;
    /**
     * Localize a chat sequence while preserving speaker names
     * @param chat - Array of chat messages, each with 'name' and 'text' properties
     * @param params - Localization parameters:
     *   - sourceLocale: The source language code (e.g., 'en')
     *   - targetLocale: The target language code (e.g., 'es')
     *   - fast: Optional boolean to enable fast mode (faster but potentially lower quality)
     * @param progressCallback - Optional callback function to report progress (0-100)
     * @returns Array of localized chat messages with preserved structure
     */
    localizeChat(chat: Array<{
        name: string;
        text: string;
    }>, params: Z.infer<typeof localizationParamsSchema>, progressCallback?: (progress: number) => void): Promise<Array<{
        name: string;
        text: string;
    }>>;
    /**
     * Localize an HTML document while preserving structure and formatting
     * Handles both text content and localizable attributes (alt, title, placeholder, meta content)
     * @param html - The HTML document string to be localized
     * @param params - Localization parameters:
     *   - sourceLocale: The source language code (e.g., 'en')
     *   - targetLocale: The target language code (e.g., 'es')
     *   - fast: Optional boolean to enable fast mode (faster but potentially lower quality)
     * @param progressCallback - Optional callback function to report progress (0-100)
     * @returns The localized HTML document as a string, with updated lang attribute
     */
    localizeHtml(html: string, params: Z.infer<typeof localizationParamsSchema>, progressCallback?: (progress: number) => void): Promise<string>;
    /**
     * Detect the language of a given text
     * @param text - The text to analyze
     * @returns Promise resolving to a locale code (e.g., 'en', 'es', 'fr')
     */
    recognizeLocale(text: string): Promise<LocaleCode>;
}

export { ReplexicaEngine };
