diff --git a/Libraries/Alert/Alert.js b/Libraries/Alert/Alert.js index 40666f70e35076..6598175c0825d3 100644 --- a/Libraries/Alert/Alert.js +++ b/Libraries/Alert/Alert.js @@ -16,6 +16,7 @@ const NativeModules = require('NativeModules'); const Platform = require('Platform'); import type { AlertType, AlertButtonStyle } from 'AlertIOS'; +import type { Fbt } from 'fbt'; export type Buttons = Array<{ text?: string, @@ -79,8 +80,8 @@ type Options = { class Alert { static alert( - title: ?string, - message?: ?string, + title: ?string | ?Fbt, + message?: ?string | ?Fbt, buttons?: Buttons, options?: Options, type?: AlertType, @@ -104,8 +105,8 @@ class Alert { class AlertAndroid { static alert( - title: ?string, - message?: ?string, + title: ?string | ?Fbt, + message?: ?string | ?Fbt, buttons?: Buttons, options?: Options, ): void { diff --git a/Libraries/Alert/AlertIOS.js b/Libraries/Alert/AlertIOS.js index 375a4db56c96a2..933df8512a3b95 100644 --- a/Libraries/Alert/AlertIOS.js +++ b/Libraries/Alert/AlertIOS.js @@ -12,7 +12,9 @@ */ 'use strict'; -var RCTAlertManager = require('NativeModules').AlertManager; +const RCTAlertManager = require('NativeModules').AlertManager; + +import type { Fbt } from 'fbt'; /** * An Alert button type @@ -133,8 +135,8 @@ class AlertIOS { * ); */ static alert( - title: ?string, - message?: ?string, + title: ?string | ?Fbt, + message?: ?string | ?Fbt, callbackOrButtons?: ?(() => void) | ButtonsArray, type?: AlertType, ): void { @@ -192,8 +194,8 @@ class AlertIOS { * ); */ static prompt( - title: ?string, - message?: ?string, + title: ?string | ?Fbt, + message?: ?string | ?Fbt, callbackOrButtons?: ?((text: string) => void) | ButtonsArray, type?: ?AlertType = 'plain-text', defaultValue?: string,