mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
45b5e5f141
commit
905e3fc5bd
@@ -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');
|
||||
Reference in New Issue
Block a user