Skip to content

Commit ffb7964

Browse files
chore(index): improve types for options.library
1 parent 0d3bc6c commit ffb7964

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

index.d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ import domToReact from './lib/dom-to-react';
55
import htmlToDOM from 'html-dom-parser';
66

77
export interface HTMLReactParserOptions {
8-
// TODO: Replace `object` by type for objects like `{ type: 'h1', props: { children: 'Heading' } }`
98
replace?: (
109
domNode: DomElement
1110
) => JSX.Element | object | void | undefined | null | false;
12-
library?: object;
11+
library?: {
12+
cloneElement: (
13+
element: JSX.Element,
14+
props?: object,
15+
...children: any
16+
) => JSX.Element;
17+
createElement: (type: any, props?: object, ...children: any) => JSX.Element;
18+
isValidElement: (element: any) => boolean;
19+
[key: string]: any;
20+
};
1321
}
1422

1523
/**

0 commit comments

Comments
 (0)