Skip to content

Commit

Permalink
Reformat type files.
Browse files Browse the repository at this point in the history
  • Loading branch information
molefrog committed Dec 15, 2022
1 parent 55795c0 commit 9c6b9df
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
23 changes: 17 additions & 6 deletions types/ts3.9.4/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ export * from "../router";
// React <18 only: fixes incorrect `ReactNode` declaration that had `{}` in the union.
// This issue has been fixed in React 18 type declaration.
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210
type ReactNode = ReactChild | Iterable<ReactNode> | ReactPortal | boolean | null | undefined;
type ReactNode =
| ReactChild
| Iterable<ReactNode>
| ReactPortal
| boolean
| null
| undefined;

/*
* Components: <Route />
Expand Down Expand Up @@ -65,9 +71,10 @@ export type LinkProps<H extends BaseLocationHook = LocationHook> = Omit<
> &
NavigationalProps<H>;

export type RedirectProps<H extends BaseLocationHook = LocationHook> = NavigationalProps<H> & {
children?: never;
};
export type RedirectProps<H extends BaseLocationHook = LocationHook> =
NavigationalProps<H> & {
children?: never;
};

export function Redirect<H extends BaseLocationHook = LocationHook>(
props: PropsWithChildren<RedirectProps<H>>,
Expand Down Expand Up @@ -105,8 +112,12 @@ export const Router: FunctionComponent<RouterProps>;

export function useRouter(): RouterObject;

export function useRoute<T extends DefaultParams = DefaultParams>(pattern: Path): Match<T>;
export function useRoute<T extends DefaultParams = DefaultParams>(
pattern: Path
): Match<T>;

export function useLocation<H extends BaseLocationHook = LocationHook>(): HookReturnValue<H>;
export function useLocation<
H extends BaseLocationHook = LocationHook
>(): HookReturnValue<H>;

// tslint:enable:no-unnecessary-generics
4 changes: 1 addition & 3 deletions types/ts4.1/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ import {
LocationHook,
} from "../use-location";

import { RouterObject, RouterOptions } from "../router";

import { DefaultParams, Match } from "../matcher";
import React = require("react");
import { RouterObject, RouterOptions } from "../router";

// re-export types from these modules
export * from "../matcher";
Expand Down

0 comments on commit 9c6b9df

Please sign in to comment.