rc-new-window-mod
Version:
popup new browser window with react
69 lines (68 loc) • 1.54 kB
TypeScript
import React from 'react';
interface Feature {
width?: number;
height?: number;
left?: number;
top?: number;
}
interface Props {
children?: React.ReactNode;
url?: string;
name?: string;
title?: string;
width?: number;
height?: number;
initPopupInnerRect?: () => Feature;
initPopupOuterRect?: () => Feature;
onOpen?: (w: Window) => void;
onClose?: () => void;
onBlock?: () => void;
copyStyles?: boolean;
}
interface State {
mounted: boolean;
}
/**
* The NewWindow class object.
* @public
*/
declare class NewWindow extends React.PureComponent<Props, State> {
static supported: boolean;
/**
* NewWindow default props.
*/
static defaultProps: Props;
window: Window;
released: boolean;
windowCheckerInterval: any;
container: HTMLDivElement;
state: State;
/**
* The NewWindow function constructor.
* @param {Object} props
*/
constructor(props: Props);
/**
* Render the NewWindow component.
*/
render(): React.ReactPortal;
componentDidMount(): void;
/**
* Create the new window when NewWindow component mount.
*/
openChild(): void;
onMainWindowUnload: () => void;
/**
* Close the opened window (if any) when NewWindow will unmount.
*/
componentWillUnmount(): void;
/**
* Release the new window and anything that was bound to it.
*/
release: (event?: any) => void;
}
/**
* Component export.
* @private
*/
export default NewWindow;