Add spec for KeyboardObserver (#24881)

Summary:
part of #24875. iOS only it appears, but not really used by RN itself. Should be fine?

## Changelog

[General] [Added] - Add TM spec for KeyboardObserver
Pull Request resolved: https://github.com/facebook/react-native/pull/24881

Reviewed By: fkgozali

Differential Revision: D15391769

Pulled By: rickhanlonii

fbshipit-source-id: 557507f6063b40d1c68ec8739e23b33bc22ade39
This commit is contained in:
Eric Lewis
2019-05-22 09:31:23 -07:00
committed by Facebook Github Bot
parent 45b5e5f141
commit 905e3fc5bd
2 changed files with 24 additions and 3 deletions
+3 -3
View File
@@ -13,10 +13,10 @@
const LayoutAnimation = require('../../LayoutAnimation/LayoutAnimation');
const invariant = require('invariant');
const NativeEventEmitter = require('../../EventEmitter/NativeEventEmitter');
const KeyboardObserver = require('../../BatchedBridge/NativeModules')
.KeyboardObserver;
const dismissKeyboard = require('../../Utilities/dismissKeyboard');
const KeyboardEventEmitter = new NativeEventEmitter(KeyboardObserver);
import NativeKeyboardObserver from './NativeKeyboardObserver';
const KeyboardEventEmitter = new NativeEventEmitter(NativeKeyboardObserver);
export type KeyboardEventName =
| 'keyboardWillShow'
@@ -0,0 +1,21 @@
/**
* 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.
*
* @flow
* @format
*/
'use strict';
import type {TurboModule} from 'RCTExport';
import * as TurboModuleRegistry from 'TurboModuleRegistry';
export interface Spec extends TurboModule {
+addListener: (eventName: string) => void;
+removeListeners: (count: number) => void;
}
export default TurboModuleRegistry.get<Spec>('KeyboardObserver');