UNPKG

svelte-markdown-pages

Version:

Build and render markdown-based content with distributed navigation for Svelte projects

111 lines (108 loc) 3.02 kB
import { z } from 'zod'; declare const DocItemTypeSchema: z.ZodEnum<["section", "page"]>; declare const DocItemSchema: z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<["section", "page"]>; label: z.ZodString; collapsed: z.ZodOptional<z.ZodBoolean>; url: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { name: string; type: "section" | "page"; label: string; collapsed?: boolean | undefined; url?: string | undefined; }, { name: string; type: "section" | "page"; label: string; collapsed?: boolean | undefined; url?: string | undefined; }>; declare const IndexSchema: z.ZodObject<{ items: z.ZodArray<z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<["section", "page"]>; label: z.ZodString; collapsed: z.ZodOptional<z.ZodBoolean>; url: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { name: string; type: "section" | "page"; label: string; collapsed?: boolean | undefined; url?: string | undefined; }, { name: string; type: "section" | "page"; label: string; collapsed?: boolean | undefined; url?: string | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { items: { name: string; type: "section" | "page"; label: string; collapsed?: boolean | undefined; url?: string | undefined; }[]; }, { items: { name: string; type: "section" | "page"; label: string; collapsed?: boolean | undefined; url?: string | undefined; }[]; }>; type DocItem = z.infer<typeof DocItemSchema>; type IndexFile = z.infer<typeof IndexSchema>; interface NavigationItem extends DocItem { path?: string; items?: NavigationItem[]; parent?: NavigationItem | undefined; } interface NavigationTree { items: NavigationItem[]; } interface BuildOptions { appOutput?: string; websiteOutput?: string; staticOutput?: string; includeContent?: boolean; autoDiscover?: boolean; } interface BuildResult { navigation: NavigationTree; content?: Record<string, string> | undefined; pages?: Array<{ path: string; content: string; html: string; }> | undefined; } interface ContentProcessor { process(content: string): string; } interface ContentProcessorOptional { process(content: string): string; } interface StaticPageOptions { title?: string; baseUrl?: string; css?: string; js?: string; } interface StaticSiteResult { pages: Array<{ path: string; content: string; html: string; }>; index?: { path: string; html: string; } | undefined; } export { type BuildOptions, type BuildResult, type ContentProcessor, type ContentProcessorOptional, type DocItem, DocItemSchema, DocItemTypeSchema, type IndexFile, IndexSchema, type NavigationItem, type NavigationTree, type StaticPageOptions, type StaticSiteResult };