fix(types): export duplicate type `Sidebar` (#2573)

pull/2574/head
烽宁 2 years ago committed by GitHub
parent 03d93da227
commit a99dcf9443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -186,7 +186,7 @@ export default {
Returns sidebar-related data. The returned object has the following type: Returns sidebar-related data. The returned object has the following type:
```ts ```ts
export interface Sidebar { export interface DocSidebar {
isOpen: Ref<boolean> isOpen: Ref<boolean>
sidebar: ComputedRef<DefaultTheme.SidebarItem[]> sidebar: ComputedRef<DefaultTheme.SidebarItem[]>
sidebarGroups: ComputedRef<DefaultTheme.SidebarItem[]> sidebarGroups: ComputedRef<DefaultTheme.SidebarItem[]>

2
theme.d.ts vendored

@ -20,4 +20,4 @@ declare const theme: {
export default theme export default theme
export type { DefaultTheme } from './types/default-theme.js' export type { DefaultTheme } from './types/default-theme.js'
export const useSidebar: () => DefaultTheme.SideBar export const useSidebar: () => DefaultTheme.DocSideBar

@ -1,3 +1,4 @@
import { type ComputedRef, type Ref } from 'vue'
import type { DocSearchProps } from './docsearch.js' import type { DocSearchProps } from './docsearch.js'
import type { LocalSearchTranslations } from './local-search.js' import type { LocalSearchTranslations } from './local-search.js'
import type { PageData } from './shared.js' import type { PageData } from './shared.js'
@ -222,7 +223,7 @@ export namespace DefaultTheme {
/** /**
* ReturnType of `useSidebar` * ReturnType of `useSidebar`
*/ */
export interface Sidebar { export interface DocSidebar {
isOpen: Ref<boolean> isOpen: Ref<boolean>
sidebar: ComputedRef<SidebarItem[]> sidebar: ComputedRef<SidebarItem[]>
sidebarGroups: ComputedRef<SidebarItem[]> sidebarGroups: ComputedRef<SidebarItem[]>

Loading…
Cancel
Save