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