import Core, { Config, SendOption, SendSuccess, SendFail, GzipConfig } from "../../core/src"; export interface RNConfig extends Config { reportApiSpeed?: boolean; beforeReportSpeed?: Function; /** * 是否开启 SPA 页面流转监控(PV 自动上报) * 默认 false。开启后 pageView 插件将监听路由变化并上报 PV。 * 注意:开启后需要在路由层手动调用 aegis.reportPageView(routeName), * 或使用 createReactNavigationListener / AegisRouteTracker 工具函数自动接入。 */ spa?: boolean; /** Gzip 压缩上报配置,默认开启。设为 false 关闭,或传入 GzipConfig 精细控制 */ gzip?: boolean | GzipConfig; } export default class Aegis extends Core { static sessionID: string; static asyncPluginIndex: number; originRequest: typeof fetch; speedLogPipeline: import("../../core/src").Pipeline; private resolvedGzipConfig; constructor(config: RNConfig); get getBean(): string; reportError(...msg: any): void; /** * 上报页面 PV(页面流转监控) * * 调用时机:路由发生切换后,由业务层或工具函数触发。 * 内部会同步更新 bean.from,确保后续日志携带正确的页面来源。 * * @param routeName 当前页面路由名或路径,如 'Home'、'/profile/123' * * @example * // React Navigation * onStateChange={() => { * const name = navigationRef.getCurrentRoute()?.name ?? ''; * aegis.reportPageView(name); * }} * * // Expo Router * const pathname = usePathname(); * useEffect(() => { aegis.reportPageView(pathname); }, [pathname]); */ reportPageView(routeName: string): void; request: (options: SendOption, success?: SendSuccess | undefined, fail?: SendFail | undefined) => void; uploadLogs(params?: any, conds?: any): void; getAsyncStorage(): any; getOriginFrom(): string; private getCurrentPageUrl; }