From d4971ae4fad81ca11ff71d4c576167cd77211b1a Mon Sep 17 00:00:00 2001 From: Valbrand Date: Wed, 21 Jun 2017 08:03:40 -0300 Subject: [PATCH] Added first definitions for redux-first-router --- types/redux-first-router/index.d.ts | 189 ++++++++++++++++++ .../redux-first-router-tests.ts | 0 types/redux-first-router/tsconfig.json | 22 ++ types/redux-first-router/tslint.json | 1 + 4 files changed, 212 insertions(+) create mode 100644 types/redux-first-router/index.d.ts create mode 100644 types/redux-first-router/redux-first-router-tests.ts create mode 100644 types/redux-first-router/tsconfig.json create mode 100644 types/redux-first-router/tslint.json diff --git a/types/redux-first-router/index.d.ts b/types/redux-first-router/index.d.ts new file mode 100644 index 0000000000..60622853bb --- /dev/null +++ b/types/redux-first-router/index.d.ts @@ -0,0 +1,189 @@ +// Type definitions for redux-first-router 1.4 +// Project: https://github.com/faceyspacey/redux-first-router#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Dispatch } from 'redux' + +declare module 'redux-first-router' { + type RouteString = string + + type RouteObject = { + path: string + capitalizedWords?: boolean + toPath?: (param: string, key?: string) => string + fromPath?: (path: string, key?: string) => string + thunk?: (dispatch: Dispatch, getState: () => S) => any | Promise + navKey?: string + } + + type Route = RouteString | RouteObject + + type RoutesMap = { + [key: string]: Route + } + + type ReceivedAction = { + type: string + payload: {} + meta?: {} + navKey?: string | null + } + + export const NOT_FOUND: string + + export function actionToPath(action: ReceivedAction, routesMap: RoutesMap): string; + + export function back(): any; + + export function canGo(n: any): any; + + export function canGoBack(): any; + + export function canGoForward(): any; + + export function connectRoutes(history: any, ...args: any[]): any; + + export function go(n: any): any; + + export function history(): any; + + export function isLocationAction(action: any): any; + + export function next(): any; + + export function nextPath(): any; + + export function pathToAction(pathname: any, routesMap: any): any; + + export function prevPath(): any; + + export function push(pathname: any): any; + + export function redirect(action: any): any; + + export function replace(pathname: any): any; + + export function scrollBehavior(): any; + + export function setKind(action: any, kind: any): any; + + export function updateScroll(): any; +} + + + +export namespace actionToPath { + const prototype: { + }; + +} + +export namespace back { + const prototype: { + }; + +} + +export namespace canGo { + const prototype: { + }; + +} + +export namespace canGoBack { + const prototype: { + }; + +} + +export namespace canGoForward { + const prototype: { + }; + +} + +export namespace connectRoutes { + const prototype: { + }; + +} + +export namespace go { + const prototype: { + }; + +} + +export namespace history { + const prototype: { + }; + +} + +export namespace isLocationAction { + const prototype: { + }; + +} + +export namespace next { + const prototype: { + }; + +} + +export namespace nextPath { + const prototype: { + }; + +} + +export namespace pathToAction { + const prototype: { + }; + +} + +export namespace prevPath { + const prototype: { + }; + +} + +export namespace push { + const prototype: { + }; + +} + +export namespace redirect { + const prototype: { + }; + +} + +export namespace replace { + const prototype: { + }; + +} + +export namespace scrollBehavior { + const prototype: { + }; + +} + +export namespace setKind { + const prototype: { + }; + +} + +export namespace updateScroll { + const prototype: { + }; + +} + diff --git a/types/redux-first-router/redux-first-router-tests.ts b/types/redux-first-router/redux-first-router-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/redux-first-router/tsconfig.json b/types/redux-first-router/tsconfig.json new file mode 100644 index 0000000000..5a77030d83 --- /dev/null +++ b/types/redux-first-router/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redux-first-router-tests.ts" + ] +} diff --git a/types/redux-first-router/tslint.json b/types/redux-first-router/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/redux-first-router/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }