Skip to content

Commit 14eca5b

Browse files
authored
chore: Remove duplicate ValueProcessor type (#8316)
## Summary This PR removed the duplicate definition of the `ValueProcessor` type.
1 parent 9422b0b commit 14eca5b

File tree

10 files changed

+13
-15
lines changed

10 files changed

+13
-15
lines changed

packages/react-native-reanimated/src/common/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
'use strict';
22
export type Maybe<T> = T | null | undefined;
33

4-
export type ValueProcessor<V, R = V> = (value: V) => Maybe<R>;
4+
export type ValueProcessor<V, R = V> = (
5+
value: V
6+
) => Maybe<R> | Record<string, R>;
57

68
export type TransformOrigin = string | Array<string | number>;
79

packages/react-native-reanimated/src/css/native/style/processors/colors.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
'use strict';
22
import type { ColorValue } from 'react-native';
33

4-
import type { Maybe } from '../../../../common';
4+
import type { Maybe, ValueProcessor } from '../../../../common';
55
import {
66
processColor as processColorInternal,
77
ReanimatedError,
88
} from '../../../../common';
9-
import type { ValueProcessor } from '../types';
109

1110
export const ERROR_MESSAGES = {
1211
invalidColor: (color: Maybe<ColorValue | number>) =>

packages/react-native-reanimated/src/css/native/style/processors/font.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
2+
import type { ValueProcessor } from '../../../../common';
23
import { ReanimatedError } from '../../../../common';
34
import { FONT_WEIGHT_MAPPINGS } from '../../../constants';
4-
import type { ValueProcessor } from '../types';
55

66
const ERROR_MESSAGES = {
77
invalidFontWeight: (weight: string | number) =>

packages/react-native-reanimated/src/css/native/style/processors/insets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
import type { DimensionValue } from 'react-native';
33

4-
import type { ValueProcessor } from '../types';
4+
import type { ValueProcessor } from '../../../../common';
55

66
type InsetProcessor = ValueProcessor<
77
DimensionValue,

packages/react-native-reanimated/src/css/native/style/processors/others.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
2+
import type { ValueProcessor } from '../../../../common';
23
import { ReanimatedError } from '../../../../common';
3-
import type { ValueProcessor } from '../types';
44

55
export const ERROR_MESSAGES = {
66
unsupportedAspectRatio: (ratio: string | number) =>

packages/react-native-reanimated/src/css/native/style/processors/transform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
2+
import type { ValueProcessor } from '../../../../common';
23
import { ReanimatedError } from '../../../../common';
34
import type { TransformsArray } from '../../../types';
45
import { isAngle, isNumber, isNumberArray, isPercentage } from '../../../utils';
5-
import type { ValueProcessor } from '../types';
66

77
export const ERROR_MESSAGES = {
88
invalidTransform: (transform: string) =>

packages/react-native-reanimated/src/css/native/style/types.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
'use strict';
2-
import type { Maybe } from '../../../common';
2+
import type { ValueProcessor } from '../../../common';
33
import type { AnyRecord, ConfigPropertyAlias } from '../../types';
44

5-
export type ValueProcessor<V, R = V> = (
6-
value: V
7-
) => Maybe<R> | Record<string, R>;
8-
95
export type StyleBuildMiddleware<P extends AnyRecord> = (props: P) => P;
106

117
export type StyleBuilder<P extends AnyRecord = AnyRecord> = {

packages/react-native-reanimated/src/css/svg/native/processors/colors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22
import type { ColorValue } from 'react-native';
33

4-
import { processColor, type ValueProcessor } from '../../../native';
4+
import type { ValueProcessor } from '../../../../common';
5+
import { processColor } from '../../../native';
56

67
export const processColorSVG: ValueProcessor<
78
ColorValue | number,

packages/react-native-reanimated/src/css/svg/native/processors/opacity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
import type { NumberProp } from 'react-native-svg';
33

4-
import type { ValueProcessor } from '../../../native';
4+
import type { ValueProcessor } from '../../../../common';
55

66
export const processOpacity: ValueProcessor<NumberProp, number> = (opacity) => {
77
const value =

packages/react-native-reanimated/src/css/svg/native/processors/others.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
import type { ValueProcessor } from '../../../native';
2+
import type { ValueProcessor } from '../../../../common';
33

44
export const convertStringToNumber =
55
<S extends string>(

0 commit comments

Comments
 (0)