import * as React from 'react'; import { Module, AsyncRouteComponentState, Ctx } from './types'; /** * Returns a new React component, ready to be instantiated. * Note the closure here protecting Component, and providing a unique * instance of Component to the static implementation of `load`. */ export declare function asyncComponent({ loader, Placeholder, chunkName, }: { loader: () => Promise>>; Placeholder?: React.ComponentType; chunkName?: string; }): { new (props: Props | Readonly): { state: { Component: (React.ComponentClass & import("./types").AsyncComponent) | (React.FunctionComponent & import("./types").AsyncComponent) | null; }; componentDidMount(): void; updateState: () => void; render(): JSX.Element | null; context: any; setState(state: AsyncRouteComponentState | ((prevState: Readonly, props: Readonly) => AsyncRouteComponentState | Pick | null) | Pick | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; refs: { [key: string]: React.ReactInstance; }; 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; }; new (props: Props, context: any): { state: { Component: (React.ComponentClass & import("./types").AsyncComponent) | (React.FunctionComponent & import("./types").AsyncComponent) | null; }; componentDidMount(): void; updateState: () => void; render(): JSX.Element | null; context: any; setState(state: AsyncRouteComponentState | ((prevState: Readonly, props: Readonly) => AsyncRouteComponentState | Pick | null) | Pick | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; refs: { [key: string]: React.ReactInstance; }; 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; }; /** * Static so that you can call load against an uninstantiated version of * this component. This should only be called one time outside of the * normal render path. */ load(): Promise; getChunkName(): string | undefined; getInitialProps(ctx: Ctx): any; contextType?: React.Context | undefined; };