Skip to content

Commit

Permalink
fix: Fix types some more (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
taion authored Feb 25, 2019
1 parent 91459a2 commit cd42a05
Show file tree
Hide file tree
Showing 3 changed files with 725 additions and 546 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@
"cpy-cli": "^2.0.0",
"delay": "^4.1.0",
"doctoc": "^1.4.0",
"dtslint": "^0.4.2",
"dtslint": "^0.5.0",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1",
"eslint": "^5.10.0",
"eslint-config-4catalyzer-react": "^0.6.0",
"eslint-config-prettier": "^3.3.0",
"eslint-config-4catalyzer-react": "^0.8.3",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-prettier": "^3.0.0",
Expand Down
15 changes: 7 additions & 8 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ declare module 'found' {
interface Resolver {
resolveElements(
match: Match,
): AsyncIterableIterator<React.ReactElement<any> | null>;
): AsyncIterableIterator<React.ReactElement | null>;
}

const resolver: Resolver;
Expand Down Expand Up @@ -294,12 +294,11 @@ declare module 'found' {
*/
defer?: boolean;
/**
*
* @returns never (RedirectException) | undefined | React.ReactElement<any> (typical)
* @throws {HttpError}
* @throws {RedirectException}
* @returns undefined | null | React.ReactElement<any> (typical)
*/
render?: (
args: RouteRenderArgs,
) => never | undefined | React.ReactElement<any>;
render?: (args: RouteRenderArgs) => undefined | null | React.ReactElement;
// Provide indexer allowing for any properties
[key: string]: any;
}
Expand Down Expand Up @@ -374,7 +373,7 @@ declare module 'found' {
function makeRouteConfig(node: React.ReactNode): RouteConfig;

type ReactElementOrGroup =
| React.ReactElement<any>
| React.ReactElement
| { [key: string]: ReactElementOrGroup[] };

interface RenderErrorArgs extends Match {
Expand Down Expand Up @@ -407,7 +406,7 @@ declare module 'found' {

function createRender(
args: CreateRenderArgs,
): (renderArgs: Match) => React.ReactElement<any>;
): (renderArgs: Match) => React.ReactElement;

interface BaseCreateRouterArgs extends CreateRenderArgs {
render?: (args: RouterRenderArgs) => React.ReactNode;
Expand Down
Loading

0 comments on commit cd42a05

Please sign in to comment.