File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ import * as React from "react"
2
+
3
+ type ChildrenFunction = ( state : object ) => React . ReactNode
4
+
5
+ interface AsyncProps {
6
+ children ?: React . ReactNode | ChildrenFunction
7
+ promiseFn ?( props : object ) : Promise < any >
8
+ deferFn ?( props : object ) : Promise < any >
9
+ watch ?: any
10
+ initialValue ?: any
11
+ onResolve ?( data : any ) : any
12
+ onReject ?( error : Error ) : any
13
+ }
14
+
15
+ interface PendingProps {
16
+ children ?: React . ReactNode | ChildrenFunction
17
+ persist ?: boolean
18
+ }
19
+
20
+ interface LoadingProps {
21
+ children ?: React . ReactNode | ChildrenFunction
22
+ initial ?: boolean
23
+ }
24
+
25
+ interface ResolvedProps {
26
+ children ?: React . ReactNode | ChildrenFunction
27
+ persist ?: boolean
28
+ }
29
+
30
+ interface RejectedProps {
31
+ children ?: React . ReactNode | ChildrenFunction
32
+ persist ?: boolean
33
+ }
34
+
35
+ declare class Async extends React . Component < AsyncProps , any > {
36
+ public static Pending : React . SFC < PendingProps >
37
+ public static Loading : React . SFC < LoadingProps >
38
+ public static Resolved : React . SFC < ResolvedProps >
39
+ public static Rejected : React . SFC < RejectedProps >
40
+ }
41
+
42
+ declare function createInstance ( defaultProps ?: object ) : Async
43
+
44
+ export default createInstance
You can’t perform that action at this time.
0 commit comments