Skip to content

Commit

Permalink
Merge pull request #364 from JabX/develop
Browse files Browse the repository at this point in the history
Update typings for new router/history.
  • Loading branch information
Ephrame authored Jun 17, 2016
2 parents 1d14a32 + f75d426 commit 129d7d3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "focus-core",
"version": "0.16.0-beta2",
"version": "0.16.0-beta3",
"description": "Focus library core part.",
"main": "index.js",
"babel": {
Expand Down
21 changes: 20 additions & 1 deletion src/history/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
/**
* Navigates to the given URL.
* Sets the navigation functions.
* @param navigate The navigate function.
* @param back The back function.
* @param start The start function.
*/
export function setNavigationFunctions(navigate: Function, back: Function, start: Function): void

/**
* Navigates to the previous page.
*/
export function back(): void

/**
* Navigates to the given URL (Backbone).
* @param path The URL to navigate to.
* @param options Navigation options.
*/
export function navigate(path: string, options?: {trigger?: boolean, replace?: boolean}): void

/**
* Navigates to the given URL (React-Router).
* @param path The URL to navigate to or an object with options.
*/
export function navigate(path: string | {pathName: string, query: {}, state: {}}): void

/**
* Starts the router.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/router/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ interface RouterConfig {
routes: {[x: string]: string};
}

declare let router: {
declare let Router: {
extend<T>(config: T & RouterConfig): {new(): {}}
};

export = router
export = Backbone => typeof Router

0 comments on commit 129d7d3

Please sign in to comment.