|
| 1 | +/* eslint-disable import/no-unresolved */ |
| 2 | +/** |
| 3 | + * An MDX file which exports a JSX component. |
| 4 | + */ |
| 5 | +declare module "*.mdx" { |
| 6 | + import type { JSX, ParentProps } from "solid-js" |
| 7 | + |
| 8 | + type MDXComponents = { |
| 9 | + [key in string]: key extends keyof JSX.IntrinsicElements |
| 10 | + ? ((properties: JSX.IntrinsicElements[key]) => JSX.Element) | keyof JSX.IntrinsicElements |
| 11 | + : (properties: ParentProps) => JSX.Element |
| 12 | + } |
| 13 | + |
| 14 | + type CustomComponents = Record<string, (properties: ParentProps) => JSX.Element> |
| 15 | + |
| 16 | + interface MDXProperties { |
| 17 | + components?: Partial<MDXComponents> |
| 18 | + children?: JSX.Element |
| 19 | + [key: string]: unknown |
| 20 | + } |
| 21 | + |
| 22 | + /** |
| 23 | + * An function component which renders the MDX content using JSX. |
| 24 | + * |
| 25 | + * @param props This value is be available as the named variable `props` inside the MDX component. |
| 26 | + * @returns A JSX element. The meaning of this may depend on the project configuration. I.e. it |
| 27 | + * could be a React, Preact, or Vuex element. |
| 28 | + */ |
| 29 | + export default function Component(properties: MDXProperties): JSX.Element |
| 30 | +} |
| 31 | + |
| 32 | +/** |
| 33 | + * A markdown file which exports a JSX component. |
| 34 | + */ |
| 35 | +declare module "*.md" { |
| 36 | + export { default } from "*.mdx" |
| 37 | +} |
| 38 | + |
| 39 | +/** |
| 40 | + * A markdown file which exports a JSX component. |
| 41 | + */ |
| 42 | +declare module "*.markdown" { |
| 43 | + export { default } from "*.mdx" |
| 44 | +} |
| 45 | + |
| 46 | +/** |
| 47 | + * A markdown file which exports a JSX component. |
| 48 | + */ |
| 49 | +declare module "*.mdown" { |
| 50 | + export { default } from "*.mdx" |
| 51 | +} |
| 52 | + |
| 53 | +/** |
| 54 | + * A markdown file which exports a JSX component. |
| 55 | + */ |
| 56 | +declare module "*.mkdn" { |
| 57 | + export { default } from "*.mdx" |
| 58 | +} |
| 59 | + |
| 60 | +/** |
| 61 | + * A markdown file which exports a JSX component. |
| 62 | + */ |
| 63 | +declare module "*.mkd" { |
| 64 | + export { default } from "*.mdx" |
| 65 | +} |
| 66 | + |
| 67 | +/** |
| 68 | + * A markdown file which exports a JSX component. |
| 69 | + */ |
| 70 | +declare module "*.mdwn" { |
| 71 | + export { default } from "*.mdx" |
| 72 | +} |
| 73 | + |
| 74 | +/** |
| 75 | + * A markdown file which exports a JSX component. |
| 76 | + */ |
| 77 | +declare module "*.mkdown" { |
| 78 | + export { default } from "*.mdx" |
| 79 | +} |
| 80 | + |
| 81 | +/** |
| 82 | + * A markdown file which exports a JSX component. |
| 83 | + */ |
| 84 | +declare module "*.ron" { |
| 85 | + export { default } from "*.mdx" |
| 86 | +} |
0 commit comments