fumadocs-mdx 14.0.0 → 14.0.2
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/dist/{build-mdx-6UAK5FF5.js → build-mdx-W3233QBZ.js} +1 -1
- package/dist/bun/index.d.ts +7 -1
- package/dist/bun/index.js +9 -8
- package/dist/{chunk-5YXP7JLN.js → chunk-5OBUOALK.js} +8 -5
- package/dist/{chunk-ZY6UZ7NH.js → chunk-6RPNS75C.js} +1 -1
- package/dist/{chunk-XHJCLBZ4.js → chunk-ED3ON275.js} +86 -162
- package/dist/{chunk-7L2KNF6B.js → chunk-GB4W3YCZ.js} +51 -7
- package/dist/{chunk-SLY7WXTX.js → chunk-KOPLIEVQ.js} +5 -6
- package/dist/{chunk-OXSRIWQW.js → chunk-LPX7ZO66.js} +4 -3
- package/dist/{chunk-SRSRFOVI.js → chunk-OLL7FM7W.js} +3 -3
- package/dist/{chunk-5UMZCWKV.js → chunk-Q5OSGLJL.js} +1 -1
- package/dist/{chunk-E5DJTSIM.js → chunk-S7KOJHHO.js} +4 -1
- package/dist/{chunk-6NISOLQ6.js → chunk-USWQVJWR.js} +1 -1
- package/dist/chunk-WBIHDYMN.js +126 -0
- package/dist/config/index.d.ts +6 -1
- package/dist/config/index.js +1 -1
- package/dist/{index-D7JdSMpp.d.cts → core-C3QZSdEx.d.ts} +73 -4
- package/dist/{index-BlVBvy-z.d.ts → index-RVIZxMZG.d.ts} +1 -1
- package/dist/index.d.ts +56 -3
- package/dist/load-from-file-OZ5N7DXU.js +8 -0
- package/dist/next/index.cjs +263 -193
- package/dist/next/index.d.ts +7 -2
- package/dist/next/index.js +12 -10
- package/dist/node/loader.js +4 -4
- package/dist/plugins/index-file.d.ts +7 -22
- package/dist/plugins/index-file.js +2 -2
- package/dist/plugins/json-schema.d.ts +7 -1
- package/dist/plugins/last-modified.d.ts +15 -2
- package/dist/plugins/last-modified.js +43 -6
- package/dist/runtime/browser.d.ts +22 -19
- package/dist/runtime/browser.js +5 -6
- package/dist/runtime/dynamic.d.ts +12 -12
- package/dist/runtime/dynamic.js +12 -11
- package/dist/runtime/server.d.ts +10 -157
- package/dist/runtime/server.js +3 -3
- package/dist/runtime/types.d.ts +61 -0
- package/dist/runtime/types.js +0 -0
- package/dist/vite/index.d.ts +7 -2
- package/dist/vite/index.js +10 -9
- package/dist/webpack/mdx.d.ts +8 -2
- package/dist/webpack/mdx.js +5 -5
- package/dist/webpack/meta.d.ts +8 -2
- package/dist/webpack/meta.js +4 -4
- package/package.json +4 -6
- package/dist/bin.cjs +0 -1889
- package/dist/bin.d.cts +0 -1
- package/dist/bun/index.cjs +0 -1112
- package/dist/bun/index.d.cts +0 -19
- package/dist/chunk-PKI7ZDA5.js +0 -29
- package/dist/config/index.cjs +0 -400
- package/dist/config/index.d.cts +0 -13
- package/dist/index-D7JdSMpp.d.ts +0 -272
- package/dist/index-P2NNUkHn.d.cts +0 -8
- package/dist/index.cjs +0 -18
- package/dist/index.d.cts +0 -8
- package/dist/load-from-file-I3ALLIVB.js +0 -8
- package/dist/next/index.d.cts +0 -28
- package/dist/node/loader.cjs +0 -1165
- package/dist/node/loader.d.cts +0 -5
- package/dist/plugins/index-file.cjs +0 -471
- package/dist/plugins/index-file.d.cts +0 -29
- package/dist/plugins/json-schema.cjs +0 -114
- package/dist/plugins/json-schema.d.cts +0 -25
- package/dist/plugins/last-modified.cjs +0 -75
- package/dist/plugins/last-modified.d.cts +0 -27
- package/dist/runtime/browser.cjs +0 -94
- package/dist/runtime/browser.d.cts +0 -50
- package/dist/runtime/dynamic.cjs +0 -985
- package/dist/runtime/dynamic.d.cts +0 -27
- package/dist/runtime/server.cjs +0 -173
- package/dist/runtime/server.d.cts +0 -161
- package/dist/vite/index.cjs +0 -1620
- package/dist/vite/index.d.cts +0 -39
- package/dist/webpack/mdx.cjs +0 -1089
- package/dist/webpack/mdx.d.cts +0 -14
- package/dist/webpack/meta.cjs +0 -649
- package/dist/webpack/meta.d.cts +0 -14
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as fumadocs_core_source from 'fumadocs-core/source';
|
|
2
|
-
import { FileInfo, AsyncDocCollectionEntry, AsyncDocsCollectionEntry } from './server.cjs';
|
|
3
|
-
import { C as CoreOptions, D as DocCollection, b as DocsCollection } from '../index-D7JdSMpp.cjs';
|
|
4
|
-
import * as _standard_schema_spec from '@standard-schema/spec';
|
|
5
|
-
import 'fumadocs-core/mdx-plugins';
|
|
6
|
-
import 'fumadocs-core/toc';
|
|
7
|
-
import 'mdx/types';
|
|
8
|
-
import 'mdast';
|
|
9
|
-
import '@mdx-js/mdx';
|
|
10
|
-
import 'react';
|
|
11
|
-
import 'unified';
|
|
12
|
-
import 'zod';
|
|
13
|
-
import 'chokidar';
|
|
14
|
-
import 'vfile';
|
|
15
|
-
|
|
16
|
-
interface LazyEntry<Data = unknown> {
|
|
17
|
-
info: FileInfo;
|
|
18
|
-
data: Data;
|
|
19
|
-
hash?: string;
|
|
20
|
-
}
|
|
21
|
-
type CreateDynamic<Config> = ReturnType<typeof fromConfigDynamic<Config>>;
|
|
22
|
-
declare function fromConfigDynamic<Config>(configExports: Config, coreOptions: CoreOptions): Promise<{
|
|
23
|
-
doc<Name extends keyof Config>(name: Name, base: string, entries: LazyEntry<unknown>[]): Promise<Config[Name] extends DocCollection<infer Schema extends _standard_schema_spec.StandardSchemaV1<unknown, unknown>> | DocsCollection<infer Schema extends _standard_schema_spec.StandardSchemaV1<unknown, unknown>, _standard_schema_spec.StandardSchemaV1<unknown, unknown>> ? AsyncDocCollectionEntry<_standard_schema_spec.StandardSchemaV1.InferOutput<Schema>>[] : never>;
|
|
24
|
-
docs<Name extends keyof Config>(name: Name, base: string, meta: Record<string, unknown>, entries: LazyEntry<unknown>[]): Promise<Config[Name] extends DocsCollection<infer Page extends _standard_schema_spec.StandardSchemaV1<unknown, unknown>, infer Meta extends _standard_schema_spec.StandardSchemaV1<unknown, unknown>> ? _standard_schema_spec.StandardSchemaV1.InferOutput<Page> extends fumadocs_core_source.PageData ? _standard_schema_spec.StandardSchemaV1.InferOutput<Meta> extends fumadocs_core_source.MetaData ? AsyncDocsCollectionEntry<_standard_schema_spec.StandardSchemaV1.InferOutput<Page>, _standard_schema_spec.StandardSchemaV1.InferOutput<Meta>> : never : never : never>;
|
|
25
|
-
}>;
|
|
26
|
-
|
|
27
|
-
export { type CreateDynamic, type LazyEntry, fromConfigDynamic };
|
package/dist/runtime/server.cjs
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/runtime/server.ts
|
|
31
|
-
var server_exports = {};
|
|
32
|
-
__export(server_exports, {
|
|
33
|
-
fromConfig: () => fromConfig,
|
|
34
|
-
toFumadocsSource: () => toFumadocsSource
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(server_exports);
|
|
37
|
-
var path = __toESM(require("path"), 1);
|
|
38
|
-
function fromConfig() {
|
|
39
|
-
function fileInfo(file, base) {
|
|
40
|
-
if (file.startsWith("./")) {
|
|
41
|
-
file = file.slice(2);
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
path: file,
|
|
45
|
-
fullPath: path.join(base, file)
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function mapDocData(entry) {
|
|
49
|
-
return {
|
|
50
|
-
body: entry.default,
|
|
51
|
-
toc: entry.toc,
|
|
52
|
-
extractedReferences: entry.extractedReferences,
|
|
53
|
-
structuredData: entry.structuredData,
|
|
54
|
-
lastModified: entry.lastModified,
|
|
55
|
-
_exports: entry
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
async doc(_name, base, glob) {
|
|
60
|
-
const out = await Promise.all(
|
|
61
|
-
Object.entries(glob).map(async ([k, v]) => {
|
|
62
|
-
const data = typeof v === "function" ? await v() : v;
|
|
63
|
-
return {
|
|
64
|
-
...mapDocData(data),
|
|
65
|
-
...data.frontmatter,
|
|
66
|
-
...createDocMethods(fileInfo(k, base), () => data)
|
|
67
|
-
};
|
|
68
|
-
})
|
|
69
|
-
);
|
|
70
|
-
return out;
|
|
71
|
-
},
|
|
72
|
-
async docLazy(_name, base, head, body) {
|
|
73
|
-
const out = await Promise.all(
|
|
74
|
-
Object.entries(head).map(async ([k, v]) => {
|
|
75
|
-
const data = typeof v === "function" ? await v() : v;
|
|
76
|
-
const content = body[k];
|
|
77
|
-
return {
|
|
78
|
-
...data,
|
|
79
|
-
...createDocMethods(fileInfo(k, base), content),
|
|
80
|
-
async load() {
|
|
81
|
-
return mapDocData(await content());
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
})
|
|
85
|
-
);
|
|
86
|
-
return out;
|
|
87
|
-
},
|
|
88
|
-
async meta(_name, base, glob) {
|
|
89
|
-
const out = await Promise.all(
|
|
90
|
-
Object.entries(glob).map(async ([k, v]) => {
|
|
91
|
-
const data = typeof v === "function" ? await v() : v;
|
|
92
|
-
return {
|
|
93
|
-
info: fileInfo(k, base),
|
|
94
|
-
...data
|
|
95
|
-
};
|
|
96
|
-
})
|
|
97
|
-
);
|
|
98
|
-
return out;
|
|
99
|
-
},
|
|
100
|
-
async docs(name, base, metaGlob, docGlob) {
|
|
101
|
-
const entry = {
|
|
102
|
-
docs: await this.doc(name, base, docGlob),
|
|
103
|
-
meta: await this.meta(name, base, metaGlob),
|
|
104
|
-
toFumadocsSource() {
|
|
105
|
-
return toFumadocsSource(this.docs, this.meta);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
return entry;
|
|
109
|
-
},
|
|
110
|
-
async docsLazy(name, base, metaGlob, docHeadGlob, docBodyGlob) {
|
|
111
|
-
const entry = {
|
|
112
|
-
docs: await this.docLazy(name, base, docHeadGlob, docBodyGlob),
|
|
113
|
-
meta: await this.meta(name, base, metaGlob),
|
|
114
|
-
toFumadocsSource() {
|
|
115
|
-
return toFumadocsSource(this.docs, this.meta);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
return entry;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function toFumadocsSource(pages, metas) {
|
|
123
|
-
const files = [];
|
|
124
|
-
for (const entry of pages) {
|
|
125
|
-
files.push({
|
|
126
|
-
type: "page",
|
|
127
|
-
path: entry.info.path,
|
|
128
|
-
absolutePath: entry.info.fullPath,
|
|
129
|
-
data: entry
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
for (const entry of metas) {
|
|
133
|
-
files.push({
|
|
134
|
-
type: "meta",
|
|
135
|
-
path: entry.info.path,
|
|
136
|
-
absolutePath: entry.info.fullPath,
|
|
137
|
-
data: entry
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
return {
|
|
141
|
-
files
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
function createDocMethods(info, load) {
|
|
145
|
-
return {
|
|
146
|
-
info,
|
|
147
|
-
async getText(type) {
|
|
148
|
-
if (type === "raw") {
|
|
149
|
-
const fs = await import("fs/promises");
|
|
150
|
-
return (await fs.readFile(info.fullPath)).toString();
|
|
151
|
-
}
|
|
152
|
-
const data = await load();
|
|
153
|
-
if (typeof data._markdown !== "string")
|
|
154
|
-
throw new Error(
|
|
155
|
-
"getText('processed') requires `includeProcessedMarkdown` to be enabled in your collection config."
|
|
156
|
-
);
|
|
157
|
-
return data._markdown;
|
|
158
|
-
},
|
|
159
|
-
async getMDAST() {
|
|
160
|
-
const data = await load();
|
|
161
|
-
if (!data._mdast)
|
|
162
|
-
throw new Error(
|
|
163
|
-
"getMDAST() requires `includeMDAST` to be enabled in your collection config."
|
|
164
|
-
);
|
|
165
|
-
return JSON.parse(data._mdast);
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
170
|
-
0 && (module.exports = {
|
|
171
|
-
fromConfig,
|
|
172
|
-
toFumadocsSource
|
|
173
|
-
});
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { PageData, MetaData, Source } from 'fumadocs-core/source';
|
|
2
|
-
import { StructuredData } from 'fumadocs-core/mdx-plugins';
|
|
3
|
-
import { TOCItemType } from 'fumadocs-core/toc';
|
|
4
|
-
import { MDXProps, MDXContent } from 'mdx/types';
|
|
5
|
-
import { E as ExtractedReference, D as DocCollection, b as DocsCollection, M as MetaCollection } from '../index-D7JdSMpp.cjs';
|
|
6
|
-
import { Root } from 'mdast';
|
|
7
|
-
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
8
|
-
import { createProcessor } from '@mdx-js/mdx';
|
|
9
|
-
import { FC } from 'react';
|
|
10
|
-
import 'unified';
|
|
11
|
-
import 'zod';
|
|
12
|
-
import 'chokidar';
|
|
13
|
-
import 'vfile';
|
|
14
|
-
|
|
15
|
-
type Processor = ReturnType<typeof createProcessor>;
|
|
16
|
-
interface CompilerOptions {
|
|
17
|
-
addDependency: (file: string) => void;
|
|
18
|
-
}
|
|
19
|
-
interface CompiledMDXProperties<Frontmatter = Record<string, unknown>> {
|
|
20
|
-
frontmatter: Frontmatter;
|
|
21
|
-
structuredData: StructuredData;
|
|
22
|
-
toc: TOCItemType[];
|
|
23
|
-
default: FC<MDXProps>;
|
|
24
|
-
/**
|
|
25
|
-
* Added by the `last-modified` plugin.
|
|
26
|
-
*/
|
|
27
|
-
lastModified?: Date;
|
|
28
|
-
/**
|
|
29
|
-
* Enable from `postprocess` option.
|
|
30
|
-
*/
|
|
31
|
-
extractedReferences?: ExtractedReference[];
|
|
32
|
-
/**
|
|
33
|
-
* Enable from `postprocess` option.
|
|
34
|
-
*/
|
|
35
|
-
_markdown?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Enable from `postprocess` option.
|
|
38
|
-
*/
|
|
39
|
-
_mdast?: string;
|
|
40
|
-
}
|
|
41
|
-
interface FumadocsDataMap {
|
|
42
|
-
/**
|
|
43
|
-
* [Fumadocs MDX] raw frontmatter, you can modify it
|
|
44
|
-
*/
|
|
45
|
-
frontmatter?: Record<string, unknown>;
|
|
46
|
-
/**
|
|
47
|
-
* [Fumadocs MDX] additional ESM exports to write
|
|
48
|
-
*/
|
|
49
|
-
'mdx-export'?: {
|
|
50
|
-
name: string;
|
|
51
|
-
value: unknown;
|
|
52
|
-
}[];
|
|
53
|
-
/**
|
|
54
|
-
* [Fumadocs MDX] The compiler object from loader
|
|
55
|
-
*/
|
|
56
|
-
_compiler?: CompilerOptions;
|
|
57
|
-
/**
|
|
58
|
-
* [Fumadocs MDX] get internal processor, do not use this on user land.
|
|
59
|
-
*/
|
|
60
|
-
_getProcessor?: (format: 'md' | 'mdx') => Processor;
|
|
61
|
-
}
|
|
62
|
-
declare module 'vfile' {
|
|
63
|
-
interface DataMap extends FumadocsDataMap {
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface FileInfo {
|
|
68
|
-
/**
|
|
69
|
-
* virtualized path for Source API
|
|
70
|
-
*/
|
|
71
|
-
path: string;
|
|
72
|
-
/**
|
|
73
|
-
* the file path in file system
|
|
74
|
-
*/
|
|
75
|
-
fullPath: string;
|
|
76
|
-
}
|
|
77
|
-
interface DocData {
|
|
78
|
-
/**
|
|
79
|
-
* Compiled MDX content (as component)
|
|
80
|
-
*/
|
|
81
|
-
body: MDXContent;
|
|
82
|
-
/**
|
|
83
|
-
* table of contents generated from content.
|
|
84
|
-
*/
|
|
85
|
-
toc: TOCItemType[];
|
|
86
|
-
/**
|
|
87
|
-
* structured data for document search indexing.
|
|
88
|
-
*/
|
|
89
|
-
structuredData: StructuredData;
|
|
90
|
-
/**
|
|
91
|
-
* Raw exports from the compiled MDX file.
|
|
92
|
-
*/
|
|
93
|
-
_exports: Record<string, unknown>;
|
|
94
|
-
/**
|
|
95
|
-
* Last modified date of document file, obtained from version control.
|
|
96
|
-
*
|
|
97
|
-
* Added by the `last-modified` plugin.
|
|
98
|
-
*/
|
|
99
|
-
lastModified?: Date;
|
|
100
|
-
/**
|
|
101
|
-
* extracted references (e.g. hrefs, paths), useful for analyzing relationships between pages.
|
|
102
|
-
*/
|
|
103
|
-
extractedReferences?: ExtractedReference[];
|
|
104
|
-
}
|
|
105
|
-
interface DocMethods {
|
|
106
|
-
/**
|
|
107
|
-
* file info
|
|
108
|
-
*/
|
|
109
|
-
info: FileInfo;
|
|
110
|
-
/**
|
|
111
|
-
* get document as text.
|
|
112
|
-
*
|
|
113
|
-
* - `type: raw` - read the original content from file system.
|
|
114
|
-
* - `type: processed` - get the processed Markdown content, only available when `includeProcessedMarkdown` is enabled on collection config.
|
|
115
|
-
*/
|
|
116
|
-
getText: (type: 'raw' | 'processed') => Promise<string>;
|
|
117
|
-
getMDAST: () => Promise<Root>;
|
|
118
|
-
}
|
|
119
|
-
interface MetaMethods {
|
|
120
|
-
/**
|
|
121
|
-
* file info
|
|
122
|
-
*/
|
|
123
|
-
info: FileInfo;
|
|
124
|
-
}
|
|
125
|
-
type MetaCollectionEntry<Data> = Data & MetaMethods;
|
|
126
|
-
type DocCollectionEntry<Frontmatter> = DocData & DocMethods & Frontmatter;
|
|
127
|
-
type AsyncDocCollectionEntry<Frontmatter> = DocMethods & {
|
|
128
|
-
load: () => Promise<DocData>;
|
|
129
|
-
} & Frontmatter;
|
|
130
|
-
type CompiledMDXFile<Frontmatter> = CompiledMDXProperties<Frontmatter> & Record<string, unknown>;
|
|
131
|
-
interface DocsCollectionEntry<Frontmatter extends PageData, Meta extends MetaData> {
|
|
132
|
-
docs: DocCollectionEntry<Frontmatter>[];
|
|
133
|
-
meta: MetaCollectionEntry<Meta>[];
|
|
134
|
-
toFumadocsSource: () => Source<{
|
|
135
|
-
pageData: DocCollectionEntry<Frontmatter>;
|
|
136
|
-
metaData: MetaCollectionEntry<Meta>;
|
|
137
|
-
}>;
|
|
138
|
-
}
|
|
139
|
-
interface AsyncDocsCollectionEntry<Frontmatter extends PageData, Meta extends MetaData> {
|
|
140
|
-
docs: AsyncDocCollectionEntry<Frontmatter>[];
|
|
141
|
-
meta: MetaCollectionEntry<Meta>[];
|
|
142
|
-
toFumadocsSource: () => Source<{
|
|
143
|
-
pageData: AsyncDocCollectionEntry<Frontmatter>;
|
|
144
|
-
metaData: MetaCollectionEntry<Meta>;
|
|
145
|
-
}>;
|
|
146
|
-
}
|
|
147
|
-
type AwaitableGlobEntries<T> = Record<string, T | (() => Promise<T>)>;
|
|
148
|
-
type ServerCreate<Config> = ReturnType<typeof fromConfig<Config>>;
|
|
149
|
-
declare function fromConfig<Config>(): {
|
|
150
|
-
doc<Name extends keyof Config>(_name: Name, base: string, glob: AwaitableGlobEntries<unknown>): Promise<Config[Name] extends DocCollection<infer Schema extends StandardSchemaV1<unknown, unknown>> | DocsCollection<infer Schema extends StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>> ? DocCollectionEntry<StandardSchemaV1.InferOutput<Schema>>[] : never>;
|
|
151
|
-
docLazy<Name extends keyof Config>(_name: Name, base: string, head: AwaitableGlobEntries<unknown>, body: Record<string, () => Promise<unknown>>): Promise<Config[Name] extends DocCollection<infer Schema extends StandardSchemaV1<unknown, unknown>> | DocsCollection<infer Schema extends StandardSchemaV1<unknown, unknown>, StandardSchemaV1<unknown, unknown>> ? AsyncDocCollectionEntry<StandardSchemaV1.InferOutput<Schema>>[] : never>;
|
|
152
|
-
meta<Name extends keyof Config>(_name: Name, base: string, glob: AwaitableGlobEntries<unknown>): Promise<Config[Name] extends MetaCollection<infer Schema extends StandardSchemaV1<unknown, unknown>> | DocsCollection<StandardSchemaV1<unknown, unknown>, infer Schema extends StandardSchemaV1<unknown, unknown>> ? MetaCollectionEntry<StandardSchemaV1.InferOutput<Schema>>[] : never>;
|
|
153
|
-
docs<Name extends keyof Config>(name: Name, base: string, metaGlob: AwaitableGlobEntries<unknown>, docGlob: AwaitableGlobEntries<unknown>): Promise<Config[Name] extends DocsCollection<infer Page extends StandardSchemaV1<unknown, unknown>, infer Meta extends StandardSchemaV1<unknown, unknown>> ? StandardSchemaV1.InferOutput<Page> extends PageData ? StandardSchemaV1.InferOutput<Meta> extends MetaData ? DocsCollectionEntry<StandardSchemaV1.InferOutput<Page>, StandardSchemaV1.InferOutput<Meta>> : never : never : never>;
|
|
154
|
-
docsLazy<Name extends keyof Config>(name: Name, base: string, metaGlob: AwaitableGlobEntries<unknown>, docHeadGlob: AwaitableGlobEntries<unknown>, docBodyGlob: Record<string, () => Promise<unknown>>): Promise<Config[Name] extends DocsCollection<infer Page extends StandardSchemaV1<unknown, unknown>, infer Meta extends StandardSchemaV1<unknown, unknown>> ? StandardSchemaV1.InferOutput<Page> extends PageData ? StandardSchemaV1.InferOutput<Meta> extends MetaData ? AsyncDocsCollectionEntry<StandardSchemaV1.InferOutput<Page>, StandardSchemaV1.InferOutput<Meta>> : never : never : never>;
|
|
155
|
-
};
|
|
156
|
-
declare function toFumadocsSource<Page extends DocMethods & PageData, Meta extends MetaMethods & MetaData>(pages: Page[], metas: Meta[]): Source<{
|
|
157
|
-
pageData: Page;
|
|
158
|
-
metaData: Meta;
|
|
159
|
-
}>;
|
|
160
|
-
|
|
161
|
-
export { type AsyncDocCollectionEntry, type AsyncDocsCollectionEntry, type CompiledMDXFile, type DocCollectionEntry, type DocData, type DocMethods, type DocsCollectionEntry, type FileInfo, type MetaCollectionEntry, type MetaMethods, type ServerCreate, fromConfig, toFumadocsSource };
|