UNPKG

1.02 kBTypeScriptView Raw
1/**
2 * @type {import('unified').Plugin<[Options], Root, ReactElement>}
3 */
4export default function rehypeReact(options: Options): void
5export type Root = import('hast').Root
6export type Element = import('hast').Element
7export type ReactNode = import('react').ReactNode
8export type ReactElement = import('react').ReactElement<unknown>
9export type CreateElementLike = (
10 name: any,
11 props: any,
12 ...children: ReactNode[]
13) => ReactNode
14export type SharedOptions = {
15 /**
16 * How to create elements or components.
17 * You should typically pass `React.createElement`.
18 */
19 createElement: CreateElementLike
20 /**
21 * Create fragments instead of an outer `<div>` if available.
22 * You should typically pass `React.Fragment`.
23 */
24 Fragment?: ((props: any) => ReactNode) | undefined
25 /**
26 * React key prefix
27 */
28 prefix?: string | undefined
29}
30export type Options = SharedOptions &
31 (
32 | import('./complex-types').ComponentsWithNodeOptions
33 | import('./complex-types').ComponentsWithoutNodeOptions
34 )
35
\No newline at end of file