forked from emeryberger/CSrankings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38a79f6
commit 40a98dc
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Type definitions for navigo 4.0 | ||
// Project: https://github.com/krasimir/navigo | ||
// Definitions by: Adrian Ehrsam <https://github.com/aersamkull> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
interface NavigoHooks { | ||
before?(done: (suppress?: boolean) => void): void; | ||
after?(): void; | ||
} | ||
type RouteHandler = ((parametersObj: any, query: string) => void) | { as: string; uses(parametersObj: any): void }; | ||
|
||
declare class Navigo { | ||
/** | ||
* Constructs the router | ||
* @param root The main URL of your application. | ||
* @param useHash If useHash set to true then the router uses an old routing approach with hash in the URL. Navigo anyways falls back to this mode if there is no History API supported. | ||
*/ | ||
constructor(root?: string | null, useHash?: boolean); | ||
|
||
on(location: string, handler: RouteHandler, hooks?: NavigoHooks): Navigo; | ||
on(location: RegExp, handler: (...parameters: string[]) => void, hooks?: NavigoHooks): Navigo; | ||
on(routes: { [key: string]: RouteHandler }): Navigo; | ||
|
||
on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; | ||
|
||
notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; | ||
|
||
navigate(path: string, absolute?: boolean): void; | ||
|
||
updatePageLinks(): void; | ||
|
||
generate(path: string, params?: any): string; | ||
|
||
resolve(currentURL?: string): boolean; | ||
|
||
link(path: string): string; | ||
|
||
disableIfAPINotAvailable(): void; | ||
|
||
pause(): void; | ||
|
||
resume(): void; | ||
|
||
destroy(): void; | ||
} | ||
export = Navigo; | ||
export as namespace Navigo; |