@types/mdx 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mdx/README.md +1 -1
- mdx/index.d.ts +9 -3
- mdx/package.json +3 -3
mdx/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for mdx (https://github.com/mdx-js/mdx).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdx.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 27 Mar 2023 18:33:54 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
mdx/index.d.ts
CHANGED
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
35
|
* The previous example added types to *all* `.mdx` files.
|
|
36
|
-
* To define
|
|
37
|
-
*
|
|
36
|
+
* To define types for a specific MDX file, create a file with the same name but postfixed with
|
|
37
|
+
* `.d.ts` next to the MDX file.
|
|
38
38
|
*
|
|
39
39
|
* For example, given the following MDX file `my-component.mdx`:
|
|
40
40
|
*
|
|
@@ -47,13 +47,19 @@
|
|
|
47
47
|
* Create the following file named `my-component.mdx.d.ts` in the same directory:
|
|
48
48
|
*
|
|
49
49
|
* ```ts
|
|
50
|
+
* export { default } from '*.mdx';
|
|
51
|
+
*
|
|
50
52
|
* export const message: string;
|
|
51
53
|
* ```
|
|
52
54
|
*
|
|
55
|
+
* Note that this overwrites the `declare module '*.mdx' { … }` types from earlier, which is why you
|
|
56
|
+
* also need to define the default export. You can also define your own default export type to narrow
|
|
57
|
+
* the accepted prop types of this specific file.
|
|
58
|
+
*
|
|
53
59
|
* It should now be possible to import both the MDX component and the exported constant `message`.
|
|
54
60
|
*/
|
|
55
61
|
declare module '*.mdx' {
|
|
56
|
-
//
|
|
62
|
+
// eslint-disable-next-line no-self-import
|
|
57
63
|
import { MDXProps } from 'mdx/types';
|
|
58
64
|
|
|
59
65
|
/**
|
mdx/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/mdx",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "TypeScript definitions for mdx",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdx",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
},
|
|
31
31
|
"scripts": {},
|
|
32
32
|
"dependencies": {},
|
|
33
|
-
"typesPublisherContentHash": "
|
|
34
|
-
"typeScriptVersion": "3
|
|
33
|
+
"typesPublisherContentHash": "c3899c3dcc27f71bfdaa0e0b59a7f669033d6b8c99d2c0b5024e8d2eb1a391eb",
|
|
34
|
+
"typeScriptVersion": "4.3"
|
|
35
35
|
}
|