mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
6449cc4363
Summary: Implements JS interface and commands in native, however it isn't connected anywhere. Changelog: [Internal] Reviewed By: shergin Differential Revision: D19471025 fbshipit-source-id: 7ec53c04b38cb27b84ef06dea7a0fdb9e1deee60
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
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.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
import requireNativeComponent from '../../ReactNative/requireNativeComponent';
|
|
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
import type {Int32} from '../../Types/CodegenTypes';
|
|
import * as React from 'react';
|
|
|
|
type NativeType = HostComponent<mixed>;
|
|
|
|
interface NativeCommands {
|
|
+focus: (viewRef: React.ElementRef<NativeType>) => void;
|
|
+blur: (viewRef: React.ElementRef<NativeType>) => void;
|
|
+setMostRecentEventCount: (
|
|
viewRef: React.ElementRef<NativeType>,
|
|
eventCount: Int32,
|
|
) => void;
|
|
+setTextAndSelection: (
|
|
viewRef: React.ElementRef<NativeType>,
|
|
mostRecentEventCount: Int32,
|
|
value: ?string, // in theory this is nullable
|
|
start: Int32,
|
|
end: Int32,
|
|
) => void;
|
|
}
|
|
|
|
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
supportedCommands: [
|
|
'focus',
|
|
'blur',
|
|
'setMostRecentEventCount',
|
|
'setTextAndSelection',
|
|
],
|
|
});
|
|
|
|
const SinglelineTextInputNativeComponent: HostComponent<mixed> = requireNativeComponent<mixed>(
|
|
'RCTMultilineTextInputView',
|
|
);
|
|
|
|
export default SinglelineTextInputNativeComponent;
|