import { mergeAllThemeOptions } from '@blocklet/theme';
import { default as Cookies } from 'js-cookie';
import { AxiosError } from 'axios';
import { $TSFixMe, Locale } from '../type';
declare let dateTool: $TSFixMe | null;
/** @deprecated for compatibility, please use `import { mergeAllThemeOptions } from '@blocklet/theme'` instead */
export { mergeAllThemeOptions as deepmergeAll };
/** 是否常见二段式顶级域名 */
export declare function isTwoSegmentTLD(domain: string): boolean;
/** 获取根域名 */
export declare function resolveRootDomain(): string;
export declare function parseQuery(str: string): Record<string, string | boolean>;
export declare function stringifyQuery(params?: {}): string;
export declare function getCookieOptions(expireInDays?: number | {
    expireInDays: number;
    path?: string;
    domain?: string;
    returnDomain?: boolean;
    sameSite?: Cookies.CookieAttributes['sameSite'];
    secure?: boolean;
}): Cookies.CookieAttributes;
export declare const getColor: (props: $TSFixMe) => any;
export declare const getBackground: (props: $TSFixMe) => any;
/**
 * 1. 将 props 中以 ::prop:: 开头的字符串替换为 component.defaultProps 中的值
 * 2. 将 props 中由 jsonAttrs 指定的 json 字符串转换为对象
 * 3. 最后将 props 中的 ::prop:: 字符串替换为 ''
 */
export declare function mergeProps<P extends object>(props: Record<string, any>, component: React.ComponentType<P>, jsonAttrs?: string[]): Record<string, any>;
export declare function getCopyright(startYear?: number): string;
export declare const getTimezone: () => string;
export declare const str2color: (str: string) => string;
export declare const formatUptime: (uptime: number) => string;
/**
 * Set the date tool library which support for format() and locale() functions,
 *  moment and dayjs are recommended.
 */
export declare function setDateTool(tool: typeof dateTool): void;
export declare function getDateTool(): any;
/**
 * Format the time string as `ll` format: MMM D, YYYY
 * Ensure that the setDateTool() function is called first to set the time tool library.
 * @returns formatted date string
 */
export declare function formatToDate(date: string | number | Date, { locale, tz }?: {
    locale?: Locale;
    tz?: string;
}): any;
/**
 * Format the time string as `lll` format: MMM D, YYYY h:mm A
 * Ensure that the setDateTool() function is called first to set the time tool library.
 * @returns formatted date string
 */
export declare function formatToDatetime(date: string | number | Date, { locale, tz, isUtc, format, }?: {
    locale?: Locale;
    tz?: string;
    isUtc?: boolean;
    format?: string;
}): any;
export declare function detectWalletExtension(): any;
export declare function openWebWallet({ webWalletUrl, action, locale, url, windowFeatures, appInfo, memberAppInfo, }: {
    webWalletUrl: string;
    action?: string;
    locale?: Locale;
    url: string;
    windowFeatures: $TSFixMe;
    appInfo: $TSFixMe;
    memberAppInfo: $TSFixMe;
}): {
    type: string;
};
export declare const getFontSize: (size: string | number) => string;
export declare const isEthereumDid: (did: string) => boolean;
export declare const appendParams: (url: string, params: {
    imageFilter: "crop" | "resize";
    w?: number;
    h?: number;
    r?: 0 | 90 | 180 | 270;
}) => string;
export declare const getUserAvatar: (avatar: string, size?: number) => string;
export declare const sleep: (time?: number) => Promise<void>;
export declare const isUrl: (str: string) => boolean;
export declare const getVisitorId: () => string | null;
export declare const setVisitorId: (value: string | null) => void;
export declare const ensureVisitorId: () => void;
export declare const getDIDColor: (did: string) => any;
type NestedTranslation = {
    [key: string]: string | NestedTranslation;
};
type TranslationsObject = {
    [locale: string]: NestedTranslation;
};
/**
 * Retrieves the appropriate translation based on the locale, with fallback options.
 * @return {string} The translated string based on the locale, with fallback options if necessary.
 */
export declare const getTranslation: (translations: TranslationsObject, locale: Locale, options?: {
    fallbackLocale?: Locale;
    defaultValue?: string;
}) => string;
export declare const lazyRetry: (fn: () => Promise<any>) => import('react').LazyExoticComponent<import('react').ComponentType<any>>;
export declare const cleanedObj: (obj: object) => import('lodash').Dictionary<any>;
/**
 * 将十六进制颜色转换为 RGBA
 * @param hex 十六进制颜色字符串 (例如: "#FF0000" 或 "FF0000")
 * @param alpha 透明度值 (0-1 之间，默认为 1)
 * @returns RGBA 颜色字符串 (例如: "rgba(255, 0, 0, 1)")
 */
export declare function hexToRgba(hex: string, alpha?: number): string;
export declare const getServerVersion: () => any;
export declare const getUxPackageVersion: () => string;
export declare const getJsSdkVersion: () => string;
/**
 * 比较两个版本号，version1 是否大于等于 version2
 * @param {*} version1
 * @param {*} version2
 * @returns boolean
 */
export declare const compareVersions: (version1: string, version2: string) => boolean;
/**
 * 是否支持用户的 follow 关系
 * 通过 server 的版本和 ux 的版本共同决定
 */
export declare const isSupportFollow: () => boolean;
export declare const formatAxiosError: (err: AxiosError) => string;
