mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 10:35:22 +08:00
fix style code error
This commit is contained in:
7
types/navigo/index.d.ts
vendored
7
types/navigo/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user