Files
react-native/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js
T
Tim Yung 494c47360f RN: Sort Imports via ESLint
Summary:
Applies the autofix from the newly introduced `lint/sort-imports` ESLint rule.

Changelog:
[Internal]

Reviewed By: cortinico, skinsshark

Differential Revision: D39907798

fbshipit-source-id: 17f5f11b08a5b4bb66286816b78eb26e07e829b8
2022-09-30 14:28:48 -07:00

69 lines
1.6 KiB
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import type {TurboModule} from '../../TurboModule/RCTExport';
import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry';
export interface Spec extends TurboModule {
+getConstants: () => {|
+HEIGHT: number,
+DEFAULT_BACKGROUND_COLOR: number,
|};
+setColor: (color: number, animated: boolean) => void;
+setTranslucent: (translucent: boolean) => void;
/**
* - statusBarStyles can be:
* - 'default'
* - 'dark-content'
*/
+setStyle: (statusBarStyle?: ?string) => void;
+setHidden: (hidden: boolean) => void;
}
const NativeModule = TurboModuleRegistry.getEnforcing<Spec>('StatusBarManager');
let constants = null;
const NativeStatusBarManager = {
getConstants(): {|
+HEIGHT: number,
+DEFAULT_BACKGROUND_COLOR?: number,
|} {
if (constants == null) {
constants = NativeModule.getConstants();
}
return constants;
},
setColor(color: number, animated: boolean): void {
NativeModule.setColor(color, animated);
},
setTranslucent(translucent: boolean): void {
NativeModule.setTranslucent(translucent);
},
/**
* - statusBarStyles can be:
* - 'default'
* - 'dark-content'
*/
setStyle(statusBarStyle?: ?string): void {
NativeModule.setStyle(statusBarStyle);
},
setHidden(hidden: boolean): void {
NativeModule.setHidden(hidden);
},
};
export default NativeStatusBarManager;