1*af2ec015STomasz Sapeta/** 2*af2ec015STomasz Sapeta * Copyright (c) Meta Platforms, Inc. and affiliates. 3*af2ec015STomasz Sapeta * 4*af2ec015STomasz Sapeta * This source code is licensed under the MIT license found in the 5*af2ec015STomasz Sapeta * LICENSE file in the root directory of this source tree. 6*af2ec015STomasz Sapeta * 7*af2ec015STomasz Sapeta * @format 8*af2ec015STomasz Sapeta */ 9*af2ec015STomasz Sapeta 10*af2ec015STomasz Sapeta/** 11*af2ec015STomasz Sapeta * This exposes the native ToastAndroid module as a JS module. This has a function 'show' 12*af2ec015STomasz Sapeta * which takes the following parameters: 13*af2ec015STomasz Sapeta * 14*af2ec015STomasz Sapeta * 1. String message: A string with the text to toast 15*af2ec015STomasz Sapeta * 2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG 16*af2ec015STomasz Sapeta * 17*af2ec015STomasz Sapeta * There is also a function `showWithGravity` to specify the layout gravity. May be 18*af2ec015STomasz Sapeta * ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER 19*af2ec015STomasz Sapeta */ 20*af2ec015STomasz Sapetaexport interface ToastAndroidStatic { 21*af2ec015STomasz Sapeta /** 22*af2ec015STomasz Sapeta * String message: A string with the text to toast 23*af2ec015STomasz Sapeta * int duration: The duration of the toast. 24*af2ec015STomasz Sapeta * May be ToastAndroid.SHORT or ToastAndroid.LONG 25*af2ec015STomasz Sapeta */ 26*af2ec015STomasz Sapeta show(message: string, duration: number): void; 27*af2ec015STomasz Sapeta /** `gravity` may be ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER */ 28*af2ec015STomasz Sapeta showWithGravity(message: string, duration: number, gravity: number): void; 29*af2ec015STomasz Sapeta 30*af2ec015STomasz Sapeta showWithGravityAndOffset( 31*af2ec015STomasz Sapeta message: string, 32*af2ec015STomasz Sapeta duration: number, 33*af2ec015STomasz Sapeta gravity: number, 34*af2ec015STomasz Sapeta xOffset: number, 35*af2ec015STomasz Sapeta yOffset: number, 36*af2ec015STomasz Sapeta ): void; 37*af2ec015STomasz Sapeta // Toast duration constants 38*af2ec015STomasz Sapeta SHORT: number; 39*af2ec015STomasz Sapeta LONG: number; 40*af2ec015STomasz Sapeta // Toast gravity constants 41*af2ec015STomasz Sapeta TOP: number; 42*af2ec015STomasz Sapeta BOTTOM: number; 43*af2ec015STomasz Sapeta CENTER: number; 44*af2ec015STomasz Sapeta} 45*af2ec015STomasz Sapeta 46*af2ec015STomasz Sapetaexport const ToastAndroid: ToastAndroidStatic; 47*af2ec015STomasz Sapetaexport type ToastAndroid = ToastAndroidStatic; 48