diff --git a/packages/remdx/client.d.ts b/packages/remdx/client.d.ts index 0422692..7d19a3d 100644 --- a/packages/remdx/client.d.ts +++ b/packages/remdx/client.d.ts @@ -3,5 +3,8 @@ declare module '*.re.mdx' { export let Components: import('./types.jsx').MDXComponents | undefined; export let Themes: import('./types.jsx').Themes | undefined; + export let Transitions: + | Record + | undefined; export default slides; } diff --git a/packages/remdx/package.json b/packages/remdx/package.json index 81b0b75..4a5ec76 100644 --- a/packages/remdx/package.json +++ b/packages/remdx/package.json @@ -29,5 +29,8 @@ }, "scripts": { "build": "rm -f index.js; esbuild --format=esm --outfile=index.js --jsx=automatic --external:react --external:react-dom --bundle ./index.tsx" + }, + "dependencies": { + "@types/mdx": "^2.0.11" } } diff --git a/packages/remdx/types.tsx b/packages/remdx/types.tsx index 0fe70f8..ee6221d 100644 --- a/packages/remdx/types.tsx +++ b/packages/remdx/types.tsx @@ -1,35 +1,8 @@ +import type { MDXComponents as _MDXComponents } from 'mdx/types.js'; import { CSSProperties } from 'react'; -/** - * Configuration for `MDXProvider`. - */ -type MDXProps = { - /** - * Children (optional). - */ - children?: ReactNode | null | undefined; - /** - * Additional components to use or a function that creates them (optional). - */ - components?: Readonly | MergeComponents | null | undefined; - /** - * Turn off outer component context (default: `false`). - */ - disableParentContext?: boolean | null | undefined; -}; - -/** - * Provider for MDX context. - * - * @param {Readonly} properties - * Properties. - * @returns {JSX.Element} - * Element. - * @satisfies {Component} - */ -function MDXProvider(properties: Readonly): JSX.Element; +export type MDXComponents = _MDXComponents; -export type MDXComponents = MDXProps['components']; export type Themes = Record; export type SlideTransition = { @@ -44,7 +17,7 @@ export type ReMDXSlide = { }; export type ReMDXModule = { - Components?: MDXComponents; + Components?: _MDXComponents; Themes?: Themes; Transitions?: Record; default: ReadonlyArray; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bad9d25..1d4b7ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -104,6 +104,10 @@ importers: version: 2.4.2 packages/remdx: + dependencies: + '@types/mdx': + specifier: ^2.0.11 + version: 2.0.11 devDependencies: '@mdx-js/react': specifier: ^3.0.0