import { Heading as Heading$1 } from 'mdast'; import { Metadata } from 'next'; import { ReactElement, FC, ReactNode } from 'react'; import { z } from 'zod'; import { NextraConfigSchema, MathJaxOptionsSchema, metaSchema, separatorItemSchema, menuSchema } from './server/schemas.js'; export { NextraConfig } from './types.generated.js'; import './lib/index.js'; import 'rehype-katex/lib/index.js'; import 'better-react-mathjax'; import 'rehype-pretty-code'; import '@mdx-js/mdx'; import 'rehype-katex'; type NextraConfigFromZod = z.infer; interface LoaderOptions extends NextraConfigFromZod { isPageImport?: boolean; locales: string[]; contentDir?: string; shouldAddLocaleToLinks?: boolean; } type TPageItem = { name: string; route: string; __pagePath: string; }; type TMetaItem = { __metaPath: string; }; interface TFolder { name: string; route: string; children: T[]; } type TItem = TPageItem | TMetaItem | TFolder; interface Folder { name: string; route: string; children: FileType[]; } type Import = { importName: string; filePath: string; }; type MetaJsonFile = { data: { [fileName: string]: Meta; }; }; type DynamicFolder = { items: DynamicMeta; title?: string; }; type DynamicMetaItem = Meta | DynamicFolder; type DynamicMeta = Record; type FrontMatter = Record; type Meta = string | Record; type MdxFile = { name: string; route: string; frontMatter?: FrontMatterType; }; type PageMapItem = Folder | MdxFile | MetaJsonFile; type Page = (MdxFile | Folder) & { meta?: Exclude; }; type Heading = { depth: Exclude; value: string | ReactElement; id: string; }; type $NextraMetadata = Omit & { title: string; filePath: string; timestamp?: number; readingTime?: ReadingTime; }; type ReadingTime = { text: string; minutes: number; time: number; words: number; }; type MathJaxOptions = z.infer; type MDXWrapper = FC<{ children: ReactNode; bottomContent?: ReactNode; } & Omit>; type MetaRecord = Record>; type SeparatorItem = z.infer; type MenuItem = z.infer; /** * Options that can be passed to `pagefind.search()`. * @remarks Copied from https://github.com/CloudCannon/pagefind/blob/2a0aa90cfb78bb8551645ac9127a1cd49cf54add/pagefind_web_js/types/index.d.ts#L72-L82 */ type PagefindSearchOptions = { /** * If set, this call will load all assets but return before searching. Prefer using `pagefind.preload()` instead. */ preload?: boolean; /** * Add more verbose console logging for this search query. */ verbose?: boolean; /** * The set of filters to execute with this search. Input type is extremely flexible, see the filtering docs for details. */ filters?: object; /** * The set of sorts to use for this search, instead of relevancy. */ sort?: object; }; type NextraMetadata = Metadata & { asIndexPage?: boolean; sidebarTitle?: string; }; type EvaluateResult = { /** The MDX component to render. */ default: FC; /** Table of contents list. */ toc: Heading[]; /** Page's front matter or `metadata` object including `title`, `description`, etc. */ metadata: $NextraMetadata; /** Raw MDX source code */ sourceCode: string; }; export type { $NextraMetadata, DynamicFolder, DynamicMeta, DynamicMetaItem, EvaluateResult, Folder, FrontMatter, Heading, Import, LoaderOptions, MDXWrapper, MathJaxOptions, MdxFile, MenuItem, Meta, MetaJsonFile, MetaRecord, NextraMetadata, Page, PageMapItem, PagefindSearchOptions, ReadingTime, SeparatorItem, TItem };