- Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathindex.d.ts
48 lines (42 loc) · 1.32 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import*asReactfrom'react';
/**
* The configuration for an asynchronous component.
*/
exportinterfaceConfiguration<P>{
resolve: ()=>Promise<React.ComponentType<P>|{default: React.ComponentType<P>}>;
LoadingComponent?: (props: P)=>JSX.Element;
ErrorComponent?: (props: P&{error: Error})=>JSX.Element;
name?: string;
autoResolveES2015Default?: boolean;
env?: 'node'|'browser';
serverMode?: 'resolve'|'defer'|'boundary';
}
/**
* A wrapper to provide the asynchronous component resolving in a React tree.
*/
exportclassAsyncComponentProviderextendsReact.Component<ProviderProps>{}
/**
* The properties that the {@link AsyncComponentProvider} accepts.
*/
exportinterfaceProviderProps{
children: JSX.Element[]|JSX.Element;
asyncContext?: Context;
rehydrateState?: object;
}
/**
* This interface defines the asynchronous context uses for the asynchronous resolving
* of components.
*/
exportinterfaceContext{
getState: ()=>object;
}
/**
* Convert the given component to a an asynchronous component.
*
* @param config The configuration to use for the asynchronous component.
*/
exportfunctionasyncComponent<P>(config: Configuration<P>): React.ComponentType<P>;
/**
* Create a context for the asynchronous component resolving module.
*/
exportfunctioncreateAsyncContext(): Context;