Skip to content

Commit

Permalink
fix ts type cherry-picking (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense authored and taion committed Jan 11, 2019
1 parent ae44898 commit abe7dee
Show file tree
Hide file tree
Showing 18 changed files with 328 additions and 40 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"version": "0.3.17",
"description": "Extensible route-based routing for React applications",
"files": [
"lib",
"types/index.d.ts"
"lib"
],
"main": "lib/index.js",
"types": "types/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build": "rimraf lib && babel src -d lib",
"build": "rimraf lib && babel src -d lib && cpy types/*.d.ts lib",
"format": "eslint --fix . && npm run prettier -- --write",
"lint": "eslint . && npm run prettier -- -l",
"prepublish": "npm run build",
Expand Down Expand Up @@ -101,6 +100,7 @@
"babel-preset-react": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"codecov": "^3.1.0",
"cpy-cli": "^2.0.0",
"delay": "^4.1.0",
"doctoc": "^1.4.0",
"dtslint": "^0.4.2",
Expand Down
5 changes: 5 additions & 0 deletions types/HttpError.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/HttpError' {
import { HttpError } from 'found';

export default HttpError;
}
5 changes: 5 additions & 0 deletions types/Link.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/Link' {
import { Link } from 'found';

export default Link;
}
5 changes: 5 additions & 0 deletions types/Redirect.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/Redirect' {
import { Redirect } from 'found';

export default Redirect;
}
5 changes: 5 additions & 0 deletions types/RedirectException.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/RedirectException' {
import { RedirectException } from 'found';

export default RedirectException;
}
5 changes: 5 additions & 0 deletions types/Route.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/Route' {
import { Route } from 'found';

export default Route;
}
5 changes: 5 additions & 0 deletions types/createBrowserRouter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/createBrowserRouter' {
import { createBrowserRouter } from 'found';

export default createBrowserRouter;
}
5 changes: 5 additions & 0 deletions types/createConnectedRouter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/createConnectedRouter' {
import { createConnectedRouter } from 'found';

export default createConnectedRouter;
}
5 changes: 5 additions & 0 deletions types/createFarceRouter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/createFarceRouter' {
import { createFarceRouter } from 'found';

export default createFarceRouter;
}
5 changes: 5 additions & 0 deletions types/createMatchEnhancer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/createMatchEnhancer' {
import { createMatchEnhancer } from 'found';

export default createMatchEnhancer;
}
5 changes: 5 additions & 0 deletions types/createRender.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/createRender' {
import { createRender } from 'found';

export default createRender;
}
5 changes: 5 additions & 0 deletions types/foundReducer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/foundReducer' {
import { foundReducer } from 'found';

export default foundReducer;
}
43 changes: 10 additions & 33 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,12 @@ declare module 'found' {
render?: (args: RouterRenderArgs) => React.ReactNode;
}

interface CreateConnectedRouterArgs extends BaseCreateRouterArgs {
getFound?: (store: any) => FoundState;
}

interface FarceCreateRouterArgs extends BaseCreateRouterArgs {
store?: Store<FoundState>;
store?: Store;
historyProtocol: any;
historyMiddlewares?: any[];
historyOptions?: any;
Expand All @@ -440,7 +444,10 @@ declare module 'found' {
matchContext?: any;
}>;

function createConnectedRouter({ store, ...options }: any): ConnectedRouter;
function createConnectedRouter({
getFound,
...opts
}: CreateConnectedRouterArgs): ConnectedRouter;

function createFarceRouter({
store,
Expand All @@ -449,39 +456,9 @@ declare module 'found' {
historyOptions,
routeConfig,
...options
}: any): ConnectedRouter;
}: FarceCreateRouterArgs): ConnectedRouter;

function createBrowserRouter(
options: CreateBrowserRouterArgs,
): BrowserRouter;
}

declare module 'found/lib/Route' {
import { Route } from 'found';

export default Route;
}

declare module 'found/lib/createRender' {
import { createRender } from 'found';

export default createRender;
}

declare module 'found/lib/makeRouteConfig' {
import { makeRouteConfig } from 'found';

export default makeRouteConfig;
}

declare module 'found/lib/RedirectException' {
import { RedirectException } from 'found';

export default RedirectException;
}

declare module 'found/lib/HttpError' {
import { HttpError } from 'found';

export default HttpError;
}
5 changes: 5 additions & 0 deletions types/makeRouteConfig.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/makeRouteConfig' {
import { makeRouteConfig } from 'found';

export default makeRouteConfig;
}
5 changes: 5 additions & 0 deletions types/resolver.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/resolver' {
import { resolver } from 'found';

export default resolver;
}
2 changes: 1 addition & 1 deletion types/tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"check-type-operator",
"check-preblock"
],

"no-single-declare-module": false,
"no-unnecessary-generics": false,
"no-unnecessary-class": false
}
Expand Down
5 changes: 5 additions & 0 deletions types/withRouter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'found/lib/withRouter' {
import { withRouter } from 'found';

export default withRouter;
}

0 comments on commit abe7dee

Please sign in to comment.