mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
[styled-react-modal] update and export ModalProps interface (#35090)
* add missing prop to styled-react-modal * fix lint errors
This commit is contained in:
Vendored
+4
-2
@@ -1,6 +1,7 @@
|
||||
// Type definitions for styled-react-modal 1.1
|
||||
// Type definitions for styled-react-modal 1.2
|
||||
// Project: https://github.com/AlexanderRichey/styled-react-modal
|
||||
// Definitions by: Adam Lavin <https://github.com/Lavoaster>
|
||||
// Greg Perlman <https://github.com/gperl27>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
@@ -9,10 +10,11 @@ import { StyledComponent, AnyStyledComponent, CSSObject, InterpolationFunction }
|
||||
|
||||
declare const BaseModalBackground: StyledComponent<'div', any>;
|
||||
|
||||
interface ModalProps {
|
||||
export interface ModalProps {
|
||||
children?: React.ReactNode;
|
||||
isOpen: boolean;
|
||||
allowScroll?: boolean;
|
||||
backgroundProps?: object;
|
||||
afterOpen?: () => void;
|
||||
afterClose?: () => void;
|
||||
beforeOpen?: Promise<void> | (() => void);
|
||||
|
||||
@@ -29,6 +29,7 @@ const test2 = (
|
||||
<ModalProvider backgroundComponent={BackgroundComponent}>
|
||||
<Modal
|
||||
isOpen={true}
|
||||
backgroundProps={{style: {padding: "20px"}}}
|
||||
onBackgroundClick={() => console.log('Background click!')}
|
||||
onEscapeKeydown={() => console.log('Background click!')}
|
||||
afterOpen={() => console.log('After Open!')}
|
||||
|
||||
Reference in New Issue
Block a user