Skip to content

Commit

Permalink
fix(types): add missing exported types
Browse files Browse the repository at this point in the history
Close #147
  • Loading branch information
posva committed Mar 29, 2020
1 parent f10300b commit ec241f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import createWebHistory from './history/html5'
import createMemoryHistory from './history/memory'
import createWebHashHistory from './history/hash'
import { inject } from 'vue'
import { routerKey, routeLocationKey } from './utils/injectionSymbols'

export {
LocationQuery,
Expand Down Expand Up @@ -36,10 +34,4 @@ export { View, useView } from './components/View'

export { createWebHistory, createMemoryHistory, createWebHashHistory }

export function useRouter() {
return inject(routerKey)!
}

export function useRoute() {
return inject(routeLocationKey)!
}
export * from './useApi'
12 changes: 12 additions & 0 deletions src/useApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { inject } from 'vue'
import { routerKey, routeLocationKey } from './utils/injectionSymbols'
import { Router } from './router'
import { RouteLocationNormalizedResolved } from './types'

export function useRouter(): Router {
return inject(routerKey)!
}

export function useRoute(): RouteLocationNormalizedResolved {
return inject(routeLocationKey)!
}

0 comments on commit ec241f7

Please sign in to comment.