Skip to content

Commit 20c3913

Browse files
authored
Fixed import type circular references by moving export type to its own js file. (#154)
1 parent f990028 commit 20c3913

19 files changed

+39
-32
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @format
8+
* @flow strict
9+
*/
10+
11+
'use strict';
12+
13+
export type NativeOrDynamicColorType = {
14+
semantic?: string,
15+
dynamic?: {
16+
light: ?(string | number | NativeOrDynamicColorType),
17+
dark: ?(string | number | NativeOrDynamicColorType),
18+
},
19+
};

Libraries/Color/normalizeColor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/* eslint no-bitwise: 0 */
1212
'use strict';
1313

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

1616
function normalizeColor(
1717
color: ?(

Libraries/Color/normalizeColorObject.android.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// [TODO(macOS ISS#2323203)
1111
'use strict';
1212

13-
export type NativeOrDynamicColorType = {};
13+
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';
1414

1515
function normalizeColorObject(
1616
color: NativeOrDynamicColorType,

Libraries/Color/normalizeColorObject.ios.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@
1010
// [TODO(macOS ISS#2323203)
1111
'use strict';
1212

13-
export type NativeOrDynamicColorType = {
14-
semantic?: string,
15-
dynamic?: {
16-
light: ?(string | number | NativeOrDynamicColorType),
17-
dark: ?(string | number | NativeOrDynamicColorType),
18-
},
19-
};
13+
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';
2014

2115
function normalizeColorObject(
2216
color: NativeOrDynamicColorType,

Libraries/Color/normalizeColorObject.macos.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@
1010
// [TODO(macOS ISS#2323203)
1111
'use strict';
1212

13-
export type NativeOrDynamicColorType = {
14-
semantic?: string,
15-
dynamic?: {
16-
light: ?(string | number | NativeOrDynamicColorType),
17-
dark: ?(string | number | NativeOrDynamicColorType),
18-
},
19-
};
13+
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';
2014

2115
function normalizeColorObject(
2216
color: NativeOrDynamicColorType,

Libraries/Components/ActivityIndicator/ActivityIndicator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const RCTActivityIndicatorViewNativeComponent = require('RCTActivityIndicatorVie
1919

2020
import type {NativeComponent} from 'ReactNative';
2121
import type {ViewProps} from 'ViewPropTypes';
22-
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
22+
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)
2323

2424
const RCTActivityIndicator =
2525
Platform.OS === 'android'

Libraries/Components/ActivityIndicator/RCTActivityIndicatorViewNativeComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const requireNativeComponent = require('requireNativeComponent');
1515
import type {ViewProps} from 'ViewPropTypes';
1616
import type {ViewStyleProp} from 'StyleSheet';
1717
import type {NativeComponent} from 'ReactNative';
18-
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
18+
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)
1919

2020
type NativeProps = $ReadOnly<{|
2121
...ViewProps,

Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type {NativeComponent} from 'ReactNative';
1616
import type {SyntheticEvent} from 'CoreEventTypes';
1717
import type {ViewStyleProp} from 'StyleSheet';
1818
import type React from 'React';
19-
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
19+
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)
2020

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

Libraries/Components/Picker/PickerIOS.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type {SyntheticEvent} from 'CoreEventTypes';
2424
import type {ColorValue} from 'StyleSheetTypes';
2525
import type {ViewProps} from 'ViewPropTypes';
2626
import type {TextStyleProp} from 'StyleSheet';
27-
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
27+
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)
2828

2929
type PickerIOSChangeEvent = SyntheticEvent<
3030
$ReadOnly<{|

Libraries/Components/Picker/RCTPickerNativeComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const requireNativeComponent = require('requireNativeComponent');
1414
import type {SyntheticEvent} from 'CoreEventTypes';
1515
import type {TextStyleProp} from 'StyleSheet';
1616
import type {NativeComponent} from 'ReactNative';
17-
import type {NativeOrDynamicColorType} from 'normalizeColorObject'; // TODO(macOS ISS#2323203)
17+
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType'; // TODO(macOS ISS#2323203)
1818

1919
type PickerIOSChangeEvent = SyntheticEvent<
2020
$ReadOnly<{|

0 commit comments

Comments
 (0)