Merge pull request #14390 from drewnoakes/react-modal-1.6.5

Update react-modal to 1.6.5
This commit is contained in:
Arthur Ozga
2017-02-06 15:03:49 -08:00
committed by GitHub
2 changed files with 51 additions and 20 deletions
+50 -20
View File
@@ -1,32 +1,62 @@
// Type definitions for react-modal v1.6.1
// Type definitions for react-modal 1.6
// Project: https://github.com/reactjs/react-modal
// Definitions by: Rajab Shakirov <https://github.com/radziksh>
// Definitions by: Rajab Shakirov <https://github.com/radziksh>, Drew Noakes <https://github.com/drewnoakes>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="react"/>
import * as React from "react";
declare module "react-modal" {
interface ReactModal {
isOpen: boolean;
export as namespace ReactModal;
export = ReactModal;
declare namespace ReactModal {
export interface Styles {
style?: {
content?: {
[key: string]: any;
},
};
overlay?: {
[key: string]: any;
}
},
appElement?: HTMLElement | {},
onAfterOpen?: Function,
onRequestClose?: Function,
closeTimeoutMS?: number,
ariaHideApp?: boolean,
shouldCloseOnOverlayClick?: boolean,
overlayClassName?: string,
className?: string
contentLabel?: string
};
};
}
export interface Props {
/* Boolean describing if the modal should be shown or not. Defaults to false. */
isOpen: boolean;
/* Object indicating styles to be used for the modal, divided into overlay and content styles. */
style?: Styles;
/* Set this to properly hide your application from assistive screenreaders and other assistive technologies while the modal is open. */
appElement?: HTMLElement | {};
/* Function that will be run after the modal has opened. */
onAfterOpen?: () => void;
/* Function that will be run when the modal is requested to be closed, prior to actually closing. */
onRequestClose?: () => void;
/* Number indicating the milliseconds to wait before closing the modal. Defaults to zero (no timeout). */
closeTimeoutMS?: number;
/* Boolean indicating if the appElement should be hidden. Defaults to true. */
ariaHideApp?: boolean;
/* Boolean indicating if the overlay should close the modal. Defaults to true. */
shouldCloseOnOverlayClick?: boolean;
/* String className to be applied to the portal. Defaults to "ReactModalPortal". */
portalClassName?: string;
/* String className to be applied to the overlay. */
overlayClassName?: string;
/* String className to be applied to the modal content. */
className?: string;
/* String indicating how the content container should be announced to screenreaders. */
contentLabel?: string;
/* String indicating the role of the modal, allowing the 'dialog' role to be applied if desired. */
role?: string;
/* Function that will be called to get the parent element that the modal will be attached to. */
parentSelector?: () => HTMLElement;
}
let ReactModal: React.ClassicComponentClass<ReactModal>;
export = ReactModal;
}
declare class ReactModal extends React.Component<ReactModal.Props, {}> {
/* Override base styles for all instances of this component. */
static defaultStyles: ReactModal.Styles;
/* Call this to properly hide your application from assistive screenreaders and other assistive technologies while the modal is open. */
static setAppElement(appElement: HTMLElement): void;
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }