1 | import type { Ref, Component } from 'react';
|
2 | import type { ShadowNodeWrapper, SharedValue, StyleProps } from '../commonTypes';
|
3 | import type { ViewConfig } from '../ConfigHelper';
|
4 | import type { ViewDescriptorsSet } from '../ViewDescriptorsSet';
|
5 | import type { BaseAnimationBuilder, EntryExitAnimationFunction, ILayoutAnimationBuilder, SharedTransition } from '../layoutReanimation';
|
6 | import type { SkipEnteringContext } from '../component/LayoutAnimationConfig';
|
7 | export interface AnimatedProps extends Record<string, unknown> {
|
8 | viewDescriptors?: ViewDescriptorsSet;
|
9 | initial?: SharedValue<StyleProps>;
|
10 | }
|
11 | export interface ViewInfo {
|
12 | viewTag: number | HTMLElement | null;
|
13 | viewName: string | null;
|
14 | shadowNodeWrapper: ShadowNodeWrapper | null;
|
15 | viewConfig: ViewConfig;
|
16 | }
|
17 | export interface IInlinePropManager {
|
18 | attachInlineProps(animatedComponent: React.Component<unknown, unknown>, viewInfo: ViewInfo): void;
|
19 | detachInlineProps(): void;
|
20 | }
|
21 | export interface IPropsFilter {
|
22 | filterNonAnimatedProps: (component: React.Component<unknown, unknown> & IAnimatedComponentInternal) => Record<string, unknown>;
|
23 | }
|
24 | export interface IJSPropsUpdater {
|
25 | addOnJSPropsChangeListener(animatedComponent: React.Component<unknown, unknown> & IAnimatedComponentInternal): void;
|
26 | removeOnJSPropsChangeListener(animatedComponent: React.Component<unknown, unknown> & IAnimatedComponentInternal): void;
|
27 | }
|
28 | export interface INativeEventsManager {
|
29 | attachEvents(): void;
|
30 | detachEvents(): void;
|
31 | updateEvents(prevProps: AnimatedComponentProps<InitialComponentProps>): void;
|
32 | }
|
33 | export type LayoutAnimationStaticContext = {
|
34 | presetName: string;
|
35 | };
|
36 | export type AnimatedComponentProps<P extends Record<string, unknown>> = P & {
|
37 | forwardedRef?: Ref<Component>;
|
38 | style?: NestedArray<StyleProps>;
|
39 | animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;
|
40 | animatedStyle?: StyleProps;
|
41 | layout?: (BaseAnimationBuilder | ILayoutAnimationBuilder | typeof BaseAnimationBuilder) & LayoutAnimationStaticContext;
|
42 | entering?: (BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe) & LayoutAnimationStaticContext;
|
43 | exiting?: (BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe) & LayoutAnimationStaticContext;
|
44 | sharedTransitionTag?: string;
|
45 | sharedTransitionStyle?: SharedTransition;
|
46 | };
|
47 | export interface AnimatedComponentRef extends Component {
|
48 | setNativeProps?: (props: Record<string, unknown>) => void;
|
49 | getScrollableNode?: () => AnimatedComponentRef;
|
50 | getAnimatableRef?: () => AnimatedComponentRef;
|
51 | }
|
52 | export interface IAnimatedComponentInternal {
|
53 | _styles: StyleProps[] | null;
|
54 | _animatedProps?: Partial<AnimatedComponentProps<AnimatedProps>>;
|
55 | |
56 |
|
57 |
|
58 |
|
59 | _componentViewTag: number;
|
60 | _isFirstRender: boolean;
|
61 | jestInlineStyle: NestedArray<StyleProps> | undefined;
|
62 | jestAnimatedStyle: {
|
63 | value: StyleProps;
|
64 | };
|
65 | _component: AnimatedComponentRef | HTMLElement | null;
|
66 | _sharedElementTransition: SharedTransition | null;
|
67 | _jsPropsUpdater: IJSPropsUpdater;
|
68 | _InlinePropManager: IInlinePropManager;
|
69 | _PropsFilter: IPropsFilter;
|
70 |
|
71 | _NativeEventsManager?: INativeEventsManager;
|
72 | _viewInfo?: ViewInfo;
|
73 | context: React.ContextType<typeof SkipEnteringContext>;
|
74 | }
|
75 | export type NestedArray<T> = T | NestedArray<T>[];
|
76 | export interface InitialComponentProps extends Record<string, unknown> {
|
77 | ref?: Ref<Component>;
|
78 | collapsable?: boolean;
|
79 | }
|
80 |
|
\ | No newline at end of file |