Skip to content

Commit

Permalink
Fix type definition for createInstance.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Jul 11, 2019
1 parent 34e79ee commit dc9eac7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/react-async/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,17 @@ declare namespace Async {
export function Settled<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): JSX.Element
}

export function createInstance<T>(defaultProps?: AsyncProps<T>): Async<T>
export function createInstance<T>(
defaultProps?: AsyncProps<T>
): (new () => Async<T>) & {
Initial<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): JSX.Element
Pending<T>(props: { children?: AsyncChildren<T>; initial?: boolean }): JSX.Element
Loading<T>(props: { children?: AsyncChildren<T>; initial?: boolean }): JSX.Element
Fulfilled<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): JSX.Element
Resolved<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): JSX.Element
Rejected<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): JSX.Element
Settled<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): JSX.Element
}

export function useAsync<T>(
arg1: AsyncOptions<T> | PromiseFn<T>,
Expand Down

0 comments on commit dc9eac7

Please sign in to comment.