From 07c172e5f6dec507f25824c2821f1ad2a81fbfc8 Mon Sep 17 00:00:00 2001 From: dominuskernel Date: Wed, 10 Jan 2018 11:51:11 +0100 Subject: [PATCH] fix style code error --- types/navigo/index.d.ts | 7 ++++--- types/navigo/navigo-tests.ts | 14 +++++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/types/navigo/index.d.ts b/types/navigo/index.d.ts index 660e44dad7..73131a9d72 100644 --- a/types/navigo/index.d.ts +++ b/types/navigo/index.d.ts @@ -2,9 +2,10 @@ // Project: https://github.com/krasimir/navigo // Definitions by: Adrian Ehrsam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -type Keys = string -type State = {[k in Keys]: any} +type Keys = string; +type State = {[k in Keys]: any}; type Params = State; interface NavigoHooks { @@ -46,7 +47,7 @@ declare class Navigo { resolve(currentURL?: string): boolean; link(path: string): string; - + lastRouteResolved(): {url: string, query: string}; disableIfAPINotAvailable(): void; diff --git a/types/navigo/navigo-tests.ts b/types/navigo/navigo-tests.ts index a59bf3cfab..1aeb645ce8 100644 --- a/types/navigo/navigo-tests.ts +++ b/types/navigo/navigo-tests.ts @@ -1,14 +1,22 @@ import Navigo = require("navigo"); +type Keys = string; +type State = {[k in Keys]: any}; +type Params = State; + const root = null; const useHash = false; let router = new Navigo(root, useHash); +const before = (done: (suppress?: boolean) => void, params: Params) => done(); + +const after = (params: Params) => params; + router.hooks({ - before: function(done, params) { //do something }, - after: function(params) { //do something } - }); + before, + after +}); router .on('/products/list', () => {