Skip to content

Commit

Permalink
fix: export go function on nav object (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
listennn08 authored Sep 27, 2023
1 parent 653adfc commit 8a2623c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/client/composables/useNav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { computed } from 'vue'
import type { RouteLocationNormalizedLoaded, RouteRecordRaw } from 'vue-router'
import type { TocItem } from '@slidev/types'
import type { SlidevContextNav } from '../modules/context'
import { addToTree, downloadPDF, filterTree, getPath, getTreeWithActiveStatuses, next, nextSlide, openInEditor, prev, prevSlide } from '../logic/nav'
import { addToTree, downloadPDF, filterTree, getPath, getTreeWithActiveStatuses, go, next, nextSlide, openInEditor, prev, prevSlide } from '../logic/nav'
import { rawRoutes } from '../routes'

export function useNav(route: ComputedRef<RouteRecordRaw | RouteLocationNormalizedLoaded>): SlidevContextNav {
Expand Down Expand Up @@ -41,6 +41,7 @@ export function useNav(route: ComputedRef<RouteRecordRaw | RouteLocationNormaliz
rawTree,
treeWithActiveStatuses,
tree,
go,
downloadPDF,
next,
nextSlide,
Expand Down
2 changes: 1 addition & 1 deletion packages/client/modules/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isDark } from '../logic/dark'
import { injectionClicks, injectionCurrentPage, injectionSlidevContext } from '../constants'
import { useContext } from '../composables/useContext'

export type SlidevContextNavKey = 'path' | 'total' | 'currentPage' | 'currentPath' | 'currentRoute' | 'currentSlideId' | 'currentLayout' | 'nextRoute' | 'rawTree' | 'treeWithActiveStatuses' | 'tree' | 'downloadPDF' | 'next' | 'nextSlide' | 'openInEditor' | 'prev' | 'prevSlide' | 'rawRoutes'
export type SlidevContextNavKey = 'path' | 'total' | 'currentPage' | 'currentPath' | 'currentRoute' | 'currentSlideId' | 'currentLayout' | 'nextRoute' | 'rawTree' | 'treeWithActiveStatuses' | 'tree' | 'downloadPDF' | 'next' | 'nextSlide' | 'openInEditor' | 'prev' | 'prevSlide' | 'rawRoutes' | 'go'
export type SlidevContextNavClicksKey = 'clicks' | 'clicksElements' | 'clicksTotal' | 'hasNext' | 'hasPrev'

export interface SlidevContextNav extends Pick<typeof nav, SlidevContextNavKey> {
Expand Down

0 comments on commit 8a2623c

Please sign in to comment.