theme.d.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // so that users can do `import DefaultTheme from 'vitepress/theme'`
  2. import type { ComputedRef, DefineComponent, ShallowRef } from 'vue'
  3. import type { EnhanceAppContext } from './dist/client/index.js'
  4. import type { DefaultTheme } from './types/default-theme.js'
  5. export type { DefaultTheme } from './types/default-theme.js'
  6. declare const theme: {
  7. Layout: DefineComponent
  8. enhanceApp: (ctx: EnhanceAppContext) => void
  9. }
  10. export default theme
  11. export declare const useLayout: () => {
  12. isHome: ComputedRef<boolean>
  13. sidebar: Readonly<ShallowRef<DefaultTheme.SidebarItem[]>>
  14. sidebarGroups: ComputedRef<DefaultTheme.SidebarItem[]>
  15. hasSidebar: ComputedRef<boolean>
  16. isSidebarEnabled: ComputedRef<boolean>
  17. hasAside: ComputedRef<boolean>
  18. leftAside: ComputedRef<boolean>
  19. /**
  20. * The outline headers of the current page.
  21. */
  22. headers: Readonly<ShallowRef<DefaultTheme.OutlineItem[]>>
  23. /**
  24. * Whether the current page has a local nav. Local nav is shown when the
  25. * "outline" is present in the page. However, note that the actual
  26. * local nav visibility depends on the screen width as well.
  27. */
  28. hasLocalNav: ComputedRef<boolean>
  29. /**
  30. * jerry add
  31. * Refresh outline headers.
  32. */
  33. refreshLocalNav: () => void
  34. }
  35. // TODO: add props for these
  36. export declare const VPBadge: DefineComponent
  37. export declare const VPButton: DefineComponent
  38. export declare const VPDocAsideSponsors: DefineComponent
  39. export declare const VPFeatures: DefineComponent
  40. export declare const VPHomeContent: DefineComponent
  41. export declare const VPHomeFeatures: DefineComponent
  42. export declare const VPHomeHero: DefineComponent
  43. export declare const VPHomeSponsors: DefineComponent
  44. export declare const VPImage: DefineComponent
  45. export declare const VPLink: DefineComponent
  46. export declare const VPNavBarSearch: DefineComponent
  47. export declare const VPSocialLink: DefineComponent
  48. export declare const VPSocialLinks: DefineComponent
  49. export declare const VPSponsors: DefineComponent
  50. export declare const VPTeamMembers: DefineComponent
  51. export declare const VPTeamPage: DefineComponent
  52. export declare const VPTeamPageSection: DefineComponent
  53. export declare const VPTeamPageTitle: DefineComponent