From f31dada1b7f4e665650c1edd29d5e88aeb2169d0 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Wed, 20 Sep 2023 08:59:42 -0700 Subject: [PATCH] Extract AppState TM type for react-native-codegen (#39546) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39546 Changelog: [Internal] Reviewed By: rshest Differential Revision: D49436860 fbshipit-source-id: d120e04f67430f66b5f1be453726b43805aeac81 --- packages/react-native/Libraries/AppState/NativeAppState.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/AppState/NativeAppState.js b/packages/react-native/Libraries/AppState/NativeAppState.js index b4b96d97a7bce7..41c2048864897d 100644 --- a/packages/react-native/Libraries/AppState/NativeAppState.js +++ b/packages/react-native/Libraries/AppState/NativeAppState.js @@ -16,10 +16,12 @@ export type AppStateConstants = {| initialAppState: string, |}; +export type AppState = {|app_state: string|}; + export interface Spec extends TurboModule { +getConstants: () => AppStateConstants; +getCurrentAppState: ( - success: (appState: {|app_state: string|}) => void, + success: (appState: AppState) => void, error: (error: Object) => void, ) => void;