1 | import { Attributes, FunctionComponentElement, ComponentElement, ReactElement, ReactNode, DOMElement } from 'react';
|
2 | type GetProps<E extends ReactElement = ReactElement> = E extends FunctionComponentElement<infer P> | ComponentElement<infer P, any> | DOMElement<infer P, any> ? P & {
|
3 | ref?: any;
|
4 | } : Record<string, any> & {
|
5 | ref?: any;
|
6 | };
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | declare function safeCloneElement<E extends ReactElement = ReactElement, P extends GetProps<E> = GetProps<E>>(element: {
|
17 | ref?: any;
|
18 | } & E, props: {
|
19 | style?: any;
|
20 | } & Partial<Attributes> & Partial<P>, ...children: ReactNode[]): E;
|
21 | export default safeCloneElement;
|
22 | export { safeCloneElement };
|
23 |
|
\ | No newline at end of file |