fix style code error

This commit is contained in:
dominuskernel
2018-01-10 11:51:11 +01:00
parent f0b524190a
commit 07c172e5f6
2 changed files with 15 additions and 6 deletions

View File

@@ -2,9 +2,10 @@
// Project: https://github.com/krasimir/navigo
// Definitions by: Adrian Ehrsam <https://github.com/aersamkull>
// 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;

View File

@@ -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', () => {