Skip to content

Commit e78ab97

Browse files
committed
Move AnyRecord to common types
1 parent b85a42a commit e78ab97

File tree

20 files changed

+30
-29
lines changed

20 files changed

+30
-29
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export type Maybe<T> = T | null | undefined;
88
*/
99
export type NonMutable<T> = T extends object ? Readonly<T> : T;
1010

11+
/* eslint-disable @typescript-eslint/no-explicit-any */
12+
export type AnyRecord = Record<string, any>;
13+
1114
export type ValueProcessor<V, R = V> = (
1215
value: NonMutable<V>
1316
) => Maybe<R> | Record<string, R>;

packages/react-native-reanimated/src/commonTypes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ import type {
1212
} from 'react-native';
1313
import type { SerializableRef, WorkletFunction } from 'react-native-worklets';
1414

15-
import type { Maybe } from './common/types';
15+
import type { AnyRecord, Maybe } from './common';
1616
import type { CSSAnimationProperties, CSSTransitionProperties } from './css';
17-
import type { AnyRecord } from './css/types';
1817
import type { EasingFunctionFactory } from './Easing';
1918

2019
type LayoutAnimationOptions =

packages/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { ComponentRef, ComponentType, ReactNode, Ref } from 'react';
33
import type React from 'react';
44
import type { FlatList, FlatListProps } from 'react-native';
55

6+
import type { AnyRecord } from '../common';
67
import type { InstanceOrElement } from '../commonTypes';
7-
import type { AnyRecord } from '../css/types';
88
import type { AnimatedProps } from '../helperTypes';
99
import type { AnimatedRef } from '../hook';
1010
import type { ExtractElementRef } from '../hook/commonTypes';

packages/react-native-reanimated/src/css/component/AnimatedComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Component } from 'react';
44
import type { StyleProp } from 'react-native';
55
import { Platform, StyleSheet } from 'react-native';
66

7+
import type { AnyRecord } from '../../common';
78
import { IS_JEST, ReanimatedError, SHOULD_BE_USE_WEB } from '../../common';
89
import type {
910
InternalHostInstance,
@@ -19,7 +20,7 @@ import { getShadowNodeWrapperFromRef } from '../../fabricUtils';
1920
import { findHostInstance } from '../../platform-specific/findHostInstance';
2021
import { markNodeAsRemovable, unmarkNodeAsRemovable } from '../native';
2122
import { CSSManager } from '../platform';
22-
import type { AnyComponent, AnyRecord, CSSStyle, PlainStyle } from '../types';
23+
import type { AnyComponent, CSSStyle, PlainStyle } from '../types';
2324
import { filterNonCSSStyleProps } from './utils';
2425

2526
export type AnimatedComponentProps = Record<string, unknown> & {

packages/react-native-reanimated/src/css/component/createAnimatedComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import type { ComponentRef, ComponentType, ReactNode, Ref } from 'react';
33
import type React from 'react';
44
import type { FlatList, FlatListProps } from 'react-native';
55

6+
import type { AnyRecord } from '../../common';
67
import type { InitialComponentProps } from '../../createAnimatedComponent/commonTypes';
78
import type { AnimatedProps } from '../../helperTypes';
89
import type { AnimatedRef } from '../../hook';
9-
import type { AnyRecord, CSSProps } from '../types';
10+
import type { CSSProps } from '../types';
1011
import type { AnimatedComponentProps } from './AnimatedComponent';
1112
import AnimatedComponentImpl from './AnimatedComponent';
1213

packages/react-native-reanimated/src/css/component/utils.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 { StyleProp } from 'react-native';
33

4-
import type { AnyRecord, CSSStyle } from '../types';
4+
import type { AnyRecord } from '../../common';
5+
import type { CSSStyle } from '../types';
56
import { isCSSStyleProp } from '../utils/guards';
67

78
function filterNonCSSStylePropsRecursive(

packages/react-native-reanimated/src/css/native/managers/CSSManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
'use strict';
2+
import type { AnyRecord } from '../../../common';
23
import { ReanimatedError } from '../../../common';
34
import type { ShadowNodeWrapper } from '../../../commonTypes';
45
import type { ViewInfo } from '../../../createAnimatedComponent/commonTypes';
5-
import type { AnyRecord, CSSStyle } from '../../types';
6+
import type { CSSStyle } from '../../types';
67
import type { ICSSManager } from '../../types/interfaces';
78
import { filterCSSAndStyleProperties } from '../../utils';
89
import { setViewStyle } from '../proxy';

packages/react-native-reanimated/src/css/native/normalization/animation/keyframes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
2+
import type { AnyRecord } from '../../../../common';
23
import { ReanimatedError } from '../../../../common';
34
import type { StyleProps } from '../../../../commonTypes';
45
import { PERCENTAGE_REGEX } from '../../../constants';
56
import type {
6-
AnyRecord,
77
CSSAnimationKeyframes,
88
CSSAnimationKeyframeSelector,
99
CSSAnimationTimingFunction,

packages/react-native-reanimated/src/css/native/normalization/transition/config.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 { AnyRecord } from '../../../../common';
23
import { ReanimatedError } from '../../../../common';
34
import type {
4-
AnyRecord,
55
CSSTransitionProperties,
66
CSSTransitionProperty,
77
} from '../../../types';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
import type { AnyRecord } from '../../types';
3+
import type { AnyRecord } from '../../../common';
44
import { isConfigPropertyAlias, isDefined, isRecord } from '../../utils';
55
import type {
66
StyleBuilder,

0 commit comments

Comments
 (0)