react-markdown
Advanced tools
+3
-3
@@ -68,3 +68,3 @@ /** | ||
| */ | ||
| export type Components = { [Key in Extract<ElementType, string>]?: ElementType<ComponentProps<Key> & ExtraProps>; }; | ||
| export type Components = { [Key in keyof JSX.IntrinsicElements]?: ComponentType<JSX.IntrinsicElements[Key] & ExtraProps> | keyof JSX.IntrinsicElements; }; | ||
| /** | ||
@@ -148,6 +148,6 @@ * Deprecation. | ||
| import type { Parents } from 'hast'; | ||
| import type { ElementType } from 'react'; | ||
| import type { ComponentProps } from 'react'; | ||
| import type { JSX } from 'react'; | ||
| import type { ComponentType } from 'react'; | ||
| import type { PluggableList } from 'unified'; | ||
| import type { Options as RemarkRehypeOptions } from 'remark-rehype'; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAqJA;;;;;;;;;;;GAWG;AACH,kCALW,QAAQ,CAAC,OAAO,CAAC,GAEf,YAAY,CAOxB;AAED;;;;;;;;;;;;GAYG;AACH,uCALW,QAAQ,CAAC,OAAO,CAAC,GAEf,OAAO,CAAC,YAAY,CAAC,CAQjC;AAED;;;;;;;;;;;;GAYG;AACH,uCALW,QAAQ,CAAC,OAAO,CAAC,GAEf,YAAY,CAgCxB;AAmKD;;;;;;;;GAQG;AACH,2CALW,MAAM,GAEJ,MAAM,CA0BlB;;;;qCA5ZU,QAAQ,CAAC,OAAO,CAAC,SAEjB,MAAM,UAEN,QAAQ,CAAC,OAAO,CAAC,GAAG,SAAS,KAE3B,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;WAOzB,OAAO,GAAG,SAAS;;;;;yBAKpB,GACP,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,eAAe,GAAG,CAAC,GAAG,UAAU,CAAC,GACtF;;;;;;;;UAOU,MAAM;;;;QAEN,MAAM;;;;SAEN,MAAM,OAAO;;;;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;;;;;;;;WAOzB,OAAO,GAAG,SAAS;;;;;yBAKpB,GACP,GAAG,IAAI,MAAM,qBAAqB,CAAC,CAAC,EAAE,cAAc,qBAAqB,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,MAAM,qBAAqB,GAC5H;;;;;;;;UAOU,MAAM;;;;QAEN,MAAM;;;;SAEN,MAAM,OAAO;;;;;;;;;;mBAOb,YAAY,GAAG,IAAI,GAAG,SAAS;;;;;sBAG/B,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS;;;;eAGxC,MAAM,GAAG,IAAI,GAAG,SAAS;;;;iBAEzB,UAAU,GAAG,IAAI,GAAG,SAAS;;;;;yBAE7B,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS;;;;oBAGxC,aAAa,GAAG,IAAI,GAAG,SAAS;;;;oBAEhC,aAAa,GAAG,IAAI,GAAG,SAAS;;;;0BAEhC,QAAQ,CAAC,mBAAmB,CAAC,GAAG,IAAI,GAAG,SAAS;;;;eAEhD,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;uBAE1B,OAAO,GAAG,IAAI,GAAG,SAAS;;;;mBAI1B,YAAY,GAAG,IAAI,GAAG,SAAS;;;;;iCAOlC,MAAM,OAEN,MAAM,QAEN,QAAQ,CAAC,OAAO,CAAC,KAEf,MAAM,GAAG,IAAI,GAAG,SAAS;kCArFa,OAAO;6BAFV,MAAM;6BAAN,MAAM;yBAEH,OAAO;mCAAP,OAAO;mCAGf,SAAS;oDAFH,eAAe"} |
+2
-5
| /** | ||
| * @import {Element, Nodes, Parents, Root} from 'hast' | ||
| * @import {Root as MdastRoot} from 'mdast' | ||
| * @import {ComponentProps, ElementType, ReactElement} from 'react' | ||
| * @import {ComponentType, JSX, ReactElement} from 'react' | ||
| * @import {Options as RemarkRehypeOptions} from 'remark-rehype' | ||
@@ -32,3 +32,3 @@ * @import {BuildVisitor} from 'unist-util-visit' | ||
| * @typedef {{ | ||
| * [Key in Extract<ElementType, string>]?: ElementType<ComponentProps<Key> & ExtraProps> | ||
| * [Key in keyof JSX.IntrinsicElements]?: ComponentType<JSX.IntrinsicElements[Key] & ExtraProps> | keyof JSX.IntrinsicElements | ||
| * }} Components | ||
@@ -329,5 +329,2 @@ * Map tag names to components. | ||
| Fragment, | ||
| // @ts-expect-error | ||
| // React components are allowed to return numbers, | ||
| // but not according to the types in hast-util-to-jsx-runtime | ||
| components, | ||
@@ -334,0 +331,0 @@ ignoreInvalidStyle: true, |
+1
-1
@@ -144,3 +144,3 @@ { | ||
| "type": "module", | ||
| "version": "10.0.0", | ||
| "version": "10.0.1", | ||
| "xo": { | ||
@@ -147,0 +147,0 @@ "envs": [ |
+8
-13
@@ -194,3 +194,3 @@ <!-- | ||
| React element (`JSX.Element`). | ||
| React element (`ReactElement`). | ||
@@ -213,3 +213,3 @@ ### `MarkdownAsync` | ||
| Promise to a React element (`Promise<JSX.Element>`). | ||
| Promise to a React element (`Promise<ReactElement>`). | ||
@@ -232,3 +232,3 @@ ### `MarkdownHooks` | ||
| React element (`JSX.Element`). | ||
| React element (`ReactElement`). | ||
@@ -272,13 +272,8 @@ ### `defaultUrlTransform(url)` | ||
| ```ts | ||
| import type {Element} from 'hast' | ||
| import type {ExtraProps} from 'react-markdown' | ||
| import type {ComponentProps, ElementType} from 'react' | ||
| type Components = Partial<{ | ||
| [TagName in keyof JSX.IntrinsicElements]: | ||
| // Class component: | ||
| | (new (props: JSX.IntrinsicElements[TagName] & ExtraProps) => JSX.ElementClass) | ||
| // Function component: | ||
| | ((props: JSX.IntrinsicElements[TagName] & ExtraProps) => JSX.Element | string | null | undefined) | ||
| // Tag name: | ||
| | keyof JSX.IntrinsicElements | ||
| }> | ||
| type Components = { | ||
| [Key in Extract<ElementType, string>]?: ElementType<ComponentProps<Key> & ExtraProps> | ||
| } | ||
| ``` | ||
@@ -285,0 +280,0 @@ |
51028
-0.52%553
-0.54%926
-0.54%