/**
 * Preprocessor
 *
 * Translates non-English hyperscript to English using the semantic parser
 * (with optional i18n fallback), so the original _hyperscript can parse it.
 */
interface PreprocessorConfig {
    /**
     * Minimum confidence threshold for semantic parsing (0-1). Default: 0.5.
     * Can be a single number (applies to all languages) or a per-language map.
     * Per-language thresholds are useful because SOV languages (ja, ko, tr) produce
     * inherently lower confidence scores than SVO languages (es, fr, de).
     *
     * @example
     * // Single threshold
     * { confidenceThreshold: 0.5 }
     *
     * @example
     * // Per-language thresholds
     * { confidenceThreshold: { es: 0.7, ja: 0.1, ko: 0.05, '*': 0.5 } }
     */
    confidenceThreshold: number | Record<string, number>;
    /** Strategy: 'semantic' (default), 'i18n', or 'auto' (semantic then i18n) */
    strategy: 'semantic' | 'i18n' | 'auto';
    /** Whether to return original text on failure. Default: true */
    fallbackToOriginal: boolean;
    /** Optional i18n toEnglish function (loaded dynamically if available) */
    i18nToEnglish?: (input: string, locale: string) => string;
}
/**
 * Preprocess non-English hyperscript into English.
 *
 * Uses the semantic parser to parse the input in the source language,
 * then renders back to English. Falls through to i18n if configured.
 *
 * Handles _hyperscript feature prefixes (e.g. "on click", "on every keyup")
 * by stripping them, translating only the command portion, then reassembling.
 */
declare function preprocessToEnglish(src: string, lang: string, config?: Partial<PreprocessorConfig>): string;

/**
 * _hyperscript Plugin
 *
 * Registers with _hyperscript.use() to intercept getScript() and
 * preprocess non-English hyperscript into English before parsing.
 */

interface PluginOptions extends Partial<PreprocessorConfig> {
    /** Default language for all elements (overridable per-element). */
    defaultLanguage?: string;
    /** Custom attribute name for per-element language. Default: "data-lang" */
    languageAttribute?: string;
    /** Enable debug logging to console. Default: false */
    debug?: boolean;
}
/**
 * Create a _hyperscript plugin that enables multilingual hyperscript.
 *
 * @example
 * // Basic usage
 * _hyperscript.use(hyperscriptI18n());
 *
 * @example
 * // With options
 * _hyperscript.use(hyperscriptI18n({
 *   defaultLanguage: 'ja',
 *   confidenceThreshold: 0.6,
 *   debug: true,
 * }));
 */
declare function hyperscriptI18n(options?: PluginOptions): (hs: unknown) => void;
/**
 * Standalone preprocessing function for programmatic use.
 * Call this when using _hyperscript.evaluate() or _hyperscript("code") directly.
 *
 * @example
 * const english = preprocess("トグル .active", "ja");
 * _hyperscript(english);
 */
declare function preprocess(src: string, lang: string, config?: Partial<PreprocessorConfig>): string;

/**
 * Language Resolver
 *
 * Determines the language of hyperscript code on a given element
 * using a cascading resolution strategy.
 */
/**
 * Resolve the language for a hyperscript attribute on an element.
 *
 * Resolution order:
 * 1. `data-lang` attribute on the element itself
 * 2. `data-hyperscript-lang` attribute on the element or closest ancestor
 * 3. `lang` attribute on `<html>` element
 * 4. null (assume English, no preprocessing needed)
 */
declare function resolveLanguage(elt: Element): string | null;

export { type PluginOptions, type PreprocessorConfig, hyperscriptI18n, preprocess, preprocessToEnglish, resolveLanguage };
