From 57a4dacea6a6ceb60ea73290cb2cafce43eb5acb Mon Sep 17 00:00:00 2001 From: Andrzej Zabost Date: Thu, 13 Jul 2017 16:03:00 +0200 Subject: [PATCH] Add missing onDismiss callback in AlertOptions --- types/react-native/index.d.ts | 2 ++ types/react-native/test/index.tsx | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 1b78fb408c..ed29038337 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -6343,6 +6343,8 @@ export interface AlertButton { interface AlertOptions { /** @platform android */ cancelable?: boolean; + /** @platform android */ + onDismiss?: () => void; } /** diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index abe7ae78bc..269162c9f3 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -13,9 +13,11 @@ For a list of complete Typescript examples: check https://github.com/bgrieder/RN import * as React from 'react' import { + Alert, AppState, AppStateIOS, BackAndroid, + Button, Dimensions, InteractionManager, ListView, @@ -283,3 +285,27 @@ class TabBarTest extends React.Component { ); } } + +class AlertTest extends React.Component { + showAlert() { + Alert.alert( + 'Title', + 'Message', + [ + { text: 'First button', onPress: () => {} }, + { text: 'Second button', onPress: () => {} }, + { text: 'Third button', onPress: () => {} } + ], + { + cancelable: false, + onDismiss: () => {} + } + ) + } + + render() { + return ( +