Skip to content

Commit

Permalink
Fix docs on types
Browse files Browse the repository at this point in the history
Closes GH-2104.
  • Loading branch information
wooorm committed Dec 8, 2022
1 parent 5fbe3f4 commit 1c83612
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
7 changes: 7 additions & 0 deletions docs/docs/getting-started.server.mdx
Expand Up @@ -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.
Expand Down
9 changes: 7 additions & 2 deletions packages/preact/readme.md
Expand Up @@ -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

Expand Down
9 changes: 7 additions & 2 deletions packages/react/readme.md
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions packages/vue/readme.md
Expand Up @@ -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.
Expand Down

1 comment on commit 1c83612

@vercel
Copy link

@vercel vercel bot commented on 1c83612 Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mdx – ./

mdxjs.com
v2.mdxjs.com
mdx-git-main-mdx.vercel.app
mdx-mdx.vercel.app

Please sign in to comment.