Skip to content

Commit

Permalink
feat(index): add htmlparser2 type to HTMLReactParserOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jun 3, 2020
1 parent c20f222 commit 81f74fb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// TypeScript Version: 3.3

import { DomElement } from 'htmlparser2';
import { DomElement, ParserOptions } from 'htmlparser2';
import domToReact from './lib/dom-to-react';
import htmlToDOM from 'html-dom-parser';

export interface HTMLReactParserOptions {
replace?: (
domNode: DomElement
) => JSX.Element | object | void | undefined | null | false;
htmlparser2?: ParserOptions;

library?: {
cloneElement: (
element: JSX.Element,
Expand All @@ -18,6 +17,10 @@ export interface HTMLReactParserOptions {
isValidElement: (element: any) => boolean;
[key: string]: any;
};

replace?: (
domNode: DomElement
) => JSX.Element | object | void | undefined | null | false;
}

/**
Expand All @@ -32,6 +35,6 @@ declare function HTMLReactParser(
options?: HTMLReactParserOptions
): ReturnType<typeof domToReact>;

export { DomElement, domToReact, htmlToDOM };
export { DomElement, ParserOptions, domToReact, htmlToDOM };

export default HTMLReactParser;

0 comments on commit 81f74fb

Please sign in to comment.