mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-07 09:49:07 +00:00
[react-native] Added BackHandler component (#16302)
This commit is contained in:
committed by
Mohamed Hegazy
parent
514a27de01
commit
74818a2559
Vendored
+15
@@ -6452,6 +6452,18 @@ export interface BackAndroidStatic {
|
||||
removeEventListener(eventName: BackPressEventName, handler: () => void): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect hardware back button presses, and programmatically invoke the
|
||||
* default back button functionality to exit the app if there are no
|
||||
* listeners or if none of the listeners return true.
|
||||
* Methods don't have more detailed documentation as of 0.25.
|
||||
*/
|
||||
export interface BackHandlerStatic {
|
||||
exitApp(): void;
|
||||
addEventListener(eventName: BackPressEventName, handler: () => void): void;
|
||||
removeEventListener(eventName: BackPressEventName, handler: () => void): void;
|
||||
}
|
||||
|
||||
export interface ButtonProperties {
|
||||
title: string;
|
||||
onPress: () => any;
|
||||
@@ -8592,6 +8604,9 @@ export type AsyncStorage = AsyncStorageStatic
|
||||
export var BackAndroid: BackAndroidStatic
|
||||
export type BackAndroid = BackAndroidStatic
|
||||
|
||||
export var BackHandler: BackHandlerStatic
|
||||
export type BackHandler = BackHandlerStatic
|
||||
|
||||
export var Button: ButtonStatic
|
||||
export type Button = ButtonStatic
|
||||
|
||||
|
||||
Reference in New Issue
Block a user