From c1dc4d3c09a763a975473bc35ce0323da9659d22 Mon Sep 17 00:00:00 2001 From: Daiki Ihara Date: Fri, 17 May 2019 01:28:23 +0900 Subject: [PATCH 1/8] [TM] Add spec for AlertManager --- Libraries/Alert/NativeAlertManager.js | 43 ++++++++++++++++++++++++++ Libraries/Alert/RCTAlertManager.ios.js | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Libraries/Alert/NativeAlertManager.js diff --git a/Libraries/Alert/NativeAlertManager.js b/Libraries/Alert/NativeAlertManager.js new file mode 100644 index 000000000000..6adf18616bbf --- /dev/null +++ b/Libraries/Alert/NativeAlertManager.js @@ -0,0 +1,43 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + * + * @flow strict-local + * @format + */ + +'use strict'; + +import type {TurboModule} from 'RCTExport'; +import * as TurboModuleRegistry from 'TurboModuleRegistry'; + +type Button = {| + text: string, + onPress: () => void, + style: 'default' | 'cancel' | 'destructive' +|}; + +type AlertType = $Enum<{ + default: string, + 'plain-text': string, + 'secure-text': string, + 'login-password': string, +}>; + +type Args = {| + title: string, + message?: string, + buttons: Array