mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
a3b9840885
Summary: This diff turns on codegen for Slider and Switch Reviewed By: TheSavior Differential Revision: D15738544 fbshipit-source-id: a0dfb5b05fd62f28fc3865855986e49598dd5e19
60 lines
1.5 KiB
JavaScript
60 lines
1.5 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.
|
|
*
|
|
* @format
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {
|
|
Float,
|
|
BubblingEvent,
|
|
DirectEvent,
|
|
WithDefault,
|
|
} from '../../Types/CodegenTypes';
|
|
|
|
import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
|
|
|
|
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
|
|
import type {ImageSource} from '../../Image/ImageSource';
|
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
|
|
type Event = $ReadOnly<{|
|
|
value: Float,
|
|
fromUser?: boolean,
|
|
|}>;
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
...ViewProps,
|
|
|
|
// Props
|
|
disabled?: ?WithDefault<boolean, false>,
|
|
enabled?: ?WithDefault<boolean, false>,
|
|
maximumTrackImage?: ?ImageSource,
|
|
maximumTrackTintColor?: ?ColorValue,
|
|
maximumValue?: ?WithDefault<Float, 1>,
|
|
minimumTrackImage?: ?ImageSource,
|
|
minimumTrackTintColor?: ?ColorValue,
|
|
minimumValue?: ?WithDefault<Float, 0>,
|
|
step?: ?WithDefault<Float, 0>,
|
|
testID?: ?WithDefault<string, ''>,
|
|
thumbImage?: ?ImageSource,
|
|
thumbTintColor?: ?ColorValue,
|
|
trackImage?: ?ImageSource,
|
|
value: ?WithDefault<Float, 0>,
|
|
|
|
// Events
|
|
onChange?: ?(event: BubblingEvent<Event>) => void,
|
|
onValueChange?: ?(event: BubblingEvent<Event>) => void,
|
|
onSlidingComplete?: ?(event: DirectEvent<Event>) => void,
|
|
|}>;
|
|
|
|
export default codegenNativeComponent<NativeProps>('Slider', {
|
|
interfaceOnly: true,
|
|
isDeprecatedPaperComponentNameRCT: true,
|
|
});
|