1/** 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 * 7 * @format 8 * @flow 9 */ 10 11export type AlertType = 12 | 'default' 13 | 'plain-text' 14 | 'secure-text' 15 | 'login-password'; 16export type AlertButtonStyle = 'default' | 'cancel' | 'destructive'; 17export type Buttons = Array<{ 18 text?: string, 19 onPress?: ?Function, 20 isPreferred?: boolean, 21 style?: AlertButtonStyle, 22 ... 23}>; 24type Options = { 25 cancelable?: ?boolean, 26 userInterfaceStyle?: 'unspecified' | 'light' | 'dark', 27 onDismiss?: ?() => void, 28 ... 29}; 30 31declare class Alert { 32 static alert( 33 title: ?string, 34 message?: ?string, 35 buttons?: Buttons, 36 options?: Options, 37 ): void; 38 static prompt( 39 title: ?string, 40 message?: ?string, 41 callbackOrButtons?: ?(((text: string) => void) | Buttons), 42 type?: ?AlertType, 43 defaultValue?: string, 44 keyboardType?: string, 45 options?: Options, 46 ): void; 47} 48 49module.exports = Alert; 50