/** * @file 异步加载JSAPI的高阶组件 * @author hedongran [hdr01@126.com] */ import React from 'react'; interface WrapperHocProps { /** 开放平台申请的ak */ ak: string; /** dugis booter的启动地址,非必填 */ booter?: string; } interface MapApiLoaderProps { [key: string]: any; } interface MapApiLoaderState { loaded: boolean; } declare const _default: (hocProps: WrapperHocProps) => (WrappedComponent: any) => { new (props: MapApiLoaderProps): { apiTimer: number; loadedTimer: number; isLoadReady(): boolean; componentDidMount(): void; componentWillUnmount(): void; loadJSAPI(): void; handleLoaded(): void; render(): JSX.Element; context: any; setState(state: MapApiLoaderState | ((prevState: Readonly, props: Readonly) => MapApiLoaderState | Pick | null) | Pick | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; state: Readonly; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; displayName: string; contextType?: React.Context | undefined; }; /** * 异步加载JSAPI的高阶组件,在业务组件中使用,从而实现将JSAPI以异步形式插入,而不是提前放到`index.html`模板里。 * @visibleName MapApiLoaderHOC 异步加载HOC */ export default _default;