diff --git a/docs/docs/getting-started.server.mdx b/docs/docs/getting-started.server.mdx index 47c7567fe..695b359bc 100644 --- a/docs/docs/getting-started.server.mdx +++ b/docs/docs/getting-started.server.mdx @@ -191,6 +191,13 @@ Then you can install and use [`@types/mdx`](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mdx), which adds types to import statements of supported files. +You can also import several types about the API of MDX files from `@types/mdx`. +For example: + +```js path="example.ts" +import type {MDXComponents} from 'mdx/types' +``` + ### Security Please note that MDX is a programming language. diff --git a/packages/preact/readme.md b/packages/preact/readme.md index 52e552bf8..2c416e04a 100644 --- a/packages/preact/readme.md +++ b/packages/preact/readme.md @@ -158,8 +158,13 @@ components. This package is fully typed with [TypeScript][]. -An additional `Components` type is exported, which represents the acceptable -configuration for the functions and components from this project. +To enable types for imported `.mdx`, `.md`, etcetera files, you should make sure +the TypeScript `JSX` namespace is typed. +This is done by installing and using the types of your framework, as in +[`preact`](https://github.com/preactjs/preact). +Then you can install and use +[`@types/mdx`](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mdx), +which adds types to import statements of supported files. ## Security diff --git a/packages/react/readme.md b/packages/react/readme.md index 75bdddd3e..a8ff1a455 100644 --- a/packages/react/readme.md +++ b/packages/react/readme.md @@ -158,8 +158,13 @@ components. This package is fully typed with [TypeScript][]. -An additional `Components` type is exported, which represents the acceptable -configuration for the functions and components from this project. +To enable types for imported `.mdx`, `.md`, etcetera files, you should make sure +the TypeScript `JSX` namespace is typed. +This is done by installing and using the types of your framework, such as +[`@types/react`](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react). +Then you can install and use +[`@types/mdx`](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mdx), +which adds types to import statements of supported files. ## Security diff --git a/packages/vue/readme.md b/packages/vue/readme.md index 42c8109dc..8e8a9586c 100644 --- a/packages/vue/readme.md +++ b/packages/vue/readme.md @@ -127,9 +127,6 @@ Get current components from the MDX Context. This package is fully typed with [TypeScript][]. -An additional `Components` type is exported, which represents the acceptable -configuration for the functions and components from this project. - ## Security See [ยง Security][security] on our website for information.