import { HTMLComponents } from "../html/HTMLComponentTypes.js"; import { ParsedMarkdown } from "./processor.js"; import { FC, HTMLAttributes, PropsWithChildren, ReactNode } from "react"; export type MarkdownProviderOptions = { /** Forces the compiler to always output content with a block-level wrapper. */ forceBlock?: boolean; /** Forces the compiler to always output content with an inline wrapper. */ forceInline?: boolean; /** Whether to preserve frontmatter in the markdown content. */ preserveFrontmatter?: boolean; /** Whether to use the GitHub Tag Filter for security. */ tagfilter?: boolean; }; export type MarkdownContextValue = { components?: HTMLComponents<'permissive', {}>; renderMarkdown: (markdown: string | ParsedMarkdown, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: FC>) => ReactNode | Promise; }; export type MarkdownProviderProps = PropsWithChildren; wrapper?: FC>; renderMarkdown?: (markdown: string | ParsedMarkdown, options?: MarkdownProviderOptions, components?: HTMLComponents<'permissive', {}>, wrapper?: FC>) => ReactNode | Promise; }>; /** * Returns the raw `MarkdownProvider` context value — the active * `renderMarkdown` function plus any provider-level component overrides. * Returns `undefined` when called outside a ``. * Prefer `useMarkdownRenderer` for most use cases; use this hook only when * you need direct access to the context object itself. */ export declare const useMarkdownContext: () => MarkdownContextValue; /** * Provider for the MarkdownRenderer component. * * It will provide the `renderMarkdown` function to the context, which can be used to render markdown. * * ```tsx * const content = useIntlayer('app'); * * return ( *
* {content.markdown} // Will be rendered with the components and options provided to the MarkdownProvider *
* ); * ``` * * @example * ```tsx * * * {markdownContent} * * * ``` */ export declare const MarkdownProvider: FC; //# sourceMappingURL=MarkdownProvider.d.ts.map