/
types.ts
106 lines (103 loc) · 2.62 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import React, { PropsWithChildren } from 'react'
import { ThemeProviderProps } from 'next-themes/dist/types'
export interface DocsThemeConfig {
projectLink?: string
github?: string
projectLinkIcon?:
| React.ReactNode
| React.FC<PropsWithChildren<{ locale: string }>>
docsRepositoryBase?: string
titleSuffix?:
| string
// Can't be React component, otherwise will get Warning: A title element received an array with more than 1 element as children.
| ((props: {
locale: string
config: DocsThemeConfig
title: string
meta: Meta
}) => string)
nextLinks?: boolean
prevLinks?: boolean
search?: boolean
darkMode?: boolean
nextThemes?: Pick<
ThemeProviderProps,
'defaultTheme' | 'storageKey' | 'forcedTheme'
>
defaultMenuCollapsed?: boolean
font?: boolean
footer?: boolean
footerText?:
| React.ReactNode
| React.FC<
PropsWithChildren<{
locale: string
}>
>
footerEditLink?:
| React.ReactNode
| React.FC<
PropsWithChildren<{
locale: string
}>
>
logo?:
| React.ReactNode
| React.FC<
PropsWithChildren<{
locale: string
}>
>
head?:
| React.ReactNode
| React.FC<
PropsWithChildren<{
locale: string
config: DocsThemeConfig
title: string
meta: Meta
}>
>
direction?: 'ltr' | 'rtl'
i18n?: { locale: string; text: string; direction: string }[]
floatTOC?: boolean
unstable_faviconGlyph?: string
feedbackLink?:
| React.ReactNode
| React.FC<
PropsWithChildren<{
locale: string
}>
>
feedbackLabels?: string
customSearch?: React.ReactNode | false
// Can't be React component
searchPlaceholder?: string | ((props: { locale: string }) => string)
projectChatLink?: string
projectChatLinkIcon?: React.FC<PropsWithChildren<{ locale: string }>>
sidebarSubtitle?: React.FC<PropsWithChildren<{ title: string }>>
banner?: React.FC<PropsWithChildren<{ locale: string }>>
bannerKey?: string
gitTimestamp?:
| string
| React.FC<PropsWithChildren<{ locale: string; timestamp: Date }>>
tocExtraContent?: React.FC<PropsWithChildren<{ locale: string }>>
unstable_searchResultEmpty?:
| React.ReactNode
| React.FC<
PropsWithChildren<{
locale: string
}>
>
}
export type PageTheme = {
navbar: boolean
sidebar: boolean
toc: boolean
pagination: boolean
footer: boolean
layout: 'default' | 'full' | 'raw'
typesetting: 'default' | 'article'
breadcrumb: boolean
}
type Meta = Record<string, any>