From acb2f62ccc44cd2d6b2dff4db0804d3bbd579506 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Fri, 8 Dec 2017 19:54:51 +0800 Subject: [PATCH 01/42] add types of mirrox --- types/mirrorx/README.md | 1 + types/mirrorx/index.d.ts | 219 +++++++++++++++++++++++++++++++++ types/mirrorx/mirrorx-tests.ts | 29 +++++ types/mirrorx/package.json | 11 ++ types/mirrorx/tsconfig.json | 26 ++++ types/mirrorx/tslint.json | 7 ++ 6 files changed, 293 insertions(+) create mode 100644 types/mirrorx/README.md create mode 100644 types/mirrorx/index.d.ts create mode 100644 types/mirrorx/mirrorx-tests.ts create mode 100644 types/mirrorx/package.json create mode 100644 types/mirrorx/tsconfig.json create mode 100644 types/mirrorx/tslint.json diff --git a/types/mirrorx/README.md b/types/mirrorx/README.md new file mode 100644 index 0000000000..a4bce407a2 --- /dev/null +++ b/types/mirrorx/README.md @@ -0,0 +1 @@ +This is typings for [mirrorjs](https://github.com/mirrorjs/mirror) \ No newline at end of file diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts new file mode 100644 index 0000000000..5720677bfe --- /dev/null +++ b/types/mirrorx/index.d.ts @@ -0,0 +1,219 @@ +// Type definitions for mirrorjs +// Project: https://github.com/mirrorjs/mirror +// Definitions by: Aaronphy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as React from 'react'; +import * as H from 'history'; +import { + ReactInstance, Component, ComponentState, + ReactElement, SFCElement, CElement, + DOMAttributes, DOMElement, ReactNode, ReactPortal +} from 'react'; +import { + History, + Location, + Path, + LocationState, + LocationDescriptor +} from 'history'; + +import { Connect } from 'react-redux'; +import { match } from "react-router"; + + +export = mirror; +export as namespace mirror; + +declare namespace mirror { + + type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; + type Omit = Pick>; + + interface model { + name:string, + initialState?:any, + reducers?:any, + effects?:any + } + + interface _model { + name:string, + reducers:any + } + + interface LinkProps extends React.AnchorHTMLAttributes { + to: H.LocationDescriptor; + replace?: boolean; + } + + interface NavLinkProps extends LinkProps { + activeClassName?: string; + activeStyle?: React.CSSProperties; + exact?: boolean; + strict?: boolean; + isActive?

(match: match

, location: H.Location): boolean; + location?: H.Location; + } + + interface SwitchProps { + children?: React.ReactNode; + location?: H.Location; + } + + interface RedirectProps { + to: H.LocationDescriptor; + push?: boolean; + from?: string; + path?: string; + exact?: boolean; + strict?: boolean; + } + + interface RouteComponentProps

{ + match: match

; + location: H.Location; + history: H.History; + staticContext?: any; + } + + interface RouteProps { + location?: H.Location; + component?: React.ComponentType> | React.ComponentType; + render?: ((props: RouteComponentProps) => React.ReactNode); + children?: ((props: RouteComponentProps) => React.ReactNode) | React.ReactNode; + path?: string; + exact?: boolean; + strict?: boolean; + } + + interface PromptProps { + message: string | ((location: H.Location) => string | boolean); + when?: boolean; + } + + interface LocationActionPayload { + method: string; + args?: any[]; + } + + interface RouterAction { + type:'@@router/CALL_HISTORY_METHOD', + payload: LocationActionPayload; + } + + interface routeActions { + push(location:any,state?:any):RouterAction, + replace(location:any,state?:any):RouterAction, + go(n:number):RouterAction, + goBack(): RouterAction, + goForward(): RouterAction + } + + export interface ConnectedRouterProps { + store?: any; + history?: History; +} + + interface Actions { + routing:routeActions, + [propName: string]: any + } + + interface defaultOptions { + initialState?:{}, + historyMode?:string, + middlewares:[any], + reducers:{}, + addEffect(name:string,handler:()=>any):any + } + + interface Renderer { + // Deprecated(render): The return value is deprecated. + // In future releases the render function's return type will be void. + + ( + element: DOMElement, T>, + container: Element | null, + callback?: () => void + ): T; + + ( + element: Array, any>>, + container: Element | null, + callback?: () => void + ): Element; + + ( + element: SFCElement | Array>, + container: Element | null, + callback?: () => void + ): void; + + >( + element: CElement, + container: Element | null, + callback?: () => void + ): T; + + ( + element: Array>>, + container: Element | null, + callback?: () => void + ): Component; + +

( + element: ReactElement

, + container: Element | null, + callback?: () => void + ): Component | Element | void; + + ( + element: Array>, + container: Element | null, + callback?: () => void + ): Component | Element | void; + + ( + parentComponent: Component | Array>, + element: SFCElement, + container: Element, + callback?: () => void + ): void; +} + + /** + * This method is used to create and inject a model. + * @param options + */ + function model(options:model):_model + /** + * connect connects your React component to your Redux store + */ + const connect:Connect + //The actions object contains both your Redux actions and reducers. + const actions:Actions + //Add a hook to monitor actions that have been dispatched. + const hook:(subscriber:()=>any)=>any + //mirror.defaults is a pretty intuitive API, you use it to configure your Mirror app. + const defaults:(options:defaultOptions)=>void + //render is an enhanced ReactDOM.render, it starts your Mirror app. + const render: Renderer; + // Mirror uses react-router@4.x, so if you're from react-router 2.x/3.x, you should checkout the Migrating from v2/v3 to v4 Guide. + class Router extends React.Component> {} + + class Link extends React.Component {} + + class NavLink extends React.Component {} + + class Redirect extends React.Component { } + + class Route extends React.Component { } + + class Prompt extends React.Component { } + + function withRouter

>(component: React.ComponentType

): React.ComponentClass>>; + + function withRouter>(target: TFunction): TFunction; +} \ No newline at end of file diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts new file mode 100644 index 0000000000..c2a1ca6616 --- /dev/null +++ b/types/mirrorx/mirrorx-tests.ts @@ -0,0 +1,29 @@ +import { Component, ReactElement } from 'react'; +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import * as mirror from 'mirrorx'; +import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} from 'mirrorx' + +mirror.model({ + name:'app', + + initialState: 0, + + reducers:{ + increment(state:any) { return state + 1 }, + decrement(state:any) { return state - 1 } + }, + + effects:{ + async incrementAsync() { + await new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, 1000) + }) + actions.app.increment() + } + } +}); + + diff --git a/types/mirrorx/package.json b/types/mirrorx/package.json new file mode 100644 index 0000000000..ee406466f8 --- /dev/null +++ b/types/mirrorx/package.json @@ -0,0 +1,11 @@ +{ + "private": true, + "dependencies": { + "@types/react":"^16.0.0", + "@types/react-dom":"^16.0.0", + "@types/react-router-dom":"^4.2.3", + "@types/redux":"^3.6.0", + "@types/react-redux":"^5.0.14", + "@types/react-router-redux":"^5.0.10" + } +} \ No newline at end of file diff --git a/types/mirrorx/tsconfig.json b/types/mirrorx/tsconfig.json new file mode 100644 index 0000000000..bc994b8f74 --- /dev/null +++ b/types/mirrorx/tsconfig.json @@ -0,0 +1,26 @@ +{ + "files": [ + "index.d.ts", + "mirrorx_test.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "experimentalDecorators": true, + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/types/mirrorx/tslint.json b/types/mirrorx/tslint.json new file mode 100644 index 0000000000..f7a71e1866 --- /dev/null +++ b/types/mirrorx/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": ["tslint:latest", "tslint-react"], + "rules": { + "no-unnecessary-generics": false, + "jsx-wrap-multiline": false + } +} \ No newline at end of file From 202a79f8b1ea947ff9866ec376bc1057a872cb7b Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 11:10:28 +0800 Subject: [PATCH 02/42] add commit in mirrorx-tests.ts file --- types/mirrorx/mirrorx-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index c2a1ca6616..57e16f9321 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -4,6 +4,10 @@ import * as ReactDOM from 'react-dom'; import * as mirror from 'mirrorx'; import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} from 'mirrorx' + +/** + * add mirror.model.tests + */ mirror.model({ name:'app', @@ -27,3 +31,4 @@ mirror.model({ }); + From 56fd54961c539eefc95c75438994f7947550891c Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 11:24:44 +0800 Subject: [PATCH 03/42] update code for new pr --- types/mirrorx/mirrorx-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 57e16f9321..79c9e581c1 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -7,6 +7,7 @@ import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} f /** * add mirror.model.tests + * */ mirror.model({ name:'app', From 34b79a66c003c4bd59523807e9faccfef5c9661c Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 11:32:07 +0800 Subject: [PATCH 04/42] update the tsconfig.json --- types/mirrorx/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/tsconfig.json b/types/mirrorx/tsconfig.json index bc994b8f74..c6dab55976 100644 --- a/types/mirrorx/tsconfig.json +++ b/types/mirrorx/tsconfig.json @@ -1,7 +1,7 @@ { "files": [ "index.d.ts", - "mirrorx_test.ts" + "mirrorx-tests.ts" ], "compilerOptions": { "module": "commonjs", From 944c7e079575e91f40891e0134d180716d29ed16 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 11:38:52 +0800 Subject: [PATCH 05/42] remove the dev --- types/mirrorx/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/package.json b/types/mirrorx/package.json index ee406466f8..fb14dbd95e 100644 --- a/types/mirrorx/package.json +++ b/types/mirrorx/package.json @@ -1,6 +1,6 @@ { "private": true, - "dependencies": { + "devDependencies": { "@types/react":"^16.0.0", "@types/react-dom":"^16.0.0", "@types/react-router-dom":"^4.2.3", From 5713b4e99389519be29dcd445b6ae312612c946e Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 11:42:28 +0800 Subject: [PATCH 06/42] update code for remove @types --- types/mirrorx/package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/mirrorx/package.json b/types/mirrorx/package.json index fb14dbd95e..b390246ac3 100644 --- a/types/mirrorx/package.json +++ b/types/mirrorx/package.json @@ -1,11 +1,11 @@ { "private": true, "devDependencies": { - "@types/react":"^16.0.0", - "@types/react-dom":"^16.0.0", - "@types/react-router-dom":"^4.2.3", - "@types/redux":"^3.6.0", - "@types/react-redux":"^5.0.14", - "@types/react-router-redux":"^5.0.10" + "react":"^16.0.0", + "react-dom":"^16.0.0", + "react-router-dom":"^4.2.3", + "redux":"^3.6.0", + "react-redux":"^5.0.14", + "react-router-redux":"^5.0.10" } } \ No newline at end of file From 232e20c614033ca44821884600016f959fa3c658 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 11:45:48 +0800 Subject: [PATCH 07/42] ass dependecies --- types/mirrorx/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/package.json b/types/mirrorx/package.json index b390246ac3..1ad45d6701 100644 --- a/types/mirrorx/package.json +++ b/types/mirrorx/package.json @@ -1,6 +1,6 @@ { "private": true, - "devDependencies": { + "dependencies": { "react":"^16.0.0", "react-dom":"^16.0.0", "react-router-dom":"^4.2.3", From d818809206f188fc42ff9cb370c1ee7170dd082b Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 11:48:51 +0800 Subject: [PATCH 08/42] remove react de --- types/mirrorx/package.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/types/mirrorx/package.json b/types/mirrorx/package.json index 1ad45d6701..63eb9221f9 100644 --- a/types/mirrorx/package.json +++ b/types/mirrorx/package.json @@ -1,11 +1,6 @@ { "private": true, "dependencies": { - "react":"^16.0.0", - "react-dom":"^16.0.0", - "react-router-dom":"^4.2.3", - "redux":"^3.6.0", - "react-redux":"^5.0.14", - "react-router-redux":"^5.0.10" + "redux":"^3.6.0" } } \ No newline at end of file From 7f34cb2f66f1b5fdce83d84d11deaf73d75dca99 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 12:02:10 +0800 Subject: [PATCH 09/42] update the dependencies --- types/mirrorx/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/package.json b/types/mirrorx/package.json index 63eb9221f9..b8e8fb1e35 100644 --- a/types/mirrorx/package.json +++ b/types/mirrorx/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux":"^3.6.0" + "mirrorx":"^0.2.10" } } \ No newline at end of file From c687f9ca319d15b98a591e658af8a540b6b47932 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 12:07:45 +0800 Subject: [PATCH 10/42] upate code for de --- types/mirrorx/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/package.json b/types/mirrorx/package.json index b8e8fb1e35..6cceba467a 100644 --- a/types/mirrorx/package.json +++ b/types/mirrorx/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "mirrorx":"^0.2.10" + "redux":"^3.7.2" } } \ No newline at end of file From d451a47ce552525b7d33232d9d03221e77a16e96 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 12:10:39 +0800 Subject: [PATCH 11/42] remove the package.json --- types/mirrorx/README.md | 1 - types/mirrorx/package.json | 6 ------ 2 files changed, 7 deletions(-) delete mode 100644 types/mirrorx/README.md delete mode 100644 types/mirrorx/package.json diff --git a/types/mirrorx/README.md b/types/mirrorx/README.md deleted file mode 100644 index a4bce407a2..0000000000 --- a/types/mirrorx/README.md +++ /dev/null @@ -1 +0,0 @@ -This is typings for [mirrorjs](https://github.com/mirrorjs/mirror) \ No newline at end of file diff --git a/types/mirrorx/package.json b/types/mirrorx/package.json deleted file mode 100644 index 6cceba467a..0000000000 --- a/types/mirrorx/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "redux":"^3.7.2" - } -} \ No newline at end of file From ab4d095b2c467f9849fc4e7310e931979453ff88 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 12:23:37 +0800 Subject: [PATCH 12/42] update code for refference --- types/mirrorx/index.d.ts | 5 +++++ types/mirrorx/mirrorx-tests.ts | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 5720677bfe..d0755b1194 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -4,6 +4,11 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +/// +/// +/// +/// + import * as React from 'react'; import * as H from 'history'; import { diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 79c9e581c1..0cfe58b358 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -1,6 +1,3 @@ -import { Component, ReactElement } from 'react'; -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; import * as mirror from 'mirrorx'; import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} from 'mirrorx' From 732e32254cfdf310049fc5439a5149e2703bd75f Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 12:29:45 +0800 Subject: [PATCH 13/42] update code for typescript --- types/mirrorx/index.d.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index d0755b1194..a286559ca0 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,12 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// -/// -/// -/// +// TypeScript Version: 2.4 import * as React from 'react'; import * as H from 'history'; From 269c14933782ca4a88f681f5619f9c46127fbf3a Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 12:56:43 +0800 Subject: [PATCH 14/42] update code for new --- types/mirrorx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index a286559ca0..8b1cc26416 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.3 import * as React from 'react'; import * as H from 'history'; From db9f2f17a6f988c473dabd6bdd5db10ee3a90b08 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 13:15:03 +0800 Subject: [PATCH 15/42] update code for ts version --- types/mirrorx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 8b1cc26416..abe6f2d496 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.2 import * as React from 'react'; import * as H from 'history'; From fc38ac1720d03e53cbcef8f5e6b5e90e7657fe05 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 13:35:13 +0800 Subject: [PATCH 16/42] typescript version --- types/mirrorx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index abe6f2d496..37805d4bac 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.0 import * as React from 'react'; import * as H from 'history'; From 952a9db4b3fffbf580ca3a485ee74a0083412b01 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 13:44:25 +0800 Subject: [PATCH 17/42] updat code for ts version --- types/mirrorx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 37805d4bac..2c07f1008b 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.0 +// TypeScript Version: 2.6 import * as React from 'react'; import * as H from 'history'; From ee98bdd185dd4fd886f3453de3191e5f1408265d Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 13:51:02 +0800 Subject: [PATCH 18/42] react ts --- types/mirrorx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 2c07f1008b..4c1da1e750 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 1.9 import * as React from 'react'; import * as H from 'history'; From d817b64e821bafd61d6c4e359676811939404715 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 13:57:44 +0800 Subject: [PATCH 19/42] update code for ts version --- types/mirrorx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 4c1da1e750..ad87c2f9ce 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 1.9 +// TypeScript Version: 1.0 import * as React from 'react'; import * as H from 'history'; From 939a36fe561970db57c899e25aa5e5c7062f54a6 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 14:31:46 +0800 Subject: [PATCH 20/42] update code for ts version --- types/mirrorx/index.d.ts | 2 +- types/mirrorx/mirrorx-tests.ts | 7 +-- types/mirrorx/tslint.json | 78 +++++++++++++++++++++++++++++++++- 3 files changed, 81 insertions(+), 6 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index ad87c2f9ce..fef4b74ec9 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 1.0 +// TypeScript Version: 2.1 import * as React from 'react'; import * as H from 'history'; diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 0cfe58b358..98d1a2e94e 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -1,7 +1,8 @@ +import { Component, ReactElement } from 'react'; +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import * as mirror from 'mirrorx'; -import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} from 'mirrorx' - - +import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} from 'mirrorx'; /** * add mirror.model.tests * diff --git a/types/mirrorx/tslint.json b/types/mirrorx/tslint.json index f7a71e1866..db6c870b64 100644 --- a/types/mirrorx/tslint.json +++ b/types/mirrorx/tslint.json @@ -1,7 +1,81 @@ { - "extends": ["tslint:latest", "tslint-react"], + "extends": "dtslint/dt.json", "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, "no-unnecessary-generics": false, - "jsx-wrap-multiline": false + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-object-spread": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "use-default-type-parameter": false, + "void-return": false, + "whitespace": false } } \ No newline at end of file From ef68bf75d342b9d36da1c594be880964db23131a Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 16:22:42 +0800 Subject: [PATCH 21/42] update the ts versin --- types/mirrorx/index.d.ts | 2 +- types/mirrorx/mirrorx-tests.ts | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index fef4b74ec9..1ffcd20925 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.4 import * as React from 'react'; import * as H from 'history'; diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 98d1a2e94e..51f30d5f40 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -2,21 +2,17 @@ import { Component, ReactElement } from 'react'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import * as mirror from 'mirrorx'; -import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} from 'mirrorx'; /** * add mirror.model.tests * */ mirror.model({ name:'app', - initialState: 0, - reducers:{ increment(state:any) { return state + 1 }, decrement(state:any) { return state - 1 } }, - effects:{ async incrementAsync() { await new Promise((resolve, reject) => { From 98c1e46910232926a3129ac1056aa8e0fbe10d8f Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 11 Dec 2017 16:27:58 +0800 Subject: [PATCH 22/42] update code for mirrorx --- types/mirrorx/mirrorx-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 51f30d5f40..7a571b2497 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -2,6 +2,7 @@ import { Component, ReactElement } from 'react'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import * as mirror from 'mirrorx'; +import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} from 'mirrorx'; /** * add mirror.model.tests * From 8d49cf6705f6debd70ea8389408b3a2181cceff7 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 12 Dec 2017 11:18:57 +0800 Subject: [PATCH 23/42] fix the code review --- types/mirrorx/index.d.ts | 2 +- types/mirrorx/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 1ffcd20925..9cea8531dc 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -124,7 +124,7 @@ declare namespace mirror { interface defaultOptions { initialState?:{}, historyMode?:string, - middlewares:[any], + middlewares:any[], reducers:{}, addEffect(name:string,handler:()=>any):any } diff --git a/types/mirrorx/tsconfig.json b/types/mirrorx/tsconfig.json index c6dab55976..561f5cdab4 100644 --- a/types/mirrorx/tsconfig.json +++ b/types/mirrorx/tsconfig.json @@ -11,7 +11,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "jsx": "react", From 0dc16819cc65f955bb5be11a4970a856a735375c Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Wed, 13 Dec 2017 11:39:02 +0800 Subject: [PATCH 24/42] update code for new code --- types/mirrorx/tslint.json | 152 +++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/types/mirrorx/tslint.json b/types/mirrorx/tslint.json index db6c870b64..77cc132a9e 100644 --- a/types/mirrorx/tslint.json +++ b/types/mirrorx/tslint.json @@ -1,81 +1,81 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-object-spread": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "use-default-type-parameter": false, - "void-return": false, - "whitespace": false + "adjacent-overload-signatures": true, + "array-type": true, + "arrow-return-shorthand": true, + "ban-types": true, + "callable-types": true, + "comment-format": true, + "dt-header": true, + "eofline": true, + "export-just-namespace": true, + "import-spacing": true, + "interface-name": true, + "interface-over-type-literal": true, + "jsdoc-format": true, + "max-line-length": true, + "member-access": true, + "new-parens": true, + "no-any-union": true, + "no-boolean-literal-compare": true, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": true, + "no-construct": true, + "no-declare-current-package": true, + "no-duplicate-imports": true, + "no-duplicate-variable": true, + "no-empty-interface": true, + "no-for-in-array": true, + "no-inferrable-types": true, + "no-internal-module": true, + "no-irregular-whitespace": true, + "no-mergeable-namespace": true, + "no-misused-new": true, + "no-namespace": true, + "no-object-literal-type-assertion": true, + "no-padding": true, + "no-redundant-jsdoc": true, + "no-redundant-jsdoc-2": true, + "no-redundant-undefined": true, + "no-reference-import": true, + "no-relative-import-in-test": true, + "no-self-import": true, + "no-single-declare-module": true, + "no-string-throw": true, + "no-unnecessary-callback-wrapper": true, + "no-unnecessary-class": true, + "no-unnecessary-generics": true, + "no-unnecessary-qualifier": true, + "no-unnecessary-type-assertion": true, + "no-useless-files": true, + "no-var-keyword": true, + "no-var-requires": true, + "no-void-expression": true, + "no-trailing-whitespace": true, + "object-literal-key-quotes": true, + "object-literal-shorthand": true, + "one-line": true, + "one-variable-per-declaration": true, + "only-arrow-functions": true, + "prefer-conditional-expression": true, + "prefer-const": true, + "prefer-declare-function": true, + "prefer-for-of": true, + "prefer-method-signature": true, + "prefer-object-spread": true, + "prefer-template": true, + "radix": true, + "semicolon": true, + "space-before-function-paren": true, + "space-within-parens": true, + "strict-export-declare-modifiers": true, + "trim-file": true, + "triple-equals": true, + "typedef-whitespace": true, + "unified-signatures": true, + "use-default-type-parameter": true, + "void-return": true, + "whitespace": true } } \ No newline at end of file From 203a292d174d75bff9984b1e70a22047f5dac760 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Wed, 13 Dec 2017 15:52:34 +0800 Subject: [PATCH 25/42] turn on the rules --- types/mirrorx/tslint.json | 74 +-------------------------------------- 1 file changed, 1 insertion(+), 73 deletions(-) diff --git a/types/mirrorx/tslint.json b/types/mirrorx/tslint.json index 77cc132a9e..9b48672d6c 100644 --- a/types/mirrorx/tslint.json +++ b/types/mirrorx/tslint.json @@ -1,81 +1,9 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": true, - "array-type": true, - "arrow-return-shorthand": true, - "ban-types": true, - "callable-types": true, - "comment-format": true, - "dt-header": true, - "eofline": true, - "export-just-namespace": true, "import-spacing": true, - "interface-name": true, "interface-over-type-literal": true, - "jsdoc-format": true, "max-line-length": true, - "member-access": true, - "new-parens": true, - "no-any-union": true, - "no-boolean-literal-compare": true, - "no-conditional-assignment": true, - "no-consecutive-blank-lines": true, - "no-construct": true, - "no-declare-current-package": true, - "no-duplicate-imports": true, - "no-duplicate-variable": true, - "no-empty-interface": true, - "no-for-in-array": true, - "no-inferrable-types": true, - "no-internal-module": true, - "no-irregular-whitespace": true, - "no-mergeable-namespace": true, - "no-misused-new": true, - "no-namespace": true, - "no-object-literal-type-assertion": true, - "no-padding": true, - "no-redundant-jsdoc": true, - "no-redundant-jsdoc-2": true, - "no-redundant-undefined": true, - "no-reference-import": true, - "no-relative-import-in-test": true, - "no-self-import": true, - "no-single-declare-module": true, - "no-string-throw": true, - "no-unnecessary-callback-wrapper": true, - "no-unnecessary-class": true, - "no-unnecessary-generics": true, - "no-unnecessary-qualifier": true, - "no-unnecessary-type-assertion": true, - "no-useless-files": true, - "no-var-keyword": true, - "no-var-requires": true, - "no-void-expression": true, - "no-trailing-whitespace": true, - "object-literal-key-quotes": true, - "object-literal-shorthand": true, - "one-line": true, - "one-variable-per-declaration": true, - "only-arrow-functions": true, - "prefer-conditional-expression": true, - "prefer-const": true, - "prefer-declare-function": true, - "prefer-for-of": true, - "prefer-method-signature": true, - "prefer-object-spread": true, - "prefer-template": true, - "radix": true, - "semicolon": true, - "space-before-function-paren": true, - "space-within-parens": true, - "strict-export-declare-modifiers": true, - "trim-file": true, - "triple-equals": true, - "typedef-whitespace": true, - "unified-signatures": true, - "use-default-type-parameter": true, - "void-return": true, - "whitespace": true + "member-access": true } } \ No newline at end of file From da53438dd21420f165a3ed66b864fa54830510cc Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Wed, 13 Dec 2017 16:04:10 +0800 Subject: [PATCH 26/42] change the tslint --- types/mirrorx/mirrorx-tests.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 7a571b2497..7d90c97b68 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -1,8 +1,7 @@ -import { Component, ReactElement } from 'react'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import * as mirror from 'mirrorx'; -import { render,actions,withRouter,Link,NavLink,Router,Route,connect,Redirect} from 'mirrorx'; +import { actions } from 'mirrorx'; /** * add mirror.model.tests * @@ -18,10 +17,10 @@ mirror.model({ async incrementAsync() { await new Promise((resolve, reject) => { setTimeout(() => { - resolve() + resolve(); }, 1000) }) - actions.app.increment() + actions.app.increment(); } } }); From d3ca9be002076cb0101ce1185a8cff2717d6cec7 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Wed, 13 Dec 2017 16:18:31 +0800 Subject: [PATCH 27/42] turn off the tslint --- types/mirrorx/tslint.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/types/mirrorx/tslint.json b/types/mirrorx/tslint.json index 9b48672d6c..790ed12b0f 100644 --- a/types/mirrorx/tslint.json +++ b/types/mirrorx/tslint.json @@ -4,6 +4,16 @@ "import-spacing": true, "interface-over-type-literal": true, "max-line-length": true, - "member-access": true + "member-access": true, + "no-trailing-whitespace":false, + "whitespace":false, + "semicolon":false, + "no-duplicate-imports":false, + "export-just-namespace":false, + "no-unnecessary-generics":false, + "typedef-whitespace":false, + "no-consecutive-blank-lines":false, + "trim-file":false, + "prefer-declare-function":"prefer-declare-function" } } \ No newline at end of file From d5693c93f38cb443611b3915b8ab3cf8a95aa179 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Wed, 13 Dec 2017 19:58:03 +0800 Subject: [PATCH 28/42] update code for new code --- types/mirrorx/tslint.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/types/mirrorx/tslint.json b/types/mirrorx/tslint.json index 790ed12b0f..a29191565d 100644 --- a/types/mirrorx/tslint.json +++ b/types/mirrorx/tslint.json @@ -14,6 +14,12 @@ "typedef-whitespace":false, "no-consecutive-blank-lines":false, "trim-file":false, - "prefer-declare-function":"prefer-declare-function" + "prefer-declare-function":false, + "dt-header":false, + "no-padding":false, + "no-redundant-jsdoc-2":false, + "comment-format":false, + "eofline":false, + "strict-export-declare-modifiers":false } } \ No newline at end of file From ebe2876998c5e45565a6cf920b84427cee0dda87 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Thu, 14 Dec 2017 14:28:29 +0800 Subject: [PATCH 29/42] add tslint --- types/mirrorx/mirrorx-tests.ts | 21 ++++++++------------- types/mirrorx/tsconfig.json | 2 +- types/mirrorx/tslint.json | 24 +----------------------- 3 files changed, 10 insertions(+), 37 deletions(-) diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 7d90c97b68..11f1af29da 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -1,29 +1,24 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import * as mirror from 'mirrorx'; -import { actions } from 'mirrorx'; +import mirror, { actions } from 'mirrorx'; /** * add mirror.model.tests - * */ mirror.model({ - name:'app', + name: 'app', initialState: 0, - reducers:{ - increment(state:any) { return state + 1 }, - decrement(state:any) { return state - 1 } + reducers: { + increment(state: any) { return state + 1; }, + decrement(state: any) { return state - 1; } }, - effects:{ + effects: { async incrementAsync() { await new Promise((resolve, reject) => { setTimeout(() => { resolve(); - }, 1000) - }) + }, 1000); + }); actions.app.increment(); } } }); - - - diff --git a/types/mirrorx/tsconfig.json b/types/mirrorx/tsconfig.json index 561f5cdab4..8ca8985f1d 100644 --- a/types/mirrorx/tsconfig.json +++ b/types/mirrorx/tsconfig.json @@ -19,7 +19,7 @@ "typeRoots": [ "../" ], - "types": [], + "types": ["types"], "noEmit": true, "forceConsistentCasingInFileNames": true } diff --git a/types/mirrorx/tslint.json b/types/mirrorx/tslint.json index a29191565d..e60c15844f 100644 --- a/types/mirrorx/tslint.json +++ b/types/mirrorx/tslint.json @@ -1,25 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "import-spacing": true, - "interface-over-type-literal": true, - "max-line-length": true, - "member-access": true, - "no-trailing-whitespace":false, - "whitespace":false, - "semicolon":false, - "no-duplicate-imports":false, - "export-just-namespace":false, - "no-unnecessary-generics":false, - "typedef-whitespace":false, - "no-consecutive-blank-lines":false, - "trim-file":false, - "prefer-declare-function":false, - "dt-header":false, - "no-padding":false, - "no-redundant-jsdoc-2":false, - "comment-format":false, - "eofline":false, - "strict-export-declare-modifiers":false - } + "extends": "dtslint/dt.json" } \ No newline at end of file From d384da9dde266644920ed3dca880e78868d2559e Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Thu, 14 Dec 2017 14:34:19 +0800 Subject: [PATCH 30/42] update code for remove types --- types/mirrorx/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mirrorx/tsconfig.json b/types/mirrorx/tsconfig.json index 8ca8985f1d..561f5cdab4 100644 --- a/types/mirrorx/tsconfig.json +++ b/types/mirrorx/tsconfig.json @@ -19,7 +19,7 @@ "typeRoots": [ "../" ], - "types": ["types"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true } From 296fcf388e170b615f0dfa524a3040be60dddcc9 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 17:31:01 +0800 Subject: [PATCH 31/42] fixed the lint one by one --- types/mirrorx/index.d.ts | 162 ++++++++++++++------------------- types/mirrorx/mirrorx-tests.ts | 10 +- 2 files changed, 73 insertions(+), 99 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 9cea8531dc..28a5fcf5ff 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -1,53 +1,39 @@ -// Type definitions for mirrorjs +// Type definitions for mirrorjs 0.2.10 // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 -import * as React from 'react'; import * as H from 'history'; -import { - ReactInstance, Component, ComponentState, - ReactElement, SFCElement, CElement, - DOMAttributes, DOMElement, ReactNode, ReactPortal -} from 'react'; -import { - History, - Location, - Path, - LocationState, - LocationDescriptor -} from 'history'; + +import * as React from 'react'; import { Connect } from 'react-redux'; import { match } from "react-router"; - export = mirror; export as namespace mirror; declare namespace mirror { - type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; + type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; type Omit = Pick>; interface model { - name:string, - initialState?:any, - reducers?:any, - effects?:any - } - - interface _model { - name:string, - reducers:any + name: string; + initialState?: any; + reducers?: any; + effects?: any; } + interface _model { + name: string; + reducers: any; + } interface LinkProps extends React.AnchorHTMLAttributes { to: H.LocationDescriptor; replace?: boolean; } - interface NavLinkProps extends LinkProps { activeClassName?: string; activeStyle?: React.CSSProperties; @@ -99,121 +85,109 @@ declare namespace mirror { } interface RouterAction { - type:'@@router/CALL_HISTORY_METHOD', + type: '@@router/CALL_HISTORY_METHOD'; payload: LocationActionPayload; } - + interface routeActions { - push(location:any,state?:any):RouterAction, - replace(location:any,state?:any):RouterAction, - go(n:number):RouterAction, - goBack(): RouterAction, - goForward(): RouterAction + push(location: any, state?: any): RouterAction; + replace(location: any, state?: any): RouterAction; + go(n: number): RouterAction; + goBack(): RouterAction; + goForward(): RouterAction; } export interface ConnectedRouterProps { store?: any; - history?: History; -} + history?: H.History; + } interface Actions { - routing:routeActions, - [propName: string]: any + routing: routeActions; + [propName: string]: any; } interface defaultOptions { - initialState?:{}, - historyMode?:string, - middlewares:any[], - reducers:{}, - addEffect(name:string,handler:()=>any):any + initialState?: {}; + historyMode?: string; + middlewares: any[]; + reducers: {}; + addEffect(name: string, handler: () => any): any; } interface Renderer { // Deprecated(render): The return value is deprecated. // In future releases the render function's return type will be void. - ( - element: DOMElement, T>, - container: Element | null, - callback?: () => void + element: React.DOMElement, T>, + container: Element | null, + callback?: () => void ): T; ( - element: Array, any>>, - container: Element | null, - callback?: () => void + element: Array, any>>, + container: Element | null, + callback?: () => void ): Element; ( - element: SFCElement | Array>, - container: Element | null, - callback?: () => void + element: React.SFCElement | Array>, + container: Element | null, + callback?: () => void ): void; - >( - element: CElement, - container: Element | null, - callback?: () => void + >( + element: React.CElement, + container: Element | null, + callback?: () => void ): T; ( - element: Array>>, - container: Element | null, - callback?: () => void - ): Component; + element: Array>>, + container: Element | null, + callback?: () => void + ): React.Component;

( - element: ReactElement

, - container: Element | null, - callback?: () => void - ): Component | Element | void; + element: React.ReactElement

, + container: Element | null, + callback?: () => void + ): React.Component | Element | void; ( - element: Array>, - container: Element | null, - callback?: () => void - ): Component | Element | void; + element: Array>, + container: Element | null, + callback?: () => void + ): React.Component | Element | void; ( - parentComponent: Component | Array>, - element: SFCElement, - container: Element, - callback?: () => void + parentComponent: React.Component | Array>, + element: React.SFCElement, + container: Element, + callback?: () => void ): void; -} + } /** * This method is used to create and inject a model. - * @param options + * @param options */ - function model(options:model):_model + function model(options: model): _model; /** * connect connects your React component to your Redux store */ - const connect:Connect - //The actions object contains both your Redux actions and reducers. - const actions:Actions - //Add a hook to monitor actions that have been dispatched. - const hook:(subscriber:()=>any)=>any - //mirror.defaults is a pretty intuitive API, you use it to configure your Mirror app. - const defaults:(options:defaultOptions)=>void - //render is an enhanced ReactDOM.render, it starts your Mirror app. + const connect: Connect; + const actions: Actions; + const hook: (subscriber: () => any) => any; + const defaults: (options: defaultOptions) => void; const render: Renderer; - // Mirror uses react-router@4.x, so if you're from react-router 2.x/3.x, you should checkout the Migrating from v2/v3 to v4 Guide. - class Router extends React.Component> {} - class Link extends React.Component {} - - class NavLink extends React.Component {} - + class Router extends React.Component> { } + class Link extends React.Component { } + class NavLink extends React.Component { } class Redirect extends React.Component { } - class Route extends React.Component { } - class Prompt extends React.Component { } - function withRouter

>(component: React.ComponentType

): React.ComponentClass>>; - function withRouter>(target: TFunction): TFunction; -} \ No newline at end of file +} diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 11f1af29da..50d4f3dbe7 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -1,9 +1,9 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import mirror, { actions } from 'mirrorx'; -/** - * add mirror.model.tests - */ +import mirror = require('mirrorx'); + /** + * add mirror.model.tests + */ mirror.model({ name: 'app', initialState: 0, @@ -18,7 +18,7 @@ mirror.model({ resolve(); }, 1000); }); - actions.app.increment(); + mirror.actions.app.increment(); } } }); From 9d9ff815ddbbdcdef5a2fef480a6a57586c32435 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 17:57:15 +0800 Subject: [PATCH 32/42] update code for header --- types/mirrorx/index.d.ts | 7 +++---- types/mirrorx/mirrorx-tests.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 28a5fcf5ff..1d8da94593 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for mirrorjs 0.2.10 +// Type definitions for mirrorx 0.2.10 // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,9 +11,6 @@ import * as React from 'react'; import { Connect } from 'react-redux'; import { match } from "react-router"; -export = mirror; -export as namespace mirror; - declare namespace mirror { type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; @@ -191,3 +188,5 @@ declare namespace mirror { function withRouter

>(component: React.ComponentType

): React.ComponentClass>>; function withRouter>(target: TFunction): TFunction; } + +export = mirror; \ No newline at end of file diff --git a/types/mirrorx/mirrorx-tests.ts b/types/mirrorx/mirrorx-tests.ts index 50d4f3dbe7..c608828e14 100644 --- a/types/mirrorx/mirrorx-tests.ts +++ b/types/mirrorx/mirrorx-tests.ts @@ -1,9 +1,9 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import mirror = require('mirrorx'); - /** - * add mirror.model.tests - */ +/** + * add mirror.model.tests + */ mirror.model({ name: 'app', initialState: 0, @@ -14,9 +14,9 @@ mirror.model({ effects: { async incrementAsync() { await new Promise((resolve, reject) => { - setTimeout(() => { - resolve(); - }, 1000); + setTimeout(() => { + resolve(); + }, 1000); }); mirror.actions.app.increment(); } From 51a19edb2e308469b955a2aead73c86e14cbc878 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 18:47:47 +0800 Subject: [PATCH 33/42] fix the lint --- types/mirrorx/index.d.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 1d8da94593..e3f69f83b5 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for mirrorx 0.2.10 +// Type definitions for mirrorx 0.2 // Project: https://github.com/mirrorjs/mirror // Definitions by: Aaronphy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,7 +12,6 @@ import { Connect } from 'react-redux'; import { match } from "react-router"; declare namespace mirror { - type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; type Omit = Pick>; @@ -36,7 +35,7 @@ declare namespace mirror { activeStyle?: React.CSSProperties; exact?: boolean; strict?: boolean; - isActive?

(match: match

, location: H.Location): boolean; + isActive?(match: match, location: H.Location): boolean; location?: H.Location; } @@ -94,7 +93,7 @@ declare namespace mirror { goForward(): RouterAction; } - export interface ConnectedRouterProps { + interface ConnectedRouterProps { store?: any; history?: H.History; } @@ -167,7 +166,6 @@ declare namespace mirror { /** * This method is used to create and inject a model. - * @param options */ function model(options: model): _model; /** @@ -175,10 +173,9 @@ declare namespace mirror { */ const connect: Connect; const actions: Actions; - const hook: (subscriber: () => any) => any; - const defaults: (options: defaultOptions) => void; + function hook():(subscriber: () => any) => any; + function defaults():(options: defaultOptions) => void; const render: Renderer; - class Router extends React.Component> { } class Link extends React.Component { } class NavLink extends React.Component { } @@ -186,7 +183,7 @@ declare namespace mirror { class Route extends React.Component { } class Prompt extends React.Component { } function withRouter

>(component: React.ComponentType

): React.ComponentClass>>; - function withRouter>(target: TFunction): TFunction; + function withRouter>(target: TFunction): TFunction; } export = mirror; \ No newline at end of file From cc4eb7aee2e321514321e45741b8eb8ccda76117 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 19:02:09 +0800 Subject: [PATCH 34/42] update code --- types/mirrorx/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index e3f69f83b5..7d50c039aa 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -173,8 +173,8 @@ declare namespace mirror { */ const connect: Connect; const actions: Actions; - function hook():(subscriber: () => any) => any; - function defaults():(options: defaultOptions) => void; + function hook(): (subscriber: () => any) => any; + function defaults(): (options: defaultOptions) => void; const render: Renderer; class Router extends React.Component> { } class Link extends React.Component { } @@ -183,7 +183,9 @@ declare namespace mirror { class Route extends React.Component { } class Prompt extends React.Component { } function withRouter

>(component: React.ComponentType

): React.ComponentClass>>; - function withRouter>(target: TFunction): TFunction; + function withRouter>(target: TFunction): TFunction; +} +declare module "mirror" { + export = mirror; } -export = mirror; \ No newline at end of file From ab9d42ec5dd6c5b85f3f2d6ae37fa661c28a6f1f Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 19:07:15 +0800 Subject: [PATCH 35/42] update code for css --- types/mirrorx/index.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 7d50c039aa..f1c112e6ed 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -11,7 +11,7 @@ import * as React from 'react'; import { Connect } from 'react-redux'; import { match } from "react-router"; -declare namespace mirror { +export namespace mirror { type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; type Omit = Pick>; @@ -187,5 +187,4 @@ declare namespace mirror { } declare module "mirror" { export = mirror; -} - +} \ No newline at end of file From 130e9022d06e45cf31e27533b3a22fa6cba2b7dd Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 19:15:06 +0800 Subject: [PATCH 36/42] update code for newlint --- types/mirrorx/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index f1c112e6ed..2ef6735ff4 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -186,5 +186,7 @@ export namespace mirror { function withRouter>(target: TFunction): TFunction; } declare module "mirror" { + export = mirror; + } \ No newline at end of file From 8c4a5ba399ecc7b92addfe77f22d791c8bf52b06 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 19:26:00 +0800 Subject: [PATCH 37/42] update code for dd --- notNeededPackages.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/notNeededPackages.json b/notNeededPackages.json index 7541a88848..286e340606 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -839,6 +839,12 @@ "typingsPackageName": "zone.js", "sourceRepoURL": "https://github.com/angular/zone.js", "asOfVersion": "0.5.12" + }, + { + "libraryName": "mirror", + "typingsPackageName": "mirrorx", + "sourceRepoURL": "https://github.com/mirrorjs/mirror", + "asOfVersion": "0.2.10" } ] } From 07ef93108e5f67d3157c68bb8c3fe0b7005f4167 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 19:31:04 +0800 Subject: [PATCH 38/42] newline fixed --- types/mirrorx/index.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 2ef6735ff4..910e516d4b 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -186,7 +186,5 @@ export namespace mirror { function withRouter>(target: TFunction): TFunction; } declare module "mirror" { - export = mirror; - -} \ No newline at end of file +} From 8de03ce022aa44b38c4c09d4eab062e5641f050e Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 19:40:46 +0800 Subject: [PATCH 39/42] change the defi --- types/mirrorx/index.d.ts | 343 +++++++++++++++++++-------------------- 1 file changed, 169 insertions(+), 174 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 910e516d4b..936078e9de 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -11,180 +11,175 @@ import * as React from 'react'; import { Connect } from 'react-redux'; import { match } from "react-router"; -export namespace mirror { - type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; - type Omit = Pick>; +type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; +type Omit = Pick>; - interface model { - name: string; - initialState?: any; - reducers?: any; - effects?: any; - } - - interface _model { - name: string; - reducers: any; - } - interface LinkProps extends React.AnchorHTMLAttributes { - to: H.LocationDescriptor; - replace?: boolean; - } - interface NavLinkProps extends LinkProps { - activeClassName?: string; - activeStyle?: React.CSSProperties; - exact?: boolean; - strict?: boolean; - isActive?(match: match, location: H.Location): boolean; - location?: H.Location; - } - - interface SwitchProps { - children?: React.ReactNode; - location?: H.Location; - } - - interface RedirectProps { - to: H.LocationDescriptor; - push?: boolean; - from?: string; - path?: string; - exact?: boolean; - strict?: boolean; - } - - interface RouteComponentProps

{ - match: match

; - location: H.Location; - history: H.History; - staticContext?: any; - } - - interface RouteProps { - location?: H.Location; - component?: React.ComponentType> | React.ComponentType; - render?: ((props: RouteComponentProps) => React.ReactNode); - children?: ((props: RouteComponentProps) => React.ReactNode) | React.ReactNode; - path?: string; - exact?: boolean; - strict?: boolean; - } - - interface PromptProps { - message: string | ((location: H.Location) => string | boolean); - when?: boolean; - } - - interface LocationActionPayload { - method: string; - args?: any[]; - } - - interface RouterAction { - type: '@@router/CALL_HISTORY_METHOD'; - payload: LocationActionPayload; - } - - interface routeActions { - push(location: any, state?: any): RouterAction; - replace(location: any, state?: any): RouterAction; - go(n: number): RouterAction; - goBack(): RouterAction; - goForward(): RouterAction; - } - - interface ConnectedRouterProps { - store?: any; - history?: H.History; - } - - interface Actions { - routing: routeActions; - [propName: string]: any; - } - - interface defaultOptions { - initialState?: {}; - historyMode?: string; - middlewares: any[]; - reducers: {}; - addEffect(name: string, handler: () => any): any; - } - - interface Renderer { - // Deprecated(render): The return value is deprecated. - // In future releases the render function's return type will be void. - ( - element: React.DOMElement, T>, - container: Element | null, - callback?: () => void - ): T; - - ( - element: Array, any>>, - container: Element | null, - callback?: () => void - ): Element; - - ( - element: React.SFCElement | Array>, - container: Element | null, - callback?: () => void - ): void; - - >( - element: React.CElement, - container: Element | null, - callback?: () => void - ): T; - - ( - element: Array>>, - container: Element | null, - callback?: () => void - ): React.Component; - -

( - element: React.ReactElement

, - container: Element | null, - callback?: () => void - ): React.Component | Element | void; - - ( - element: Array>, - container: Element | null, - callback?: () => void - ): React.Component | Element | void; - - ( - parentComponent: React.Component | Array>, - element: React.SFCElement, - container: Element, - callback?: () => void - ): void; - } - - /** - * This method is used to create and inject a model. - */ - function model(options: model): _model; - /** - * connect connects your React component to your Redux store - */ - const connect: Connect; - const actions: Actions; - function hook(): (subscriber: () => any) => any; - function defaults(): (options: defaultOptions) => void; - const render: Renderer; - class Router extends React.Component> { } - class Link extends React.Component { } - class NavLink extends React.Component { } - class Redirect extends React.Component { } - class Route extends React.Component { } - class Prompt extends React.Component { } - function withRouter

>(component: React.ComponentType

): React.ComponentClass>>; - function withRouter>(target: TFunction): TFunction; +interface model { + name: string; + initialState?: any; + reducers?: any; + effects?: any; } -declare module "mirror" { - export = mirror; + +interface _model { + name: string; + reducers: any; } +interface LinkProps extends React.AnchorHTMLAttributes { + to: H.LocationDescriptor; + replace?: boolean; +} +interface NavLinkProps extends LinkProps { + activeClassName?: string; + activeStyle?: React.CSSProperties; + exact?: boolean; + strict?: boolean; + isActive?(match: match, location: H.Location): boolean; + location?: H.Location; +} + +interface SwitchProps { + children?: React.ReactNode; + location?: H.Location; +} + +interface RedirectProps { + to: H.LocationDescriptor; + push?: boolean; + from?: string; + path?: string; + exact?: boolean; + strict?: boolean; +} + +interface RouteComponentProps

{ + match: match

; + location: H.Location; + history: H.History; + staticContext?: any; +} + +interface RouteProps { + location?: H.Location; + component?: React.ComponentType> | React.ComponentType; + render?: ((props: RouteComponentProps) => React.ReactNode); + children?: ((props: RouteComponentProps) => React.ReactNode) | React.ReactNode; + path?: string; + exact?: boolean; + strict?: boolean; +} + +interface PromptProps { + message: string | ((location: H.Location) => string | boolean); + when?: boolean; +} + +interface LocationActionPayload { + method: string; + args?: any[]; +} + +interface RouterAction { + type: '@@router/CALL_HISTORY_METHOD'; + payload: LocationActionPayload; +} + +interface routeActions { + push(location: any, state?: any): RouterAction; + replace(location: any, state?: any): RouterAction; + go(n: number): RouterAction; + goBack(): RouterAction; + goForward(): RouterAction; +} + +interface ConnectedRouterProps { + store?: any; + history?: H.History; +} + +interface Actions { + routing: routeActions; + [propName: string]: any; +} + +interface defaultOptions { + initialState?: {}; + historyMode?: string; + middlewares: any[]; + reducers: {}; + addEffect(name: string, handler: () => any): any; +} + +interface Renderer { + // Deprecated(render): The return value is deprecated. + // In future releases the render function's return type will be void. + ( + element: React.DOMElement, T>, + container: Element | null, + callback?: () => void + ): T; + + ( + element: Array, any>>, + container: Element | null, + callback?: () => void + ): Element; + + ( + element: React.SFCElement | Array>, + container: Element | null, + callback?: () => void + ): void; + + >( + element: React.CElement, + container: Element | null, + callback?: () => void + ): T; + + ( + element: Array>>, + container: Element | null, + callback?: () => void + ): React.Component; + +

( + element: React.ReactElement

, + container: Element | null, + callback?: () => void + ): React.Component | Element | void; + + ( + element: Array>, + container: Element | null, + callback?: () => void + ): React.Component | Element | void; + + ( + parentComponent: React.Component | Array>, + element: React.SFCElement, + container: Element, + callback?: () => void + ): void; +} + +/** + * This method is used to create and inject a model. + */ +export function model(options: model): _model; +/** + * connect connects your React component to your Redux store + */ +export const connect: Connect; +export const actions: Actions; +export function hook(): (subscriber: () => any) => any; +export function defaults(): (options: defaultOptions) => void; +export const render: Renderer; +export class Router extends React.Component> { } +export class Link extends React.Component { } +export class NavLink extends React.Component { } +export class Redirect extends React.Component { } +export class Route extends React.Component { } +export class Prompt extends React.Component { } +export function withRouter

>(component: React.ComponentType

): React.ComponentClass>>; +export function withRouter>(target: TFunction): TFunction; From 6b2af09a5c4bdfa42af077f2d2119be58755bdf0 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Tue, 19 Dec 2017 19:46:30 +0800 Subject: [PATCH 40/42] add export --- types/mirrorx/index.d.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 936078e9de..986287c5ad 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -11,25 +11,25 @@ import * as React from 'react'; import { Connect } from 'react-redux'; import { match } from "react-router"; -type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; -type Omit = Pick>; +export type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; +export type Omit = Pick>; -interface model { +export interface model { name: string; initialState?: any; reducers?: any; effects?: any; } -interface _model { +export interface _model { name: string; reducers: any; } -interface LinkProps extends React.AnchorHTMLAttributes { +export interface LinkProps extends React.AnchorHTMLAttributes { to: H.LocationDescriptor; replace?: boolean; } -interface NavLinkProps extends LinkProps { +export interface NavLinkProps extends LinkProps { activeClassName?: string; activeStyle?: React.CSSProperties; exact?: boolean; @@ -38,12 +38,12 @@ interface NavLinkProps extends LinkProps { location?: H.Location; } -interface SwitchProps { +export interface SwitchProps { children?: React.ReactNode; location?: H.Location; } -interface RedirectProps { +export interface RedirectProps { to: H.LocationDescriptor; push?: boolean; from?: string; @@ -52,14 +52,14 @@ interface RedirectProps { strict?: boolean; } -interface RouteComponentProps

{ +export interface RouteComponentProps

{ match: match

; location: H.Location; history: H.History; staticContext?: any; } -interface RouteProps { +export interface RouteProps { location?: H.Location; component?: React.ComponentType> | React.ComponentType; render?: ((props: RouteComponentProps) => React.ReactNode); @@ -69,22 +69,22 @@ interface RouteProps { strict?: boolean; } -interface PromptProps { +export interface PromptProps { message: string | ((location: H.Location) => string | boolean); when?: boolean; } -interface LocationActionPayload { +export interface LocationActionPayload { method: string; args?: any[]; } -interface RouterAction { +export interface RouterAction { type: '@@router/CALL_HISTORY_METHOD'; payload: LocationActionPayload; } -interface routeActions { +export interface routeActions { push(location: any, state?: any): RouterAction; replace(location: any, state?: any): RouterAction; go(n: number): RouterAction; @@ -92,17 +92,17 @@ interface routeActions { goForward(): RouterAction; } -interface ConnectedRouterProps { +export interface ConnectedRouterProps { store?: any; history?: H.History; } -interface Actions { +export interface Actions { routing: routeActions; [propName: string]: any; } -interface defaultOptions { +export interface defaultOptions { initialState?: {}; historyMode?: string; middlewares: any[]; @@ -110,7 +110,7 @@ interface defaultOptions { addEffect(name: string, handler: () => any): any; } -interface Renderer { +export interface Renderer { // Deprecated(render): The return value is deprecated. // In future releases the render function's return type will be void. ( From c57d03a6808965863fc3ea156b36f09839778d7f Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Fri, 22 Dec 2017 11:29:24 +0800 Subject: [PATCH 41/42] remove the mirror --- notNeededPackages.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/notNeededPackages.json b/notNeededPackages.json index 286e340606..7541a88848 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -839,12 +839,6 @@ "typingsPackageName": "zone.js", "sourceRepoURL": "https://github.com/angular/zone.js", "asOfVersion": "0.5.12" - }, - { - "libraryName": "mirror", - "typingsPackageName": "mirrorx", - "sourceRepoURL": "https://github.com/mirrorjs/mirror", - "asOfVersion": "0.2.10" } ] } From a7f3f6fe3457a2ef1ad74c7495e723ff3fb0fd26 Mon Sep 17 00:00:00 2001 From: yhpnorra Date: Mon, 25 Dec 2017 10:02:21 +0800 Subject: [PATCH 42/42] update code for jsdoc --- types/mirrorx/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index 986287c5ad..66f85e14e7 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -111,8 +111,6 @@ export interface defaultOptions { } export interface Renderer { - // Deprecated(render): The return value is deprecated. - // In future releases the render function's return type will be void. ( element: React.DOMElement, T>, container: Element | null,