diff --git a/examples/contentlayer/tsconfig.json b/examples/contentlayer/tsconfig.json index 717344bd..51db4f93 100644 --- a/examples/contentlayer/tsconfig.json +++ b/examples/contentlayer/tsconfig.json @@ -19,8 +19,12 @@ "contentlayer/generated": ["./.contentlayer/generated"] } }, + "mdx": { + "checkMdx": true + }, "include": [ "next-env.d.ts", + "**/*.mdx", "**/*.ts", "**/*.tsx", ".contentlayer/generated" diff --git a/examples/contentlayer/types.ts b/examples/contentlayer/types.ts new file mode 100644 index 00000000..5b5824b9 --- /dev/null +++ b/examples/contentlayer/types.ts @@ -0,0 +1,9 @@ +import { CH } from "@code-hike/mdx/components" + +declare global { + interface MDXProvidedComponents { + CH: typeof CH + } +} + +export {} diff --git a/packages/mdx/src/components.tsx b/packages/mdx/src/components.tsx index 2c7f63f4..eebcaed1 100644 --- a/packages/mdx/src/components.tsx +++ b/packages/mdx/src/components.tsx @@ -14,7 +14,6 @@ import { } from "./mdx-client/annotations" import { Preview } from "./mdx-client/preview" import { InlineCode } from "./mdx-client/inline-code" -import type { MDXComponents } from "mdx/types" import { useStaticToggle, StaticToggle, @@ -38,7 +37,7 @@ export { StaticToggle, } -export const CH: MDXComponents = { +export const CH = { Code, Section, SectionLink,