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 ( +