import React from 'react'; import type { CurrencyDisplayType } from '../../types/props.js'; /** * Exposure tracking parameters */ export interface ExposureParams { componentType: string; componentName: string; componentTitle?: string; componentDescription?: string; navigation?: string; pageGroup?: string; position?: number; } /** * Callback function for custom exposure handling */ export type OnExposureCallback = (params: ExposureParams) => void; interface AiuiContextType { /** * 全局埋点数据,至少应包含 pageGroup 字段用于区分页面,其他字段可根据需要添加 */ trackingData: Record; /** * 当前语言环境,默认为浏览器语言 */ locale?: string; /** * 当前页面路径,用于埋点区分不同页面,默认为 window.location.pathname */ pathname?: string; /** * 商户自定义的店铺域名,用于埋点区分不同商户,默认为空字符串 */ storeDomain?: string; /** * 用户是否登录 */ isLogin?: boolean; /** * 用户是否为Plus会员 */ isPlusMember?: boolean; /** * 货币代码,默认为USD */ currencyCode?: string; /** * 货币显示方式,默认为symbol(符号),可选值包括:'symbol'(符号,如$)、'code'(货币代码,如USD)和'name'(货币名称,如美元)。 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay for more details */ currencyDisplay?: CurrencyDisplayType; /** * 文案配置,商户可通过此字段覆盖默认文案 */ copyWriting?: Record; /** * 自定义曝光回调。传入后会替代默认的 GA 埋点逻辑。 * * @example * { * // 使用商户自己的埋点系统记录曝光事件 * ga.track('component_impression', params) * }} * > * {children} * */ onExposure?: OnExposureCallback; } export declare const AiuiContext: React.Context; export declare const useAiuiContext: () => AiuiContextType; declare const AiuiProvider: ({ children, ...rest }: { children: React.ReactNode; } & AiuiContextType) => import("react/jsx-runtime").JSX.Element; export default AiuiProvider;