Skip to content

Commit

Permalink
add typings
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Dec 23, 2019
1 parent c129c0b commit 8c12d00
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hooks/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,13 @@ export function useDebugValue<T>(
value: T,
formatter?: (value: T) => string | number
): void;

export interface ComponentFunction<P = {}> {
(props: P, error?: Error): preact.ComponentChild;
displayName?: string;
}

export function errorBoundary<P = {}>(
fn: ComponentFunction<P>,
callback: () => Promise<void> | void
): preact.FunctionalComponent<P>;

0 comments on commit 8c12d00

Please sign in to comment.