import React__default from 'react';

/**
 * i18n 类型定义
 */
type Locale = 'zh-CN' | 'zh-TW' | 'en-US' | 'ja-JP';
type TranslationKey = string;
type TranslationValue = string | {
    [key: string]: TranslationValue;
};
type Translations = {
    [key: string]: TranslationValue;
};
type LocaleResources = {
    [locale in Locale]?: Translations;
};
interface TranslateOptions {
    defaultValue?: string;
    count?: number;
    context?: Record<string, any>;
}
type InterpolateFunction = (template: string, data: Record<string, any>) => string;
interface I18nConfig {
    locale: Locale;
    fallbackLocale?: Locale;
    resources: LocaleResources;
    interpolate?: InterpolateFunction;
}
interface I18nInstance {
    locale: Locale;
    t: (key: string, options?: TranslateOptions) => string;
    setLocale: (locale: Locale) => void;
    addResources: (locale: Locale, resources: Translations) => void;
    getLocale: () => Locale;
}
interface I18nAdapter {
    getSystemLocale: () => Locale;
    saveLocale: (locale: Locale) => Promise<void>;
    loadLocale: () => Promise<Locale | null>;
}

/**
 * 轻量级 i18n 核心实现
 * 支持：翻译、插值、复数、嵌套键、类型安全
 */

/**
 * 创建 i18n 实例
 */
declare function createI18n(config: I18nConfig): I18nInstance;
/**
 * 初始化全局 i18n
 */
declare function initI18n(config: I18nConfig): I18nInstance;
/**
 * 获取全局 i18n 实例
 */
declare function getI18n(): I18nInstance;
/**
 * 快捷翻译函数
 */
declare function t(key: string, options?: TranslateOptions): string;

/**
 * React hooks for i18n
 */

/**
 * useTranslation Hook
 * React 组件中使用翻译
 * 支持 SSR 环境，在 i18n 未初始化时安全降级
 */
declare function useTranslation(): {
    t: (key: string, options?: TranslateOptions) => string;
    locale: Locale;
    setLocale: (newLocale: Locale) => void;
};
/**
 * useLocale Hook
 * 只获取和设置语言，不包含翻译函数
 */
declare function useLocale(): {
    locale: Locale;
    setLocale: (newLocale: Locale) => void;
};

/**
 * 简体中文翻译
 */
declare const _default$1: {
    readonly app: {
        readonly name: "LyricNote";
        readonly fullName: "LyricNote - 歌词笔记";
        readonly icon: "🎵";
        readonly description: "一个强大的歌词和笔记管理应用";
        readonly author: "LyricNote Team";
        readonly copyright: string;
        readonly version: "1.0.0";
    };
    readonly titles: {
        readonly main: "🎵 LyricNote";
        readonly admin: "LyricNote 管理后台";
        readonly withVersion: "LyricNote v1.0.0";
        readonly welcome: "欢迎使用 LyricNote";
        readonly about: "关于 LyricNote";
    };
    readonly common: {
        readonly hello: "你好";
        readonly welcome: "欢迎";
        readonly confirm: "确认";
        readonly cancel: "取消";
        readonly save: "保存";
        readonly delete: "删除";
        readonly edit: "编辑";
        readonly back: "返回";
        readonly next: "下一步";
        readonly submit: "提交";
        readonly finish: "完成";
        readonly loading: "加载中...";
        readonly success: "操作成功";
        readonly error: "操作失败";
        readonly retry: "重试";
        readonly empty: "暂无数据";
    };
    readonly nav: {
        readonly home: "首页";
        readonly lyrics: "歌词";
        readonly create: "创作";
        readonly collection: "收藏";
        readonly profile: "我的";
        readonly settings: "设置";
        readonly history: "历史";
        readonly logout: "退出登录";
    };
    readonly user: {
        readonly login: "登录";
        readonly register: "注册";
        readonly username: "用户名";
        readonly password: "密码";
        readonly email: "邮箱";
        readonly phone: "手机号";
        readonly nickname: "昵称";
    };
    readonly pages: {
        readonly home: {
            readonly title: "首页";
            readonly description: "一个强大的歌词和笔记管理应用";
        };
        readonly profile: {
            readonly title: "个人中心";
            readonly description: "管理您的个人信息和偏好设置";
        };
        readonly admin: {
            readonly title: "LyricNote 管理后台";
            readonly description: "系统管理和数据统计";
        };
        readonly login: {
            readonly title: "登录";
            readonly description: "登录到 LyricNote";
        };
    };
    readonly validation: {
        readonly required: "{{field}}不能为空";
        readonly invalid_email: "邮箱格式不正确";
        readonly password_too_short: "密码至少需要{{count}}个字符";
        readonly password_weak: "密码强度不够";
        readonly passwords_not_match: "两次密码不一致";
    };
    readonly status: {
        readonly loading: "加载中...";
        readonly success: "操作成功";
        readonly error: "操作失败";
        readonly empty: "暂无数据";
        readonly network_error: "网络错误，请稍后重试";
    };
    readonly errors: {
        readonly network: "网络错误，请稍后重试";
        readonly server: "服务器错误";
        readonly unauthorized: "未授权，请先登录";
        readonly not_found: "未找到相关内容";
        readonly unknown: "未知错误";
    };
    readonly success: {
        readonly saved: "保存成功";
        readonly deleted: "删除成功";
        readonly updated: "更新成功";
        readonly created: "创建成功";
    };
    readonly language: {
        readonly label: "语言";
        readonly zh_cn: "简体中文";
        readonly zh_tw: "繁體中文";
        readonly en_us: "English";
        readonly ja_jp: "日本語";
    };
};

/**
 * English translations
 */
declare const _default: {
    readonly app: {
        readonly name: "LyricNote";
        readonly fullName: "LyricNote - Lyrics & Notes";
        readonly icon: "🎵";
        readonly description: "A powerful lyrics and notes management app";
        readonly author: "LyricNote Team";
        readonly copyright: string;
        readonly version: "1.0.0";
    };
    readonly titles: {
        readonly main: "🎵 LyricNote";
        readonly admin: "LyricNote Admin";
        readonly withVersion: "LyricNote v1.0.0";
        readonly welcome: "Welcome to LyricNote";
        readonly about: "About LyricNote";
    };
    readonly common: {
        readonly hello: "Hello";
        readonly welcome: "Welcome";
        readonly confirm: "Confirm";
        readonly cancel: "Cancel";
        readonly save: "Save";
        readonly delete: "Delete";
        readonly edit: "Edit";
        readonly back: "Back";
        readonly next: "Next";
        readonly submit: "Submit";
        readonly finish: "Finish";
        readonly loading: "Loading...";
        readonly success: "Success";
        readonly error: "Error";
        readonly retry: "Retry";
        readonly empty: "No data";
    };
    readonly nav: {
        readonly home: "Home";
        readonly lyrics: "Lyrics";
        readonly create: "Create";
        readonly collection: "Collection";
        readonly profile: "Profile";
        readonly settings: "Settings";
        readonly history: "History";
        readonly logout: "Logout";
    };
    readonly user: {
        readonly login: "Login";
        readonly register: "Register";
        readonly username: "Username";
        readonly password: "Password";
        readonly email: "Email";
        readonly phone: "Phone";
        readonly nickname: "Nickname";
    };
    readonly pages: {
        readonly home: {
            readonly title: "Home";
            readonly description: "A powerful lyrics and notes management app";
        };
        readonly profile: {
            readonly title: "Profile";
            readonly description: "Manage your personal information and preferences";
        };
        readonly admin: {
            readonly title: "LyricNote Admin";
            readonly description: "System management and data statistics";
        };
        readonly login: {
            readonly title: "Login";
            readonly description: "Login to LyricNote";
        };
    };
    readonly validation: {
        readonly required: "{{field}} is required";
        readonly invalid_email: "Invalid email format";
        readonly password_too_short: "Password must be at least {{count}} characters";
        readonly password_weak: "Password is too weak";
        readonly passwords_not_match: "Passwords do not match";
    };
    readonly status: {
        readonly loading: "Loading...";
        readonly success: "Success";
        readonly error: "Error";
        readonly empty: "No data";
        readonly network_error: "Network error, please try again later";
    };
    readonly errors: {
        readonly network: "Network error, please try again later";
        readonly server: "Server error";
        readonly unauthorized: "Unauthorized, please login first";
        readonly not_found: "Not found";
        readonly unknown: "Unknown error";
    };
    readonly success: {
        readonly saved: "Saved successfully";
        readonly deleted: "Deleted successfully";
        readonly updated: "Updated successfully";
        readonly created: "Created successfully";
    };
    readonly language: {
        readonly label: "Language";
        readonly zh_cn: "简体中文";
        readonly zh_tw: "繁體中文";
        readonly en_us: "English";
        readonly ja_jp: "日本語";
    };
};

/**
 * Web 平台适配器
 * 用于浏览器环境的语言检测和存储
 */

/**
 * Web 平台适配器
 * 使用 localStorage 存储语言偏好
 */
declare class WebI18nAdapter implements I18nAdapter {
    private storageKey;
    getSystemLocale(): Locale;
    saveLocale(locale: Locale): Promise<void>;
    loadLocale(): Promise<Locale | null>;
    private normalizeLocale;
}

/**
 * React Native 平台适配器
 * 用于 React Native 应用的语言检测和存储
 */

/**
 * React Native 平台适配器
 * 使用 AsyncStorage 存储语言偏好
 *
 * 注意：需要安装 @react-native-async-storage/async-storage
 */
declare class ReactNativeI18nAdapter implements I18nAdapter {
    private storageKey;
    getSystemLocale(): Locale;
    saveLocale(locale: Locale): Promise<void>;
    loadLocale(): Promise<Locale | null>;
    private normalizeLocale;
}

/**
 * Taro (小程序) 平台适配器
 * 用于微信小程序、支付宝小程序等通过 Taro 开发的应用
 */

/**
 * Taro (小程序) 平台适配器
 * 使用 Taro.storage API 存储语言偏好
 *
 * 注意：需要安装 @tarojs/taro
 */
declare class TaroI18nAdapter implements I18nAdapter {
    private storageKey;
    getSystemLocale(): Locale;
    saveLocale(locale: Locale): Promise<void>;
    loadLocale(): Promise<Locale | null>;
    private normalizeLocale;
}

/**
 * Electron 平台适配器
 * 用于 Electron 桌面应用的语言检测和存储
 */

/**
 * Electron 平台适配器
 * 使用 localStorage 存储语言偏好
 *
 * 注意：Electron 渲染进程支持 Web API
 */
declare class ElectronI18nAdapter implements I18nAdapter {
    private storageKey;
    getSystemLocale(): Locale;
    saveLocale(locale: Locale): Promise<void>;
    loadLocale(): Promise<Locale | null>;
    private normalizeLocale;
}

/**
 * 语言切换组件
 * 支持多种样式：按钮组、下拉菜单、图标按钮
 * 使用 Tailwind CSS 样式，支持暗色模式
 */

interface LanguageSwitcherProps {
    variant?: 'buttons' | 'dropdown' | 'icon';
    className?: string;
    onLanguageChange?: (locale: Locale) => void;
}
interface LanguageOption {
    locale: Locale;
    label: string;
    flag: string;
}
/**
 * 按钮组语言切换器
 */
declare function LanguageSwitcherButtons({ className, onLanguageChange, }: LanguageSwitcherProps): React__default.JSX.Element;
/**
 * 下拉菜单语言切换器
 */
declare function LanguageSwitcherDropdown({ className, onLanguageChange, }: LanguageSwitcherProps): React__default.JSX.Element;
/**
 * 图标按钮语言切换器（带下拉菜单）
 */
declare function LanguageSwitcherIcon({ className, onLanguageChange }: LanguageSwitcherProps): React__default.JSX.Element;
/**
 * 语言切换器主组件
 * 根据 variant 自动选择样式
 */
declare function LanguageSwitcher({ variant, className, onLanguageChange, }: LanguageSwitcherProps): React__default.JSX.Element;

export { ElectronI18nAdapter, type I18nAdapter, type I18nConfig, type I18nInstance, type LanguageOption, LanguageSwitcher, LanguageSwitcherButtons, LanguageSwitcherDropdown, LanguageSwitcherIcon, type LanguageSwitcherProps, type Locale, type LocaleResources, ReactNativeI18nAdapter, TaroI18nAdapter, type TranslateOptions, type TranslationKey, type TranslationValue, type Translations, WebI18nAdapter, createI18n, _default as enUS, getI18n, initI18n, t, useLocale, useTranslation, _default$1 as zhCN };
