From 982b76ff4a72383f036c38d4d8ed0bc7ea7c7316 Mon Sep 17 00:00:00 2001 From: Yaron Malin Date: Fri, 23 Aug 2019 00:42:01 +0300 Subject: [PATCH] Extend react-native-dialog with react-native-modal types (#37700) * Extend react-native-dialog with react-native-modal types * style change * minor change --- types/react-native-dialog/index.d.ts | 8 +++++-- types/react-native-dialog/package.json | 6 ++++++ .../react-native-dialog-tests.tsx | 21 +++++-------------- 3 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 types/react-native-dialog/package.json diff --git a/types/react-native-dialog/index.d.ts b/types/react-native-dialog/index.d.ts index 50866d6d0c..67be5ac9f5 100644 --- a/types/react-native-dialog/index.d.ts +++ b/types/react-native-dialog/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for react-native-dialog 5.5 +// Type definitions for react-native-dialog 5.6 // Project: https://github.com/mmazzarolo/react-native-dialog // Definitions by: MrLuje // Stack Builders // Esteban Ibarra +// Yaron Malin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -14,6 +15,7 @@ import { TextInputProps, ViewStyle } from "react-native"; +import * as reactNativeModal from 'react-native-modal'; interface ButtonProps { label: string; @@ -59,11 +61,13 @@ interface DescriptionProps { children: string; } +type reactNativeModalContainerProps = Pick>; + export namespace Dialog { class Button extends PureComponent< ButtonProps & ViewProps & TextProps > {} - class Container extends PureComponent {} + class Container extends PureComponent {} class Title extends PureComponent< TitleProps & ViewProps & TextProps > {} diff --git a/types/react-native-dialog/package.json b/types/react-native-dialog/package.json new file mode 100644 index 0000000000..5b0dadcb67 --- /dev/null +++ b/types/react-native-dialog/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "react-native-modal": ">=9.0.0" + } +} \ No newline at end of file diff --git a/types/react-native-dialog/react-native-dialog-tests.tsx b/types/react-native-dialog/react-native-dialog-tests.tsx index 544025051c..cdabf88880 100644 --- a/types/react-native-dialog/react-native-dialog-tests.tsx +++ b/types/react-native-dialog/react-native-dialog-tests.tsx @@ -17,30 +17,19 @@ class Example extends Component { } singleButton() { - return ( null} />); + return null} />; } render() { const ref = createRef(); return ( - - - A nice title - + + A nice title A good descr - console.log("test")} - /> - console.log("test")} - /> + console.log('test')} /> + console.log('test')} /> {this.dynamicButtons()} {this.singleButton()}