From 34c28a11da363a27d5de601b666c2feca176aa9a Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Wed, 1 Feb 2017 21:41:16 +0000 Subject: [PATCH] Fix tslint error 'no-single-declare-module ' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit File has only 1 module declaration — write it as an external module. --- react-modal/index.d.ts | 93 +++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/react-modal/index.d.ts b/react-modal/index.d.ts index 30db228f59..68e6f1e2bc 100644 --- a/react-modal/index.d.ts +++ b/react-modal/index.d.ts @@ -6,52 +6,53 @@ /// -declare module "react-modal" { - interface Styles { - style?: { - content?: { - [key: string]: any; - }; - overlay?: { - [key: string]: any; - }; +interface Styles { + style?: { + content?: { + [key: string]: any; + }; + overlay?: { + [key: string]: any; }; - } - interface ReactModal { - /* 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 & { - /* Override styles for all modals. */ - defaultStyles: Styles; - /* Call this to properly hide your application from assistive screenreaders and other assistive technologies while the modal is open. */ - setAppElement(appElement: HTMLElement): void; }; - export = ReactModal; } + +interface ReactModal { + /* 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; +} + +declare const ReactModal: React.ClassicComponentClass & { + /* Override styles for all modals. */ + defaultStyles: Styles; + /* Call this to properly hide your application from assistive screenreaders and other assistive technologies while the modal is open. */ + setAppElement(appElement: HTMLElement): void; +}; + +export = ReactModal;