@slidev/parser 51.6.1 → 51.6.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.
@@ -0,0 +1,402 @@
1
+ import { parseAspectRatio } from "./utils-CLLoIRbA.mjs";
2
+ import { ensurePrefix, toArray, uniq } from "@antfu/utils";
3
+ import YAML from "yaml";
4
+
5
+ //#region src/config.ts
6
+ function getDefaultConfig() {
7
+ return {
8
+ theme: "default",
9
+ title: "Slidev",
10
+ titleTemplate: "%s - Slidev",
11
+ addons: [],
12
+ remoteAssets: false,
13
+ monaco: true,
14
+ monacoTypesSource: "local",
15
+ monacoTypesAdditionalPackages: [],
16
+ monacoTypesIgnorePackages: [],
17
+ monacoRunAdditionalDeps: [],
18
+ download: false,
19
+ export: {},
20
+ info: false,
21
+ highlighter: "shiki",
22
+ twoslash: true,
23
+ lineNumbers: false,
24
+ colorSchema: "auto",
25
+ routerMode: "history",
26
+ aspectRatio: 16 / 9,
27
+ canvasWidth: 980,
28
+ exportFilename: "",
29
+ selectable: false,
30
+ themeConfig: {},
31
+ fonts: {},
32
+ favicon: "https://cdn.jsdelivr.net/gh/slidevjs/slidev/assets/favicon.png",
33
+ drawings: {},
34
+ plantUmlServer: "https://www.plantuml.com/plantuml",
35
+ codeCopy: true,
36
+ author: "",
37
+ record: "dev",
38
+ css: "unocss",
39
+ presenter: true,
40
+ browserExporter: "dev",
41
+ htmlAttrs: {},
42
+ transition: null,
43
+ editor: true,
44
+ contextMenu: null,
45
+ wakeLock: true,
46
+ remote: false,
47
+ mdc: false,
48
+ seoMeta: {}
49
+ };
50
+ }
51
+ function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
52
+ const themeHightlighter = [
53
+ "prism",
54
+ "shiki",
55
+ "shikiji"
56
+ ].includes(themeMeta.highlighter || "") ? themeMeta.highlighter : void 0;
57
+ const themeColorSchema = ["light", "dark"].includes(themeMeta.colorSchema || "") ? themeMeta.colorSchema : void 0;
58
+ const defaultConfig = getDefaultConfig();
59
+ const config = {
60
+ ...defaultConfig,
61
+ highlighter: themeHightlighter || defaultConfig.highlighter,
62
+ colorSchema: themeColorSchema || defaultConfig.colorSchema,
63
+ ...themeMeta.defaults,
64
+ ...headmatter.config,
65
+ ...headmatter,
66
+ fonts: resolveFonts({
67
+ ...themeMeta.defaults?.fonts,
68
+ ...headmatter.config?.fonts,
69
+ ...headmatter?.fonts
70
+ }),
71
+ drawings: resolveDrawings(headmatter.drawings, filepath),
72
+ htmlAttrs: {
73
+ ...themeMeta.defaults?.htmlAttrs,
74
+ ...headmatter.config?.htmlAttrs,
75
+ ...headmatter?.htmlAttrs
76
+ }
77
+ };
78
+ if (config.highlighter === "shikiji") {
79
+ console.warn(`[slidev] "shikiji" is merged back to "shiki", you can safely change it "highlighter: shiki"`);
80
+ config.highlighter = "shiki";
81
+ }
82
+ if (config.highlighter === "prism") throw new Error(`[slidev] "prism" support has been dropped. Please use "highlighter: shiki" instead`);
83
+ if (config.colorSchema !== "dark" && config.colorSchema !== "light") config.colorSchema = "auto";
84
+ if (themeColorSchema && config.colorSchema === "auto") config.colorSchema = themeColorSchema;
85
+ config.aspectRatio = parseAspectRatio(config.aspectRatio);
86
+ if (verify) verifyConfig(config, themeMeta);
87
+ return config;
88
+ }
89
+ function verifyConfig(config, themeMeta = {}, warn = (v) => console.warn(`[slidev] ${v}`)) {
90
+ const themeHightlighter = themeMeta.highlighter === "shiki" ? themeMeta.highlighter : void 0;
91
+ const themeColorSchema = ["light", "dark"].includes(themeMeta.colorSchema || "") ? themeMeta.colorSchema : void 0;
92
+ if (themeColorSchema && config.colorSchema !== themeColorSchema) warn(`Color schema "${config.colorSchema}" does not supported by the theme`);
93
+ if (themeHightlighter && config.highlighter !== themeHightlighter) warn(`Syntax highlighter "${config.highlighter}" does not supported by the theme`);
94
+ if (config.css !== "unocss") {
95
+ warn(`Unsupported Atomic CSS engine "${config.css}", fallback to UnoCSS`);
96
+ config.css = "unocss";
97
+ }
98
+ }
99
+ function resolveFonts(fonts = {}) {
100
+ const { fallbacks = true, italic = false, provider = "google" } = fonts;
101
+ let sans = toArray(fonts.sans).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
102
+ let serif = toArray(fonts.serif).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
103
+ let mono = toArray(fonts.mono).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
104
+ const weights = toArray(fonts.weights || "200,400,600").flatMap((i) => i.toString().split(/,\s*/g)).map((i) => i.trim());
105
+ const custom = toArray(fonts.custom).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
106
+ const local = toArray(fonts.local).flatMap((i) => i.split(/,\s*/g)).map((i) => i.trim());
107
+ const webfonts = fonts.webfonts ? fonts.webfonts : fallbacks ? uniq([
108
+ ...sans,
109
+ ...serif,
110
+ ...mono,
111
+ ...custom
112
+ ]) : [];
113
+ webfonts.filter((i) => local.includes(i));
114
+ function toQuoted(font) {
115
+ if (/^(['"]).*\1$/.test(font)) return font;
116
+ return `"${font}"`;
117
+ }
118
+ if (fallbacks) {
119
+ sans = uniq([
120
+ ...sans.map(toQuoted),
121
+ "ui-sans-serif",
122
+ "system-ui",
123
+ "-apple-system",
124
+ "BlinkMacSystemFont",
125
+ "\"Segoe UI\"",
126
+ "Roboto",
127
+ "\"Helvetica Neue\"",
128
+ "Arial",
129
+ "\"Noto Sans\"",
130
+ "sans-serif",
131
+ "\"Apple Color Emoji\"",
132
+ "\"Segoe UI Emoji\"",
133
+ "\"Segoe UI Symbol\"",
134
+ "\"Noto Color Emoji\""
135
+ ]);
136
+ serif = uniq([
137
+ ...serif.map(toQuoted),
138
+ "ui-serif",
139
+ "Georgia",
140
+ "Cambria",
141
+ "\"Times New Roman\"",
142
+ "Times",
143
+ "serif"
144
+ ]);
145
+ mono = uniq([
146
+ ...mono.map(toQuoted),
147
+ "ui-monospace",
148
+ "SFMono-Regular",
149
+ "Menlo",
150
+ "Monaco",
151
+ "Consolas",
152
+ "\"Liberation Mono\"",
153
+ "\"Courier New\"",
154
+ "monospace"
155
+ ]);
156
+ }
157
+ return {
158
+ sans,
159
+ serif,
160
+ mono,
161
+ webfonts,
162
+ provider,
163
+ local,
164
+ italic,
165
+ weights
166
+ };
167
+ }
168
+ function resolveDrawings(options = {}, filepath) {
169
+ const { enabled = true, persist = false, presenterOnly = false, syncAll = true } = options;
170
+ const persistPath = typeof persist === "string" ? persist : persist ? `.slidev/drawings${filepath ? `/${filepath.match(/([^\\/]+?)(\.\w+)?$/)?.[1]}` : ""}` : false;
171
+ return {
172
+ enabled,
173
+ persist: persistPath,
174
+ presenterOnly,
175
+ syncAll
176
+ };
177
+ }
178
+
179
+ //#endregion
180
+ //#region src/core.ts
181
+ function stringify(data) {
182
+ return `${data.slides.map(stringifySlide).join("\n").trim()}\n`;
183
+ }
184
+ function stringifySlide(data, idx = 0) {
185
+ return data.raw.startsWith("---") || idx === 0 ? data.raw : `---\n${ensurePrefix("\n", data.raw)}`;
186
+ }
187
+ function prettifySlide(data) {
188
+ const trimed = data.content.trim();
189
+ data.content = trimed ? `\n${data.content.trim()}\n` : "";
190
+ data.raw = data.frontmatterDoc?.contents ? data.frontmatterStyle === "yaml" ? `\`\`\`yaml\n${data.frontmatterDoc.toString().trim()}\n\`\`\`\n${data.content}` : `---\n${data.frontmatterDoc.toString().trim()}\n---\n${data.content}` : data.content;
191
+ if (data.note) data.raw += `\n<!--\n${data.note.trim()}\n-->\n`;
192
+ return data;
193
+ }
194
+ function prettify(data) {
195
+ data.slides.forEach(prettifySlide);
196
+ return data;
197
+ }
198
+ function matter(code, options) {
199
+ let type;
200
+ let raw;
201
+ let content = code.replace(/^---.*\r?\n([\s\S]*?)---/, (_, f) => {
202
+ type = "frontmatter";
203
+ raw = f;
204
+ return "";
205
+ });
206
+ if (type !== "frontmatter") content = content.replace(/^\s*```ya?ml([\s\S]*?)```/, (_, f) => {
207
+ type = "yaml";
208
+ raw = f;
209
+ return "";
210
+ });
211
+ const doc = raw && !options.noParseYAML ? YAML.parseDocument(raw) : void 0;
212
+ return {
213
+ type,
214
+ raw,
215
+ doc,
216
+ data: doc?.toJSON(),
217
+ content
218
+ };
219
+ }
220
+ function detectFeatures(code) {
221
+ return {
222
+ katex: !!code.match(/\$.*?\$/) || !!code.match(/\$\$/),
223
+ monaco: code.match(/\{monaco.*\}/) ? scanMonacoReferencedMods(code) : false,
224
+ tweet: !!code.match(/<Tweet\b/),
225
+ mermaid: !!code.match(/^```mermaid/m)
226
+ };
227
+ }
228
+ function parseSlide(raw, options = {}) {
229
+ const matterResult = matter(raw, options);
230
+ let note;
231
+ const frontmatter = matterResult.data || {};
232
+ let content = matterResult.content.trim();
233
+ const revision = hash(raw.trim());
234
+ const comments = Array.from(content.matchAll(/<!--([\s\S]*?)-->/g));
235
+ if (comments.length) {
236
+ const last = comments[comments.length - 1];
237
+ if (last.index !== void 0 && last.index + last[0].length >= content.length) {
238
+ note = last[1].trim();
239
+ content = content.slice(0, last.index).trim();
240
+ }
241
+ }
242
+ let title;
243
+ let level;
244
+ if (frontmatter.title || frontmatter.name) title = frontmatter.title || frontmatter.name;
245
+ else {
246
+ const match = content.match(/^(#+) (.*)$/m);
247
+ title = match?.[2]?.trim();
248
+ level = match?.[1]?.length;
249
+ }
250
+ if (frontmatter.level) level = frontmatter.level || 1;
251
+ return {
252
+ raw,
253
+ title,
254
+ level,
255
+ revision,
256
+ content,
257
+ contentRaw: content,
258
+ frontmatter,
259
+ frontmatterStyle: matterResult.type,
260
+ frontmatterDoc: matterResult.doc,
261
+ frontmatterRaw: matterResult.raw,
262
+ note
263
+ };
264
+ }
265
+ async function parse(markdown, filepath, extensions, options = {}) {
266
+ const lines = markdown.split(options.preserveCR ? "\n" : /\r?\n/g);
267
+ const slides = [];
268
+ let start = 0;
269
+ let contentStart = 0;
270
+ async function slice(end) {
271
+ if (start === end) return;
272
+ const raw = lines.slice(start, end).join("\n");
273
+ const slide = {
274
+ ...parseSlide(raw, options),
275
+ filepath,
276
+ index: slides.length,
277
+ start,
278
+ contentStart,
279
+ end
280
+ };
281
+ if (extensions) for (const e of extensions) {
282
+ if (e.transformSlide) {
283
+ const newContent = await e.transformSlide(slide.content, slide.frontmatter);
284
+ if (newContent !== void 0) slide.content = newContent;
285
+ if (typeof slide.frontmatter.title === "string") slide.title = slide.frontmatter.title;
286
+ if (typeof slide.frontmatter.level === "number") slide.level = slide.frontmatter.level;
287
+ }
288
+ if (e.transformNote) {
289
+ const newNote = await e.transformNote(slide.note, slide.frontmatter);
290
+ if (newNote !== void 0) slide.note = newNote;
291
+ }
292
+ }
293
+ slides.push(slide);
294
+ start = end + 1;
295
+ contentStart = end + 1;
296
+ }
297
+ if (extensions) {
298
+ for (const e of extensions) if (e.transformRawLines) await e.transformRawLines(lines);
299
+ }
300
+ for (let i = 0; i < lines.length; i++) {
301
+ const line = lines[i].trimEnd();
302
+ if (line.startsWith("---")) {
303
+ await slice(i);
304
+ const next = lines[i + 1];
305
+ if (line[3] !== "-" && next?.trim()) {
306
+ start = i;
307
+ for (i += 1; i < lines.length; i++) if (lines[i].trimEnd() === "---") break;
308
+ contentStart = i + 1;
309
+ }
310
+ } else if (line.trimStart().startsWith("```")) {
311
+ const codeBlockLevel = line.match(/^\s*`+/)[0];
312
+ let j = i + 1;
313
+ for (; j < lines.length; j++) if (lines[j].startsWith(codeBlockLevel)) break;
314
+ if (j !== lines.length) i = j;
315
+ }
316
+ }
317
+ if (start <= lines.length - 1) await slice(lines.length);
318
+ return {
319
+ filepath,
320
+ raw: markdown,
321
+ slides
322
+ };
323
+ }
324
+ function parseSync(markdown, filepath, options = {}) {
325
+ const lines = markdown.split(options.preserveCR ? "\n" : /\r?\n/g);
326
+ const slides = [];
327
+ let start = 0;
328
+ let contentStart = 0;
329
+ function slice(end) {
330
+ if (start === end) return;
331
+ const raw = lines.slice(start, end).join("\n");
332
+ const slide = {
333
+ ...parseSlide(raw, options),
334
+ filepath,
335
+ index: slides.length,
336
+ start,
337
+ contentStart,
338
+ end
339
+ };
340
+ slides.push(slide);
341
+ start = end + 1;
342
+ contentStart = end + 1;
343
+ }
344
+ for (let i = 0; i < lines.length; i++) {
345
+ const line = lines[i].trimEnd();
346
+ if (line.startsWith("---")) {
347
+ slice(i);
348
+ const next = lines[i + 1];
349
+ if (line[3] !== "-" && next?.trim()) {
350
+ start = i;
351
+ for (i += 1; i < lines.length; i++) if (lines[i].trimEnd() === "---") break;
352
+ contentStart = i + 1;
353
+ }
354
+ } else if (line.trimStart().startsWith("```")) {
355
+ const codeBlockLevel = line.match(/^\s*`+/)[0];
356
+ let j = i + 1;
357
+ for (; j < lines.length; j++) if (lines[j].startsWith(codeBlockLevel)) break;
358
+ if (j !== lines.length) i = j;
359
+ }
360
+ }
361
+ if (start <= lines.length - 1) slice(lines.length);
362
+ return {
363
+ filepath,
364
+ raw: markdown,
365
+ slides
366
+ };
367
+ }
368
+ function scanMonacoReferencedMods(md) {
369
+ const types = new Set();
370
+ const deps = new Set();
371
+ md.replace(/^```(\w+)\s*\{monaco([^}]*)\}\s*(\S[\s\S]*?)^```/gm, (full, lang = "ts", kind, code) => {
372
+ lang = lang.trim();
373
+ const isDep = kind === "-run";
374
+ if ([
375
+ "js",
376
+ "javascript",
377
+ "ts",
378
+ "typescript"
379
+ ].includes(lang)) {
380
+ for (const [, , specifier] of code.matchAll(/\s+from\s+(["'])([/.\w@-]+)\1/g)) if (specifier) {
381
+ if (!"./".includes(specifier)) types.add(specifier);
382
+ if (isDep) deps.add(specifier);
383
+ }
384
+ }
385
+ return "";
386
+ });
387
+ return {
388
+ types: Array.from(types),
389
+ deps: Array.from(deps)
390
+ };
391
+ }
392
+ function hash(str) {
393
+ let hash$1 = 0;
394
+ for (let i = 0; i < str.length; i++) {
395
+ hash$1 = (hash$1 << 5) - hash$1 + str.charCodeAt(i);
396
+ hash$1 |= 0;
397
+ }
398
+ return hash$1.toString(36).slice(0, 12);
399
+ }
400
+
401
+ //#endregion
402
+ export { detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig };
@@ -0,0 +1,25 @@
1
+ import { FontOptions, ResolvedFontOptions, SlidevConfig, SlidevDetectedFeatures, SlidevMarkdown, SlidevPreparserExtension, SlidevThemeMeta, SourceSlideInfo } from "@slidev/types";
2
+
3
+ //#region src/config.d.ts
4
+ declare function getDefaultConfig(): SlidevConfig;
5
+ declare function resolveConfig(headmatter: any, themeMeta?: SlidevThemeMeta, filepath?: string, verify?: boolean): SlidevConfig;
6
+ declare function verifyConfig(config: SlidevConfig, themeMeta?: SlidevThemeMeta, warn?: (v: string) => void): void;
7
+ declare function resolveFonts(fonts?: FontOptions): ResolvedFontOptions;
8
+
9
+ //#endregion
10
+ //#region src/core.d.ts
11
+ interface SlidevParserOptions {
12
+ noParseYAML?: boolean;
13
+ preserveCR?: boolean;
14
+ }
15
+ declare function stringify(data: SlidevMarkdown): string;
16
+ declare function stringifySlide(data: SourceSlideInfo, idx?: number): string;
17
+ declare function prettifySlide(data: SourceSlideInfo): SourceSlideInfo;
18
+ declare function prettify(data: SlidevMarkdown): SlidevMarkdown;
19
+ declare function detectFeatures(code: string): SlidevDetectedFeatures;
20
+ declare function parseSlide(raw: string, options?: SlidevParserOptions): Omit<SourceSlideInfo, 'filepath' | 'index' | 'start' | 'contentStart' | 'end'>;
21
+ declare function parse(markdown: string, filepath: string, extensions?: SlidevPreparserExtension[], options?: SlidevParserOptions): Promise<SlidevMarkdown>;
22
+ declare function parseSync(markdown: string, filepath: string, options?: SlidevParserOptions): SlidevMarkdown;
23
+
24
+ //#endregion
25
+ export { SlidevParserOptions, detectFeatures as detectFeatures$1, getDefaultConfig as getDefaultConfig$1, parse as parse$1, parseSlide as parseSlide$1, parseSync as parseSync$1, prettify as prettify$1, prettifySlide as prettifySlide$1, resolveConfig as resolveConfig$1, resolveFonts as resolveFonts$1, stringify as stringify$1, stringifySlide as stringifySlide$1, verifyConfig as verifyConfig$1 };
package/dist/core.d.mts CHANGED
@@ -1,22 +1,3 @@
1
- import { SlidevConfig, SlidevThemeMeta, FontOptions, ResolvedFontOptions, SlidevMarkdown, SourceSlideInfo, SlidevDetectedFeatures, SlidevPreparserExtension } from '@slidev/types';
2
- export { parseAspectRatio, parseRangeString } from './utils.mjs';
3
-
4
- declare function getDefaultConfig(): SlidevConfig;
5
- declare function resolveConfig(headmatter: any, themeMeta?: SlidevThemeMeta, filepath?: string, verify?: boolean): SlidevConfig;
6
- declare function verifyConfig(config: SlidevConfig, themeMeta?: SlidevThemeMeta, warn?: (v: string) => void): void;
7
- declare function resolveFonts(fonts?: FontOptions): ResolvedFontOptions;
8
-
9
- interface SlidevParserOptions {
10
- noParseYAML?: boolean;
11
- preserveCR?: boolean;
12
- }
13
- declare function stringify(data: SlidevMarkdown): string;
14
- declare function stringifySlide(data: SourceSlideInfo, idx?: number): string;
15
- declare function prettifySlide(data: SourceSlideInfo): SourceSlideInfo;
16
- declare function prettify(data: SlidevMarkdown): SlidevMarkdown;
17
- declare function detectFeatures(code: string): SlidevDetectedFeatures;
18
- declare function parseSlide(raw: string, options?: SlidevParserOptions): Omit<SourceSlideInfo, 'filepath' | 'index' | 'start' | 'contentStart' | 'end'>;
19
- declare function parse(markdown: string, filepath: string, extensions?: SlidevPreparserExtension[], options?: SlidevParserOptions): Promise<SlidevMarkdown>;
20
- declare function parseSync(markdown: string, filepath: string, options?: SlidevParserOptions): SlidevMarkdown;
21
-
22
- export { type SlidevParserOptions, detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig };
1
+ import { SlidevParserOptions, detectFeatures$1 as detectFeatures, getDefaultConfig$1 as getDefaultConfig, parse$1 as parse, parseSlide$1 as parseSlide, parseSync$1 as parseSync, prettify$1 as prettify, prettifySlide$1 as prettifySlide, resolveConfig$1 as resolveConfig, resolveFonts$1 as resolveFonts, stringify$1 as stringify, stringifySlide$1 as stringifySlide, verifyConfig$1 as verifyConfig } from "./core-S2rX0Zs8.mjs";
2
+ import { parseAspectRatio$1 as parseAspectRatio, parseRangeString$1 as parseRangeString } from "./utils-DHlj88Gz.mjs";
3
+ export { SlidevParserOptions, detectFeatures, getDefaultConfig, parse, parseAspectRatio, parseRangeString, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig };
package/dist/core.mjs CHANGED
@@ -1,34 +1,4 @@
1
- import {
2
- detectFeatures,
3
- getDefaultConfig,
4
- parse,
5
- parseSlide,
6
- parseSync,
7
- prettify,
8
- prettifySlide,
9
- resolveConfig,
10
- resolveFonts,
11
- stringify,
12
- stringifySlide,
13
- verifyConfig
14
- } from "./chunk-SIS7SDEP.mjs";
15
- import {
16
- parseAspectRatio,
17
- parseRangeString
18
- } from "./chunk-47YLTX76.mjs";
19
- export {
20
- detectFeatures,
21
- getDefaultConfig,
22
- parse,
23
- parseAspectRatio,
24
- parseRangeString,
25
- parseSlide,
26
- parseSync,
27
- prettify,
28
- prettifySlide,
29
- resolveConfig,
30
- resolveFonts,
31
- stringify,
32
- stringifySlide,
33
- verifyConfig
34
- };
1
+ import { parseAspectRatio, parseRangeString } from "./utils-CLLoIRbA.mjs";
2
+ import { detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig } from "./core-CHLjwsGZ.mjs";
3
+
4
+ export { detectFeatures, getDefaultConfig, parse, parseAspectRatio, parseRangeString, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig };
package/dist/fs.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- import { PreparserExtensionLoader, SlidevData, SlidevMarkdown } from '@slidev/types';
2
- export { SlidevParserOptions, detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig } from './core.mjs';
3
- export { parseAspectRatio, parseRangeString } from './utils.mjs';
1
+ import { SlidevParserOptions, detectFeatures$1 as detectFeatures, getDefaultConfig$1 as getDefaultConfig, parse$1 as parse, parseSlide$1 as parseSlide, parseSync$1 as parseSync, prettify$1 as prettify, prettifySlide$1 as prettifySlide, resolveConfig$1 as resolveConfig, resolveFonts$1 as resolveFonts, stringify$1 as stringify, stringifySlide$1 as stringifySlide, verifyConfig$1 as verifyConfig } from "./core-S2rX0Zs8.mjs";
2
+ import { parseAspectRatio$1 as parseAspectRatio, parseRangeString$1 as parseRangeString } from "./utils-DHlj88Gz.mjs";
3
+ import { PreparserExtensionLoader, SlidevData, SlidevMarkdown } from "@slidev/types";
4
4
 
5
+ //#region src/fs.d.ts
5
6
  declare function injectPreparserExtensionLoader(fn: PreparserExtensionLoader): void;
6
7
  /**
7
8
  * Slidev data without config and themeMeta,
@@ -11,4 +12,5 @@ type LoadedSlidevData = Omit<SlidevData, 'config' | 'themeMeta'>;
11
12
  declare function load(userRoot: string, filepath: string, loadedSource?: Record<string, string>, mode?: string): Promise<LoadedSlidevData>;
12
13
  declare function save(markdown: SlidevMarkdown): Promise<string>;
13
14
 
14
- export { type LoadedSlidevData, injectPreparserExtensionLoader, load, save };
15
+ //#endregion
16
+ export { LoadedSlidevData, SlidevParserOptions, detectFeatures, getDefaultConfig, injectPreparserExtensionLoader, load, parse, parseAspectRatio, parseRangeString, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, save, stringify, stringifySlide, verifyConfig };