Skip to content
🎉MDX Conf — August 24th, 2020
MDX logo
v2.0.0-next.9

TypeScript

MDX provides typings for many of the core packages.

If you want to improve upon the types, we would love a PR to improve the developer experience for TypeScript users.


Typings for Components and Utilities

  • @mdx-js/mdx
  • @mdx-js/preact
  • @mdx-js/react
  • @mdx-js/runtime
  • @mdx-js/vue
  • remark-mdx

Include types, no additional setup needed.


Typings for MDX imports

React and Webpack

Add an mdx.d.ts file with the below content, and ensure it is included by the tsconfig.json.

/// <reference types="@mdx-js/loader" />

Vue and Webpack

Add an mdx.d.ts file with the below content, and ensure it is included by the tsconfig.json.

/// <reference types="@mdx-js/vue-loader" />
Edit this page on GitHub