Installation
npm install --save @types/styled-react-modal
Summary
This package contains type definitions for styled-react-modal (https://github.com/AlexanderRichey/styled-react-modal).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/styled-react-modal.
import * as React from "react";
import { AnyStyledComponent, CSSObject, InterpolationFunction, StyledComponent } from "styled-components";
declare const BaseModalBackground: StyledComponent<"div", any>;
export interface ModalProps {
children?: React.ReactNode | undefined;
isOpen: boolean;
allowScroll?: boolean | undefined;
backgroundProps?: object | undefined;
afterOpen?: (() => void) | undefined;
afterClose?: (() => void) | undefined;
beforeOpen?: Promise<void> | (() => void) | undefined;
beforeClose?: Promise<void> | (() => void) | undefined;
onEscapeKeydown?: ((event: Event) => void) | undefined;
onBackgroundClick?: ((event: React.MouseEvent<HTMLDivElement>) => void) | undefined;
}
declare class Modal extends React.Component<ModalProps> {
static styled(
object: CSSObject | InterpolationFunction<any>,
): StyledComponent<React.ComponentClass<ModalProps>, any>;
static styled(
strings: TemplateStringsArray,
...interpolations: any[]
): StyledComponent<React.ComponentClass<ModalProps>, any>;
}
interface ModalProviderProps {
backgroundComponent?: AnyStyledComponent | undefined;
children: React.ReactNode;
}
declare class ModalProvider extends React.Component<ModalProviderProps> {}
export default Modal;
export { BaseModalBackground, ModalProvider };
Additional Details
Credits
These definitions were written by Greg Perlman.