mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
ff5592cff4
Summary: This diff removes an option from the codegen and replaces it with two new options Removes: - `isDeprecatedPaperComponentNameRCT` Adds: - `paperComponentName`: a better version of the removed option that allows more than just adding RCT - `paperComponentNameDeprecated`: a new option that allows migrating native code to a new name ``` // Use for components with no current paper rename in progress // Does not check for new name paperComponentName?: string, // Use for components currently being renamed in paper // Will use new name if it is available and fallback to this name paperComponentNameDeprecated?: string, ``` For example, Slider uses `paperComponentName: 'RCTSlider'` because it has a different name in fabric but is not currently being migrated to a new name. Because of other work in progress, we don't want to use UIManager check if we don't need to Reviewed By: shergin Differential Revision: D15857629 fbshipit-source-id: ca0d3b7dc4a75e00d136ae1f5c84f7423960399d
220 lines
6.1 KiB
JavaScript
220 lines
6.1 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 {SchemaType} from '../../../packages/react-native-codegen/src/CodegenSchema.js';
|
|
|
|
const SliderSchema: SchemaType = {
|
|
modules: {
|
|
SliderSchema: {
|
|
components: {
|
|
Slider: {
|
|
interfaceOnly: true,
|
|
paperComponentName: 'RCTSlider',
|
|
extendsProps: [
|
|
{
|
|
type: 'ReactNativeBuiltInType',
|
|
knownTypeName: 'ReactNativeCoreViewProps',
|
|
},
|
|
],
|
|
events: [
|
|
{
|
|
name: 'onChange',
|
|
optional: true,
|
|
bubblingType: 'bubble',
|
|
typeAnnotation: {
|
|
type: 'EventTypeAnnotation',
|
|
argument: {
|
|
type: 'ObjectTypeAnnotation',
|
|
properties: [
|
|
{
|
|
type: 'FloatTypeAnnotation',
|
|
name: 'value',
|
|
optional: false,
|
|
},
|
|
{
|
|
type: 'BooleanTypeAnnotation',
|
|
name: 'fromUser',
|
|
optional: false,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'onSlidingComplete',
|
|
optional: true,
|
|
bubblingType: 'direct',
|
|
typeAnnotation: {
|
|
type: 'EventTypeAnnotation',
|
|
argument: {
|
|
type: 'ObjectTypeAnnotation',
|
|
properties: [
|
|
{
|
|
type: 'FloatTypeAnnotation',
|
|
name: 'value',
|
|
optional: false,
|
|
},
|
|
{
|
|
type: 'BooleanTypeAnnotation',
|
|
name: 'fromUser',
|
|
optional: false,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: 'onValueChange',
|
|
optional: true,
|
|
bubblingType: 'bubble',
|
|
typeAnnotation: {
|
|
type: 'EventTypeAnnotation',
|
|
argument: {
|
|
type: 'ObjectTypeAnnotation',
|
|
properties: [
|
|
{
|
|
type: 'FloatTypeAnnotation',
|
|
name: 'value',
|
|
optional: false,
|
|
},
|
|
{
|
|
type: 'BooleanTypeAnnotation',
|
|
name: 'fromUser',
|
|
optional: false,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
props: [
|
|
{
|
|
name: 'disabled',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'BooleanTypeAnnotation',
|
|
default: false,
|
|
},
|
|
},
|
|
{
|
|
name: 'enabled',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'BooleanTypeAnnotation',
|
|
default: false,
|
|
},
|
|
},
|
|
{
|
|
name: 'maximumTrackImage',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'NativePrimitiveTypeAnnotation',
|
|
name: 'ImageSourcePrimitive',
|
|
},
|
|
},
|
|
{
|
|
name: 'maximumTrackTintColor',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'NativePrimitiveTypeAnnotation',
|
|
name: 'ColorPrimitive',
|
|
},
|
|
},
|
|
{
|
|
name: 'maximumValue',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'FloatTypeAnnotation',
|
|
default: 1,
|
|
},
|
|
},
|
|
{
|
|
name: 'minimumTrackImage',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'NativePrimitiveTypeAnnotation',
|
|
name: 'ImageSourcePrimitive',
|
|
},
|
|
},
|
|
{
|
|
name: 'minimumTrackTintColor',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'NativePrimitiveTypeAnnotation',
|
|
name: 'ColorPrimitive',
|
|
},
|
|
},
|
|
{
|
|
name: 'minimumValue',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'FloatTypeAnnotation',
|
|
default: 0,
|
|
},
|
|
},
|
|
{
|
|
name: 'step',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'FloatTypeAnnotation',
|
|
default: 0,
|
|
},
|
|
},
|
|
{
|
|
name: 'testID',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'StringTypeAnnotation',
|
|
default: '',
|
|
},
|
|
},
|
|
{
|
|
name: 'thumbImage',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'NativePrimitiveTypeAnnotation',
|
|
name: 'ImageSourcePrimitive',
|
|
},
|
|
},
|
|
{
|
|
name: 'trackImage',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'NativePrimitiveTypeAnnotation',
|
|
name: 'ImageSourcePrimitive',
|
|
},
|
|
},
|
|
{
|
|
name: 'thumbTintColor',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'NativePrimitiveTypeAnnotation',
|
|
name: 'ColorPrimitive',
|
|
},
|
|
},
|
|
{
|
|
name: 'value',
|
|
optional: true,
|
|
typeAnnotation: {
|
|
type: 'FloatTypeAnnotation',
|
|
default: 0,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
module.exports = SliderSchema;
|