-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.d.ts
More file actions
21 lines (21 loc) · 812 Bytes
/
index.d.ts
File metadata and controls
21 lines (21 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { ReactElement } from 'react'
export interface IMountOptions<P = any> {
mountNode?: Node
attributes?: any
element?: ReactElement<P>
wrapper?: (reactElem: ReactElement) => ReactElement
}
export interface IMountCenter<P = any> {
close: () => void
open: (options?: IMountOptions<P>) => Node
}
/**
* @public
* @param {IMountOptions<P>} opts
* @param {Node} [opts.mountNode = document.body] - mountNode fallback in `open` function
* @param {any} [opts.attributes] - attributes fallback in `open` function
* @param {ReactElement<P>} [opts.element] - element fallback in `open` function
* @param {(elem: ReactElement<P>) => ReactElement<P>} [opts.wrapper] - element wrapper
* @return {IMountCenter}
*/
export default function createMountCenter<P = any>(opts?: IMountOptions<P>): IMountCenter