UNPKG

mdx-bundler

Version:

Compile and bundle your MDX files and their dependencies. FAST.

22 lines (21 loc) 808 B
export type ComponentMap = { [name: string]: string | React.ComponentType<{}> | ComponentMap; }; export type MDXContentProps = { [props: string]: unknown; components?: ComponentMap | undefined; }; /** * @typedef {{[name: string]: React.ComponentType | string | ComponentMap}} ComponentMap */ /** * @typedef {{[props: string]: unknown, components?: ComponentMap}} MDXContentProps */ /** * * @param {string} code - The string of code you got from bundleMDX * @param {Record<string, unknown>} [globals] - Any variables your MDX needs to have accessible when it runs * @return {React.FunctionComponent<MDXContentProps>} */ export function getMDXComponent(code: string, globals?: Record<string, unknown> | undefined): React.FunctionComponent<MDXContentProps>; import * as React from "react";