DefinitelyTyped/types/rehype-react/index.d.ts
Johan Fagerberg d01dbee933 [rehype-react] Add Fragment option, update which options are optional (#41600)
* [rehype-react] Add Fragment option

Usually this will be `React.Fragment`, but it accepts any component.

* [rehype-react] Update which options are optional

Most options have healthy defaults. Only `createElement` is required.

* [rehype-react] Update version number

* [rehype-react] Update tests to include Fragment option
2020-01-21 13:14:03 -08:00

24 lines
645 B
TypeScript

// Type definitions for rehype-react 4.0
// Project: https://github.com/rhysd/rehype-react
// Definitions by: Adrian Kremer <https://github.com/adriankremer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from "react";
interface Options {
createElement: typeof React.createElement;
Fragment?: React.ComponentType<{ children?: React.ReactNode }>;
components?: {
[tagName: string]: React.ComponentType<any>;
};
prefix?: string;
}
declare class RehypeReact {
constructor(options: Options)
Compiler: (node: any) => any;
}
export = RehypeReact;