/// import Loadable, { type CommonOptions } from 'react-loadable'; import React, { MouseEventHandler } from 'react'; export declare const componenntFail: (message: string, onClick: MouseEventHandler | undefined) => JSX.Element; /** * 通用的加载中组件 * @param {Object} props */ export declare const LoadingComponennt: (props: any) => JSX.Element; declare const LoadableComponent: (loader: any, loading?: false | CommonOptions['loading']) => React.ComponentType & Loadable.LoadableComponent; export interface ErrorType { event: Event | string; source?: string; lineno?: number; colno?: number; error?: Error; } export declare const loadScript: (src: string, libName: string) => Promise; /** * 序列化加载多个脚本 * @param libs * @returns */ export declare const seqLoadScripts: (libs: { src: string; libName: string; }[]) => Promise; /** * 获取导出的默认值 * @param obj * @returns */ export declare const getExportDefault: (obj: any) => any; /** * 按需加载script组件 * @param opts * @returns */ export declare const LoadableScriptComponent: (opts: { src: string; libName: string; loading: () => React.ReactNode; fail: (error: ErrorType, rerender: () => void) => React.ReactNode; }) => { new (props: any): { state: Readonly<{ render: React.ComponentClass | null; error?: ErrorType; status: 'loading' | 'success' | 'fail'; }>; /** * 加载script */ load(): void; /** * 重新渲染 */ rerender(): void; render(): React.ReactNode; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly<{}> & Readonly<{ children?: React.ReactNode; }>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; 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; }; contextType?: React.Context | undefined; }; export default LoadableComponent;