-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Expand file tree
/
Copy pathindex.ts
More file actions
146 lines (119 loc) · 3.9 KB
/
index.ts
File metadata and controls
146 lines (119 loc) · 3.9 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import {DEFAULT_SEARCH_TAG} from './utils/searchUtils';
// TODO Docusaurus v4: remove these workarounds as a breaking change
// and remove docs plugin peerDeps in theme-common/package.json
// This is public API surface that we need to keep for v3
// See https://github.com/facebook/docusaurus/pull/10316
export function useCurrentSidebarCategory(...args: unknown[]): unknown {
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require('@docusaurus/plugin-content-docs/client').useCurrentSidebarCategory(
...args,
);
}
export function filterDocCardListItems(...args: unknown[]): unknown {
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require('@docusaurus/plugin-content-docs/client').filterDocCardListItems(
...args,
);
}
export function useDocsPreferredVersion(...args: unknown[]): unknown {
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require('@docusaurus/plugin-content-docs/client').useDocsPreferredVersion(
...args,
);
}
export function useContextualSearchFilters() {
const {i18n} = useDocusaurusContext();
const docsTags =
// eslint-disable-next-line @typescript-eslint/no-var-requires, react-compiler/react-compiler
require('@docusaurus/plugin-content-docs/client').useDocsContextualSearchTags();
const tags = [DEFAULT_SEARCH_TAG, ...docsTags];
return {locale: i18n.currentLocale, tags};
}
/*
* APIs to document
*/
export {
useThemeConfig,
type ThemeConfig,
type UserThemeConfig,
type Navbar,
type NavbarItem,
type NavbarLogo,
type MultiColumnFooter,
type SimpleFooter,
type Footer,
type FooterLogo,
type FooterLinkItem,
type ColorModeConfig,
} from './utils/useThemeConfig';
export {default as ThemedComponent} from './components/ThemedComponent';
export {
createStorageSlot,
useStorageSlot,
listStorageKeys,
} from './utils/storageUtils';
export {usePluralForm} from './utils/usePluralForm';
export {useCollapsible, Collapsible} from './components/Collapsible';
export {ThemeClassNames} from './utils/ThemeClassNames';
export {prefersReducedMotion} from './utils/accessibilityUtils';
export {
useEvent,
usePrevious,
composeProviders,
ReactContextError,
} from './utils/reactUtils';
export {PageMetadata, HtmlClassNameProvider} from './utils/metadataUtils';
export {useColorMode, type ColorMode} from './contexts/colorMode';
export {
NavbarSecondaryMenuFiller,
type NavbarSecondaryMenuComponent,
} from './contexts/navbarSecondaryMenu/content';
export {useWindowSize} from './hooks/useWindowSize';
/*
* APIs kept undocumented, on purpose
* Note: we still guarantee retro-compatibility on those
*/
export {
translateTagsPageTitle,
listTagsByLetters,
type TagLetterEntry,
} from './utils/tagsUtils';
export {
useSearchQueryString,
useSearchLinkCreator,
} from './hooks/useSearchPage';
export {isMultiColumnFooterLinks} from './utils/footerUtils';
export {isRegexpStringMatch} from './utils/regexpUtils';
export {duplicates, uniq, groupBy} from './utils/jsUtils';
export {usePrismTheme} from './hooks/usePrismTheme';
export {processAdmonitionProps} from './utils/admonitionUtils';
export {
useHistorySelector,
useQueryString,
useQueryStringList,
useClearQueryString,
} from './utils/historyUtils';
export {
SkipToContentFallbackId,
SkipToContentLink,
} from './utils/skipToContentUtils';
export {
UnlistedBannerTitle,
UnlistedBannerMessage,
UnlistedMetadata,
DraftBannerTitle,
DraftBannerMessage,
} from './translations/contentVisibilityTranslations';
export {
ErrorBoundaryTryAgainButton,
ErrorBoundaryError,
ErrorBoundaryErrorMessageFallback,
ErrorCauseBoundary,
} from './utils/errorBoundaryUtils';