11import * as React from 'react' ;
22
33import Framework7Router from '../../framework7-vue/router' ;
4- import { Framework7 , IFramework7Params } from '../Framework7' ;
4+ import { Framework7 , IFramework7Params , Dom7 } from '../Framework7' ;
55import { applyOverscrollFix } from '../utils/OverscrollFix' ;
66
77export type ThemeTypeEnum = 'ios' | 'material' ;
@@ -34,6 +34,7 @@ export interface IFramework7AppContext {
3434 onRouteChange : ( componentId : number , callback : ( route : IFramework7Route ) => void ) => void ;
3535 unregisterRouteChange : ( callback : ( componentId : number ) => void ) => void ;
3636 getCurrentRoute : ( ) => any ;
37+ getRouter : ( ) => any ;
3738}
3839
3940export interface IFramework7AppProps extends IFramework7Params , React . Props < any > {
@@ -49,6 +50,7 @@ export class Framework7App extends React.Component<IFramework7AppProps, Framewor
4950 private framework7InitCallbacks : ( ( framework7 : Framework7 ) => void ) [ ] = [ ] ;
5051 private routeChangeCallbacks : any = { } ;
5152 private currentRoute ;
53+ private router ;
5254
5355 public static childContextTypes = {
5456 framework7AppContext : React . PropTypes . object
@@ -65,7 +67,8 @@ export class Framework7App extends React.Component<IFramework7AppProps, Framewor
6567 } ,
6668 onRouteChange : this . onRouteChange . bind ( this ) ,
6769 unregisterRouteChange : this . unregisterRouteChange . bind ( this ) ,
68- getCurrentRoute : ( ) => this . currentRoute
70+ getCurrentRoute : ( ) => this . currentRoute ,
71+ getRouter : ( ) => this . router
6972 }
7073 } ;
7174 }
@@ -88,7 +91,7 @@ export class Framework7App extends React.Component<IFramework7AppProps, Framewor
8891 private initFramework7 ( ) {
8992 this . framework7 = new Framework7 ( this . props ) ;
9093
91- const router = new Framework7Router ( this . props . routes , this . framework7 ) ;
94+ const router = this . router = new Framework7Router ( this . props . routes , this . framework7 , Dom7 ) ;
9295
9396 router . setRouteChangeHandler ( route => {
9497 this . currentRoute = route ;
0 commit comments