Skip to content

Commit

Permalink
fix: Fix typing on transition hook result (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
taion committed Jun 21, 2019
1 parent 0242618 commit 867eb32
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ declare module 'found' {

type LocationDescriptor = LocationDescriptorObject | string;

type TransitionHookResult = boolean | string | null | undefined;

/**
* The transition hook function receives the location to which the user is
* attempting to navigate.
Expand All @@ -172,9 +174,9 @@ declare module 'found' {
*
* @see https://github.com/4Catalyzer/farce#transition-hooks
*/
type TransitionHook = (
location: Location,
) => undefined | (boolean | string | Promise<boolean | string>);
interface TransitionHook {
(location: Location): TransitionHookResult | Promise<TransitionHookResult>;
}

interface Router {
/**
Expand Down

0 comments on commit 867eb32

Please sign in to comment.