config.d.ts 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. export declare namespace DefaultTheme {
  2. interface Config {
  3. logo?: string;
  4. nav?: NavItem[] | false;
  5. sidebar?: SideBarConfig | MultiSideBarConfig;
  6. search?: SearchConfig | false;
  7. /**
  8. * GitHub repository following the format <user>/<project>.
  9. *
  10. * @example vuejs/vue-next
  11. */
  12. repo?: string;
  13. /**
  14. * Customize the header label. Defaults to GitHub/Gitlab/Bitbucket depending
  15. * on the provided repo
  16. *
  17. * @exampe `"Contribute!"`
  18. */
  19. repoLabel?: string;
  20. /**
  21. * If your docs are in a different repository from your main project
  22. *
  23. * @example `"vuejs/docs-next"`
  24. */
  25. docsRepo?: string;
  26. /**
  27. * If your docs are not at the root of the repo.
  28. *
  29. * @example `"docs"`
  30. */
  31. docsDir?: string;
  32. /**
  33. * If your docs are in a different branch. Defaults to `master`
  34. * @example `"next"`
  35. */
  36. docsBranch?: string;
  37. /**
  38. * Enable links to edit pages at the bottom of the page
  39. */
  40. editLinks?: boolean;
  41. /**
  42. * Custom text for edit link. Defaults to "Edit this page"
  43. */
  44. editLinkText?: string;
  45. lastUpdated?: string | boolean;
  46. prevLink?: boolean;
  47. nextLink?: boolean;
  48. }
  49. type NavItem = NavItemWithLink | NavItemWithChildren;
  50. interface NavItemWithLink extends NavItemBase {
  51. link: string;
  52. }
  53. interface NavItemWithChildren extends NavItemBase {
  54. items: NavItem[];
  55. }
  56. interface NavItemBase {
  57. text: string;
  58. target?: string;
  59. rel?: string;
  60. ariaLabel?: string;
  61. }
  62. type SideBarConfig = SideBarItem[] | 'auto' | false;
  63. interface MultiSideBarConfig {
  64. [path: string]: SideBarConfig;
  65. }
  66. type SideBarItem = SideBarLink | SideBarGroup;
  67. interface SideBarLink {
  68. text: string;
  69. link: string;
  70. }
  71. interface SideBarGroup {
  72. text: string;
  73. link?: string;
  74. /**
  75. * @default false
  76. */
  77. collapsable?: boolean;
  78. children: SideBarItem[];
  79. }
  80. interface SearchConfig {
  81. /**
  82. * @default 5
  83. */
  84. maxSuggestions?: number;
  85. /**
  86. * @default ''
  87. */
  88. placeholder?: string;
  89. algolia?: {
  90. apiKey: string;
  91. indexName: string;
  92. };
  93. }
  94. }