@hanzo/docs-core 16.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/algolia-IZEDLPHE.js +58 -0
- package/dist/breadcrumb.d.ts +46 -0
- package/dist/breadcrumb.js +81 -0
- package/dist/chunk-5PMI7QDD.js +220 -0
- package/dist/chunk-ADBHPKXG.js +78 -0
- package/dist/chunk-APKPSBSB.js +74 -0
- package/dist/chunk-CH7YHH7V.js +222 -0
- package/dist/chunk-EFVXL2PP.js +144 -0
- package/dist/chunk-EMWGTXSW.js +19 -0
- package/dist/chunk-FAEPKD7U.js +20 -0
- package/dist/chunk-FUUVPEA5.js +29 -0
- package/dist/chunk-GINBKBVQ.js +12 -0
- package/dist/chunk-GLRQBLGN.js +59 -0
- package/dist/chunk-JUF4WZ6G.js +117 -0
- package/dist/chunk-K4WNLOVQ.js +75 -0
- package/dist/chunk-L4JKQWCM.js +131 -0
- package/dist/chunk-MA6O2UUE.js +50 -0
- package/dist/chunk-ONG4RVCR.js +8 -0
- package/dist/chunk-OTD7MV33.js +53 -0
- package/dist/chunk-PFNP6PEB.js +11 -0
- package/dist/chunk-QJRXMG4S.js +275 -0
- package/dist/chunk-SH7BNTG7.js +38 -0
- package/dist/chunk-TWIDBWFG.js +84 -0
- package/dist/chunk-U67V476Y.js +35 -0
- package/dist/chunk-VLSDGCJE.js +47 -0
- package/dist/chunk-W6WTLKRA.js +73 -0
- package/dist/chunk-X2HFD5QJ.js +275 -0
- package/dist/chunk-XJ6ZQNEX.js +91 -0
- package/dist/chunk-XN2LKXFZ.js +101 -0
- package/dist/chunk-XOFXGHS4.js +93 -0
- package/dist/chunk-XZSI7AHE.js +67 -0
- package/dist/chunk-YVVDKJ2H.js +34 -0
- package/dist/chunk-ZMWYLUDP.js +21 -0
- package/dist/content/github.d.ts +40 -0
- package/dist/content/github.js +44 -0
- package/dist/content/index.d.ts +16 -0
- package/dist/content/index.js +30 -0
- package/dist/content/mdx/preset-bundler.d.ts +31 -0
- package/dist/content/mdx/preset-bundler.js +72 -0
- package/dist/content/mdx/preset-runtime.d.ts +31 -0
- package/dist/content/mdx/preset-runtime.js +71 -0
- package/dist/content/toc.d.ts +21 -0
- package/dist/content/toc.js +22 -0
- package/dist/definitions-pJ7PybYY.d.ts +60 -0
- package/dist/dynamic-link.d.ts +12 -0
- package/dist/dynamic-link.js +32 -0
- package/dist/fetch-IBTWQCJR.js +22 -0
- package/dist/framework/index.d.ts +41 -0
- package/dist/framework/index.js +18 -0
- package/dist/framework/next.d.ts +12 -0
- package/dist/framework/next.js +31 -0
- package/dist/framework/react-router.d.ts +12 -0
- package/dist/framework/react-router.js +59 -0
- package/dist/framework/tanstack.d.ts +15 -0
- package/dist/framework/tanstack.js +72 -0
- package/dist/framework/waku.d.ts +12 -0
- package/dist/framework/waku.js +63 -0
- package/dist/highlight/client.d.ts +15 -0
- package/dist/highlight/client.js +18 -0
- package/dist/highlight/index.d.ts +30 -0
- package/dist/highlight/index.js +13 -0
- package/dist/i18n/index.d.ts +39 -0
- package/dist/i18n/index.js +9 -0
- package/dist/i18n/middleware.d.ts +34 -0
- package/dist/i18n/middleware.js +76 -0
- package/dist/link.d.ts +18 -0
- package/dist/link.js +9 -0
- package/dist/loader-BvlPPJX0.d.ts +321 -0
- package/dist/mdx-plugins/codeblock-utils.d.ts +29 -0
- package/dist/mdx-plugins/codeblock-utils.js +9 -0
- package/dist/mdx-plugins/index.d.ts +20 -0
- package/dist/mdx-plugins/index.js +73 -0
- package/dist/mdx-plugins/rehype-code.d.ts +55 -0
- package/dist/mdx-plugins/rehype-code.js +15 -0
- package/dist/mdx-plugins/rehype-toc.d.ts +14 -0
- package/dist/mdx-plugins/rehype-toc.js +7 -0
- package/dist/mdx-plugins/remark-admonition.d.ts +20 -0
- package/dist/mdx-plugins/remark-admonition.js +8 -0
- package/dist/mdx-plugins/remark-code-tab.d.ts +30 -0
- package/dist/mdx-plugins/remark-code-tab.js +8 -0
- package/dist/mdx-plugins/remark-directive-admonition.d.ts +27 -0
- package/dist/mdx-plugins/remark-directive-admonition.js +7 -0
- package/dist/mdx-plugins/remark-gfm.d.ts +1 -0
- package/dist/mdx-plugins/remark-gfm.js +7 -0
- package/dist/mdx-plugins/remark-heading.d.ts +31 -0
- package/dist/mdx-plugins/remark-heading.js +8 -0
- package/dist/mdx-plugins/remark-image.d.ts +57 -0
- package/dist/mdx-plugins/remark-image.js +7 -0
- package/dist/mdx-plugins/remark-mdx-files.d.ts +40 -0
- package/dist/mdx-plugins/remark-mdx-files.js +7 -0
- package/dist/mdx-plugins/remark-mdx-mermaid.d.ts +15 -0
- package/dist/mdx-plugins/remark-mdx-mermaid.js +7 -0
- package/dist/mdx-plugins/remark-npm.d.ts +31 -0
- package/dist/mdx-plugins/remark-npm.js +8 -0
- package/dist/mdx-plugins/remark-steps.d.ts +23 -0
- package/dist/mdx-plugins/remark-steps.js +7 -0
- package/dist/mdx-plugins/remark-structure.d.ts +71 -0
- package/dist/mdx-plugins/remark-structure.js +12 -0
- package/dist/mixedbread-RAHDVXGJ.js +118 -0
- package/dist/negotiation/index.d.ts +19 -0
- package/dist/negotiation/index.js +11 -0
- package/dist/orama-cloud-UZAPMPFV.js +93 -0
- package/dist/page-tree/index.d.ts +33 -0
- package/dist/page-tree/index.js +17 -0
- package/dist/search/algolia.d.ts +69 -0
- package/dist/search/algolia.js +71 -0
- package/dist/search/client.d.ts +140 -0
- package/dist/search/client.js +99 -0
- package/dist/search/index.d.ts +26 -0
- package/dist/search/index.js +7 -0
- package/dist/search/orama-cloud.d.ts +79 -0
- package/dist/search/orama-cloud.js +60 -0
- package/dist/search/server.d.ts +136 -0
- package/dist/search/server.js +400 -0
- package/dist/source/client/index.d.ts +16 -0
- package/dist/source/client/index.js +41 -0
- package/dist/source/index.d.ts +42 -0
- package/dist/source/index.js +776 -0
- package/dist/source/plugins/lucide-icons.d.ts +14 -0
- package/dist/source/plugins/lucide-icons.js +23 -0
- package/dist/source/schema.d.ts +26 -0
- package/dist/source/schema.js +25 -0
- package/dist/static-A2YJ5TXV.js +62 -0
- package/dist/toc.d.ts +43 -0
- package/dist/toc.js +151 -0
- package/dist/util-bZU2QeJ2.d.ts +6 -0
- package/dist/utils/use-effect-event.d.ts +9 -0
- package/dist/utils/use-effect-event.js +16 -0
- package/dist/utils/use-media-query.d.ts +3 -0
- package/dist/utils/use-media-query.js +23 -0
- package/dist/utils/use-on-change.d.ts +8 -0
- package/dist/utils/use-on-change.js +7 -0
- package/package.json +222 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { R as Root, I as Item, F as Folder, S as Separator } from './definitions-pJ7PybYY.js';
|
|
2
|
+
import { I18nConfig } from './i18n/index.js';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
interface Source<Config extends SourceConfig = SourceConfig> {
|
|
6
|
+
files: VirtualFile<Config>[];
|
|
7
|
+
}
|
|
8
|
+
interface SourceConfig {
|
|
9
|
+
pageData: PageData;
|
|
10
|
+
metaData: MetaData;
|
|
11
|
+
}
|
|
12
|
+
interface MetaData {
|
|
13
|
+
icon?: string | undefined;
|
|
14
|
+
title?: string | undefined;
|
|
15
|
+
root?: boolean | undefined;
|
|
16
|
+
pages?: string[] | undefined;
|
|
17
|
+
defaultOpen?: boolean | undefined;
|
|
18
|
+
collapsible?: boolean | undefined;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
interface PageData {
|
|
22
|
+
icon?: string | undefined;
|
|
23
|
+
title?: string;
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
type VirtualFile<Config extends SourceConfig = SourceConfig> = VirtualPage<Config['pageData']> | VirtualMeta<Config['metaData']>;
|
|
27
|
+
interface BaseVirtualFile {
|
|
28
|
+
/**
|
|
29
|
+
* Virtualized path (relative to content directory)
|
|
30
|
+
*
|
|
31
|
+
* @example `docs/page.mdx`
|
|
32
|
+
*/
|
|
33
|
+
path: string;
|
|
34
|
+
/**
|
|
35
|
+
* Absolute path of the file
|
|
36
|
+
*/
|
|
37
|
+
absolutePath?: string;
|
|
38
|
+
}
|
|
39
|
+
interface VirtualPage<Data extends PageData> extends BaseVirtualFile {
|
|
40
|
+
type: 'page';
|
|
41
|
+
/**
|
|
42
|
+
* Specified Slugs for page
|
|
43
|
+
*/
|
|
44
|
+
slugs?: string[];
|
|
45
|
+
data: Data;
|
|
46
|
+
}
|
|
47
|
+
interface VirtualMeta<Data extends MetaData> extends BaseVirtualFile {
|
|
48
|
+
type: 'meta';
|
|
49
|
+
data: Data;
|
|
50
|
+
}
|
|
51
|
+
type _ConfigUnion_<T extends Record<string, Source>> = {
|
|
52
|
+
[K in keyof T]: T[K] extends Source<infer Config> ? {
|
|
53
|
+
pageData: Config['pageData'] & {
|
|
54
|
+
type: K;
|
|
55
|
+
};
|
|
56
|
+
metaData: Config['metaData'] & {
|
|
57
|
+
type: K;
|
|
58
|
+
};
|
|
59
|
+
} : never;
|
|
60
|
+
}[keyof T];
|
|
61
|
+
declare function multiple<T extends Record<string, Source>>(sources: T): Source<_ConfigUnion_<T>>;
|
|
62
|
+
declare function source<Page extends PageData, Meta extends MetaData>(config: {
|
|
63
|
+
pages: VirtualPage<Page>[];
|
|
64
|
+
metas: VirtualMeta<Meta>[];
|
|
65
|
+
}): Source<{
|
|
66
|
+
pageData: Page;
|
|
67
|
+
metaData: Meta;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* update a source object in-place.
|
|
71
|
+
*/
|
|
72
|
+
declare function update<Config extends SourceConfig>(source: Source<Config>): {
|
|
73
|
+
files<Page extends PageData, Meta extends MetaData>(fn: (files: VirtualFile<Config>[]) => (VirtualPage<Page> | VirtualMeta<Meta>)[]): typeof update<{
|
|
74
|
+
pageData: Page;
|
|
75
|
+
metaData: Meta;
|
|
76
|
+
}>;
|
|
77
|
+
page<V extends PageData>(fn: (page: VirtualPage<Config["pageData"]>) => VirtualPage<V>): typeof update<{
|
|
78
|
+
pageData: V;
|
|
79
|
+
metaData: Config["metaData"];
|
|
80
|
+
}>;
|
|
81
|
+
meta<V extends MetaData>(fn: (meta: VirtualMeta<Config["metaData"]>) => VirtualMeta<V>): typeof update<{
|
|
82
|
+
pageData: Config["pageData"];
|
|
83
|
+
metaData: V;
|
|
84
|
+
}>;
|
|
85
|
+
build(): Source<Config>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* In memory file system.
|
|
90
|
+
*/
|
|
91
|
+
declare class FileSystem<File> {
|
|
92
|
+
files: Map<string, File>;
|
|
93
|
+
folders: Map<string, string[]>;
|
|
94
|
+
constructor(inherit?: FileSystem<File>);
|
|
95
|
+
read(path: string): File | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* get the direct children of folder (in virtual file path)
|
|
98
|
+
*/
|
|
99
|
+
readDir(path: string): string[] | undefined;
|
|
100
|
+
write(path: string, file: File): void;
|
|
101
|
+
/**
|
|
102
|
+
* Delete files at specified path.
|
|
103
|
+
*
|
|
104
|
+
* @param path - the target path.
|
|
105
|
+
* @param [recursive=false] - if set to `true`, it will also delete directories.
|
|
106
|
+
*/
|
|
107
|
+
delete(path: string, recursive?: boolean): boolean;
|
|
108
|
+
getFiles(): string[];
|
|
109
|
+
makeDir(path: string): void;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
type ContentStorage<Config extends SourceConfig = SourceConfig> = FileSystem<ContentStorageFile<Config>>;
|
|
113
|
+
type ContentStorageFile<Config extends SourceConfig = SourceConfig> = {
|
|
114
|
+
path: string;
|
|
115
|
+
absolutePath?: string;
|
|
116
|
+
format: 'meta';
|
|
117
|
+
data: Config['metaData'];
|
|
118
|
+
} | {
|
|
119
|
+
path: string;
|
|
120
|
+
absolutePath?: string;
|
|
121
|
+
format: 'page';
|
|
122
|
+
slugs: string[];
|
|
123
|
+
data: Config['pageData'];
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* @param defaultLanguage - language to use when i18n is not configured.
|
|
127
|
+
* @returns a map of locale and its content storage.
|
|
128
|
+
*
|
|
129
|
+
* in the storage, locale codes are removed from file paths, hence the same file will have same file paths in every storage.
|
|
130
|
+
*/
|
|
131
|
+
declare function buildContentStorage(loaderConfig: ResolvedLoaderConfig, defaultLanguage: string): Record<string, ContentStorage>;
|
|
132
|
+
|
|
133
|
+
interface PageTreeBuilderContext<Config extends SourceConfig = SourceConfig> {
|
|
134
|
+
rootId: string;
|
|
135
|
+
generateNodeId: () => string;
|
|
136
|
+
options: PageTreeOptions;
|
|
137
|
+
transformers: PageTreeTransformer<Config>[];
|
|
138
|
+
builder: PageTreeBuilder;
|
|
139
|
+
storage: ContentStorage<Config>;
|
|
140
|
+
getUrl: ResolvedLoaderConfig['url'];
|
|
141
|
+
storages?: Record<string, ContentStorage<Config>>;
|
|
142
|
+
locale?: string;
|
|
143
|
+
}
|
|
144
|
+
interface PageTreeTransformer<Config extends SourceConfig = SourceConfig> {
|
|
145
|
+
file?: (this: PageTreeBuilderContext<Config>, node: Item, filePath?: string) => Item;
|
|
146
|
+
folder?: (this: PageTreeBuilderContext<Config>, node: Folder, folderPath: string, metaPath?: string) => Folder;
|
|
147
|
+
separator?: (this: PageTreeBuilderContext<Config>, node: Separator) => Separator;
|
|
148
|
+
root?: (this: PageTreeBuilderContext<Config>, node: Root) => Root;
|
|
149
|
+
}
|
|
150
|
+
interface PageTreeOptions<Config extends LoaderConfig = LoaderConfig> {
|
|
151
|
+
id?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Remove references to the file path of original nodes (`$ref`)
|
|
154
|
+
*
|
|
155
|
+
* @defaultValue false
|
|
156
|
+
*/
|
|
157
|
+
noRef?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* generate fallback page tree
|
|
160
|
+
*
|
|
161
|
+
* @defaultValue true
|
|
162
|
+
*/
|
|
163
|
+
generateFallback?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Additional page tree transformers to apply
|
|
166
|
+
*/
|
|
167
|
+
transformers?: PageTreeTransformer<Config['source']>[];
|
|
168
|
+
}
|
|
169
|
+
interface PageTreeBuilder {
|
|
170
|
+
build: (storage: ContentStorage, options?: PageTreeOptions) => Root;
|
|
171
|
+
buildI18n: (storages: Record<string, ContentStorage>, options?: PageTreeOptions) => Record<string, Root>;
|
|
172
|
+
}
|
|
173
|
+
declare function createPageTreeBuilder(loaderConfig: ResolvedLoaderConfig): PageTreeBuilder;
|
|
174
|
+
|
|
175
|
+
interface LoaderPlugin<Config extends LoaderConfig = LoaderConfig> {
|
|
176
|
+
name?: string;
|
|
177
|
+
/**
|
|
178
|
+
* Change the order of plugin:
|
|
179
|
+
* - `pre`: before normal plugins
|
|
180
|
+
* - `post`: after normal plugins
|
|
181
|
+
*/
|
|
182
|
+
enforce?: 'pre' | 'post';
|
|
183
|
+
/**
|
|
184
|
+
* receive & replace loader options
|
|
185
|
+
*/
|
|
186
|
+
config?: (config: ResolvedLoaderConfig) => ResolvedLoaderConfig | void | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* transform the storage after loading
|
|
189
|
+
*/
|
|
190
|
+
transformStorage?: (context: {
|
|
191
|
+
storage: ContentStorage<Config['source']>;
|
|
192
|
+
}) => void;
|
|
193
|
+
/**
|
|
194
|
+
* transform the generated page tree
|
|
195
|
+
*/
|
|
196
|
+
transformPageTree?: PageTreeTransformer<Config['source']>;
|
|
197
|
+
}
|
|
198
|
+
type LoaderPluginOption<Config extends LoaderConfig = LoaderConfig> = LoaderPlugin<Config> | LoaderPluginOption<Config>[] | undefined;
|
|
199
|
+
declare function buildPlugins(plugins: LoaderPluginOption[], sort?: boolean): LoaderPlugin[];
|
|
200
|
+
|
|
201
|
+
type IconResolver = (icon: string | undefined) => ReactNode;
|
|
202
|
+
|
|
203
|
+
interface LoaderConfig {
|
|
204
|
+
source: SourceConfig;
|
|
205
|
+
i18n: I18nConfig | undefined;
|
|
206
|
+
}
|
|
207
|
+
interface LoaderOptions<C extends LoaderConfig = LoaderConfig> {
|
|
208
|
+
baseUrl: string;
|
|
209
|
+
i18n?: C['i18n'];
|
|
210
|
+
url?: (slugs: string[], locale?: string) => string;
|
|
211
|
+
/**
|
|
212
|
+
* Additional options for page tree builder
|
|
213
|
+
*/
|
|
214
|
+
pageTree?: PageTreeOptions<C>;
|
|
215
|
+
plugins?: LoaderPluginOption[] | ((context: {
|
|
216
|
+
typedPlugin: (plugin: LoaderPlugin<C>) => LoaderPlugin;
|
|
217
|
+
}) => LoaderPluginOption[]);
|
|
218
|
+
icon?: IconResolver;
|
|
219
|
+
slugs?: (info: {
|
|
220
|
+
path: string;
|
|
221
|
+
}) => string[];
|
|
222
|
+
}
|
|
223
|
+
interface ResolvedLoaderConfig {
|
|
224
|
+
source: Source;
|
|
225
|
+
url: (slugs: string[], locale?: string) => string;
|
|
226
|
+
plugins?: LoaderPlugin[];
|
|
227
|
+
pageTree?: PageTreeOptions;
|
|
228
|
+
i18n?: I18nConfig | undefined;
|
|
229
|
+
}
|
|
230
|
+
interface SharedFileInfo {
|
|
231
|
+
/**
|
|
232
|
+
* Virtualized file path (relative to content directory)
|
|
233
|
+
*
|
|
234
|
+
* @example `docs/page.mdx`
|
|
235
|
+
*/
|
|
236
|
+
path: string;
|
|
237
|
+
/**
|
|
238
|
+
* Absolute path of the file
|
|
239
|
+
*/
|
|
240
|
+
absolutePath?: string;
|
|
241
|
+
}
|
|
242
|
+
interface Page<Data = PageData> extends SharedFileInfo {
|
|
243
|
+
slugs: string[];
|
|
244
|
+
url: string;
|
|
245
|
+
data: Data;
|
|
246
|
+
locale?: string | undefined;
|
|
247
|
+
}
|
|
248
|
+
interface Meta<Data = MetaData> extends SharedFileInfo {
|
|
249
|
+
data: Data;
|
|
250
|
+
}
|
|
251
|
+
interface LoaderOutput<Config extends LoaderConfig> {
|
|
252
|
+
pageTree: Config['i18n'] extends I18nConfig ? Record<string, Root> : Root;
|
|
253
|
+
getPageTree: (locale?: string) => Root;
|
|
254
|
+
getPageByHref: (href: string, options?: {
|
|
255
|
+
language?: string;
|
|
256
|
+
/**
|
|
257
|
+
* resolve relative file paths in `href` from specified dirname, must be a virtual path.
|
|
258
|
+
*/
|
|
259
|
+
dir?: string;
|
|
260
|
+
}) => {
|
|
261
|
+
page: Page<Config['source']['pageData']>;
|
|
262
|
+
hash?: string;
|
|
263
|
+
} | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* @internal
|
|
266
|
+
*/
|
|
267
|
+
_i18n?: I18nConfig;
|
|
268
|
+
/**
|
|
269
|
+
* Get a list of pages from specified language
|
|
270
|
+
*
|
|
271
|
+
* @param language - If empty, list pages from all languages.
|
|
272
|
+
*/
|
|
273
|
+
getPages: (language?: string) => Page<Config['source']['pageData']>[];
|
|
274
|
+
/**
|
|
275
|
+
* get each language and its pages, empty if i18n is not enabled.
|
|
276
|
+
*/
|
|
277
|
+
getLanguages: () => {
|
|
278
|
+
language: string;
|
|
279
|
+
pages: Page<Config['source']['pageData']>[];
|
|
280
|
+
}[];
|
|
281
|
+
/**
|
|
282
|
+
* Get page with slugs, the slugs can also be URI encoded.
|
|
283
|
+
*
|
|
284
|
+
* @param language - If empty, the default language will be used
|
|
285
|
+
*/
|
|
286
|
+
getPage: (slugs: string[] | undefined, language?: string) => Page<Config['source']['pageData']> | undefined;
|
|
287
|
+
getNodePage: (node: Item, language?: string) => Page<Config['source']['pageData']> | undefined;
|
|
288
|
+
getNodeMeta: (node: Folder, language?: string) => Meta<Config['source']['metaData']> | undefined;
|
|
289
|
+
/**
|
|
290
|
+
* generate static params for Next.js SSG
|
|
291
|
+
*
|
|
292
|
+
* @param slug - customise parameter name for slugs
|
|
293
|
+
* @param lang - customise parameter name for lang
|
|
294
|
+
*/
|
|
295
|
+
generateParams: <TSlug extends string = 'slug', TLang extends string = 'lang'>(slug?: TSlug, lang?: TLang) => (Record<TSlug, string[]> & Record<TLang, string>)[];
|
|
296
|
+
/**
|
|
297
|
+
* serialize page tree for non-RSC environments
|
|
298
|
+
*/
|
|
299
|
+
serializePageTree: (tree: Root) => Promise<object>;
|
|
300
|
+
}
|
|
301
|
+
declare function createGetUrl(baseUrl: string, i18n?: I18nConfig): ResolvedLoaderConfig['url'];
|
|
302
|
+
declare function loader<Config extends SourceConfig, I18n extends I18nConfig | undefined = undefined>(source: Source<Config>, options: LoaderOptions<{
|
|
303
|
+
source: NoInfer<Config>;
|
|
304
|
+
i18n: I18n;
|
|
305
|
+
}>): LoaderOutput<{
|
|
306
|
+
source: Config;
|
|
307
|
+
i18n: I18n;
|
|
308
|
+
}>;
|
|
309
|
+
declare function loader<Config extends SourceConfig, I18n extends I18nConfig | undefined = undefined>(options: LoaderOptions<{
|
|
310
|
+
source: NoInfer<Config>;
|
|
311
|
+
i18n: I18n;
|
|
312
|
+
}> & {
|
|
313
|
+
source: Source<Config>;
|
|
314
|
+
}): LoaderOutput<{
|
|
315
|
+
source: Config;
|
|
316
|
+
i18n: I18n;
|
|
317
|
+
}>;
|
|
318
|
+
type InferPageType<Utils extends LoaderOutput<any>> = Utils extends LoaderOutput<infer Config> ? Page<Config['source']['pageData']> : never;
|
|
319
|
+
type InferMetaType<Utils extends LoaderOutput<any>> = Utils extends LoaderOutput<infer Config> ? Meta<Config['source']['metaData']> : never;
|
|
320
|
+
|
|
321
|
+
export { type ContentStorage as C, FileSystem as F, type InferPageType as I, type LoaderPlugin as L, type MetaData as M, type PageData as P, type ResolvedLoaderConfig as R, type Source as S, type VirtualFile as V, type _ConfigUnion_ as _, type SourceConfig as a, type LoaderConfig as b, type LoaderOptions as c, type Page as d, type Meta as e, type LoaderOutput as f, createGetUrl as g, type InferMetaType as h, type PageTreeBuilderContext as i, type PageTreeTransformer as j, type PageTreeOptions as k, loader as l, multiple as m, type PageTreeBuilder as n, createPageTreeBuilder as o, type ContentStorageFile as p, buildContentStorage as q, type LoaderPluginOption as r, source as s, buildPlugins as t, update as u };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
2
|
+
import { BlockContent, Text } from 'mdast';
|
|
3
|
+
|
|
4
|
+
interface CodeBlockTabsOptions {
|
|
5
|
+
attributes?: MdxJsxAttribute[];
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
persist?: {
|
|
8
|
+
id: string;
|
|
9
|
+
} | false;
|
|
10
|
+
triggers: {
|
|
11
|
+
value: string;
|
|
12
|
+
children: (BlockContent | Text)[];
|
|
13
|
+
}[];
|
|
14
|
+
tabs: {
|
|
15
|
+
value: string;
|
|
16
|
+
children: BlockContent[];
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
19
|
+
declare function generateCodeBlockTabs({ persist, defaultValue, triggers, tabs, ...options }: CodeBlockTabsOptions): MdxJsxFlowElement;
|
|
20
|
+
interface CodeBlockAttributes<Name extends string = string> {
|
|
21
|
+
attributes: Partial<Record<Name, string | null>>;
|
|
22
|
+
rest: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parse Fumadocs-style code block attributes from meta string, like `title="hello world"`
|
|
26
|
+
*/
|
|
27
|
+
declare function parseCodeBlockAttributes<Name extends string = string>(meta: string, allowedNames?: Name[]): CodeBlockAttributes<Name>;
|
|
28
|
+
|
|
29
|
+
export { type CodeBlockAttributes, type CodeBlockTabsOptions, generateCodeBlockTabs, parseCodeBlockAttributes };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { Options as RemarkGfmOptions, default as remarkGfm } from 'remark-gfm';
|
|
2
|
+
export { CodeBlockIcon, RehypeCodeOptions, rehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab } from './rehype-code.js';
|
|
3
|
+
export { RemarkImageOptions, remarkImage } from './remark-image.js';
|
|
4
|
+
export { StructureOptions, StructuredData, remarkStructure, remarkStructureDefaultOptions, structure } from './remark-structure.js';
|
|
5
|
+
export { RemarkHeadingOptions, remarkHeading } from './remark-heading.js';
|
|
6
|
+
export { RemarkAdmonitionOptions, remarkAdmonition } from './remark-admonition.js';
|
|
7
|
+
export { RemarkDirectiveAdmonitionOptions, remarkDirectiveAdmonition } from './remark-directive-admonition.js';
|
|
8
|
+
export { RehypeTocOptions, rehypeToc } from './rehype-toc.js';
|
|
9
|
+
export { RemarkCodeTabOptions, remarkCodeTab } from './remark-code-tab.js';
|
|
10
|
+
export { RemarkStepsOptions, remarkSteps } from './remark-steps.js';
|
|
11
|
+
export { RemarkNpmOptions, remarkNpm } from './remark-npm.js';
|
|
12
|
+
export { CodeBlockAttributes, CodeBlockTabsOptions, generateCodeBlockTabs, parseCodeBlockAttributes } from './codeblock-utils.js';
|
|
13
|
+
export { RemarkMdxFilesOptions, remarkMdxFiles } from './remark-mdx-files.js';
|
|
14
|
+
export { RemarkMdxMermaidOptions, remarkMdxMermaid } from './remark-mdx-mermaid.js';
|
|
15
|
+
import 'hast';
|
|
16
|
+
import '@shikijs/rehype';
|
|
17
|
+
import 'unified';
|
|
18
|
+
import 'shiki';
|
|
19
|
+
import 'mdast';
|
|
20
|
+
import 'mdast-util-mdx-jsx';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
remarkImage
|
|
3
|
+
} from "../chunk-5PMI7QDD.js";
|
|
4
|
+
import {
|
|
5
|
+
remarkMdxFiles
|
|
6
|
+
} from "../chunk-ADBHPKXG.js";
|
|
7
|
+
import {
|
|
8
|
+
remarkMdxMermaid
|
|
9
|
+
} from "../chunk-FUUVPEA5.js";
|
|
10
|
+
import {
|
|
11
|
+
remarkNpm
|
|
12
|
+
} from "../chunk-GLRQBLGN.js";
|
|
13
|
+
import {
|
|
14
|
+
remarkSteps
|
|
15
|
+
} from "../chunk-XJ6ZQNEX.js";
|
|
16
|
+
import {
|
|
17
|
+
remarkStructure,
|
|
18
|
+
remarkStructureDefaultOptions,
|
|
19
|
+
structure
|
|
20
|
+
} from "../chunk-JUF4WZ6G.js";
|
|
21
|
+
import {
|
|
22
|
+
rehypeCode,
|
|
23
|
+
rehypeCodeDefaultOptions,
|
|
24
|
+
transformerIcon,
|
|
25
|
+
transformerTab
|
|
26
|
+
} from "../chunk-X2HFD5QJ.js";
|
|
27
|
+
import {
|
|
28
|
+
rehypeToc
|
|
29
|
+
} from "../chunk-EFVXL2PP.js";
|
|
30
|
+
import {
|
|
31
|
+
remarkAdmonition
|
|
32
|
+
} from "../chunk-W6WTLKRA.js";
|
|
33
|
+
import {
|
|
34
|
+
remarkCodeTab
|
|
35
|
+
} from "../chunk-CH7YHH7V.js";
|
|
36
|
+
import {
|
|
37
|
+
generateCodeBlockTabs,
|
|
38
|
+
parseCodeBlockAttributes
|
|
39
|
+
} from "../chunk-TWIDBWFG.js";
|
|
40
|
+
import {
|
|
41
|
+
remarkDirectiveAdmonition
|
|
42
|
+
} from "../chunk-APKPSBSB.js";
|
|
43
|
+
import {
|
|
44
|
+
default as default2
|
|
45
|
+
} from "../chunk-ONG4RVCR.js";
|
|
46
|
+
import "../chunk-XN2LKXFZ.js";
|
|
47
|
+
import {
|
|
48
|
+
remarkHeading
|
|
49
|
+
} from "../chunk-MA6O2UUE.js";
|
|
50
|
+
import "../chunk-VLSDGCJE.js";
|
|
51
|
+
import "../chunk-U67V476Y.js";
|
|
52
|
+
export {
|
|
53
|
+
generateCodeBlockTabs,
|
|
54
|
+
parseCodeBlockAttributes,
|
|
55
|
+
rehypeCode,
|
|
56
|
+
rehypeCodeDefaultOptions,
|
|
57
|
+
rehypeToc,
|
|
58
|
+
remarkAdmonition,
|
|
59
|
+
remarkCodeTab,
|
|
60
|
+
remarkDirectiveAdmonition,
|
|
61
|
+
default2 as remarkGfm,
|
|
62
|
+
remarkHeading,
|
|
63
|
+
remarkImage,
|
|
64
|
+
remarkMdxFiles,
|
|
65
|
+
remarkMdxMermaid,
|
|
66
|
+
remarkNpm,
|
|
67
|
+
remarkSteps,
|
|
68
|
+
remarkStructure,
|
|
69
|
+
remarkStructureDefaultOptions,
|
|
70
|
+
structure,
|
|
71
|
+
transformerIcon,
|
|
72
|
+
transformerTab
|
|
73
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Root } from 'hast';
|
|
2
|
+
import { RehypeShikiOptions } from '@shikijs/rehype';
|
|
3
|
+
import { Processor, Transformer } from 'unified';
|
|
4
|
+
import { ShikiTransformer } from 'shiki';
|
|
5
|
+
|
|
6
|
+
type CodeBlockIcon = {
|
|
7
|
+
viewBox: string;
|
|
8
|
+
fill: string;
|
|
9
|
+
d: string;
|
|
10
|
+
} | string;
|
|
11
|
+
interface IconOptions {
|
|
12
|
+
shortcuts?: Record<string, string>;
|
|
13
|
+
extend?: Record<string, CodeBlockIcon>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Inject icons to `icon` property (as HTML)
|
|
17
|
+
*/
|
|
18
|
+
declare function transformerIcon(options?: IconOptions): ShikiTransformer;
|
|
19
|
+
|
|
20
|
+
declare const rehypeCodeDefaultOptions: RehypeCodeOptions;
|
|
21
|
+
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
|
22
|
+
type RehypeCodeOptions = DistributiveOmit<RehypeShikiOptions, 'lazy'> & {
|
|
23
|
+
/**
|
|
24
|
+
* Load languages and themes on-demand.
|
|
25
|
+
* @defaultValue true
|
|
26
|
+
*/
|
|
27
|
+
lazy?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The regex engine to use.
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue 'js'
|
|
32
|
+
*/
|
|
33
|
+
engine?: 'js' | 'oniguruma';
|
|
34
|
+
/**
|
|
35
|
+
* Filter meta string before processing
|
|
36
|
+
*/
|
|
37
|
+
filterMetaString?: (metaString: string) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Add icon to code blocks
|
|
40
|
+
*/
|
|
41
|
+
icon?: IconOptions | false;
|
|
42
|
+
/**
|
|
43
|
+
* Wrap code blocks in `<Tab>` component when "tab" meta string presents
|
|
44
|
+
*
|
|
45
|
+
* @defaultValue true
|
|
46
|
+
*/
|
|
47
|
+
tab?: boolean;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Handle codeblocks
|
|
51
|
+
*/
|
|
52
|
+
declare function rehypeCode(this: Processor, _options?: Partial<RehypeCodeOptions>): Transformer<Root, Root>;
|
|
53
|
+
declare function transformerTab(): ShikiTransformer;
|
|
54
|
+
|
|
55
|
+
export { type CodeBlockIcon, type RehypeCodeOptions, rehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rehypeCode,
|
|
3
|
+
rehypeCodeDefaultOptions,
|
|
4
|
+
transformerIcon,
|
|
5
|
+
transformerTab
|
|
6
|
+
} from "../chunk-X2HFD5QJ.js";
|
|
7
|
+
import "../chunk-TWIDBWFG.js";
|
|
8
|
+
import "../chunk-XN2LKXFZ.js";
|
|
9
|
+
import "../chunk-U67V476Y.js";
|
|
10
|
+
export {
|
|
11
|
+
rehypeCode,
|
|
12
|
+
rehypeCodeDefaultOptions,
|
|
13
|
+
transformerIcon,
|
|
14
|
+
transformerTab
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Processor, Transformer } from 'unified';
|
|
2
|
+
import { Root } from 'hast';
|
|
3
|
+
|
|
4
|
+
interface RehypeTocOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Export generated toc as a variable
|
|
7
|
+
*
|
|
8
|
+
* @defaultValue true
|
|
9
|
+
*/
|
|
10
|
+
exportToc?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function rehypeToc(this: Processor, { exportToc }?: RehypeTocOptions): Transformer<Root, Root>;
|
|
13
|
+
|
|
14
|
+
export { type RehypeTocOptions, rehypeToc };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Transformer } from 'unified';
|
|
2
|
+
import { Root } from 'mdast';
|
|
3
|
+
|
|
4
|
+
interface RemarkAdmonitionOptions {
|
|
5
|
+
tag?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Map type to another type
|
|
8
|
+
*/
|
|
9
|
+
typeMap?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Remark Plugin to support Admonition syntax
|
|
13
|
+
*
|
|
14
|
+
* Useful when Migrating from Docusaurus
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Use `remarkDirectiveAdmonition` with `remark-directive` configured instead.
|
|
17
|
+
*/
|
|
18
|
+
declare function remarkAdmonition(options?: RemarkAdmonitionOptions): Transformer<Root, Root>;
|
|
19
|
+
|
|
20
|
+
export { type RemarkAdmonitionOptions, remarkAdmonition };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Processor, Transformer } from 'unified';
|
|
2
|
+
import { Code, Root } from 'mdast';
|
|
3
|
+
import { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
4
|
+
|
|
5
|
+
type TabType = keyof typeof Types;
|
|
6
|
+
interface RemarkCodeTabOptions {
|
|
7
|
+
Tabs?: TabType;
|
|
8
|
+
/**
|
|
9
|
+
* Parse MDX in tab values
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue false
|
|
12
|
+
*/
|
|
13
|
+
parseMdx?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare module 'mdast' {
|
|
16
|
+
interface CodeData {
|
|
17
|
+
tab?: string;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
declare const Types: {
|
|
21
|
+
CodeBlockTabs: {
|
|
22
|
+
convert(processor: Processor, nodes: Code[], withMdx?: boolean, withParent?: boolean): MdxJsxFlowElement;
|
|
23
|
+
};
|
|
24
|
+
Tabs: {
|
|
25
|
+
convert(processor: Processor, nodes: Code[], withMdx?: boolean, withParent?: boolean): MdxJsxFlowElement;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
declare function remarkCodeTab(this: Processor, options?: RemarkCodeTabOptions): Transformer<Root, Root>;
|
|
29
|
+
|
|
30
|
+
export { type RemarkCodeTabOptions, remarkCodeTab };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Root } from 'mdast';
|
|
2
|
+
import { Transformer } from 'unified';
|
|
3
|
+
|
|
4
|
+
interface RemarkDirectiveAdmonitionOptions {
|
|
5
|
+
/**
|
|
6
|
+
* the tag names of Callout component.
|
|
7
|
+
*/
|
|
8
|
+
tags?: {
|
|
9
|
+
CalloutContainer?: string;
|
|
10
|
+
CalloutTitle?: string;
|
|
11
|
+
CalloutDescription?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* All supported admonition types and their linked Callout type.
|
|
15
|
+
*
|
|
16
|
+
* When specified, all defaults will be cleared.
|
|
17
|
+
*/
|
|
18
|
+
types?: Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Remark Plugin to support Admonition syntax in Docusaurus, useful for migrating from Docusaurus.
|
|
22
|
+
*
|
|
23
|
+
* Requires [`remark-directive`](https://github.com/remarkjs/remark-directive) to be configured.
|
|
24
|
+
*/
|
|
25
|
+
declare function remarkDirectiveAdmonition({ tags: { CalloutContainer, CalloutTitle, CalloutDescription, }, types, }?: RemarkDirectiveAdmonitionOptions): Transformer<Root, Root>;
|
|
26
|
+
|
|
27
|
+
export { type RemarkDirectiveAdmonitionOptions, remarkDirectiveAdmonition };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Options as RemarkGfmOptions, default as remarkGfm } from 'remark-gfm';
|