@types/mdx 2.0.11 → 2.0.13

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.
Files changed (4) hide show
  1. mdx/README.md +1 -1
  2. mdx/index.d.ts +2 -2
  3. mdx/package.json +3 -3
  4. mdx/types.d.ts +7 -2
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: Tue, 30 Jan 2024 21:35:45 GMT
11
+ * Last updated: Thu, 11 Apr 2024 15:07:22 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
mdx/index.d.ts CHANGED
@@ -52,7 +52,7 @@
52
52
  */
53
53
  declare module "*.mdx" {
54
54
  // eslint-disable-next-line @definitelytyped/no-self-import
55
- import { MDXProps } from "mdx/types";
55
+ import { Element, MDXProps } from "mdx/types";
56
56
 
57
57
  /**
58
58
  * An function component which renders the MDX content using JSX.
@@ -61,7 +61,7 @@ declare module "*.mdx" {
61
61
  * @returns A JSX element. The meaning of this may depend on the project configuration. I.e. it
62
62
  * could be a React, Preact, or Vuex element.
63
63
  */
64
- export default function MDXContent(props: MDXProps): JSX.Element;
64
+ export default function MDXContent(props: MDXProps): Element;
65
65
  }
66
66
 
67
67
  // Support markdown extensions from
mdx/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/mdx",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
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": "255d12a68ca2af3d4bb076c14be25530f082517ea6c1fd5348ccc7d6172e285c",
34
- "typeScriptVersion": "4.6"
33
+ "typesPublisherContentHash": "e9930b09508f8573e534a6a2fb0c41a3f791f073d8596be495dc6e47b788c530",
34
+ "typeScriptVersion": "4.7"
35
35
  }
mdx/types.d.ts CHANGED
@@ -22,12 +22,17 @@ type ClassElementType = Extract<ElementType, new(props: Record<string, any>) =>
22
22
  */
23
23
  type StringComponent = Extract<keyof JSX.IntrinsicElements, ElementType extends never ? string : ElementType>;
24
24
 
25
+ /**
26
+ * A JSX element returned by MDX content.
27
+ */
28
+ export type Element = JSX.Element;
29
+
25
30
  /**
26
31
  * A valid JSX function component.
27
32
  */
28
33
  type FunctionComponent<Props> = ElementType extends never
29
34
  // If JSX.ElementType isn’t defined, the valid return type is JSX.Element
30
- ? (props: Props) => JSX.Element | null
35
+ ? (props: Props) => Element | null
31
36
  : FunctionElementType extends never
32
37
  // If JSX.ElementType is defined, but doesn’t allow function components, function components are disallowed.
33
38
  ? never
@@ -93,7 +98,7 @@ export interface MDXProps {
93
98
  /**
94
99
  * The type of the default export of an MDX module.
95
100
  */
96
- export type MDXContent = (props: MDXProps) => JSX.Element;
101
+ export type MDXContent = (props: MDXProps) => Element;
97
102
 
98
103
  /**
99
104
  * A generic MDX module type.