1 |
|
2 | import * as React from 'react';
|
3 | export interface AsyncRouteComponentProps {
|
4 | isInitialRender: boolean;
|
5 | setAppState: (data: any) => void;
|
6 | }
|
7 | export interface AsyncRouteComponentState {
|
8 | Component: React.ReactNode | null;
|
9 | }
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare function asyncComponent<Props = any>({loader, Placeholder}: {
|
16 | loader: () => Promise<any>;
|
17 | Placeholder?: React.ComponentType<Props>;
|
18 | }): {
|
19 | new (props: any): {
|
20 | componentWillMount(): void;
|
21 | updateState(): void;
|
22 | render(): JSX.Element | null;
|
23 | setState<K extends "Component">(state: AsyncRouteComponentState | ((prevState: Readonly<AsyncRouteComponentState>, props: any) => AsyncRouteComponentState | Pick<AsyncRouteComponentState, K>) | Pick<AsyncRouteComponentState, K>, callback?: (() => void) | undefined): void;
|
24 | forceUpdate(callBack?: (() => void) | undefined): void;
|
25 | props: Readonly<{
|
26 | children?: React.ReactNode;
|
27 | }> & Readonly<any>;
|
28 | state: Readonly<AsyncRouteComponentState>;
|
29 | context: any;
|
30 | refs: {
|
31 | [key: string]: React.ReactInstance;
|
32 | };
|
33 | };
|
34 | load(): Promise<void>;
|
35 | getInitialProps(ctx: any): any;
|
36 | };
|
37 |
|
\ | No newline at end of file |