Files
react-native/Libraries/Components/StatusBar/StatusBarIOS.js
T
Rubén Norte fa406ac2aa Implement typed event emitters
Summary:
Adds types to Event Emitters and migrates the most relevant modules using them in `react-native`.

The most relevant file of this diff is `react-native/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js` with the Flow tests showing and testing the behavior of the new types

Changelog: [Internal] Add types for Event Emitters and subclasses

Reviewed By: motiz88

Differential Revision: D25587936

fbshipit-source-id: feeb09f9ad15d383cdd82deaaaba0d12b94e868b
2021-01-07 03:19:04 -08:00

36 lines
876 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict-local
*/
'use strict';
import NativeEventEmitter from '../../EventEmitter/NativeEventEmitter';
import NativeStatusBarManagerIOS from './NativeStatusBarManagerIOS';
type StatusBarFrameChangeEvent = {
frame: {
x: number,
y: number,
width: number,
height: number,
},
};
type StatusBarIOSEventDefinitions = {
statusBarFrameDidChange: [StatusBarFrameChangeEvent],
statusBarFrameWillChange: [StatusBarFrameChangeEvent],
};
/**
* Use `StatusBar` for mutating the status bar.
*/
class StatusBarIOS extends NativeEventEmitter<StatusBarIOSEventDefinitions> {}
module.exports = (new StatusBarIOS(NativeStatusBarManagerIOS): StatusBarIOS);