Skip to content

Commit dd84642

Browse files
committed
fix: Typings
1 parent cd0657b commit dd84642

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/index.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { createRouter } from "./vue-router.common";
2+
import { Route } from './typings/router-service';
13

2-
export {
3-
};
4+
export { createRouter, Route };

src/typings/router-service.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ export interface RouterServiceOptions {
6666
/**
6767
* Callback triggered when routeTo/push is invoked
6868
*/
69-
routeToCallback: RouteToCallback;
69+
routeToCallback?: RouteToCallback;
7070

7171
/**
7272
* Callback triggered when routeBack/back is invoked
7373
*/
74-
routeBackCallback: RouteBackCallback;
74+
routeBackCallback?: RouteBackCallback;
7575

7676
/**
7777
* Vue Instance
7878
*/
79-
vm: any;
79+
vm?: any;
8080

8181
/**
8282
* NS Frame Instance
8383
*/
84-
frame: any;
84+
frame?: any;
8585

8686
/**
8787
* Path to a route used as a fallback (default route), when user tries to navigate back but no path exists

src/typings/shims-vue.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ declare module 'vue/types/vue' {
33

44
import type {
55
RouterService,
6-
} from '@shared/types/services/router/router-service';
6+
} from '../router-service';
77

88
interface VueConstructor<V extends Vue = Vue> {
99
$router: RouterService;

src/vue-router.common.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import routerMixin from "./router-mixin";
1919
* @param {RouterService} routerOptions Router Service options
2020
* @returns {RouterService} Router Service Instance
2121
*/
22-
const createRouter = (
22+
export const createRouter = (
2323
vueRouterOptions: NSVueRouterOptions,
2424
routerOptions: RouterServiceOptions
2525
) => {
@@ -54,8 +54,6 @@ const createRouter = (
5454
return router;
5555
};
5656

57-
export { createRouter };
58-
5957
export default {
6058
createRouter,
6159
};

0 commit comments

Comments
 (0)