-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
2 changed files
with
35 additions
and
12 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 |
---|---|---|
|
@@ -5,4 +5,5 @@ coverage | |
dist | ||
docs/dist | ||
node_modules | ||
.idea | ||
npm-debug.log |
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 |
---|---|---|
@@ -1,17 +1,39 @@ | ||
import {State} from "router5"; | ||
import {IComputedValue} from "mobx/lib/core/computedvalue"; | ||
import {Route, Router} from "router5/create-router"; | ||
|
||
declare module "mobx-router5" { | ||
import {PluginFactory} from "router5/core/plugins"; | ||
import {PluginFactory} from "router5/core/plugins"; | ||
import {Params} from "router5"; | ||
|
||
class RouterStore { | ||
public router: Router; | ||
public previousRoute: Route; | ||
public transitionRoute: Route; | ||
public transitionError: any; | ||
public intersectionNode: string; | ||
// public toActivate: IObservableArray<any>; | ||
// public toDeactivate: IObservableArray<any>; | ||
|
||
class RouterStore { | ||
public navigate: (toRoute: string, params?: any) => void; | ||
} | ||
public setRouter: (router: Router) => void; | ||
public updateRoute: (routeType: string, route: Route) => void; | ||
public resetRoute: (routeType: string) => void; | ||
public onTransitionStart: (route: Route, previousRoute: Route) => void; | ||
public onTransitionSuccess: (route: Route, previousRoute: Route, opts) => void; | ||
public onTransitionCancel: (route: Route, previousRoute: Route) => void; | ||
public onTransitionError: (route: Route, previousRoute: Route, transitionError: any) => void; | ||
public clearErrors: () => void; | ||
public navigate: (toRoute: string, params?: Params) => void; | ||
public shouldUpdateNodeFactory: (nodeName) => IComputedValue<(toState: State, fromState?: State) => Boolean>; | ||
} | ||
|
||
function mobxPlugin(router: any): PluginFactory; | ||
function mobxPlugin(routerStore: RouterStore): PluginFactory; | ||
|
||
namespace RouterStore {} | ||
namespace mobxPlugin {} | ||
namespace RouterStore {} | ||
namespace mobxPlugin {} | ||
|
||
export { | ||
RouterStore, | ||
mobxPlugin, | ||
}; | ||
} | ||
export { | ||
RouterStore, | ||
mobxPlugin, | ||
}; | ||
} |