Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Libraries/Color/NativeOrDynamicColorType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* 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 strict
*/

'use strict';

export type NativeOrDynamicColorType = {
semantic?: string,
dynamic?: {
light: ?(string | number | NativeOrDynamicColorType),
dark: ?(string | number | NativeOrDynamicColorType),
},
};
2 changes: 1 addition & 1 deletion Libraries/Color/normalizeColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* eslint no-bitwise: 0 */
'use strict';

import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

function normalizeColor(
color: ?(
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Color/normalizeColorObject.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// [TODO(macOS ISS#2323203)
'use strict';

export type NativeOrDynamicColorType = {};
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';

function normalizeColorObject(
color: NativeOrDynamicColorType,
Expand Down
8 changes: 1 addition & 7 deletions Libraries/Color/normalizeColorObject.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@
// [TODO(macOS ISS#2323203)
'use strict';

export type NativeOrDynamicColorType = {
semantic?: string,
dynamic?: {
light: ?(string | number | NativeOrDynamicColorType),
dark: ?(string | number | NativeOrDynamicColorType),
},
};
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';

function normalizeColorObject(
color: NativeOrDynamicColorType,
Expand Down
8 changes: 1 addition & 7 deletions Libraries/Color/normalizeColorObject.macos.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@
// [TODO(macOS ISS#2323203)
'use strict';

export type NativeOrDynamicColorType = {
semantic?: string,
dynamic?: {
light: ?(string | number | NativeOrDynamicColorType),
dark: ?(string | number | NativeOrDynamicColorType),
},
};
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';

function normalizeColorObject(
color: NativeOrDynamicColorType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const RCTActivityIndicatorViewNativeComponent = require('RCTActivityIndicatorVie

import type {NativeComponent} from 'ReactNative';
import type {ViewProps} from 'ViewPropTypes';
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

const RCTActivityIndicator =
Platform.OS === 'android'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const requireNativeComponent = require('requireNativeComponent');
import type {ViewProps} from 'ViewPropTypes';
import type {ViewStyleProp} from 'StyleSheet';
import type {NativeComponent} from 'ReactNative';
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

type NativeProps = $ReadOnly<{|
...ViewProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {NativeComponent} from 'ReactNative';
import type {SyntheticEvent} from 'CoreEventTypes';
import type {ViewStyleProp} from 'StyleSheet';
import type React from 'React';
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

type ColorValue = null | string | NativeOrDynamicColorType; // TODO(macOS ISS#2323203)

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Picker/PickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {SyntheticEvent} from 'CoreEventTypes';
import type {ColorValue} from 'StyleSheetTypes';
import type {ViewProps} from 'ViewPropTypes';
import type {TextStyleProp} from 'StyleSheet';
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

type PickerIOSChangeEvent = SyntheticEvent<
$ReadOnly<{|
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Picker/RCTPickerNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const requireNativeComponent = require('requireNativeComponent');
import type {SyntheticEvent} from 'CoreEventTypes';
import type {TextStyleProp} from 'StyleSheet';
import type {NativeComponent} from 'ReactNative';
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

type PickerIOSChangeEvent = SyntheticEvent<
$ReadOnly<{|
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Switch/SwitchNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const requireNativeComponent = require('requireNativeComponent');

import type {SwitchChangeEvent} from 'CoreEventTypes';
import type {ViewProps} from 'ViewPropTypes';
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

type SwitchProps = $ReadOnly<{|
...ViewProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {SyntheticEvent} from 'CoreEventTypes';
import type {ImageSource} from 'ImageSource';
import type {ViewProps} from 'ViewPropTypes';
import type {NativeComponent} from 'ReactNative';
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

type Action = $ReadOnly<{|
title: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
const processColor = require('processColor');

import type {PressEvent} from 'CoreEventTypes';
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

const rippleBackgroundPropType = PropTypes.shape({
type: PropTypes.oneOf(['RippleAndroid']),
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ReactNative/getNativeComponentAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const resolveAssetSource = require('resolveAssetSource');
const sizesDiffer = require('sizesDiffer');
const invariant = require('invariant');
const warning = require('fbjs/lib/warning');
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

function getNativeComponentAttributes(uiViewClassName: string) {
const viewConfig = UIManager.getViewManagerConfig(uiViewClassName);
Expand Down
2 changes: 1 addition & 1 deletion Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

const AnimatedNode = require('AnimatedNode');
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

export type ColorValue = null | string | NativeOrDynamicColorType; // TODO(macOS ISS#2323203)
export type DimensionValue = null | number | string | AnimatedNode;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/StyleSheet/processColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const Platform = require('Platform');
const normalizeColor = require('normalizeColor');
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)

/* eslint no-bitwise: 0 */
function processColor(
Expand Down
2 changes: 1 addition & 1 deletion Libraries/StyleSheet/processColorObject.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// [TODO(macOS ISS#2323203)
'use strict';

import type {NativeOrDynamicColorType} from 'normalizeColorObject';
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';

function processColorObject(
color: NativeOrDynamicColorType,
Expand Down
4 changes: 2 additions & 2 deletions Libraries/StyleSheet/processColorObject.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// [TODO(macOS ISS#2323203)
'use strict';

import type {NativeOrDynamicColorType} from 'normalizeColorObject';
const processColor = require('processColor');
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';

function processColorObject(
color: NativeOrDynamicColorType,
): ?NativeOrDynamicColorType {
if ('dynamic' in color && color.dynamic !== undefined) {
const processColor = require('processColor');
const dynamic = color.dynamic;
const dynamicColor: NativeOrDynamicColorType = {
dynamic: {
Expand Down
4 changes: 2 additions & 2 deletions Libraries/StyleSheet/processColorObject.macos.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
// [TODO(macOS ISS#2323203)
'use strict';

import type {NativeOrDynamicColorType} from 'normalizeColorObject';
const processColor = require('processColor');
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';

function processColorObject(
color: NativeOrDynamicColorType,
): ?NativeOrDynamicColorType {
if ('dynamic' in color && color.dynamic !== undefined) {
const processColor = require('processColor');
const dynamic = color.dynamic;
const dynamicColor: NativeOrDynamicColorType = {
dynamic: {
Expand Down