From dde8922b4cecd2545dbf3d114ab53aae84db5381 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Fri, 14 Sep 2018 18:48:37 +0200 Subject: [PATCH] redux-little-routers: remove typings, they are now upstream (#28681) See https://github.com/FormidableLabs/redux-little-router/pull/269 --- notNeededPackages.json | 6 + types/redux-little-router/index.d.ts | 171 ------------------ types/redux-little-router/package.json | 6 - .../redux-little-router-tests.tsx | 93 ---------- types/redux-little-router/tsconfig.json | 25 --- types/redux-little-router/tslint.json | 1 - 6 files changed, 6 insertions(+), 296 deletions(-) delete mode 100644 types/redux-little-router/index.d.ts delete mode 100644 types/redux-little-router/package.json delete mode 100644 types/redux-little-router/redux-little-router-tests.tsx delete mode 100644 types/redux-little-router/tsconfig.json delete mode 100644 types/redux-little-router/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index e0e880c3e6..e1a2f2e6cd 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1278,6 +1278,12 @@ "sourceRepoURL": "https://github.com/zalmoxisus/redux-devtools-extension", "asOfVersion": "2.13.2" }, + { + "libraryName": "redux-little-router", + "typingsPackageName": "redux-little-router", + "sourceRepoURL": "https://github.com/FormidableLabs/redux-little-router", + "asOfVersion": "15.1.0" + }, { "libraryName": "redux-persist", "typingsPackageName": "redux-persist", diff --git a/types/redux-little-router/index.d.ts b/types/redux-little-router/index.d.ts deleted file mode 100644 index 5ea39ce138..0000000000 --- a/types/redux-little-router/index.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -// Type definitions for redux-little-router 14.0 -// Project: https://github.com/FormidableLabs/redux-little-router -// Definitions by: priecint -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import * as React from "react"; -import { Reducer, Middleware, StoreEnhancer } from "redux"; - -export interface Routes { - [index: string]: RouteDefinition; -} - -export interface RouteDefinition { - [index: string]: string | RouteDefinition; -} - -export interface LocationOptions { - persistQuery?: boolean; -} - -export interface Query { - [key: string]: string; -} - -export interface Params { - [key: string]: string; -} - -export interface Location { - pathname?: string; - options?: LocationOptions; - params?: Params; - previous?: Location; - query?: Query; - result?: TResult; - hash?: string; -} - -export interface BrowserRouterOptions { - routes: Routes; - basename?: string; -} - -export interface RouterState { - router: Location; -} - -export function routerForBrowser(options: BrowserRouterOptions): { - reducer: Reducer; - middleware: Middleware; - enhancer: StoreEnhancer; -}; - -export interface ServerRouterOptions { - routes: Routes; - request: { - path: string; - baseUrl: string; - url: string; - query: { - [key: string]: string; - } - }; -} - -export function routerForExpress(options: ServerRouterOptions): { - reducer: Reducer; - middleware: Middleware; - enhancer: StoreEnhancer; -}; - -export interface HapiRouterOptions { - routes: Routes; - request: { - path: string; - url: string; - query: { - [key: string]: string; - } - }; -} - -export function routerForHapi(options: HapiRouterOptions): { - reducer: Reducer; - middleware: Middleware; - enhancer: StoreEnhancer; -}; - -export function initializeCurrentLocation(location: Location): { - type: string; - payload: Location; -}; - -export interface PersistentQueryLinkProps { - className?: string; - href: Href; - persistQuery?: boolean; - target?: string; - onClick?: React.EventHandler>; -} - -export interface LinkProps extends PersistentQueryLinkProps { - replaceState?: boolean; -} - -export class Link extends React.Component { -} - -export class PersistentQueryLink extends React.Component { -} - -export interface FragmentPropsForRoute { - forRoute: string; -} - -export interface FragmentPropsWithConditions { - withConditions: (location: Location) => boolean; -} - -// https://stackoverflow.com/q/37688318 -export type FragmentProps = FragmentPropsForRoute | FragmentPropsWithConditions | (FragmentPropsForRoute & FragmentPropsWithConditions); - -export class Fragment extends React.Component { -} - -export type Href = string | Location; - -export function push(href: Href, options?: LocationOptions): { - type: string; - payload: Location & { - state: { - reduxLittleRouter: { - query: {}; - options: LocationOptions; - }; - }; - }; -}; - -export function replace(href: Href, options?: LocationOptions): { - type: string; - payload: Location & { - state: { - reduxLittleRouter: { - query: {}; - options: LocationOptions; - }; - }; - }; -}; - -export function go(index: number): { - type: string; - payload: number; -}; - -export function goBack(): { - type: string; -}; - -export function goForward(): { - type: string; -}; - -export const LOCATION_CHANGED: string; -export const PUSH: string; -export const REPLACE: string; -export const GO: string; -export const GO_BACK: string; -export const GO_FORWARD: string; diff --git a/types/redux-little-router/package.json b/types/redux-little-router/package.json deleted file mode 100644 index 6d68bf2f9b..0000000000 --- a/types/redux-little-router/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "redux": "^3.6.0" - } -} diff --git a/types/redux-little-router/redux-little-router-tests.tsx b/types/redux-little-router/redux-little-router-tests.tsx deleted file mode 100644 index ad65cc399d..0000000000 --- a/types/redux-little-router/redux-little-router-tests.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import * as React from "react"; -import { createStore, compose, combineReducers, applyMiddleware, Reducer, Dispatch } from "redux"; -import { connect } from "react-redux"; - -import { - Fragment, - go, - GO, - GO_BACK, - GO_FORWARD, - goBack, - goForward, - Href, - initializeCurrentLocation, - Link, - Location, - LOCATION_CHANGED, - LocationOptions, - Params, - push, - PUSH, - replace, - REPLACE, - routerForBrowser, - RouterState -} from "redux-little-router"; - -const goBackActionType: string = GO_BACK; -const goForwardActionType: string = GO_FORWARD; -const locationChangedActionType: string = LOCATION_CHANGED; -const pushActionType: string = PUSH; -const replaceActionType: string = REPLACE; - -const { - reducer, - middleware, - enhancer -} = routerForBrowser({ - routes: { - "/": { - title: "Home" - } - } -}); - -const store = createStore( - combineReducers({ router: reducer }), - { router: {} }, - compose(enhancer, applyMiddleware(middleware)) -); - -const initialLocation = store.getState().router; - -if (initialLocation) { - store.dispatch(initializeCurrentLocation(initialLocation)); -} - -interface TestProps { - currentPath?: string; -} - -interface DispatchProps { - go: (index: number) => void; - goBack: () => void; - goForward: () => void; - push: (path: string) => void; - replace: (path: string) => void; -} - -const TestComponent: React.SFC = ({ currentPath }) => ( -
- -
- Current Path: {currentPath} - -
-
-
-); - -const mapStateToProps = (state: RouterState): TestProps => ({ - currentPath: state.router.pathname -}); - -const mapDispatchToProps = (dispatch: Dispatch<{}>): DispatchProps => ({ - go: index => dispatch(go(index)), - goBack: () => dispatch(goBack()), - goForward: () => dispatch(goForward()), - push: path => dispatch(push(path)), - replace: path => dispatch(replace(path)) -}); - -const connectedTest = connect(mapStateToProps)(TestComponent); diff --git a/types/redux-little-router/tsconfig.json b/types/redux-little-router/tsconfig.json deleted file mode 100644 index 30884e8741..0000000000 --- a/types/redux-little-router/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "jsx": "react", - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "redux-little-router-tests.tsx" - ] -} \ No newline at end of file diff --git a/types/redux-little-router/tslint.json b/types/redux-little-router/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/redux-little-router/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" }