import React from 'react'; import { History } from 'history'; declare global { interface Window { __IS_CONSOLE_OS_CONTEXT__: boolean; } } /** * @deprecated * 判断是否在微应用环境,实现上有问题,请不要再使用 * @returns */ export declare const isOsContext: () => boolean; /** * 判断是否作为微应用的 jsBundle 加载,使用 hook 函数传入的 context 来判断 * 用于替换 isOsContext */ export declare const isOsBundle: () => boolean; interface IProps extends React.Attributes { [key: string]: any; } export declare const getPathNameWithQueryAndSearch: () => string; /** * 移除 hash 前缀,避免 react-router history 无法识别 * @param path * @returns */ export declare const removeHash: (path?: string) => string; /** * 更新路由 * @param history * @param path * @param state history.state * @param checkReplaceInFirstEnter * @returns */ export declare const updateHistory: (history: History, path: string, state?: Record) => void; export declare function useSyncHistory(history: History): { isFirstEnter: boolean; needSync: any; renderFromParent: boolean; syncHistory: any; }; /** * Sync route with children * @param Comp * @param history */ export declare const withSyncHistory: (Comp: React.ComponentClass | React.FC, history: History) => React.FC; export declare class Wrapper extends React.Component { static displayName: string; componentDidMount(): void; componentDidUpdate(preprops: any): void; render(): React.DetailedReactHTMLElement, HTMLInputElement>; } /** * Sync route with children Compatible with react15 * @param Comp * @param history */ export declare const withCompatibleSyncHistory: (Comp: React.ComponentClass | React.FC, history: History) => (props: IProps) => React.CElement; /** * 获取当前浏览器地址 */ export declare const getBrowserUrl: () => string; /** * 是否是 alfa 创建的