/// /** * 统一响应结构(与后端 commonEesType 对齐) */ export interface commonEesType { code: number; msg: string; data: T; ret?: number; } /** * 库所需的最小 HTTP 能力(仅 post)。 * 用结构化类型而非直接依赖 AxiosInstance, * 避免与消费方 axios 版本的类型定义强耦合(如 1.13 vs 1.20 的 query 方法差异)。 * 任何具备 axios 兼容 post 签名的实例均可注入。 */ export interface PntHttpLike { get(url: string, config?: any): Promise; post(url: string, data?: D, config?: any): Promise; } /** * 高敏信息解锁接口配置(可选,全局覆盖) */ export interface PntHighSecurityConfig { /** * 业务级解密接口 URL,覆盖默认 /api/v3/business/game_info/high-security-decrypt?audience=/laas-pnt * @description scope='business'(默认)时使用 */ decryptUrl?: string; /** * 平台级解密接口 URL,覆盖默认 /api/v3/business/game_info/plat-high-security-decrypt?audience=/laas-pnt * @description scope='platform' 时使用(发布记录页等平台级权限校验场景) */ decryptPlatUrl?: string; /** 成功码字段:'code'(默认)或 'ret'(account-business 现状) */ successCodeField?: 'code' | 'ret'; /** audience 覆盖(默认 /laas-pnt) */ audience?: string; } /** * 地区查询接口配置(可选,全局覆盖) */ export interface PntRegionQueryConfig { /** * 业务级地区查询接口 URL,覆盖默认 /api/v5/business/region/query?audience=/laas-pnt * @description scope='business'(默认)时使用 */ queryUrl?: string; /** * 平台级地区查询接口 URL,覆盖默认 /api/v5/business/region/plat-query?audience=/laas-pnt * @description scope='platform' 时使用 */ queryPlatUrl?: string; } /** * 组件库运行时配置:由消费方通过 PntProvider 注入 */ export interface PntConfig { /** 消费方已配置好的 axios 实例(含拦截器、鉴权、baseURL 等) */ http: PntHttpLike; /** 高敏信息解锁接口全局配置(可选) */ highSecurity?: PntHighSecurityConfig; /** 地区查询接口全局配置(可选) */ regionQuery?: PntRegionQueryConfig; /** * 全局语言设置 @default 'zh' * - zh: 中文(默认文案) * - en: 英文(内置英文文案) * @description 组件内部文案(全选、反选、批量导入等)会根据此值自动切换 */ locale?: 'zh' | 'en'; } /** * 配置 Provider:消费方在应用根入口包裹一次即可 * @example * ```tsx * import { PntProvider } from '@pnt-team/pnt-component-frontend'; * import http from './utils/request'; * * * * * ``` */ export declare const PntProvider: import("react").Provider; /** * 获取组件库运行时配置(内部使用) * @internal */ export declare const usePntConfig: () => PntConfig; /** * 获取组件库运行时配置(可选版本,内部使用) * @description 供「外部受控数据」模式的组件使用:未注入 Provider 时返回 null, * 组件自行降级(不发起内部请求),不抛错 * @internal */ export declare const usePntConfigOptional: () => PntConfig | null;